-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for Amazon Linux 2 (issue #118)
- Loading branch information
1 parent
3074699
commit 7555a6d
Showing
12 changed files
with
238 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM amazonlinux:2 | ||
|
||
RUN yum -y install python3 rpm-build tar | ||
|
||
RUN mkdir -p /root/slurm-mail | ||
|
||
CMD ["/usr/bin/tail", "-f", "/dev/null"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# This file is part of Slurm-Mail. | ||
# | ||
# Slurm-Mail is a drop in replacement for Slurm's e-mails to give users | ||
# much more information about their jobs compared to the standard Slurm | ||
# e-mails. | ||
# | ||
# Copyright (C) 2018-2024 Neil Munday ([email protected]) | ||
# | ||
# Slurm-Mail is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by the | ||
# Free Software Foundation, either version 3 of the License, or (at | ||
# your option) any later version. | ||
# | ||
# Slurm-Mail is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Slurm-Mail. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
set -e | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
NAME="slurm-mail-builder-al2" | ||
CONTAINER_NAME="${NAME}-${RANDOM}" | ||
|
||
cd $DIR | ||
source ../common.sh | ||
|
||
rm -f ./slurm-mail*.rpm | ||
|
||
docker build -t ${NAME}:latest . | ||
|
||
tmp_file=`mktemp /tmp/XXXXXX.tar.gz` | ||
echo "Temporary tar file: $tmp_file" | ||
tar cvfz $tmp_file ../../* | ||
|
||
docker run -h slurm-mail-buildhost -d --name ${CONTAINER_NAME} ${NAME} | ||
docker cp $tmp_file ${CONTAINER_NAME}:$tmp_file | ||
rm -f $tmp_file | ||
docker exec ${CONTAINER_NAME} /bin/bash -c "cd /root/slurm-mail && tar xvf $tmp_file" | ||
docker exec ${CONTAINER_NAME} /bin/bash -c "/root/slurm-mail/build-tools/build-rpm.sh" | ||
rpm=`docker exec ${CONTAINER_NAME} /bin/bash -c "ls -1 /root/rpmbuild/RPMS/noarch/slurm-mail*.rpm"` | ||
docker cp ${CONTAINER_NAME}:$rpm . | ||
|
||
echo "Created: "`ls -1 slurm-mail*.rpm` | ||
|
||
tidyup ${CONTAINER_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
AmazonLinux_2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
ARG SLURM_VER | ||
|
||
FROM ghcr.io/neilmunday/slurm-mail/slurm-amzn2:$SLURM_VER | ||
|
||
ARG SMTP_SERVER=localhost | ||
ARG SMTP_PORT=25 | ||
ARG DISABLE_CRON=0 | ||
ARG SLURM_MAIL_PKG | ||
|
||
RUN yum install -y chrony cronie python3 && \ | ||
pip3 install aiosmtpd && \ | ||
pip3 install pyyaml && \ | ||
mkdir -p /root/testing/output && \ | ||
sed -i "s#MailProg=/usr/bin/mailx#MailProg=/usr/bin/slurm-spool-mail#" /etc/slurm/slurm.conf && \ | ||
echo "alias ll='ls -l'" >> /root/.bashrc | ||
|
||
COPY supervisord.conf /etc/supervisord.conf | ||
|
||
COPY mail-server.py /usr/local/sbin/ | ||
|
||
RUN chmod 0700 /usr/local/sbin/mail-server.py | ||
|
||
COPY run-tests.py tests.yml /root/testing/ | ||
|
||
COPY $SLURM_MAIL_PKG /root/ | ||
|
||
RUN yum localinstall -y /root/$SLURM_MAIL_PKG && \ | ||
sed -i "s/includeOutputLines = 0/includeOutputLines = 20/" /etc/slurm-mail/slurm-mail.conf && \ | ||
sed -i "s/verbose = false/verbose = true/" /etc/slurm-mail/slurm-mail.conf && \ | ||
sed -i "s/smtpServer = localhost/smtpServer = $SMTP_SERVER/" /etc/slurm-mail/slurm-mail.conf && \ | ||
sed -i "s/smtpPort = 25/smtpPort = $SMTP_PORT/" /etc/slurm-mail/slurm-mail.conf && \ | ||
rm -f /root/$SLURM_MAIL_PKG | ||
|
||
RUN if [ "$DISABLE_CRON" = 1 ]; then rm /etc/cron.d/slurm-mail; fi | ||
|
||
CMD ["tail -f /dev/null"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
FROM amazonlinux:2 | ||
|
||
LABEL org.opencontainers.image.source="https://github.com/neilmunday/slurm-mail" \ | ||
org.opencontainers.image.description="An Amazon Linux 2 Slurm container intended for testing Slurm-Mail" \ | ||
org.opencontainers.image.title="amzn2-slurm" \ | ||
maintainer="Neil Munday" | ||
|
||
ARG SLURM_VER=23.11.4 | ||
|
||
# download, build, install and clean-up | ||
RUN yum update -y && \ | ||
amazon-linux-extras install epel -y && \ | ||
yum install -y \ | ||
gcc \ | ||
mailx \ | ||
make \ | ||
mariadb-devel \ | ||
mariadb-server \ | ||
munge-devel \ | ||
pam-devel \ | ||
perl \ | ||
perl-ExtUtils-MakeMaker \ | ||
python3 \ | ||
readline-devel \ | ||
rpm-build \ | ||
supervisor \ | ||
tini \ | ||
wget && \ | ||
wget https://download.schedmd.com/slurm/slurm-${SLURM_VER}.tar.bz2 -O /root/slurm-${SLURM_VER}.tar.bz2 && \ | ||
rpmbuild -tb /root/slurm-${SLURM_VER}.tar.bz2 && \ | ||
yum localinstall -y /root/rpmbuild/RPMS/x86_64/slurm-${SLURM_VER}*.amzn2.x86_64.rpm \ | ||
/root/rpmbuild/RPMS/x86_64/slurm-slurmctld-${SLURM_VER}*.amzn2.x86_64.rpm \ | ||
/root/rpmbuild/RPMS/x86_64/slurm-slurmd-${SLURM_VER}*.amzn2.x86_64.rpm \ | ||
/root/rpmbuild/RPMS/x86_64/slurm-slurmdbd-${SLURM_VER}*.amzn2.x86_64.rpm && \ | ||
yum -y erase gcc mariab-devel make munge-devel pam-devel readline-devel rpm-build wget && \ | ||
yum clean all && \ | ||
rm -rf /root/rpmbuild /root/slurm*.tar.bz2 && \ | ||
groupadd -r slurm && \ | ||
useradd -r -g slurm -d /var/empty/slurm -m -s /bin/bash slurm && \ | ||
groupadd test && \ | ||
useradd -g test -d /home/test -m test && \ | ||
install -d -o slurm -g slurm /etc/slurm /var/spool/slurm /var/log/slurm | ||
|
||
COPY supervisord.conf /etc/ | ||
COPY --chown=slurm slurm.*.conf /etc/slurm/ | ||
COPY --chown=slurm slurmdbd.conf /etc/slurm/ | ||
COPY --chown=root entrypoint.sh /usr/local/sbin/ | ||
|
||
RUN MAJOR_VER=`echo ${SLURM_VER} | egrep -o "^[0-9]+"` && \ | ||
mv /etc/slurm/slurm.${MAJOR_VER}.conf /etc/slurm/slurm.conf && \ | ||
rm -f /etc/slurm/slurm.*.conf && \ | ||
chmod 600 /etc/slurm/slurm*.conf | ||
|
||
RUN /usr/bin/mysql_install_db --user=mysql | ||
|
||
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/sbin/entrypoint.sh"] | ||
CMD ["tail -f /dev/null"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters