Learn how to use the ovhai CLI.
Requirements
- a working
ovhai
CLI (see this guide for more information)
Instructions
Run a job
To submit a job, you need a docker image and (optionally) some data.
First, let's submit a simple job, a public Ubuntu image that executes a command echo
:
- Add the flag
--help
to get more information about a command. - You can increase the number of GPUs with the flag
--gpu <x>
or choose to use CPUs with the flag--cpu <x>
.
You can then list your current and old jobs with:
- Add the flag
--watch
to watch changes live. - Most commands handle the flag
--output <format>
if you want a different output (JSON or YAML).
You should see the job you just ran; you need its ID
to get more information about it.
To see information about a job, use the following command:
To see its logs live, use the following command:
You should see the output of the echo
command:
Hello from my first job
Use data in your job
You can upload data to the Object Storage and mount that data when you run a job. If you mount that data with read/write it will be saved to the Object Storage when the job ends.
Let's upload some data and use it in a job that will produce more data.
- If you already used the Swift CLI, the commands are similar.
Now that you have some data in a container, you can mount it when you run a job with the flag --volume
.
- You can use the flag
--volume
more than one time if you want to mount more containers. - Mounted containers with write access are only synchronized when the job is terminated.
You can list and download data you uploaded or generated by a job with:
Synchronize data while a job is running
You can synchronize data to the Object Storage while a job is running with:
You can see the progress with:
Execute commands inside a running job
You can execute commands (like bash
) while a job is running.
This way you can interact with a running job.
Run a job with ssh access
You can create a job with SSH access:
Multiple -s
arguments can be used to provide multiple SSH public keys.
Once the job is in RUNNING
state, you can retrieve the sshUrl
with:
Then you can connect to it with a terminal:
Manage registries
You can list available registries with:
By default, you have access to public registries and a shared registry scoped to your project.
NOTE: This shared registry can help you perform your tests, but should not be used in production, as we reserve the right to delete its content if deemed necessary. The images pushed to this registry are for AI Tools workloads only and will not be accessible for external uses.
This is why it can be interesting to add and manage other registries. To add a private registry, use:
You will be asked to type your credentials.
More information about adding and managing public and private registries can be found here.
Go further
For more information and tutorials, please see our other AI & Machine Learning support guides or explore the guides for other OVHcloud products and services.
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.