Skip to content

Commit

Permalink
Add more systemd containers
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Nov 13, 2024
1 parent 87baffe commit a0e2ff7
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 23 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@ will be commited.
- testing:amazonlinux-2023 - `ghcr.io/saltstack/salt-ci-containers/testing:amazonlinux-2023`
- testing:debian-11 - `ghcr.io/saltstack/salt-ci-containers/testing:debian-11`
- testing:debian-12 - `ghcr.io/saltstack/salt-ci-containers/testing:debian-12`
- testing:debian-13 - `ghcr.io/saltstack/salt-ci-containers/testing:debian-13`
- testing:fedora-40 - `ghcr.io/saltstack/salt-ci-containers/testing:fedora-40`
- testing:photon-4 - `ghcr.io/saltstack/salt-ci-containers/testing:photon-4`
- testing:photon-5 - `ghcr.io/saltstack/salt-ci-containers/testing:photon-5`
- testing:rockylinux-8 - `ghcr.io/saltstack/salt-ci-containers/testing:rockylinux-8`
- testing:rockylinux-9 - `ghcr.io/saltstack/salt-ci-containers/testing:rockylinux-9`
- testing:systemd-photon-5 - `ghcr.io/saltstack/salt-ci-containers/testing:systemd-photon-5`
- testing:systemd-rockylinux-8 - `ghcr.io/saltstack/salt-ci-containers/testing:systemd-rockylinux-8`
- testing:systemd-rockylinux-9 - `ghcr.io/saltstack/salt-ci-containers/testing:systemd-rockylinux-9`
- testing:systemd-ubuntu-22.04 - `ghcr.io/saltstack/salt-ci-containers/testing:systemd-ubuntu-22.04`
- testing:ubuntu-20.04 - `ghcr.io/saltstack/salt-ci-containers/testing:ubuntu-20.04`
- testing:ubuntu-22.04 - `ghcr.io/saltstack/salt-ci-containers/testing:ubuntu-22.04`
Expand Down
4 changes: 3 additions & 1 deletion containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ custom:
- systemd-ubuntu-22.04
- ubuntu-24.04
- rockylinux-8
- systemd-rockylinux-8
- rockylinux-9
- systemd-rockylinux-9
- photon-4
- photon-5
- systemd-photon-5
- debian-11
- debian-12
- debian-13
- fedora-40
- amazonlinux-2
- amazonlinux-2023
Expand Down
4 changes: 3 additions & 1 deletion custom/testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
- testing:amazonlinux-2023 - `ghcr.io/saltstack/salt-ci-containers/testing:amazonlinux-2023`
- testing:debian-11 - `ghcr.io/saltstack/salt-ci-containers/testing:debian-11`
- testing:debian-12 - `ghcr.io/saltstack/salt-ci-containers/testing:debian-12`
- testing:debian-13 - `ghcr.io/saltstack/salt-ci-containers/testing:debian-13`
- testing:fedora-40 - `ghcr.io/saltstack/salt-ci-containers/testing:fedora-40`
- testing:photon-4 - `ghcr.io/saltstack/salt-ci-containers/testing:photon-4`
- testing:photon-5 - `ghcr.io/saltstack/salt-ci-containers/testing:photon-5`
- testing:rockylinux-8 - `ghcr.io/saltstack/salt-ci-containers/testing:rockylinux-8`
- testing:rockylinux-9 - `ghcr.io/saltstack/salt-ci-containers/testing:rockylinux-9`
- testing:systemd-photon-5 - `ghcr.io/saltstack/salt-ci-containers/testing:systemd-photon-5`
- testing:systemd-rockylinux-8 - `ghcr.io/saltstack/salt-ci-containers/testing:systemd-rockylinux-8`
- testing:systemd-rockylinux-9 - `ghcr.io/saltstack/salt-ci-containers/testing:systemd-rockylinux-9`
- testing:systemd-ubuntu-22.04 - `ghcr.io/saltstack/salt-ci-containers/testing:systemd-ubuntu-22.04`
- testing:ubuntu-20.04 - `ghcr.io/saltstack/salt-ci-containers/testing:ubuntu-20.04`
- testing:ubuntu-22.04 - `ghcr.io/saltstack/salt-ci-containers/testing:ubuntu-22.04`
Expand Down
6 changes: 6 additions & 0 deletions custom/testing/rockylinux-9.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ COPY golden-pillar-tree golden-pillar-tree
COPY golden-state-tree golden-state-tree

