Skip to content

Docker containers for PYME's distributed servers - #1219

Closed
zacsimile wants to merge 11 commits into
python-microscopy:masterfrom
zacsimile:dockerize
Closed

Docker containers for PYME's distributed servers#1219
zacsimile wants to merge 11 commits into
python-microscopy:masterfrom
zacsimile:dockerize

Conversation

@zacsimile

@zacsimile zacsimile commented Apr 8, 2022

Copy link
Copy Markdown
Member

This is a Docker file and GitHub Action that creates a container for PYME distributed servers and uploads it to https://hub.docker.com/. Tested and working in Docker on Ubuntu 20.04.4 LTS.

One uploaded (or built locally with docker build -t pyme-server .), a server node can be brought up with

docker run -dp 9000:9000 pyme-server

and the main node can be brought up with

docker run -dp 9000:9000 pyme-server --main.

Note the -d flag runs in detached mode and -p 9000:9000 maps port 9000 of the Docker image to port 9000 of the host machine (more info at https://docs.docker.com/get-started/02_our_app/).

Still on the to-do list...

This is a WIP, and thoughts on how to do this better are most welcome. Feel free to try on your home machine :).

@zacsimile zacsimile changed the title Docker images for PYME's distributed servers Docker containers for PYME's distributed servers Apr 8, 2022
@zacsimile
zacsimile marked this pull request as draft April 8, 2022 18:06
@zacsimile

Copy link
Copy Markdown
Member Author

nvidia-container-toolkit (https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/overview.html) must be installed on the Docker host machine for this to work. Launch the GPU-enabled Docker server (main node uses --main flag, other nodes do not have this flag) with

docker run --rm -dp 9000:9000 --gpus all pyme-server --main

@barentine

Copy link
Copy Markdown
Member

Looks like we might also be able to run the multi-process service. Wild. Would be neat from a performance standpoint, but if its a headache its a headache
NVIDIA/nvidia-docker#419

@barentine

Copy link
Copy Markdown
Member

Also big thanks for doing this Zach!

@zacsimile

Copy link
Copy Markdown
Member Author

Would be cool. And no problem. Once this is merged/built on our own Docker Hub account (presumably python-microscopy? or maybe david_baddeley for continuity?) we can write up the instructions for install, which will be something like.

Before you begin

Note that this could create some big security holes in your network. We recommend running this on a separate, private network connected only to your microscope computer.

Requirements

  • GNU/Linux x86_64 with kernel version > 3.10
  • Docker >= 19.03
  • NVIDIA GPU with Architecture >= Kepler (or compute capability 3.0)
  • NVIDIA Linux drivers

Installation

  1. Install NVIDIA container toolkit (https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/overview.html).
  2. Run docker pull python-microscopy/pyme-server:latest.

Run

  1. Enter docker run --rm -d --gpus all pyme-server --main to launch the main node of a PYME server array.
  2. For each additional machine you wish to bring into the server array, enter docker run --rm -d --gpus all pyme-server.

@zacsimile

Copy link
Copy Markdown
Member Author

NOTE: There is currently no python manage.py runserver 9000 call (https://python-microscopy.org/doc/cluster/cluster_install.html#cluster-install). Maybe we want to add this?

@zacsimile
zacsimile marked this pull request as ready for review May 10, 2022 18:45
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants