Skip to content

Commit

Permalink
Run StackHPC OpenStack tests in aio CI
Browse files Browse the repository at this point in the history
  • Loading branch information
markgoddard committed May 14, 2024
1 parent 9c07a7c commit 99bc1c8
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 91 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/stackhpc-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,16 +366,39 @@ jobs:
env:
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}

- name: StackHPC OpenStack tests
id: stackhpc-openstack-tests
continue-on-error: true
run: |
mkdir -p sot-results
docker run -t --rm \
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
-v $(pwd)/sot-results:/stack/sot-results \
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
$KAYOBE_IMAGE \
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/stackhpc-openstack-tests.yml'
env:
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}

- name: Upload test result artifacts
uses: actions/upload-artifact@v4
with:
name: tempest-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' }}
path: tempest-artifacts/*
name: test-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' }}
path: >
tempest-artifacts/
sot-results/
- name: Fail if any Tempest tests failed
run: |
test $(wc -l < tempest-artifacts/failed-tests) -lt 1
- name: Fail if any StackHPC OpenStack tests failed
run: |
echo "Some StackHPC OpenStack tests failed."
echo "See HTML results artifact (sot-results) for details."
exit 1
if: steps.stackhpc-openstack-tests.outcome == 'failure'

- name: Destroy
run: terraform destroy -auto-approve
working-directory: ${{ github.workspace }}/terraform/aio
Expand Down
93 changes: 4 additions & 89 deletions .github/workflows/stackhpc-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ concurrency:
name: Pull request
'on':
pull_request:
# FIXME:
push:
branches:
- stackhpc-openstack-tests
jobs:
# Detect which files have changed and use this to run jobs conditionally.
# Note that we can't use the workflow-level paths attribute since this
Expand Down Expand Up @@ -105,92 +109,3 @@ jobs:
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}

all-in-one-ubuntu-jammy-ovn:
name: aio (Ubuntu Jammy OVN)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
os_distribution: ubuntu
os_release: jammy
ssh_username: ubuntu
neutron_plugin: ovn
OS_CLOUD: openstack
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}

all-in-one-rocky-9-ovs:
name: aio (Rocky 9 OVS)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
os_distribution: rocky
os_release: "9"
ssh_username: cloud-user
neutron_plugin: ovs
OS_CLOUD: openstack
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}

all-in-one-rocky-9-ovn:
name: aio (Rocky 9 OVN)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
os_distribution: rocky
os_release: "9"
ssh_username: cloud-user
neutron_plugin: ovn
OS_CLOUD: openstack
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}

# Test two upgrade scenarios: Ubuntu Jammy OVS and Rocky 9 OVN.

all-in-one-upgrade-ubuntu-jammy-ovs:
name: aio upgrade (Ubuntu Jammy OVS)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
os_distribution: ubuntu
os_release: jammy
ssh_username: ubuntu
neutron_plugin: ovs
OS_CLOUD: openstack
if: ${{ needs.check-changes.outputs.aio == 'true' }}
upgrade: true
secrets: inherit
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}

all-in-one-upgrade-rocky-9-ovn:
name: aio upgrade (Rocky 9 OVN)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
os_distribution: rocky
os_release: "9"
ssh_username: cloud-user
neutron_plugin: ovn
OS_CLOUD: openstack
if: ${{ needs.check-changes.outputs.aio == 'true' }}
upgrade: true
secrets: inherit
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
80 changes: 80 additions & 0 deletions etc/kayobe/ansible/stackhpc-openstack-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
- name: Run StackHPC OpenStack tests
hosts: tempest_runner
tags:
- stackhpc-openstack-tests
vars:
sot_venv: "{{ virtualenv_path }}/sot-venv"
sot_repo: "https://github.com/stackhpc/stackhpc-openstack-tests"
# FIXME:
sot_version: "poc"
sot_timeout: 30
results_path_local: "{{ lookup('env', 'HOME') }}/sot-results"
tasks:
- block:
- name: Create a temporary directory for tests repo
ansible.builtin.tempfile:
state: directory
suffix: sot-repo
register: repo_tmpdir

- name: Create a temporary directory for results
ansible.builtin.tempfile:
state: directory
suffix: sot-results
register: results_tmpdir

- name: Clone the StackHPC OpenStack tests repository
ansible.builtin.git:
repo: "{{ sot_repo }}"
version: "{{ sot_version }}"
dest: "{{ repo_tmpdir.path }}"
depth: 1
single_branch: true

- name: Ensure the latest versions of pip and setuptools are installed # noqa package-latest
ansible.builtin.pip:
name: "{{ item.name }}"
state: latest
virtualenv: "{{ sot_venv }}"
virtualenv_command: "python3 -m venv"
with_items:
- { name: pip }
- { name: setuptools }

- name: Ensure required Python packages are installed
ansible.builtin.pip:
name:
- "{{ repo_tmpdir.path }}"
- "-r{{ repo_tmpdir.path }}/requirements.txt"
- pytest-html
- pytest-timeout
virtualenv: "{{ sot_venv }}"

- name: Run StackHPC OpenStack tests
ansible.builtin.command:
cmd: >
{{ sot_venv }}/bin/py.test
--html={{ results_tmpdir.path }}/stackhpc-openstack-tests.html
--self-contained-html
--pyargs stackhpc_openstack_tests
--timeout {{ sot_timeout }}
environment:
OPENSEARCH_HOSTS: "{% for host in groups['controllers'] %}{{ internal_net_name | net_ip(host) }}{% if not loop.last %},{% endif %}{% endfor %}"
OPENSEARCH_PORT: "9200"
OPENSEARCH_TLS: "false"
PROMETHEUS_URL: "{{ 'https' if kolla_enable_tls_internal | bool else 'http' }}://{{ kolla_internal_fqdn }}:9091"
always:
- name: Fetch results
ansible.builtin.fetch:
src: "{{ results_tmpdir.path }}/stackhpc-openstack-tests.html"
dest: "{{ results_path_local }}/"
flat: true

- name: Clean up temporary directory
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- "{{ repo_tmpdir.path }}"
- "{{ results_tmpdir.path }}"

0 comments on commit 99bc1c8

Please sign in to comment.