Create a GPU Container Job
Generate a job config with the CLI, submit it, and confirm the GPU Container Job.
Create a GPU Container Job from the CLI. You generate a job config, then submit it. CosmicAC creates the job.
Prerequisites
You need the following before you start.
- A running CosmicAC deployment. See Installation.
- The CosmicAC CLI installed, configured, and logged in. See Install the CLI.
Generate the job config
Run the interactive setup.
cosmicac jobs initThe CLI prompts you for these fields, then writes a job.config.json file in the current directory.
- Name — the name for the job.
- Tags — one or more comma-separated tags.
- Type — the job type, set to
GPU_CONTAINER. - Location — the location where the job runs.
- GPU type — the GPU to use.
- GPU count — the number of GPUs.
- CPU per GPU — the CPU cores per GPU.
- Memory per GPU — the memory per GPU and its unit.
- Root disk size — the root disk size, at least 100Gi.
- External disk — an optional external disk.
- Cost limit — the maximum cost in USD.
- Alerts — the alerts to enable.
Write the config to another directory
Pass --dir to write job.config.json somewhere other than the current directory.
cosmicac jobs init --dir <directory>Example job.config.json
{
"name": "my-gpu-container",
"tags": ["experiment"],
"type": "GPU_CONTAINER",
"location": "IN",
"gpu": { "type": "<gpu-type>", "count": 1 },
"params": {
"req_cpu_per_gpu": 4,
"req_mem_per_gpu": "16Gi",
"root_disk_size": "100Gi",
"external_disk_size": null
},
"cost_limit": 1000,
"alerts": { "cost_exceeded": false, "errors": false }
}Create the job
Submit the job config.
cosmicac jobs createThe CLI reads job.config.json from the current directory and submits it to your deployment. CosmicAC creates the GPU Container Job.
Create from a config file elsewhere
Pass --config to use a config file from another path.
cosmicac jobs create --config <path>Confirm the job
List your jobs to confirm the job was created and to find its ID.
cosmicac jobs listThe job appears in the table with its ID, name, tags, and status.