Skip to content

Commit

Permalink
Use a specific external network for CI (#73)
Browse files Browse the repository at this point in the history
* Use a specific external network for CI

* Propagate external network through config
  • Loading branch information
mkjpryor authored Dec 13, 2023
1 parent 18b4cf9 commit 4999ac1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
22 changes: 2 additions & 20 deletions bin/check-alerts
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@ if [ -z "$AZIMUTH_CONFIG_ROOT" ] || [ -z "$AZIMUTH_CONFIG_ENVIRONMENT_ROOT" ]; t
fi


ansible_variable() {
ANSIBLE_LOAD_CALLBACK_PLUGINS=true \
ANSIBLE_STDOUT_CALLBACK=json \
ansible -m debug -a "var=$1" all | \
jq -r ".plays[0].tasks[0].hosts.localhost.$1"
}


# Get the install_mode that is in use
install_mode="$(ansible_variable install_mode)"

# For HA installs, there should only be the watchdog
# Single-node deployments have other expected alerts
if [ "$install_mode" = "ha" ]; then
EXPECTED_ALERT_COUNT=1
else
EXPECTED_ALERT_COUNT=4
fi

echo "Starting port-forward for Prometheus API"
./bin/port-forward prometheus 9090 > /dev/null 2>&1 &
PID="$!"
Expand Down Expand Up @@ -71,7 +52,8 @@ while true; do
echo "$ALERTS" | jq -r '.data.alerts[] | " " + .labels.alertname + " is " + .state'
echo ""

if [[ ${ALERT_COUNT} -eq ${EXPECTED_ALERT_COUNT} ]]; then
# Check that only the Watchdog is firing
if [[ ${ALERT_COUNT} -eq 1 ]]; then
exit
elif [[ ${RETRIES} -eq ${RETRY_LIMIT} ]]; then
exit 1
Expand Down
3 changes: 3 additions & 0 deletions environments/ci/inventory/group_vars/all/variables.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Use the external-facing network
infra_external_network_id: "{{ lookup('pipe', 'openstack network show CUDN-Internet -f value -c id') }}"

# Use the pre-existing portal-internal network so that we don't need to steal a router
infra_network_id: "{{ lookup('pipe', 'openstack network show portal-internal -f value -c id') }}"

Expand Down
8 changes: 8 additions & 0 deletions environments/demo/inventory/group_vars/all/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ infra_flavor_id: >-
json_query('ID')
}}
# Use the same external network as we use for the infra
azimuth_capi_operator_external_network_id: "{{ infra_external_network_id }}"

# For Slurm, we need at least 4GB RAM
# Use the same flavor for login and control nodes
azimuth_caas_stackhpc_slurm_appliance_login_flavor_name: >-
Expand All @@ -56,6 +59,11 @@ community_images_update_existing_visibility: false
# Disable HTTPS and certificate verification everywhere to avoid certificate issues
ingress_tls_enabled: false

# Use the same external network as the infra for Azimuth auto-created networking
azimuth_openstack_external_net_template: >-
{{-
lookup('pipe', 'openstack network show -f value -c name ' ~ infra_external_network_id)
}}
# Disable SSL verification for OpenStack in case it uses a custom CA
azimuth_openstack_verify_ssl: false

Expand Down
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
collections:
- name: https://github.com/stackhpc/ansible-collection-azimuth-ops.git
type: git
version: 0.2.1
version: 0.3.0-alpha.2
# For local development
# - type: dir
# source: ../ansible-collection-azimuth-ops

0 comments on commit 4999ac1

Please sign in to comment.