Skip to content

Commit

Permalink
CI: Add a workflow to test Ansible deployment playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
markgoddard committed Sep 6, 2023
1 parent eb7b6bd commit 52f4d0c
Showing 1 changed file with 62 additions and 1 deletion.
63 changes: 62 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ jobs:

- name: Lint
run: make lint

- name: Install ansible-lint
run: pip install ansible-lint==6.17.*

- name: Install Ansible Galaxy requirements
run: ansible-galaxy collection install -r deployment/requirements.yml

- name: Lint Ansible playbook
run: ansible-lint deployment/site.yml
test:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -79,7 +88,7 @@ jobs:

- name: Wait for active storage server to start
run: |
until curl -if --cacert root.crt https://localhost:8080/.well-known/reductionist-schema; do
until curl -if http://localhost:8080/.well-known/reductionist-schema; do
sleep 1;
done
Expand Down Expand Up @@ -107,6 +116,58 @@ jobs:
- name: Stop active storage container
run: make stop
if: always()
deployment-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4

- name: Install deployment dependencies
run: pip install -r deployment/requirements.txt

- name: Install Ansible Galaxy requirements
run: ansible-galaxy collection install -r deployment/requirements.yml

- name: Run Ansible playbook
# GitHub runner already has Docker installed.
run: ansible-playbook -i deployment/inventory deployment/site.yml --skip-tags docker

- name: Install Python client dependencies
run: pip install -r scripts/requirements.txt

- name: Upload some sample data
run: python ./scripts/upload_sample_data.py

- name: Perform a smoke test
run: >
# Get the local IP of the default route
ip=$(ip r get 8.8.8.8 | awk '/via/ { print $7 }') &&
python ./scripts/client.py
sum
--server https://${ip}:8080
--cacert root.crt
--source http://localhost:9000
--username minioadmin --password minioadmin
--bucket sample-data --object data-uint32.dat
--dtype uint32
- name: Debug on failure
run: |
set -x
set +e
docker ps -a
for container in $(docker ps -aq); do
docker logs $container
done
sudo ss -nltp
sudo cat /etc/haproxy/haproxy.cfg
sudo cat /etc/prometheus/prometheus.yml
sudo ip a
sudo ip r
if: failure()
dependency-review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
Expand Down

0 comments on commit 52f4d0c

Please sign in to comment.