Skip to content

Commit

Permalink
bump to ubuntu 24.04 and add mold linker
Browse files Browse the repository at this point in the history
  • Loading branch information
s-sajid-ali committed May 6, 2024
1 parent 42bb165 commit a984e96
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 0 deletions.
74 changes: 74 additions & 0 deletions cuda-11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 as bootstrap

ENV SPACK_ROOT=/opt/spack \
CURRENTLY_BUILDING_DOCKER_IMAGE=1 \
container=docker

ENV DEBIAN_FRONTEND=noninteractive \
LANGUAGE=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8

RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub

RUN apt-get -yqq update \
&& apt-get -yqq upgrade \
&& apt-get -yqq install --no-install-recommends \
build-essential \
ca-certificates \
curl \
file \
g++ \
gcc \
gfortran \
git \
gnupg2 \
iproute2 \
locales \
make \
mercurial \
subversion \
python3 \
python3-pip \
python3-setuptools \
unzip \
zstd \
&& locale-gen en_US.UTF-8 \
&& pip3 install boto3 \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir $SPACK_ROOT && cd $SPACK_ROOT && \
git init --quiet && git remote add origin https://github.com/spack/spack.git && git fetch --depth=1 origin develop && git checkout --detach FETCH_HEAD && \
mkdir -p $SPACK_ROOT/opt/spack

RUN ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
/usr/local/bin/docker-shell \
&& ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
/usr/local/bin/interactive-shell \
&& ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
/usr/local/bin/spack-env

RUN mkdir -p /root/.spack \
&& cp $SPACK_ROOT/share/spack/docker/modules.yaml \
/root/.spack/modules.yaml \
&& rm -rf /root/*.* /run/nologin

# [WORKAROUND]
# https://superuser.com/questions/1241548/
# xubuntu-16-04-ttyname-failed-inappropriate-ioctl-for-device#1253889
RUN [ -f ~/.profile ] \
&& sed -i 's/mesg n/( tty -s \\&\\& mesg n || true )/g' ~/.profile \
|| true


WORKDIR /root
SHELL ["docker-shell"]

# Creates the package cache
RUN spack bootstrap now \
&& spack bootstrap status --optional \
&& spack spec hdf5+mpi

ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]
CMD ["interactive-shell"]

# Build stage with Spack pre-installed and ready to be used
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 as builder

Expand Down
74 changes: 74 additions & 0 deletions cuda-12/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04 as bootstrap

ENV SPACK_ROOT=/opt/spack \
CURRENTLY_BUILDING_DOCKER_IMAGE=1 \
container=docker

ENV DEBIAN_FRONTEND=noninteractive \
LANGUAGE=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8

RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub

RUN apt-get -yqq update \
&& apt-get -yqq upgrade \
&& apt-get -yqq install --no-install-recommends \
build-essential \
ca-certificates \
curl \
file \
g++ \
gcc \
gfortran \
git \
gnupg2 \
iproute2 \
locales \
make \
mercurial \
subversion \
python3 \
python3-pip \
python3-setuptools \
unzip \
zstd \
&& locale-gen en_US.UTF-8 \
&& pip3 install boto3 \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir $SPACK_ROOT && cd $SPACK_ROOT && \
git init --quiet && git remote add origin https://github.com/spack/spack.git && git fetch --depth=1 origin develop && git checkout --detach FETCH_HEAD && \
mkdir -p $SPACK_ROOT/opt/spack

RUN ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
/usr/local/bin/docker-shell \
&& ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
/usr/local/bin/interactive-shell \
&& ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
/usr/local/bin/spack-env

RUN mkdir -p /root/.spack \
&& cp $SPACK_ROOT/share/spack/docker/modules.yaml \
/root/.spack/modules.yaml \
&& rm -rf /root/*.* /run/nologin

# [WORKAROUND]
# https://superuser.com/questions/1241548/
# xubuntu-16-04-ttyname-failed-inappropriate-ioctl-for-device#1253889
RUN [ -f ~/.profile ] \
&& sed -i 's/mesg n/( tty -s \\&\\& mesg n || true )/g' ~/.profile \
|| true


WORKDIR /root
SHELL ["docker-shell"]

# Creates the package cache
RUN spack bootstrap now \
&& spack bootstrap status --optional \
&& spack spec hdf5+mpi

ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]
CMD ["interactive-shell"]

# Build stage with Spack pre-installed and ready to be used
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04 as builder

Expand Down

0 comments on commit a984e96

Please sign in to comment.