Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 2.53 KB

TUTORIAL.md

File metadata and controls

70 lines (48 loc) · 2.53 KB

Base Images for Running AI Workflows

There are a variety of POWERPC images with popular deep learning library installed provided by IBM: ibmcom/powerai

You can choose from the list of tags according to your project requirement.

However, we do recommend that Satorians use the base image generated by us. atlas4openshift/powerai-openshift

On top of installing powerai packages, this base image resolves some of the CUDA issues and user permission problem when running on MoC-OpenShift.

We provide the dockerfile used to generate our base image:

FROM ibmcom/powerai

ENV LD_LIBRARY_PATH="/usr/local/nvidia/lib:/usr/local/nvidia/lib64"
ENV NVIDIA_DRIVER_CAPABILITIES="compute,utility"
ENV NVIDIA_REQUIRE_CUDA=cuda>="10.1"

RUN chgrp -R 0 /home/pwrai && \
    chmod -R g=u /home/pwrai && \
    chmod g=u /etc/passwd

RUN echo 'if ! whoami &> /dev/null; then\n  if [ -w /etc/passwd ]; then\n    echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/usr/sbin/nologin" >> /etc/passwd\n  fi\nfi\n\nHOME=/home/pwrai' >> /home/pwrai/setup_user_for_openshift.sh &&\
     sh /home/pwrai/setup_user_for_openshift.sh

WORKDIR /home/pwrai

Installing New Dependencies in Base Image

Method 1: Specify dependencies in Dockerfile

For the ones who are more familiar with building docker images, we suggest writing your own Dockerfile and specify installation commands within it.

Example:

FROM atlas4openshift/powerai-openshift:latest

# Linux libs installation
RUN sudo apt-get -y install git
RUN sudo apt-get -y install sysstat
...

# Python package installation
RUN /home/pwrai/anaconda/envs/wmlce/bin/pip install tqdm
...

Method 2: Install in Running Container

If you need an interactive environment to test the installation commands, we suggest you start the base image in a POWER9 PC VM, and run the commands in a running container.

Example:

# In POWERPC VM
>>> docker pull atlas4openshift/powerai-openshift:latest
>>> docker run -it --entrypoint /bin/bash docker.io/atlas4openshift/powerai-openshift

# In powerai container
(wmlce) >>> sudo apt-get install git

After installing, detach from the running container (CTRL+P+CTRL+Q) and commit the container as a new image. And finally push this image to some dockerhub repository.

(Detach from container instance)
>>> docker commit [CONTAINER_ID] docker.io/atlas4openshift/powerai-openshift:[TAG]
>>> docker push [YOUR_DOCKERHUB_REPO]