Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Some docker fixes #3

Merged
merged 2 commits into from Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.md
@@ -1,10 +1,10 @@
# HPCCloud Services

### Goal
## Goal

Streamline a test deployment environment.

## Running it
### Running it

```
git clone https://github.com/Kitware/hpccloud-services.git
Expand All @@ -26,4 +26,16 @@ If you want to stop the services you can run the command
docker-compose down
```

### Running w/ GPU accleration

In order to run compute and visualize containers which can utilize the GPU on your system:

```
docker-compose -f docker-compose.yml -f docker-compose-nvidia.yml up -d
```

This will apply the service overrides found in `docker-compose-nvidia.yml`, which make use of the `nvidia` container runtime.

### Development workflow

[Developent workflow][dev_workflow.md] has more complete instructions on troubleshooting and manual testing.
3 changes: 2 additions & 1 deletion ansible/ansible.cfg
@@ -1,3 +1,4 @@
[defaults]
host_key_checking = False
library=~/.ansible/roles/girder.girder/library
library=~/.ansible/roles/girder.girder/library
remote_tmp=/tmp
4 changes: 1 addition & 3 deletions ansible/dev.yml
@@ -1,8 +1,6 @@

- hosts: girder_setup
vars:
ansible_python_interpreter: "/usr/local/bin/python"
connection: local
roles:
- role: girder
tags: girder_setup
tags: girder_setup
2 changes: 1 addition & 1 deletion ansible/host_vars/compute
Expand Up @@ -2,4 +2,4 @@ ansible_connection: ssh
ansible_user: demo
ansible_ssh_pass: letmein
ansible_ssh_extra_args: '-o StrictHostKeyChecking=no'
ansible_python_interpreter: /usr/local/bin/python
ansible_python_interpreter: /usr/bin/python3
3 changes: 2 additions & 1 deletion ansible/host_vars/localhost
@@ -1,8 +1,9 @@
ansible_python_interpreter: "/usr/local/bin/python"
dev: yes
girder_host: girder
girder_port: 8080
girder_api_root: '/api/v1'
girder_scheme: 'http'
hpccloud_password: letmein
cumulus_password: letmein
demo_password: letmein
demo_password: letmein
2 changes: 1 addition & 1 deletion ansible/host_vars/visualize
Expand Up @@ -2,4 +2,4 @@ ansible_connection: ssh
ansible_user: demo
ansible_ssh_pass: letmein
ansible_ssh_extra_args: '-o StrictHostKeyChecking=no'
ansible_python_interpreter: /usr/local/bin/python
ansible_python_interpreter: /usr/bin/python3
39 changes: 39 additions & 0 deletions docker-compose-nvidia.yml
@@ -0,0 +1,39 @@
# Go back to an older compose format version due to a bug
# where 'runtime' is available in version 2.3 but not 3
# https://github.com/docker/compose/issues/6239
version: '2.3'
services:

compute:
image: kitware/hpccloud:nvidia-compute-pyfr
build:
context: .
dockerfile: docker/compute-pyfr/Dockerfile
args:
- BASE_IMG=kitware/hpccloud:nvidia-sge-ssh
hostname: compute
runtime: nvidia
volumes:
- scratch.hc:/scratch
networks:
- hc
ports:
- "2201:22"

visualize:
image: kitware/hpccloud:visualize-egl
build:
context: .
dockerfile: docker/visualize-egl/Dockerfile
args:
- PARAVIEW_TAG=v5.6.1
- SUPERBUILD_TAG=v5.6.1
hostname: visualize
runtime: nvidia
volumes:
- scratch.hc:/scratch
networks:
- hc
ports:
- "2202:22"
- "9090:9090"
5 changes: 4 additions & 1 deletion docker-compose.yml
@@ -1,4 +1,7 @@
version: '3'
# Go back to an older compose format version due to a bug
# where 'runtime' is available in version 2.3 but not 3
# https://github.com/docker/compose/issues/6239
version: '2.3'
services:
mongodb:
image: mongo:3.6
Expand Down
17 changes: 8 additions & 9 deletions docker/ansible/Dockerfile
@@ -1,12 +1,14 @@
FROM python:3.6-slim

