CLI - Commands reference
Objective
This guide covers the usage of the ovhai CLI.
Requirements
- a working
ovhaiCLI how to install ovhai CLI
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 which executes a command echo:
- Add the flag
--helpto 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
--watchto watch changes in 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 in 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
--volumemore 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 some 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.
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 & private registries can be found here.
Switch region in the CLI
The regions available to install and use the ovhai CLI are GRA and BHS. If you want to change the region in the CLI, you can use the following commands.
You can list the Names and URLs of the available regions with:
The region in green is the one you are currently in.
To change the region, use:
<region> is the new region name (GRA or BHS), in which you want to be placed.
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.
Feedback
Please send us your questions, feedback and suggestions to improve the service:
- On the OVHcloud Discord server