... | ... | @@ -24,15 +24,10 @@ To update: |
|
|
|
|
|
# Deploying
|
|
|
|
|
|
First make sure to create a production.yml file corresponding to your needs, see [the docker-compose docs](https://docs.docker.com/compose/). Be wary that docker does everything in /var/lib/docker rather than the current path, so it's advisable to either override the volumes configuration or the whole docker data directory.
|
|
|
First make sure to create a production.yml file corresponding to your needs, see [the docker-compose docs](https://docs.docker.com/compose/). Be wary that docker does everything in /var/lib/docker rather than the current path, so it's advisable to either override the volumes configuration or the whole docker data directory if your system partition is small.
|
|
|
Change the admin password and the secret key in the variables.env file **before building**!
|
|
|
The variables.env file is passed to the containers, some configurations need to be passed directly to the docker-compose build through environement variables on the host.
|
|
|
Change the number of cores used by the queues based on your config, for example if you have 8 cores, leaving 2 for general http and sql:
|
|
|
|
|
|
$ export CELERY_MAIN_CORES=4 # defaults to 3
|
|
|
$ export CELERY_LOW_CORES=2 # defaults to 2
|
|
|
|
|
|
And configure exim (to send emails) with:
|
|
|
The variables.env file is passed to the containers, some configurations need to be passed directly to the docker-compose build through environment variables on the host.
|
|
|
Configure exim (to send emails) with:
|
|
|
|
|
|
$ export MAIL_PRIMARY_HOST=domainname.com
|
|
|
|
... | ... | @@ -57,8 +52,22 @@ It may become a build option at some point. |
|
|
|
|
|
### Using a gpu
|
|
|
|
|
|
For now you can only use one gpu, using the KRAKEN_TRAINING_DEVICE setting in the `variables.env` file, so for example:
|
|
|
First make sure to have a supported distribution [here](https://nvidia.github.io/nvidia-docker/).
|
|
|
Then install the latest nvidia drivers.
|
|
|
For Debian 10 the easiest way is to use the [buster backports](http://ftp.debian.org/debian/dists/buster/).
|
|
|
`echo deb http://deb.debian.org/debian buster-backports main > /etc/apt/sources.list`
|
|
|
`sudo apt-get update`
|
|
|
`apt-get install -t buster-backports nvidia-driver`
|
|
|
|
|
|
*insert additional steps here*
|
|
|
|
|
|
Since docker-compose [doesn't have a way to use Docker's --gpus argument](https://github.com/docker/compose/issues/6691), we have to use the deprecated [nvidia-docker2](https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)) along with the old docker-compose file api 2.4.
|
|
|
|
|
|
You can follow the installation process explained [here](https://github.com/NVIDIA/nvidia-docker/tree/master), but instead of `nvidia-container-toolkit` install `nvidia-docker2`.
|
|
|
|
|
|
Beware that this may overwrite your `/etc/docker/daemon.json` configuration so make sure to update it as needed.
|
|
|
|
|
|
Then in your production.yml file, uncomment the dedicated GPU environment variables and configurations.
|
|
|
To make use of more gpus, simply add more workers following the same configuration.
|
|
|
|
|
|
KRAKEN_TRAINING_DEVICE=cuda:0
|
|
|
|
|
|
You also need to install cuda, cudn and use https://github.com/NVIDIA/nvidia-docker. |