PushToCompute is a powerful container platform for running high performance and accelerated applications in the cloud. Here is a quick overview of all components that will get you up and running quickly so that your application can grow new legs in our HPC cloud environment. This tutorial will be focused on providing a PushToCompute quick start guide.
Components of PushToCompute
Docker: When using PushToCompute, Docker will be your best friend. This is because Docker allows you to define your own environment regardless of the underlying operating system. This is achieved with a Dockerfile and containerization.
Dockerfile: A playbook of sorts that defines the environment and all component/scripts/files required to run a given application.
We will not go into all of the details of what can be done in Docker but we will introduce a basic Dockerfile for this example. To read more on Dockerfile syntax and features see the following links:
Github: For the purposes of this example GitHub will be storing all of our files, custom code, and our Dockerfile that will not be inherited from an existing Docker container.
Hello World - Tutorial
For this tutorial you will need a Docker hub account. You can also create a GitHub account or use an existing GitHub account, but this is not strictly required for this tutorial. We will create an application that will send a basic "Hello World" message.
- Log into platform.jarvice.com and expand the left and the right menu’s by clicking on the three horizontal lines icon in the upper left and the Nimbix logo in the upper right.
- Click on the Push to Compute tab on the right menu. (If you do not have a PushToCompute tab contact support so they can enable developer mode for your account)
- From the PushToCompute page we will create a new application but first we need a docker hub repository to save our new application. You may notice that the left menu in platform.jarvice.com is asking for your docker hub credentials. You can enter them now.
- Now leave that page up and open a new tab to docker hub. Create a new repository for this project and name it whatever you want. We will connect an existing GitHub project to our application and JARVICE will build the container from the GitHub project and then push the new container to the Docker hub account/repository you defined.
- Now we have all the pieces we need to create our application.
- First give your app a name.
- Next add the Docker Hub repository to the Docker Repository field. Add it in the same format that you would use to pull the container. Using the Nimbix Docker Hub version, it would be as follows:
- Now paste the GitHub link from our helloworld project into the Git Source URL field.
- Lastly, select the x86 architecture and click ok.
If you would like to make changes to the GitHub project, you can clone the project and push it to your own GitHub repository then use your GitHub url instead. PushToCompute will pull from this GitHub project and use the Dockerfile to build a container that can be launched on Nimbix.
This Docker Hub repository must be in the same account that you used to sign in to PushToCompute.
Now you are ready to pull and build your app. Select the three horizontal lines icon on your new app and click on Build+Pull.
Then select the three lines icon again and select History. You should eventually see the following output.
1 minute ago: Pull completed - index.docker.io/nimbix/helloworld:latest -> appname.app 3 minutes ago: Pull started - index.docker.io/nimbix/helloworld:latest -> appname.app 3 minutes ago: Pull scheduled - index.docker.io/nimbix/helloworld -> appname.app 3 minutes ago: Build pushed - https://github.com/nimbixdemo/helloworld(master) -> index.docker.io/nimbix/helloworld 3 minutes ago: Build started - https://github.com/nimbixdemo/helloworld(master) -> nimbix/helloworld 3 minutes ago: Build scheduled - appname.app
Once the last pull has completed, click on the app to open it up. Our application will only run in batch mode. You will see a server and GUI option as well, ignore them for now. Select "Batch" and enter the command ‘helloWorld’.
Once the job completes you can expand the output and see that the helloWorld command has displayed a message.
Congratulations! You have created your first PushToCompute Application! Want to try a different command? Try deviceQuery instead of helloWorld. For the deviceQuery command, you'll need to run on GPU machine type. Any standard bash command could be used here as well. Here's the output you should see if it's successful:
The one piece we did not touch on in this tutorial is how to customize the application definition (AppDef.json). PushToCompute will automatically generate an “AppDef.json” and you may notice after your successful build your app that you can download this file. Since the platform does not know how we would like to run this application it will enable GUI, server, and batch options for running.
As an additional challenge try removing the GUI and Server options from the AppDef.json so that only the functioning option “Batch” is available.
Hint: You will need to add this line to your Dockerfile and place the AppDef.json file in the NAE folder on your Git Hub project.
COPY ./NAE/AppDef.json /etc/NAE/AppDef.json
For additional documentation on PushToCompute, please visit http://jarvice.readthedocs.io/en/latest/