RUN <<EOF
set -e

if [ $(uname -m) = "x86_64" ]; then
export ARCH=x86_64
else
export ARCH=arm64
fi

yum update -y
yum install -y epel-release
yum install -y curl wget tar xz patchelf

wget https://packages.broadcom.com/artifactory/saltproject-generic/onedir/3007.1/salt-3007.1-onedir-linux-$ARCH.tar.xz
tar xf salt-3007.1-onedir-linux-$ARCH.tar.xz

./salt/salt-call --local --pillar-root=/golden-pillar-tree --file-root=/golden-state-tree state.apply provision

rm -rf salt
rm -rf salt-3007.1-onedir-linux-$ARCH.tar.xz
rm -rf golden-pillar-tree
Expand Down
39 changes: 39 additions & 0 deletions custom/testing/systemd-photon-5.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM photon:5.0

COPY golden-pillar-tree golden-pillar-tree
COPY golden-state-tree golden-state-tree

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

RUN <<EOF
set -e

if [ $(uname -m) = "x86_64" ]; then
export ARCH=x86_64
else
export ARCH=arm64
fi

tdnf update -y
tdnf install -y curl wget tar xz # patchelf

wget https://packages.broadcom.com/artifactory/saltproject-generic/onedir/3007.1/salt-3007.1-onedir-linux-$ARCH.tar.xz
tar xf salt-3007.1-onedir-linux-$ARCH.tar.xz

./salt/salt-call --local --pillar-root=/golden-pillar-tree --file-root=/golden-state-tree state.apply python

rm -rf salt
rm -rf salt-3007.1-onedir-linux-$ARCH.tar.xz
rm -rf golden-pillar-tree
rm -rf golden-state-tree

mv /usr/bin/tail /usr/bin/tail.real
EOF

COPY rescue.service /etc/systemd/system/rescue.service.d/override.conf
COPY tail /usr/bin/tail
COPY entrypoint.py /entrypoint.py
RUN chmod +x /usr/bin/tail /entrypoint.py

ENTRYPOINT [ "/entrypoint.py" ]
CMD ["/bin/bash"]
8 changes: 6 additions & 2 deletions custom/testing/systemd-rockylinux-8.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rockylinux:8
FROM rockylinux:9

COPY golden-pillar-tree golden-pillar-tree
COPY golden-state-tree golden-state-tree
Expand All @@ -21,16 +21,20 @@ RUN <<EOF
wget https://packages.broadcom.com/artifactory/saltproject-generic/onedir/3007.1/salt-3007.1-onedir-linux-$ARCH.tar.xz
tar xf salt-3007.1-onedir-linux-$ARCH.tar.xz

./salt/salt-call --local --pillar-root=/golden-pillar-tree --file-root=/golden-state-tree state.apply provision
./salt/salt-call --local --pillar-root=/golden-pillar-tree --file-root=/golden-state-tree state.apply python

rm -rf salt
rm -rf salt-3007.1-onedir-linux-$ARCH.tar.xz
rm -rf golden-pillar-tree
rm -rf golden-state-tree

mv /usr/bin/tail /usr/bin/tail.real
EOF

COPY rescue.service /etc/systemd/system/rescue.service.d/override.conf
COPY tail /usr/bin/tail
COPY entrypoint.py /entrypoint.py
RUN chmod +x /usr/bin/tail /entrypoint.py

