Implement podman rootless and rootful #165
Workflow file for this run
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
--- | |
name: Pull Request Test | |
on: | |
push: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
install-requirements: | |
name: Test installation of the project requirements | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: [ 3.11 ] | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: pip | |
- name: Install python requirements | |
run: | | |
pip install -r requirements.txt | |
pip install -r molecule/requirements.txt | |
ansible-galaxy collection install -r collections/requirements.yml --upgrade | |
- name: Print configuration versions | |
run: | | |
pip freeze | |
ansible-galaxy collection list | |
# - name: Run role tests | |
# run: | | |
# molecule test --scenario-name github | |
kind-test-docker-linux: | |
name: Test Kind Deployment using Docker on Linux | |
runs-on: ${{ matrix.os }} | |
env: | |
IngressHTTPPort: 80 | |
strategy: | |
matrix: | |
kind_version: [v0.22.0] | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v3 | |
- name: Deploy kind | |
run: | | |
curl -Lo ./kind/kind https://kind.sigs.k8s.io/dl/${{ matrix.kind_version }}/kind-linux-amd64 | |
chmod 755 kind | |
./kind/registry.sh install --registry-name kind-registry.local | |
./kind/kind.sh install --registry-name kind-registry.local | |
- name: Wait for ingress to be available | |
uses: iFaxity/wait-on-action@v1 | |
with: | |
resource: http://localhost:$IngressHTTPPort | |
timeout: 300000 | |
- name: Check that ingress is available | |
run: | | |
set +e | |
CURL_EXIT_CODE=$(curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort) | |
if [ ! "${CURL_EXIT_CODE}" == '0' ]; then | |
echo "Exit code should have been 0 but it was ${CURL_EXIT_CODE}." | |
curl -o /dev/null -s -w "%{http_code}\n" http://localhost:$IngressHTTPPort | |
curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort | |
exit 1 | |
fi | |
kind-test-docker-macos: | |
name: Test Kind Deployment using Docker on MacOS | |
runs-on: ${{ matrix.os }} | |
env: | |
IngressHTTPPort: 80 | |
strategy: | |
matrix: | |
kind_version: [v0.22.0] | |
os: [macos-13] | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v3 | |
- name: Setup Docker | |
run: | | |
brew install --cask docker | |
- name: Deploy kind | |
run: | | |
curl -Lo ./kind/kind https://kind.sigs.k8s.io/dl/${{ matrix.kind_version }}/kind-linux-amd64 | |
chmod 755 kind | |
./kind/registry.sh install --registry-name kind-registry.local | |
./kind/kind.sh install --registry-name kind-registry.local | |
- name: Wait for ingress to be available | |
uses: iFaxity/wait-on-action@v1 | |
with: | |
resource: http://localhost:$IngressHTTPPort | |
timeout: 60000 | |
- name: Check that ingress is available | |
run: | | |
set +e | |
CURL_EXIT_CODE=$(curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort) | |
if [ ! "${CURL_EXIT_CODE}" == '0' ]; then | |
echo "Exit code should have been 0 but it was ${CURL_EXIT_CODE}." | |
curl -o /dev/null -s -w "%{http_code}\n" http://localhost:$IngressHTTPPort | |
curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort | |
exit 1 | |
fi | |
kind-test-podman-rootless-linux: | |
name: Test Kind Deployment using Podman rootless on Linux | |
runs-on: ${{ matrix.os }} | |
env: | |
IngressHTTPPort: 30080 | |
IngressHTTPSPort: 30443 | |
strategy: | |
matrix: | |
kind_version: [v0.22.0] | |
os: [ubuntu-latest] | |
steps: | |
- name: Setup Podman | |
run: | | |
sudo apt update | |
sudo apt-get -y install podman | |
- name: Checkout project | |
uses: actions/checkout@v3 | |
- name: Deploy kind | |
run: | | |
curl -Lo ./kind/kind https://kind.sigs.k8s.io/dl/${{ matrix.kind_version }}/kind-linux-amd64 | |
chmod 755 kind | |
./kind/registry.sh install --registry-name kind-registry.local --provider podman --rootless | |
./kind/kind.sh install --registry-name kind-registry.local --provider podman --rootless | |
# - name: Wait before checking if ingress available | |
# uses: GuillaumeFalourd/wait-sleep-action@v1 | |
# with: | |
# time: '60' # for 60 seconds | |
- name: Wait for ingress to be available | |
uses: iFaxity/wait-on-action@v1 | |
with: | |
resource: http://localhost:$IngressPort | |
timeout: 60000 | |
- name: Check that ingress is available | |
run: | | |
set +e | |
CURL_EXIT_CODE=$(curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort/) | |
if [ ! "${CURL_EXIT_CODE}" == '0' ]; then | |
echo "Exit code should have been 0 but it was ${CURL_EXIT_CODE}." | |
curl -o /dev/null -s -w "%{http_code}\n" http://localhost:$IngressHTTPPort | |
curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort | |
curl -o /dev/null -s -w "%{http_code}\n" https://localhost:$IngressHTTPSPort --insecure | |
curl -o /dev/null -s -w "%{exitcode}\n" https://localhost:$IngressHTTPSPort --insecure | |
echo "Not going to fail as rootless containers still don't work with podman." | |
exit 0 | |
else | |
echo "If rootless containers now work must review this workflow." | |
exit 1 | |
fi | |
kind-test-podman-rootful-linux: | |
name: Test Kind Deployment using Podman rootful on Linux | |
runs-on: ${{ matrix.os }} | |
env: | |
IngressHTTPPort: 80 | |
strategy: | |
matrix: | |
kind_version: [v0.22.0] | |
os: [ubuntu-latest] | |
steps: | |
- name: Setup Podman | |
run: | | |
sudo apt update | |
sudo apt-get -y install podman | |
- name: Checkout project | |
uses: actions/checkout@v3 | |
- name: Deploy kind | |
run: | | |
curl -Lo ./kind/kind https://kind.sigs.k8s.io/dl/${{ matrix.kind_version }}/kind-linux-amd64 | |
chmod 755 kind | |
./kind/registry.sh install --registry-name kind-registry.local --provider podman | |
./kind/kind.sh install --registry-name kind-registry.local --provider podman | |
- name: Wait for ingress to be available | |
uses: iFaxity/wait-on-action@v1 | |
with: | |
resource: http://localhost:$IngressHTTPPort | |
timeout: 60000 | |
- name: Check that ingress is available | |
run: | | |
set +e | |
CURL_EXIT_CODE=$(curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort) | |
if [ ! "${CURL_EXIT_CODE}" == '0' ]; then | |
echo "Exit code should have been 0 but it was ${CURL_EXIT_CODE}." | |
curl -o /dev/null -s -w "%{http_code}\n" http://localhost:$IngressHTTPPort | |
curl -o /dev/null -s -w "%{exitcode}\n" http://localhost:$IngressHTTPPort | |
exit 1 | |
fi | |
... |