Skip to content

Commit

Permalink
remove dependency on external script copy (#7292)
Browse files Browse the repository at this point in the history
* remove dependency on external script copy
added : for SUFFIX
added versioning information to dependencies

Signed-off-by: Misiu Godfrey <misiu.godfrey@kraken.mapd.com>
  • Loading branch information
jack-mapd authored and misiugodfrey committed Aug 28, 2023
1 parent 5f7c30f commit bc8ef31
Show file tree
Hide file tree
Showing 8 changed files with 508 additions and 83 deletions.
57 changes: 57 additions & 0 deletions docker/build/centos7_param/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Build libglvnd for libGL, libEGL, libOpenGL
# Not currently pulled in by nvidia-docker2
ARG BASE_CUDA_IMAGE
FROM ${BASE_CUDA_IMAGE}

ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,graphics

# Add entrypoint script to run ldconfig
RUN echo $'#!/bin/bash\n\
ldconfig\n\
exec "$@"'\
>> /docker-entrypoint.sh && \
chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

RUN yum groupinstall -y "Development Tools"

RUN yum install -y \
zlib-devel \
epel-release \
libssh \
openssl-devel \
ncurses-devel \
git \
maven \
java-1.8.0-openjdk-devel \
java-1.8.0-openjdk-headless \
gperftools \
gperftools-devel \
gperftools-libs \
python-devel \
wget \
curl \
sudo \
openldap-devel \
libX11-devel \
mesa-libGL-devel \
environment-modules \
which \
PyYAML \
valgrind && \
rm -rf /var/cache/yum/*
RUN yum install -y \
cloc \
jq && \
rm -rf /var/cache/yum/*

RUN mkdir -p /etc/vulkan/icd.d && \
echo '{ "file_format_version" : "1.0.0", "ICD" : { "library_path" : "libGLX_nvidia.so.0", "api_version" : "1.1.99" } }' > /etc/vulkan/icd.d/nvidia_icd.json

RUN echo > /etc/ld.so.preload

# copy the script into the docker context
# the script needs to already be in '.'
COPY mapd-deps-prebuilt.sh .
ARG PREBUILT_CUSTOM_ARG
RUN USER=root sudo bash ./mapd-deps-prebuilt.sh ${PREBUILT_CUSTOM_ARG}
30 changes: 30 additions & 0 deletions docker/build/centos7_param/Dockerfile.jenkins-ssh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

RUN ln -snf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
RUN echo America/Los_Angeles > /etc/timezone

RUN yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
RUN yum install -y openssh-server\
device-mapper-persistent-data \
lvm2 \
docker-ce \
&& rm -rf /var/cache/yum/*

RUN sshd-keygen

RUN useradd -m jenkins-slave
WORKDIR /home/jenkins-slave
RUN echo 'jenkins-slave ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

USER jenkins-slave

RUN mkdir -p .ssh \
&& chmod 700 .ssh \
&& curl https://github.com/mapd-bot.keys >> .ssh/authorized_keys \
&& chmod 600 .ssh/authorized_keys

USER root

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
38 changes: 38 additions & 0 deletions docker/build/ubuntu_param/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# cudagl required to expose cuda and graphics (vulkan)

ARG BASE_CUDA_IMAGE
FROM ${BASE_CUDA_IMAGE}

ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,graphics

# Add entrypoint script to run ldconfig
RUN echo '#!/bin/bash\n\
ldconfig\n\
exec "$@"'\
>> /docker-entrypoint.sh && \
chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

#
# add --build-arg TZDATA="" to cmd for ubuntu 1804 build
ARG TZDATA_INSTALL="DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y tzdata"

RUN apt-get update && \
apt-get install -y sudo curl
RUN /bin/bash -c "${TZDATA_INSTALL}"
RUN rm -rf /var/lib/apt/lists/*

RUN mkdir -p /etc/vulkan/icd.d && \
echo '{ "file_format_version" : "1.0.0", "ICD" : { "library_path" : "libGLX_nvidia.so.0", "api_version" : "1.1.99" } }' > /etc/vulkan/icd.d/nvidia_icd.json

RUN echo > /etc/ld.so.preload

# copy the script into the docker context
# the script needs to already be in '.'
COPY mapd-deps-prebuilt.sh .

#
# example cmd use --build-arg PREBUILT_CUSTOM_ARG="--custom=tsan-20230706"
#
ARG PREBUILT_CUSTOM_ARG
RUN USER=root sudo bash ./mapd-deps-prebuilt.sh ${PREBUILT_CUSTOM_ARG}
35 changes: 35 additions & 0 deletions docker/build/ubuntu_param/Dockerfile.jenkins-ssh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# example cmd option to set BASE_IMAGE --build-arg BASE_IMAGE="docker-internal.mapd.com/mapd/core-build--cuda11.8.0:20230327-913f2ab80"
# Note a leading ':' is required
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

RUN ln -snf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
RUN echo America/Los_Angeles > /etc/timezone

RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
RUN apt update && \
apt install -y openssh-server\
docker-ce \
docker-ce-cli \
containerd.io \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /var/run/sshd

RUN useradd -m jenkins-slave
WORKDIR /home/jenkins-slave
RUN echo 'jenkins-slave ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

USER jenkins-slave

RUN mkdir -p .ssh \
&& chmod 700 .ssh \
&& curl https://github.com/mapd-bot.keys >> .ssh/authorized_keys \
&& chmod 600 .ssh/authorized_keys

USER root

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
Loading

0 comments on commit bc8ef31

Please sign in to comment.