Add more documentation

This commit is contained in:
Andras Schmelczer 2022-07-11 19:20:13 +02:00
parent 7165174f4f
commit 8d1ad9a242
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
21 changed files with 406 additions and 92 deletions

View file

@ -131,49 +131,7 @@
"source": [
"Now that you've made sure your application is hardened enough for the intended use case, it is time to deploy it. The responsibilities of GreatAI end when it wraps your inference function and model into a production-ready service. You're given the freedom and responsibility to deploy this service. Fortunately, you (or your organisation) probably already has an established routine for deploying services.\n",
"\n",
"There are three main approaches to deploy a GreatAI service.\n",
"\n",
"### Manual deployment\n",
"\n",
"Simply run `ENVIRONMENT=production great-ai deploy.ipynb` in the command-line of a production machine.\n",
"> This is the crudest approach, however, it might be fitting for some contexts.\n",
"\n",
"### Containerised deployment\n",
"\n",
"Run the notebook directly in a container or create a service for it using your favourite orchestrator.\n",
"\n",
"```sh\n",
"docker run \\\n",
" -p 6060:6060 \\\n",
" --volume `pwd`:/app \\\n",
" --rm \\\n",
" schmelczera/great-ai deploy.ipynb\n",
"```\n",
"> You can replace ``pwd`` with the path to your code's folder.\n",
"\n",
"#### Use a Platform-as-a-Service\n",
"\n",
"Similarly to the previous approach, your code will run in a container. However, instead of manually managing it, you can just choose from a plethora of PaaS providers that take a Docker image as a source and handle the rest of the deployment.\n",
"\n",
"To this end, you can also create a custom Docker image. It is especially useful if you have third-party dependencies, such as pytorch or tensorflow.\n",
"\n",
"```Dockerfile\n",
"FROM schmelczera/great-ai:latest\n",
"\n",
"# Remove this block if you don't have a requirements.txt\n",
"COPY requirements.txt ./ \n",
"RUN pip install --no-cache-dir --requirement requirements.txt\n",
"\n",
"# If you store your models in S3 or GridFS, it may be a \n",
"# good idea to # cache them in the image so that you don't\n",
"# have to download it each time a container starts\n",
"# RUN large-file --backend s3 --secrets s3.ini --cache my-domain-predictor\n",
"\n",
"COPY . .\n",
"\n",
"CMD [\"deploy.ipynb\"]\n",
"\n",
"```"
"There are three main approaches to deploy a GreatAI service: For more info about them, check out [the deployment how-to](/how-to-guides/use-service)."
]
},
{