Last updated 29th October, 2020.
This guide covers the usage of the ovhai CLI.
- a working
ovhaiCLI how to install ovhai CLI
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
ovhai job run ubuntu --gpu 1 -- echo "Hello from my first job"
- Add the flag
--helpto get more information about a command.
- You can give access to your job to more GPUs with the flag
You can then list your current and old jobs with:
ovhai job list
- 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 its logs in live use the following command:
ovhai job logs <job-id>
You should see the output of the
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 access you can save data from a job.
Let's upload some data and use it in a job that will produce more data.
ovhai data upload <region> <container> some-file.txt
- 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
ovhai job run <image> --volume <container>@<region>:/data:rw
- 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:
ovhai data list <region> <container> ovhai data download <region> <container> --prefix /some-data
Execute commands inside a running job
You can execute commands (like
bash) while a job is running.
ovhai job exec <id> -- bash
This way you can interact with a running job.
You can list available registries with:
ovhai registry list
By default, you have access to public registries, and a shared registry scoped to your project. To add a private registry, use:
ovhai registry add <url>
You will be asked to type your credentials.
Please send us your questions, feedback and suggestions to improve the service:
- On the OVHcloud AI community forum
Did you find this guide useful?
Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.