RUN apt-get update && apt-get -y install \
git \
sshpass
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
openssh-client \
sshpass && \
apt-get clean && rm -rf /var/lib/apt/lists/*


RUN pip install ansible && \
pip install girder_client
RUN pip3 install ansible \
girder_client

COPY ./ansible /ansible

Expand All @@ -16,7 +18,4 @@ RUN cd /ansible && \
COPY ./docker/ansible/entrypoint.sh /entrypoint.sh
COPY ./docker/ansible/wait-for-it.sh /wait-for-it.sh


ENTRYPOINT ["/wait-for-it.sh", "-t", "30", "girder:8080", "--", "/entrypoint.sh"]

RUN apt-get clean && rm -rf /var/lib/apt/lists/*
2 changes: 1 addition & 1 deletion docker/ansible/entrypoint.sh
@@ -1,3 +1,3 @@
#!/bin/sh
cd /ansible
ansible-playbook -i inventory/localhost dev.yml
ansible-playbook -i inventory/localhost dev.yml
31 changes: 24 additions & 7 deletions docker/bionic-python/Dockerfile
@@ -1,21 +1,38 @@
# Docker file for 18.04 Ubuntu with 3.6 Python
#
# To replace basic Ubuntu image with one ready for NVidia egl
# builds, specify the BASE_IMAGE build argument when building:
#
# docker build --build-arg BASE_IMAGE=nvidia/opengl:1.0-glvnd-devel-ubuntu18.04 -t kitware/hpccloud:nvidia-bionic-python .
#

ARG UBUNTU_VERSION=18.04
ARG PYTHON_VERSION=3.6
ARG BASE_IMAGE=ubuntu:18.04

FROM ubuntu:${UBUNTU_VERSION}
FROM ${BASE_IMAGE}

LABEL maintainer="patrick.oleary@kitware.com" \
version="1.0"

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
locales \
python3.6 \
python3-dev \
python3-setuptools \
python3-pip && \
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
locale-gen en_US.UTF-8 && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Add LANG default to en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

FROM python:${PYTHON_VERSION}

RUN pip install supervisor && \
RUN pip3 install supervisor && \
mkdir /var/log/supervisor && \
chmod 0777 /var/log/supervisor

# overwrite this with 'CMD []' in a dependent Dockerfile
CMD ["/bin/bash"]
CMD ["/bin/bash"]
30 changes: 15 additions & 15 deletions docker/celery-parflow/Dockerfile
Expand Up @@ -6,22 +6,22 @@ LABEL maintainer="patrick.oleary@kitware.com" \
parflow.version="master"

RUN apt-get update && \
apt-get install -y build-essential \
gcc-6 \
g++-6 \
g++-6-multilib \
gfortran-6 \
libopenblas-dev \
liblapack-dev \
openssh-client \
openssh-server \
openmpi-bin \
libopenmpi-dev \
cmake \
--no-install-recommends && \
apt-get install -y --no-install-recommends \
gcc-6 \
g++-6 \
g++-6-multilib \
gfortran-6 \
libopenblas-dev \
liblapack-dev \
openssh-client \
openssh-server \
openmpi-bin \
libopenmpi-dev \
cmake && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-6 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-6
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-6 && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Allow root to mpiexec (not in current openmpi version for Ubuntu 18.04)
#ENV OMPI_ALLOW_RUN_AS_ROOT=1
Expand Down Expand Up @@ -72,4 +72,4 @@ RUN git clone https://gitlab.kitware.com/parflow/parflow.git parflow && \
cd /

# Allow root to run mpiexec (kludge)
COPY ./docker/celery-parflow/run /parflow/bin/run
COPY ./docker/celery-parflow/run /parflow/bin/run
36 changes: 17 additions & 19 deletions docker/celery-pyfr/Dockerfile
Expand Up @@ -6,26 +6,26 @@ LABEL maintainer="patrick.oleary@kitware.com" \
pyfr.version="1.8.0"

RUN apt-get update && \
apt-get install -y build-essential \
gcc-6 \
g++-6 \
g++-6-multilib \
gfortran-6 \
libopenblas-dev \
liblapack-dev \
openssh-client \
openssh-server \
openmpi-bin \
libopenmpi-dev \
libhdf5-dev \
libmetis-dev \
strace \
unzip \
wget \
--no-install-recommends && \
apt-get install -y --no-install-recommends \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was dropping build-essential intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just moved it to the base image (bionic-python).

gcc-6 \
g++-6 \
g++-6-multilib \
gfortran-6 \
libopenblas-dev \
liblapack-dev \
openssh-client \
openssh-server \
openmpi-bin \
libopenmpi-dev \
libhdf5-dev \
libmetis-dev \
strace \
unzip \
wget && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-6 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-6 && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
pip3 install appdirs \
numpy \
pytools \
Expand All @@ -43,5 +43,3 @@ RUN wget -q -O PyFR-1.8.0.zip http://www.pyfr.org/download/PyFR-1.8.0.zip && \
cd /

RUN chown -R celery /PyFR-1.8.0

RUN apt-get clean && rm -rf /var/lib/apt/lists/*
9 changes: 5 additions & 4 deletions docker/celery/Dockerfile
@@ -1,4 +1,5 @@
FROM kitware/hpccloud:bionic-python
ARG BASE_IMAGE=kitware/hpccloud:bionic-python
FROM ${BASE_IMAGE}

LABEL maintainer="patrick.oleary@kitware.com" \
version="1.0"
Expand All @@ -10,9 +11,9 @@ RUN git clone https://github.com/Kitware/cumulus.git /cumulus && \
cd /cumulus && \
# git checkout v1.0.0 && \
cd / && \
pip install --no-cache-dir -r /cumulus/requirements.txt && \
pip install --no-cache-dir -e /cumulus && \
pip install --no-cache-dir girder
pip3 install --no-cache-dir -r /cumulus/requirements.txt && \
pip3 install --no-cache-dir -e /cumulus && \
pip3 install --no-cache-dir girder

# TEMP cumulus fix - requirements.txt needs to be updated for AWS, in progress.
# COPY ./cumulus/cumulus/girderclient.py /cumulus/cumulus/girderclient.py
Expand Down
36 changes: 18 additions & 18 deletions docker/compute-parflow/Dockerfile
@@ -1,28 +1,30 @@
# Docker file for compute Parflow

FROM kitware/hpccloud:sge-ssh
ARG BASE_IMAGE=kitware/hpccloud:sge-ssh

FROM ${BASE_IMAGE}
LABEL maintainer="patrick.oleary@kitware.com" \
version="1.0" \
parflow.version="master"

RUN apt-get update && \
apt-get install -y build-essential \
gcc-6 \
g++-6 \
g++-6-multilib \
gfortran-6 \
openmpi-bin \
libopenmpi-dev \
git \
curl \
cmake \
strace \
unzip \
wget \
--no-install-recommends && \
apt-get install -y --no-install-recommends \
gcc-6 \
g++-6 \
g++-6-multilib \
gfortran-6 \
openmpi-bin \
libopenmpi-dev \
git \
curl \
cmake \
strace \
unzip \
wget && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-6 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-6
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-6 && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Allow root to mpiexec (not in current openmpi version for Ubuntu 18.04)
#ENV OMPI_ALLOW_RUN_AS_ROOT=1
Expand Down Expand Up @@ -74,5 +76,3 @@ RUN git clone https://gitlab.kitware.com/parflow/parflow.git parflow && \

# Allow root to run mpiexec (kludge)
COPY ./docker/celery-parflow/run /parflow/bin/run

RUN apt-get clean && rm -rf /var/lib/apt/lists/*