You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -81,12 +81,12 @@ More information can be found in the [official Docker documentation](https://doc
81
81
82
82
### Create an OVHcloud user and a working directory
83
83
84
-
Deployed containers are not run as root user, but by an “OVHcloud” user with **UID 42420**.
84
+
Deployed containers are not run as root, but by an “OVHcloud” user with **UID 42420**.
85
85
It means that if you want to be able to write in a specific directory at runtime, you will have to give it specific rights.
86
86
87
-
This is the case in the vast majority of use-cases.
87
+
This is the case in the vast majority of usecases.
88
88
89
-
You can do it with the following instruction:
89
+
You can do it with the following instructions:
90
90
91
91
92
92
```{.console}
@@ -128,24 +128,24 @@ RUN pip install -r requirements.txt
128
128
### Manage output data effectively (S3, ...)
129
129
130
130
Just like AI Notebooks and AI Training, AI Deploy is easily connected to remote storage such as S3 object storage containers at launch.
131
-
However, unlike AI Notebooks and AI Training, AI Deploy **does NOT**synchronize data back to your remote storage.
131
+
However, unlike AI Notebooks and AI Training, AI Deploy **does NOT**synchronise data back to your remote storage.
132
132
133
133
If you need to write data somewhere, for example output from your AI model (generated images), your code application should include storage connection.
134
-
For example, you can use Python `Boto3` library when using Python and S3.
134
+
For example, you can use the Python `Boto3` library when using Python and S3.
135
135
136
136
Be careful, **if you write data directly in your working directory, it will be lost when you stop your application**.
137
137
138
138
### Use environment variables for dynamic values
139
139
140
140
> [!primary]
141
141
>
142
-
> For sensitive data such as password or token, consider using [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/).
142
+
> For sensitive data such as passwords or tokens, consider using [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/).
143
143
144
-
Sometimes, instead of hardcoding a variable inside a Dockerfile, it is much more powerful to pass variables during deployment. Docker provides natively this option with`--env` argument, and OVHcloud AI tools follow the same logic.
144
+
Sometimes, instead of hardcoding a variable inside a Dockerfile, it is much more powerful to pass variables during deployment. Docker provides this option natively through the`--env` argument, and OVHcloud AI tools follow the same logic.
145
145
146
-
During AI Deploy app creation, you will be able to pass environment variables via CLI, API or UI in the control panel. In your Dockerfile, you can gather theses variables with the `ENV` value
146
+
During AI Deploy app creation, you will be able to pass environment variables via CLI, API or UI in the control panel. In your Dockerfile, you can gather theses variables with the `ENV` value.
147
147
148
-
For example, you can launch a new app with two variable like this:
148
+
For example, you can launch a new app with two variables like this:
149
149
150
150
```
151
151
ovhai run app <my_docker_image> -e LANGUAGE=english TOKEN=12345678
@@ -172,34 +172,34 @@ ADD . $foo
172
172
### Exposing your model or application with an API
173
173
174
174
Inside your Dockerfile, you will need to expose your model or application so anyone can use it. The easiest way is to expose API via REST endpoint.
175
+
The most popular open source frameworks for exposing APIs are [Flask]() and [Fast API]().
175
176
176
-
Most famous and open source frameworks for exposing API are [Flask]() and [Fast API]()
177
-
You can find a basic example in the next chapter, and more advanced tutorials in [AI Deploy documentation](https://docs.ovh.com/gb/en/publiccloud/ai/).
177
+
You can find a basic example in the section below, and more advanced tutorials in our [AI Deploy documentation](https://docs.ovh.com/gb/en/publiccloud/ai/).
178
178
179
179
### Exposing your application with a web frontend
180
180
181
181
While an API is useful for automation and code, sometimes you will need to expose your application or model through a web interface.
182
182
183
-
AI Deploy is fully compliant with multiple frontend frameworks, such as [Streamlit](https://streamlit.io/), [Gradio](https://gradio.app/) or [Taipy](https://www.taipy.io/
184
-
).
183
+
AI Deploy is fully compliant with multiple frontend frameworks, such as [Streamlit](https://streamlit.io/), [Gradio](https://gradio.app/) or [Taipy](https://www.taipy.io/).
185
184
You can of course also build your own frontend with your favourite tools, such as HTML/CSS.
186
-
You can find a basic example in the next chapter, and more advanced tutorials in [AI Deploy documentation](https://docs.ovh.com/gb/en/publiccloud/ai/).
187
185
188
-
## Basic example: write your own Dockerfile and build your image
186
+
You can find a basic example in the section below, and more advanced tutorials in our [AI Deploy documentation](https://docs.ovh.com/gb/en/publiccloud/ai/).
189
187
190
-
Here, we will build a basic docker image, following the guidelines.
188
+
## Basic example: Write your own Dockerfile and build your image
189
+
190
+
Here we will build a basic Docker image, following the guidelines.
191
191
192
192
### Prepare the Dockerfile
193
193
194
-
Create a new file and name it `Dockerfile` following guidelines.
194
+
Create a new file and name it `Dockerfile`, following the guidelines.
195
195
196
196
1. First you need to choose a base image to start from.
197
-
2. Install what you need as dependencies with `apt` or `pip`. Bash command instructions on your Dockerfile should begin with `RUN` prefix.
198
-
3. Copy files from your local directory inside docker image with the `COPY` prefix.
199
-
4. Allow user OVHcloud UID 42420 to get specific rights
200
-
5. Run your script
197
+
2. Install what you need as dependencies with `apt` or `pip`. Bash command instructions on your Dockerfile should begin with the `RUN` prefix.
198
+
3. Copy files from your local directory inside the Docker image with the `COPY` prefix.
199
+
4. Allow user "OVHcloud UID 42420" to get specific rights.
200
+
5. Run your script.
201
201
202
-
A basic example can be summarized like this:
202
+
A basic example can be summarised like this:
203
203
204
204
```{.console}
205
205
# Start from official Python image since we don't need GPU
@@ -215,7 +215,7 @@ RUN apt-get update && apt-get install -y vim git
215
215
ADD example.py /workspace/
216
216
ADD dataset.csv /workspace/
217
217
218
-
# Create a HOME dedicated to the OVHcloud user (42420:42420). mandatory step
218
+
# Create a HOME dedicated to the OVHcloud user (42420:42420). Mandatory step
Once your **Dockerfile** is complete and match your needs, you have to choose a name and build the image using the following command in the same directory:
228
+
Once your **Dockerfile** is complete and matches your needs, you have to choose a name and build the image using the following command in the same directory:
229
229
230
230
```{.console}
231
231
docker build . -t <image-identifier>
232
232
```
233
233
234
234
> [!primary]
235
235
>
236
-
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
236
+
> The dot argument `.` indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
237
237
238
238
> [!primary]
239
239
>
240
240
> The `-t` argument allows you to choose the identifier to give to your image. Usually, image identifiers are composed of a **name** and a **version tag**`<name>:<version>`.
241
241
242
242
> [!warning]
243
243
>
244
-
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/amd64** architecture. You could, for instance, build your image using **buildx** as follows:
244
+
> Please make sure that the Docker image you will push in order to run containers using AI products respects the **linux/amd64** architecture. You could, for instance, build your image using **buildx** as follows:
If you want to verify that your built image is working properly, run the following command:
252
252
@@ -256,17 +256,17 @@ docker run --rm -it --user=42420:42420 <image-identifier>
256
256
257
257
> [!warning]
258
258
>
259
-
> Don't forget the `--user=42420:42420` argument if you want to simulate the exact same behavior that will occur on **AI Deploy apps**. It executes the docker container as the specific OVHcloud user (user **42420:42420**).
259
+
> Don't forget the `--user=42420:42420` argument if you want to simulate the exact same behaviour that will occur on **AI Deploy apps**. It executes the Docker container as the specific OVHcloud user (user **42420:42420**).
260
260
261
-
### Push image in the registry of your choice
261
+
### Push the image to the registry of your choice
262
262
263
263
Pushing your image to a registry is needed in order for AI Deploy to pull it.
264
264
265
265
AI Deploy provides a default registry called **Shared registry** where users are able to push their custom images. It is linked with every project by default.
266
266
267
-
If you prefer using your own private docker registry instead of the shared one, feel free to use it. Just don't forget to [add your registry in your AI Tools project](https://docs.ovh.com/gb/en/publiccloud/ai/training/add-private-registry) before using it.
267
+
If you prefer using your own private Docker registry instead of the shared one, feel free to use it. Just don't forget to [add your registry in your AI Tools project](https://docs.ovh.com/gb/en/publiccloud/ai/training/add-private-registry) before using it.
268
268
269
-
The basic commands to push a docker image to a registry is:
269
+
The basic commands to push a Docker image to a registry is:
270
270
271
271
```{.console}
272
272
# Add a new registry into OVHcloud AI Tools
@@ -278,7 +278,7 @@ docker tag <image-identifier> <registry>/<image-identifier>
278
278
docker push <registry>/<image-identifier>
279
279
```
280
280
281
-
Example: if you want to push an image named `custom-image` inside a registry `registry.gra.training.ai.cloud.ovh.net`:
281
+
Example: If you want to push an image named `custom-image` inside a registry `registry.gra.training.ai.cloud.ovh.net`:
282
282
283
283
```{.console}
284
284
# Add a new registry into OVHcloud AI Tools
@@ -302,4 +302,4 @@ If you want to know the exact commands to push on the shared registry, please co
302
302
303
303
Please send us your questions, feedback and suggestions to improve the service:
304
304
305
-
- On the OVHcloud [Discord server](https://discord.gg/ovhcloud)
305
+
- On the OVHcloud [Discord server](https://discord.gg/ovhcloud)
0 commit comments