Skip to content

Commit

Permalink
Community deploy (#660)
Browse files Browse the repository at this point in the history
* Testing directory

Added testing directory and test suite(basic)

* Update testing-deploy-openstack.yaml

Configuring to run after images are pushed to QUAY

* Update env.yaml.example

typo fix

* Update doit.sh

fix paths

* Update doit.sh

Need to auto accept ssh keys

* path corrections and typos

Lots of path corrections to make it work as a workflow

* Update deploy.yaml

Added health checks

* Update deploy.yaml

whitespace cleanup

* fixes for pre-commit

fixing problems with pre-commit

* Pre commit fixes

* Update doit.sh

* Update doit.sh

* Update testing-deploy-openstack.yaml

changed image to latest
aedan authored Jan 24, 2025
1 parent 66107bc commit 61c7700
Showing 10 changed files with 680 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/image-pull-and-tag.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Migrate Images to GHCR
name: Migrate Images to QUAY

on:
push:
45 changes: 45 additions & 0 deletions .github/workflows/testing-deploy-openstack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: testing-openstack-deploy

on:
workflow_run:
workflows:
- Migrate Images to QUAY
types:
- completed
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python environment
run: sudo apt-get update && sudo apt-get install -y python3-pip

- name: Install requirements
run: pip3 install -r testing/requirements.txt

- name: Create OpenStack config directory
run: mkdir -p ~/.config/openstack

- name: Retrieve clouds.yaml from GitHub secrets
env:
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
run: |
echo "$CLOUDS_YAML" > ~/.config/openstack/clouds.yaml
- name: Retrieve env.yaml from GitHub secrets
env:
ENV_YAML: ${{ secrets.ENV_YAML }}
run: |
echo "$ENV_YAML" > ~/env.yaml
- name: Run deployment script
run: bash testing/doit.sh

- name: Cleanup
if: always()
run: bash testing/cleanup.sh
98 changes: 98 additions & 0 deletions testing/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
heat_template_version: wallaby

description: Build genestack for testing

parameters:
in_net:
type: string
description: Internal network name

ext_net:
type: string
description: External network for floating IP

image_name:
type: string
description: Image name for the VMs

key_pair:
type: string
description: Key pair name for the VMs
default: "genestack-keypair"

flavor_name:
type: string
description: Flavor name for the VMs

security_group:
type: string
description: Security group for the VMs

name1:
type: string
description: Name of first machine
default: "controller1"

name2:
type: string
description: Name of second machine
default: "controller2"

name3:
type: string
description: Name of third machine
default: "controller3"

resources:
genestack_keypair:
type: OS::Nova::KeyPair
properties:
name: "genestack-keypair"
public_key: { get_file: ./key.pub }

genestack_machine1:
type: OS::Heat::Stack
properties:
template: { get_file: single.yaml }
parameters:
internal: {get_param: in_net }
external: {get_param: ext_net }
image: {get_param: image_name }
flavor: {get_param: flavor_name }
keys: { get_resource: genestack_keypair }
sec_group: {get_param: security_group }
name: {get_param: name1 }

genestack_machine2:
type: OS::Heat::Stack
properties:
template: { get_file: single.yaml }
parameters:
internal: {get_param: in_net }
external: {get_param: ext_net }
image: {get_param: image_name }
flavor: {get_param: flavor_name }
keys: { get_resource: genestack_keypair }
sec_group: {get_param: security_group }
name: {get_param: name2 }

genestack_machine3:
type: OS::Heat::Stack
properties:
template: { get_file: single.yaml }
parameters:
internal: {get_param: in_net }
external: {get_param: ext_net }
image: {get_param: image_name }
flavor: {get_param: flavor_name }
keys: { get_resource: genestack_keypair }
sec_group: {get_param: security_group }
name: {get_param: name3 }

outputs:
all_out:
description: ip addresses of the 3 machines
value:
- { get_attr: [genestack_machine1, outputs, vm_ip] }
- { get_attr: [genestack_machine2, outputs, vm_ip] }
- { get_attr: [genestack_machine3, outputs, vm_ip] }
5 changes: 5 additions & 0 deletions testing/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
cd testing || exit
rm ./key*
rm ./inventory.yaml
yes y | openstack --os-cloud default stack delete testing
Loading

0 comments on commit 61c7700

Please sign in to comment.