Modernmt: Docker

Created on 10 May 2019  路  4Comments  路  Source: modernmt/modernmt

I agree with @davidecaroselli that using Docker is a much better idea to avoid painful installation issues that many people seem to have when building from source (me included).

As not all of us are programmers though, what would greatly help is a very detailed explanation (Install.md) explaining:

  1. How to install the correct gfx driver
  2. How to install Docker
  3. How to install the correct gfx driver in Docker
  4. How to install ModernMT in Docker
  5. Most important: how to start/stop multiple engines on different ports using Docker
  6. Automate 5) using a Bash script (first starting engine 1 on ports xyz, then starting engine 2 on ports abc, etc)

In the end this will save everybody, Davido included, a lot of time, I think.

Most helpful comment

Hi @LoekvanKooten

  1. How to install the correct gfx driver

In both versions of INSTALL.md it is explained how to install ModernMT with Docker. In v3 it is required to install CUDA 9, while for version 4.0 only the drivers are needed, and it is explained how to do that.

  1. How to install Docker

There are many many how-to online depending on the platform you have, this one is reported also in v4 INSTALL.md for convenience: https://docs.docker.com/install/linux/docker-ce/ubuntu/

  1. How to install the correct gfx driver in Docker
  2. How to install ModernMT in Docker

No need to, that's the power of Docker! You just need to follow the instructions on INSTALL.md

  1. Most important: how to start/stop multiple engines on different ports using Docker

This is a sys admin task, I can give you my preferred way, you may have a different one following your needs.
I have the "engines" folder on the host machine that I mount onto the Docker image. This way any changes will be persisted (otherwise you will lost all data after a docker restart!). In this folder you can have different engine.xconf with different ports configurations.

  1. Automate 5) using a Bash script (first starting engine 1 on ports xyz, then starting engine 2 on ports abc, etc)

Automation is again a sys admin task. If you want to have your own logic at startup, my advice is to create your Docker image using ModernMT as a base image.

More in general: Docker is a fantastic tool, but you need to get to know it before going straight to production. You need to understand what is a container, its lifecycle and how you can automate your deployment. There are plenty of tutorials from beginners to advance features usage so you just have to search! :)

All 4 comments

Hi @LoekvanKooten

  1. How to install the correct gfx driver

In both versions of INSTALL.md it is explained how to install ModernMT with Docker. In v3 it is required to install CUDA 9, while for version 4.0 only the drivers are needed, and it is explained how to do that.

  1. How to install Docker

There are many many how-to online depending on the platform you have, this one is reported also in v4 INSTALL.md for convenience: https://docs.docker.com/install/linux/docker-ce/ubuntu/

  1. How to install the correct gfx driver in Docker
  2. How to install ModernMT in Docker

No need to, that's the power of Docker! You just need to follow the instructions on INSTALL.md

  1. Most important: how to start/stop multiple engines on different ports using Docker

This is a sys admin task, I can give you my preferred way, you may have a different one following your needs.
I have the "engines" folder on the host machine that I mount onto the Docker image. This way any changes will be persisted (otherwise you will lost all data after a docker restart!). In this folder you can have different engine.xconf with different ports configurations.

  1. Automate 5) using a Bash script (first starting engine 1 on ports xyz, then starting engine 2 on ports abc, etc)

Automation is again a sys admin task. If you want to have your own logic at startup, my advice is to create your Docker image using ModernMT as a base image.

More in general: Docker is a fantastic tool, but you need to get to know it before going straight to production. You need to understand what is a container, its lifecycle and how you can automate your deployment. There are plenty of tutorials from beginners to advance features usage so you just have to search! :)

As said, I got it running from source now (thanks to your help!), and the numpy issue was a show stopper, so at this moment that way is easiest for me. It was just meant in a good way, as I see more questions about these issues popping up elsewhere, and I notice you're answering the same questions multiple times.

Generally: the better Install.md, the fewer questions, the more time you have on your hands!

In both versions of INSTALL.md it is explained how to install ModernMT with Docker. In v3 it is required to install CUDA 9, while for version 4.0 only the drivers are needed, and it is explained how to do that.

Does CUDA 9 install directly on Ubuntu 18.04 ? I didn't succeed on my side. I just found the solution yesterday: by firstly installing CUDA 10.

@EtienneAb3d you're right!
I think that the best solution right now is to follow instruction on your issue #482 . However, I suggest to stick to Ubuntu 14.04 if running ModernMT v3, while upgrading to Ubuntu 18.04 for ModernMT v4.

I have actually noticed that you can actually run a docker image with NVIDIA driver different from the one of the host machine. However I think that this is possible only in some cases, where the two drivers are somehow compatible. I am afraid this won't work more in general.

My personal advice is.. give it a try! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EtienneAb3d picture EtienneAb3d  路  3Comments

LoekvanKooten picture LoekvanKooten  路  3Comments

EtienneAb3d picture EtienneAb3d  路  4Comments

EtienneAb3d picture EtienneAb3d  路  4Comments

mzeidhassan picture mzeidhassan  路  6Comments