AI Deploy - Getting started
Discover AI Deploy and unfold your first application
Discover AI Deploy and unfold your first application
Last updated 3rd November, 2022.
AI Deploy is in beta
. During the beta-testing phase, the infrastructure’s availability and data longevity are not guaranteed. Please do not use this service for applications that are in production, as this phase is not complete.
AI Deploy is covered by OVHcloud Public Cloud Special Conditions.
OVHcloud provides a set of managed AI tools designed for building your machine learning projects.
This guide explains how to get started with OVHcloud AI Deploy by deploying your first application through the Control Panel.
Log in to your OVHcloud Control Panel and switch to Public Cloud
in the top navigation bar. After selecting your Public Cloud project, click on AI Deploy
in the left-hand navigation bar under AI & Machine Learning.
Click on the Deploy an AI Deploy app
button and accept terms and conditions if any.
Once clicked, you will be redirected to the creation process detailed below.
Select where your AI Deploy app will be hosted, meaning the physical location.
OVHcloud provides multiple datacenters. You can find the capabilities for AI Deploy in the guide AI Deploy capabilities.
AI Deploy allows a user to deploy applications from two sources:
In this tutorial, we will select an OVHcloud Docker image to deploy your first AI Deploy app.
Enter the name of the image: ovhcom/ai-deploy-hello-world
You can find this image on the OVHcloud DockerHub. For more information about this Docker image, please check the GitHub repository.
The objective is to deploy and call a simple Flask API for a kind of Hello World. The API welcomes you on your first AI Deploy app by sending back Hello
followed by the name
you sent and the end of the sentence.
If you want to deploy your own container, you need to comply with a few rules like adding a specific user. Follow our Build and use custom images guide.
An AI Deploy app needs compute resources to be deployed, from a minimum of one instance to a maximum of ten. Each instance will be billed based on the amount of running time, whether or not you use your AI Deploy app.
Each node is composed of:
You can modify the Resource Size to adjust the amount of CPU or GPU cores, RAM and Network Bandwidth. Then you can modify the Number of instances on which your AI Deploy apps will be deployed.
To benefit from High Availability, a minimum of 2 instances are required.
For our first deployment, we will select two instances.
First, choose a name for your AI Deploy app or keep the automatically generated name.
Then, you have the option to add some Key/Value labels to filter or organize your AI Deploy app access.
As an example, add a label with Key=owner and Value=elea.
The last parameter to select is the Access rule. Either you restrict your AI Deploy app access to selected tokens, or you allow any access. Use this option carefully; usually a Public access is used for a test, but not in production since everyone will be able to use it.
We will select Restricted Access for this deployment.
This final step is a summary about your AI Deploy app deployment. You can review the previously selected options and parameters.
Launch your AI Deploy app by clicking on Deploy an AI Deploy app
Congratulations, your first AI Deploy app is now running on production!
AI Deploy can be your own Docker container or applications proposed by the OVHcloud ecosystem.
In this tutorial, we deployed a Flask API allowing us to return. There is no web interface. What is given is an API endpoint that you can reach via HTTP.
First, go check your app details and verify that your AI Deploy app has a running status. Please also verify that your labels are clearly mentioned.
In this example, we added the label owner=elea and two labels were automatically added by OVHcloud.
During the AI Deploy apps deployment process, we selected "restricted access". To query your app, you first need a valid security token.
In your OVHcloud Control Panel, go to your AI Deploy list. Select the Token tab.
Click on the New token
button then fill in a name, a label selector, a role and region as below:
A few explanations:
Now that your AI Deploy app is running and token generated, you are ready for your first query.
You can find the cURL example in the bottom part of your AI Deploy app, with standard parameters and JSON output format.
Since we are on restricted access, you need to specify the authentication token in the header following this format:
-H "Authorization: Bearer $YOURTOKENHERE"
In our case, the exact cURL code is:
curl --request POST
--url https://9b5b651e-8514-43d0-ae68-af801771542f.app.gra.training.ai.cloud.ovh.net
-H "Authorization: Bearer WixOC/dmSoK3d0YSd20UvLMzbSVxMTMosnz6FcBQOQDlqxAsR5BezCVKtYfu18e"
--header 'Content-Type: application/json'
--data ' "Elea" '
Giving us
"Hello Elea. Congratulations, you have launched your first AI App!"
If you see this message with the name you provided, you have successfully launched your first app!
If you want to query this API with Python, this code sample with Python Request library may suit you:
import requests
import json
from requests.structures import CaseInsensitiveDict
url = "https://9b5b651e-8514-43d0-ae68-af801771542f.app.gra.training.ai.cloud.ovh.net"
headers = CaseInsensitiveDict()
headers = {'content-type': 'application/json',
'Accept-Charset': 'UTF-8',
'Authorization': 'Bearer WixOC/dmSoK3d0YSd20UvLMzbSVxMTMosnz6FcBQOQDlqxAsR5BezCVKtYfu18eC'}
data = "Elea"
j_data = json.dumps(data)
r = requests.post(url, data = j_data, headers = headers)
print(r.status_code)
print(r.text)
Result:
200
"Hello Elea. Congratulations, you have launched your first AI App!"
That's it!
You can keep your AI Deploy app running as long as you want. At any time, you may stop your application in your AI Deploy app details:
Once stopped, your AI Deploy app will free up the previously allocated compute resources. Your endpoint is kept and if you restart your AI Deploy app, the same endpoint can be reused seamlessly. Also, when you stop your app, you don't book compute resources anymore which means you don't have expenses for this part. Only expenses for attached storage may occur.
If you want to completely delete your AI Deploy app, just click on the delete
action.
Be sure to also delete your Object Storage data if you don't need it anymore.
Please feel free to send us your questions, feedback and suggestions to help our team improve the service on the OVHcloud Discord server!
Zachęcamy do przesyłania sugestii, które pomogą nam ulepszyć naszą dokumentację.
Obrazy, zawartość, struktura - podziel się swoim pomysłem, my dołożymy wszelkich starań, aby wprowadzić ulepszenia.
Zgłoszenie przesłane za pomocą tego formularza nie zostanie obsłużone. Skorzystaj z formularza "Utwórz zgłoszenie" .
Dziękujemy. Twoja opinia jest dla nas bardzo cenna.
Dostęp do OVHcloud Community Przesyłaj pytania, zdobywaj informacje, publikuj treści i kontaktuj się z innymi użytkownikami OVHcloud Community.
Porozmawiaj ze społecznością OVHcloud