Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch errors while provisioning #89

Merged
merged 15 commits into from
Nov 18, 2024
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
34 changes: 29 additions & 5 deletions custom/testing/amazonlinux-2.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
FROM amazonlinux:2

RUN yum update -y \
&& yum install -y python3 python3-devel python3-pip openssl git rpmdevtools rpmlint \
systemd-units git gnupg2 jq createrepo rpm-sign epel-release rustc cargo \
curl wget \
&& yum install -y patchelf
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 curl wget tar xz patchelf util-linux openssl-pkcs11

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
rm -rf golden-state-tree
EOF

CMD ["/bin/bash"]
34 changes: 29 additions & 5 deletions custom/testing/amazonlinux-2023.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
FROM amazonlinux:2023

RUN yum update -y \
&& yum install -y --allowerasing python3 python3-devel python3-pip openssl git rpmdevtools rpmlint \
systemd-units git gnupg2 jq createrepo rpm-sign rustc cargo \
curl wget \
&& yum install -y patchelf
#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 wget tar xz patchelf util-linux openssl openssl-pkcs11

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 --log-level=debug --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
# rm -rf golden-state-tree
EOF

CMD ["/bin/bash"]
43 changes: 26 additions & 17 deletions custom/testing/debian-11.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,33 @@ COPY 01_nodoc /etc/dpkg/dpkg.cfg.d/01_nodoc
COPY golden-pillar-tree golden-pillar-tree
COPY golden-state-tree golden-state-tree

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

RUN <<EOF
echo 'tzdata tzdata/Areas select America' | debconf-set-selections
echo 'tzdata tzdata/Zones/America select Phoenix' | debconf-set-selections
export DEBIAN_FRONTEND="noninteractive"
if [ $(uname -m) = "x86_64" ]; then
export ARCH=x86_64
else
export ARCH=arm64
fi
apt update -y
apt install -y tar wget xz-utils vim-nox apt-utils
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
rm -rf golden-state-tree
set -e

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

echo 'tzdata tzdata/Areas select America' | debconf-set-selections
echo 'tzdata tzdata/Zones/America select Phoenix' | debconf-set-selections

export DEBIAN_FRONTEND="noninteractive"

apt update -y
apt install -y tar wget xz-utils vim-nox apt-utils

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
rm -rf golden-state-tree
EOF

CMD ["/bin/bash"]
37 changes: 23 additions & 14 deletions custom/testing/debian-12.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,33 @@ COPY 01_nodoc /etc/dpkg/dpkg.cfg.d/01_nodoc
COPY golden-pillar-tree golden-pillar-tree
COPY golden-state-tree golden-state-tree

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

RUN <<EOF
echo 'tzdata tzdata/Areas select America' | debconf-set-selections
echo 'tzdata tzdata/Zones/America select Phoenix' | debconf-set-selections
export DEBIAN_FRONTEND="noninteractive"
if [ $(uname -m) = "x86_64" ]; then
export ARCH=x86_64
else
export ARCH=arm64
fi
apt update -y
apt install -y tar wget xz-utils vim-nox apt-utils
set -e

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

echo 'tzdata tzdata/Areas select America' | debconf-set-selections
echo 'tzdata tzdata/Zones/America select Phoenix' | debconf-set-selections

export DEBIAN_FRONTEND="noninteractive"

apt update -y
apt install -y tar wget xz-utils vim-nox apt-utils
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
rm -rf golden-state-tree

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

CMD ["/bin/bash"]
28 changes: 0 additions & 28 deletions custom/testing/debian-13.Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion custom/testing/entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/bin/env /usr/local/bin/python3
"""
Systemd entrypoint hack.

Expand Down
13 changes: 10 additions & 3 deletions custom/testing/fedora-40.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ FROM fedora:40
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
yum install -y curl wget tar xz patchelf openssl-pkcs11-sign-provider

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 --log-level=debug --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
5 changes: 3 additions & 2 deletions custom/testing/golden-state-tree/os/amazon/config/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ include:
- config.path
- config.ulimits
- config.locale
{#-
- config.sssd
- config.timezone
- config.dhclient
- config.sshd_config
- config.timezone #}
- config.dhclient
4 changes: 0 additions & 4 deletions custom/testing/golden-state-tree/os/amazon/init.sls
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
include:
- .config
- .pkgs

{%- if pillar.get('github_actions_runner', False) %}
- github-actions-runner
{%- endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ include:
- config.ulimits
- config.locale
- config.sssd
- config.timezone
- config.dhclient
{#-
- config.timezone
- config.sshd_config
#}
5 changes: 1 addition & 4 deletions custom/testing/golden-state-tree/os/amazon2023/init.sls
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
include:
- .config
- .pkgs

{%- if pillar.get('github_actions_runner', False) %}
- github-actions-runner
{%- endif %}
- python
4 changes: 2 additions & 2 deletions custom/testing/golden-state-tree/os/amazon2023/pkgs/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include:
- pkgs.gpg
- pkgs.libcurl
- pkgs.libffi
- pkgs.libsodium-compile
{#- - pkgs.libsodium-compile #}
- pkgs.libxml
- pkgs.libxslt
- pkgs.make
Expand Down Expand Up @@ -37,5 +37,5 @@ include:

{#- OS Specific packages install #}
{%- if grains['osarch'] not in ('amd64', 'armhf', 'arm64') %}
- .docker
{#- - .docker #}
{%- endif %}
2 changes: 2 additions & 0 deletions custom/testing/golden-state-tree/os/debian/config/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ include:
- config.ulimits
- config.locale
- config.sssd
{#-
- config.timezone
- config.dhclient
- config.sshd_config
#}
5 changes: 1 addition & 4 deletions custom/testing/golden-state-tree/os/debian/init.sls
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
include:
- .config
- .pkgs

{%- if pillar.get('github_actions_runner', False) %}
- github-actions-runner
{%- endif %}
- python
6 changes: 3 additions & 3 deletions custom/testing/golden-state-tree/os/fedora/config/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include:
- config.path
- config.ulimits
- config.locale
- config.sssd
- config.timezone
- config.dhclient
{#- - config.sssd
- config.sshd_config
- config.timezone #}
- config.dhclient
5 changes: 1 addition & 4 deletions custom/testing/golden-state-tree/os/fedora/init.sls
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
include:
- .config
- .pkgs

{%- if pillar.get('github_actions_runner', False) %}
- github-actions-runner
{%- endif %}
{# - python #}
2 changes: 1 addition & 1 deletion custom/testing/golden-state-tree/os/fedora/pkgs/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include:
- pkgs.curl
- pkgs.dmidecode
- pkgs.dnsutils
- pkgs.docker
{#- - pkgs.docker #}
- pkgs.gcc
- pkgs.gpg
- pkgs.ipset
Expand Down
6 changes: 4 additions & 2 deletions custom/testing/golden-state-tree/os/photon/config/init.sls
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
include:
- .ssh_config
- config.path
- config.ulimits
- config.locale
{#-
- .ssh_config
- config.sssd
- config.timezone
- config.dhclient
- config.sshd_config
- config.timezone
#}
Loading
Loading