ENTRYPOINT [ "/entrypoint.py" ]
CMD ["/bin/bash"]
40 changes: 40 additions & 0 deletions custom/testing/systemd-rockylinux-9.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM rockylinux:9

COPY golden-pillar-tree golden-pillar-tree
COPY golden-state-tree golden-state-tree

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

RUN <<EOF
set -e

if [ $(uname -m) = "x86_64" ]; then
export ARCH=x86_64
else
export ARCH=arm64
fi

yum update -y
yum install -y epel-release
yum install -y curl wget tar xz patchelf systemd

wget https://packages.broadcom.com/artifactory/saltproject-generic/onedir/3007.1/salt-3007.1-onedir-linux-$ARCH.tar.xz
tar xf salt-3007.1-onedir-linux-$ARCH.tar.xz

./salt/salt-call --local --pillar-root=/golden-pillar-tree --file-root=/golden-state-tree state.apply python

rm -rf salt
rm -rf salt-3007.1-onedir-linux-$ARCH.tar.xz
rm -rf golden-pillar-tree
rm -rf golden-state-tree

mv /usr/bin/tail /usr/bin/tail.real
EOF

COPY rescue.service /etc/systemd/system/rescue.service.d/override.conf
COPY tail /usr/bin/tail
COPY entrypoint.py /entrypoint.py
RUN chmod +x /usr/bin/tail /entrypoint.py

ENTRYPOINT [ "/entrypoint.py" ]
CMD ["/bin/bash"]
49 changes: 31 additions & 18 deletions custom/testing/systemd-ubuntu-22.04.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,37 @@ COPY golden-state-tree golden-state-tree

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

# init and systemd are the only real requirements for systemd.
#
# tar wget x-utils can be used to fetch and extract a salt onedir.
#
# apt-utils was required by golden states, this may/should be fixed in those
# states.
#
# tree is used by workflows for debugging
#
# coreutils provides tail
RUN apt update -y \
&& echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
&& echo 'tzdata tzdata/Zones/America select Phoenix' | debconf-set-selections \
&& DEBIAN_FRONTEND="noninteractive" apt install -y \
coreutils tree tar wget xz-utils apt-utils systemd python3 python3-pip python3-venv git \
&& mv /usr/bin/tail /usr/bin/tail.real

RUN <<EOF
set -e
# init and systemd are the only real requirements for systemd.
#
# tar wget x-utils can be used to fetch and extract a salt onedir.
#
# apt-utils was required by golden states, this may/should be fixed in those
# states.
#
# tree is used by workflows for debugging
#
# coreutils provides tail
RUN apt update -y
echo 'tzdata tzdata/Areas select America' | debconf-set-selections
echo 'tzdata tzdata/Zones/America select Phoenix' | debconf-set-selections
DEBIAN_FRONTEND="noninteractive" apt install -y coreutils tree tar \
wget xz-utils apt-utils systemd python3 python3-pip python3-venv git


wget https://packages.broadcom.com/artifactory/saltproject-generic/onedir/3007.1/salt-3007.1-onedir-linux-$ARCH.tar.xz
tar xf salt-3007.1-onedir-linux-$ARCH.tar.xz

./salt/salt-call --local --pillar-root=/golden-pillar-tree --file-root=/golden-state-tree state.apply python

rm -rf salt
rm -rf salt-3007.1-onedir-linux-$ARCH.tar.xz
rm -rf golden-pillar-tree
rm -rf golden-state-tree

mv /usr/bin/tail /usr/bin/tail.real
EOF
# Set the root password, this was done before single user mode worked.
# RUN echo "root\nroot" | passwd -q root

Expand All @@ -42,7 +56,6 @@ COPY rescue.service /etc/systemd/system/rescue.service.d/override.conf
# run tail.
COPY tail /usr/bin/tail
COPY entrypoint.py /entrypoint.py

RUN chmod +x /usr/bin/tail /entrypoint.py

ENTRYPOINT [ "/entrypoint.py" ]
Expand Down

0 comments on commit a0e2ff7

Please sign in to comment.