Create a GPU Container Job
In this tutorial, you will create your first GPU Container job using the CosmicAC CLI. By the end, you will have a running container ready to accept a shell session.
Prerequisites:
- A CosmicAC account
- CosmicAC CLI installed. See Installation.
Log in
Authenticate with your CosmicAC account:
cosmicac loginThis opens a browser window. Complete the login steps to continue. If the browser does not open, copy the URL from the terminal and paste it into your browser.
Skip this step if you are already authenticated.
Initialize the job configuration
Run the interactive setup to generate a job.config.json file:
cosmicac jobs initFollow the prompts:
| Prompt | Description |
|---|---|
| Project name | A name for your job |
| Tags | Comma-separated labels to organize the job |
| Type | Select GPU_CONTAINER |
| GPU type | The GPU hardware to use (e.g., H100) |
| GPU count | The number of GPUs to allocate |
| Country code | The 2-letter region code where your container runs (e.g., us, in, gb) |
| Container image | The base image in repository:tag format (e.g., ubuntu:24.04) |
| Cost limit | The maximum spend in USD |
| Alerts | Select Cost Exceeded, Errors, or both |
The CLI saves your answers to job.config.json in the current directory.
Review the configuration
Open job.config.json and confirm your settings before submitting:
{
"name": "train-image-model",
"tags": ["training", "image-recognition"],
"type": "GPU_CONTAINER",
"gpu": {
"type": "H100",
"count": "2"
},
"location": "in",
"container": {
"image": {
"repository": "ubuntu",
"tag": "24.04"
}
},
"params": {},
"cost_limit": 100,
"alerts": {
"cost_exceeded": true,
"errors": true
}
}If anything is incorrect, edit the file directly or re-run cosmicac jobs init to regenerate it.
Create the container
Submit the job:
cosmicac jobs createCosmicAC provisions and starts your GPU Container job. This takes a few minutes.
Verify the container is running
Check the status of your job:
cosmicac jobs listYour container is ready when the status shows Running.
You have created your first GPU Container job. It is now running and ready to accept a shell session.