Skip to content

Commit

Permalink
[irods/irods#7191] Add Dockerfiles for Rocky Linux 9
Browse files Browse the repository at this point in the history
  • Loading branch information
SwooshyCueb authored and alanking committed Sep 20, 2023
1 parent 9647388 commit 979cab9
Show file tree
Hide file tree
Showing 6 changed files with 413 additions and 0 deletions.
90 changes: 90 additions & 0 deletions build_debuggers.rocky9.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# syntax=docker/dockerfile:1.5

ARG debugger_base=rockylinux:9
FROM ${debugger_base}

SHELL [ "/usr/bin/bash", "-c" ]

# Make sure we're starting with an up-to-date image
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf update -y || [ "$?" -eq 100 ] && \
rm -rf /tmp/*

ARG parallelism=3
ARG tools_prefix=/opt/debug_tools

RUN mkdir -p ${tools_prefix}

WORKDIR /tmp

#--------
# valgrind, gdb

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y gcc-toolset-12 && \
echo "#!/bin/sh" > /etc/profile.d/gcc-toolset-12.sh && \
echo "" >> /etc/profile.d/gcc-toolset-12.sh && \
echo ". /opt/rh/gcc-toolset-12/enable" >> /etc/profile.d/gcc-toolset-12.sh && \
rm -rf /tmp/*

#--------
# lldb

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y lldb && \
rm -rf /tmp/*

#--------
# rr

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
python3-urllib3 \
binutils \
&& \
rm -rf /tmp/*

ARG rr_version="5.6.0"

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y "https://github.com/rr-debugger/rr/releases/download/${rr_version}/rr-${rr_version}-Linux-x86_64.rpm" && \
rm -rf /tmp/*

#--------
# xmlrunner

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
python3-pip \
&& \
rm -rf /tmp/*

RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked \
--mount=type=cache,target=/root/.cache/wheel,sharing=locked \
python3 -m pip install \
xmlrunner \
&& \
rm -rf /tmp/*

#--------
# utils

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
sudo \
nano \
vim-enhanced \
tmux \
lsof \
which \
file \
iproute \
&& \
rm -rf /tmp/*
51 changes: 51 additions & 0 deletions externals_builder.rocky9.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# syntax=docker/dockerfile:1.5

FROM rockylinux:9

SHELL [ "/usr/bin/bash", "-c" ]

# Make sure we're starting with an up-to-date image
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf update -y || [ "$?" -eq 100 ] && \
rm -rf /tmp/*

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
sudo \
git \
python3 \
python3-distro \
gcc-toolset-12 \
&& \
rm -rf /tmp/*

ARG externals_repo="https://github.com/irods/externals"
ARG externals_branch="main"

WORKDIR /externals
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
git clone "${externals_repo}" -b "${externals_branch}" /externals && \
python3 -m venv build_env && \
source build_env/bin/activate && \
./install_prerequisites.py && \
rm -rf /externals /tmp/*

# TODO: The following will enable the newer toolchain on interactive shell logins. The
# externals builder, however, is not an interactive shell, so this does not execute. This seems
# like a much better option than explicitly setting the PATH environment variable to check for
# new thing, as is being done below. Investigate making this effective for this builder.
#RUN echo "#!/bin/sh" > /etc/profile.d/gcc-toolset-12.sh && \
# echo "" >> /etc/profile.d/gcc-toolset-12.sh && \
# echo ". /opt/rh/gcc-toolset-12/enable" >> /etc/profile.d/gcc-toolset-12.sh

ENV PATH=/opt/rh/gcc-toolset-12/root/usr/bin:$PATH

ENV file_extension="rpm"
ENV package_manager="dnf"

WORKDIR /
COPY --chmod=755 build_and_copy_externals_to_dir.sh /
ENTRYPOINT ["./build_and_copy_externals_to_dir.sh"]
126 changes: 126 additions & 0 deletions irods_core_builder.rocky9.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# syntax=docker/dockerfile:1.5

FROM rockylinux:9

SHELL [ "/usr/bin/bash", "-c" ]

# Make sure we're starting with an up-to-date image
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf update -y || [ "$?" -eq 100 ] && \
rm -rf /tmp/*

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
epel-release \
wget \
&& \
rm -rf /tmp/*

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
ccache \
python3-devel \
python3-distro \
python3-jsonschema \
python3-psutil \
python3-pyodbc \
python3-requests \
openssl \
openssl-devel \
lsof \
postgresql-server \
which \
&& \
rm -rf /tmp/*

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
dnf-plugin-config-manager \
&& \
rpm --import https://packages.irods.org/irods-signing-key.asc && \
dnf config-manager -y --add-repo https://packages.irods.org/renci-irods.yum.repo && \
dnf config-manager -y --set-enabled renci-irods && \
rpm --import https://core-dev.irods.org/irods-core-dev-signing-key.asc && \
dnf config-manager -y --add-repo https://core-dev.irods.org/renci-irods-core-dev.yum.repo && \
dnf config-manager -y --set-enabled renci-irods-core-dev && \
rm -rf /tmp/*

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
'irods-externals*' \
&& \
rm -rf /tmp/*

# For rocky linux, the crb repository should be enabled so that certain developer
# tools such as ninja-build and help2man can be installed.
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
dnf-plugins-core \
&& \
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
dnf config-manager --set-enabled crb && \
dnf install -y \
git \
pam-devel \
fuse-devel \
libcurl-devel \
bzip2-devel \
libxml2-devel \
make \
gcc \
gcc-c++ \
rpm-build \
sudo \
ninja-build \
help2man \
python3-packaging \
unixODBC-devel \
&& \
rm -rf /tmp/*

# For Python3 modules not available as packages:
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
--mount=type=cache,target=/root/.cache/pip,sharing=locked \
--mount=type=cache,target=/root/.cache/wheel,sharing=locked \
dnf install -y \
python3-pip \
cmake \
spdlog-devel \
&& \
python3 -m pip install \
lief \
--global-option="--lief-no-cache" \
--global-option="--ninja" \
--global-option="--lief-no-pe" \
--global-option="--lief-no-macho" \
--global-option="--lief-no-android" \
--global-option="--lief-no-art" \
--global-option="--lief-no-vdex" \
--global-option="--lief-no-oat" \
--global-option="--lief-no-dex" \
&& \
rm -rf /tmp/*

ARG cmake_path="/opt/irods-externals/cmake3.21.4-0/bin"
ENV PATH=${cmake_path}:$PATH

ENV file_extension="rpm"
ENV package_manager="dnf"

ENV CCACHE_DIR="/irods_build_cache"
# Default to a reasonably large cache size
ENV CCACHE_MAXSIZE="64G"
# Allow for a lot of files (1.5M files, 300 per directory)
ENV CCACHE_NLEVELS="3"
# Allow any uid to use cache
ENV CCACHE_UMASK="000"

COPY --chmod=755 build_and_copy_packages_to_dir.sh /
ENTRYPOINT ["./build_and_copy_packages_to_dir.sh"]
96 changes: 96 additions & 0 deletions irods_runner.rocky9.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# syntax=docker/dockerfile:1.5
#
# iRODS Runner
#
ARG runner_base=rockylinux:9
FROM ${runner_base} as irods-runner

SHELL [ "/bin/bash", "-c" ]

# Make sure we're starting with an up-to-date image
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf update -y || [ "$?" -eq 100 ] && \
rm -rf /tmp/*

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
epel-release \
sudo \
wget \
&& \
rm -rf /tmp/*

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
python3 \
python3-distro \
python3-jsonschema \
python3-psutil \
python3-pyodbc \
python3-requests \
openssl \
lsof \
postgresql-server \
unixODBC \
&& \
rm -rf /tmp/*

# install and configure rsyslog
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
rsyslog \
&& \
sed -i \
-e 's/^\(module(load="imuxsock"\)\s*/\1) /' \
-e '/^\s\+SysSock.Use="off")/d' \
-e '/^\s\+# local messages/d' \
/etc/rsyslog.conf \
&& \
sed -i \
-e 's/^\(module(load="imjournal"\)\s*/\1) /' \
-e '/^\s\+StateFile=/d' \
/etc/rsyslog.conf \
&& \
rm -rf /tmp/*
COPY irods.rsyslog /etc/rsyslog.d/00-irods.conf
COPY irods.logrotate /etc/logrotate.d/irods

# irodsauthuser required for some tests
# UID and GID ranges picked to hopefully not overlap with anything
RUN useradd \
--key UID_MIN=40000 \
--key UID_MAX=50000 \
--key GID_MIN=40000 \
--key GID_MAX=50000 \
--create-home \
--shell /bin/bash \
irodsauthuser && \
echo 'irodsauthuser:;=iamnotasecret' | chpasswd

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
dnf-plugin-config-manager \
&& \
rpm --import https://packages.irods.org/irods-signing-key.asc && \
dnf config-manager -y --add-repo https://packages.irods.org/renci-irods.yum.repo && \
dnf config-manager -y --set-enabled renci-irods && \
rpm --import https://core-dev.irods.org/irods-core-dev-signing-key.asc && \
dnf config-manager -y --add-repo https://core-dev.irods.org/renci-irods-core-dev.yum.repo && \
dnf config-manager -y --set-enabled renci-irods-core-dev && \
rm -rf /tmp/*

RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
--mount=type=cache,target=/var/cache/yum,sharing=locked \
dnf install -y \
'irods-externals*' \
&& \
rm -rf /tmp/*

COPY ICAT.sql /
COPY --chmod=755 keep_alive.sh /keep_alive.sh
ENTRYPOINT ["/keep_alive.sh"]
Loading

0 comments on commit 979cab9

Please sign in to comment.