Cookbooks
The DSO team has lead an effort to share application across TACC infrastructure using the TAPIS systems.
We've provided three templates to develop an application:
- Running a command
- Running a Python script using conda
- Running a Jupyter Notebook
Requirements¶
- A GitHub account
- TACC account. If you don't have one, you can request one here
- To access TACC systems, you should have an allocation
- You can see your allocations here
- If you don't have an allocation, you can request one here
Template Overview¶
This template creates a simple cookbook that will run a job on a TACC cluster using two parameters/arguments, Greeting and Target, and obtain the output via a UI, saving it to a file named out.txt.
How does it work?¶
app.json
file: contains the definition of the Tapis application, including the application's name, description, Docker image, input files, and advanced options.Dockerfile
: a Docker image is built from theDockerfile
. The Docker image defines the runtime environment for the application and the files that will be used by the application.run.sh
: contains all the commands that will be executed on the TACC cluster.
Job run script¶
The run.sh
file is used to run the commands.
#!/bin/bash
Greeting=$1
Target=$2
FULL_GREETING="${Greeting} ${Target}. My name is ${_tapisJobOwner}"
echo "$FULL_GREETING"
echo $FULL_GREETING > $_tapisExecSystemOutputDir/out.txt
The run.sh
script receives two parameters, Greeting
and Target
, and uses them to create a message that will be saved to a file named out.txt
.
Also, the script uses the _tapisExecSystemOutputDir
variable, which contains the path where the application writes the output files.
Create your Cookbook¶
Create a new repository¶
- Click on the "Use this template" button to create a new repository
- Fill in the form with the information for your new repository
Build the Docker image¶
You can either create your own docker image, use the one generated by Github, or use the Docker image from the Docker Hub.
- Clone the repository
- Build the Docker image using the command below
- Push the Docker image to a container registry
docker tag cookbook-python <your-registry>/cookbook-python
docker push <your-registry>/cookbook-python
The container image will be under the following address
Modify the app.json
file¶
Each app has a unique id
and description
. So, you should change these fields to match your app's name and description.
- Download the
app.json
file - Change the values
id
anddescription
fields with the name and description as you wish. - If you built the Docker image, change the
containerImage
field with the image name you used.
Create a New Application on the Cookbook UI¶
- Go to Cookbook UI
- Click on the "Create Application" button
- Fill in the form with the information from your
app.json
file - Click "Create Application"
- A new application will be created, and you will be redirected to the application's page
Run your Cookbook¶
- Go to the application's page on the Cookbook UI, if you are not already there
- Click on the "Run" button on the right side of the page. This will open the Portal UI
- Select the parameters for your job
Check the Output¶
- After the job finishes, you can check the output by clicking on the "Output location" link on the job's page
- You will be redirected to the output location, where you can see the output files generated by the job
- Click on a file to see its content. In this case, the file is named
out.txt
Next templates¶
Authors¶
William Mobley - wmobley@tacc.utexas.edu Maximiliano Osorio