Skip to content

Commit 59386d6

Browse files
authored
Remerge OOD after merging OOD CI fixes (#161)
* WIP: check OOD is up in CI * fail task if 200 OK not found in wget outpput * fix wget of OOD server in CI * fix apt command for proxychains in OOD CI * add debugging to smslabs ci * use default 9050 port for proxychains (environment var ignored) * add test user password to OOD check via SOCKS * fix ci environment name
1 parent 192edee commit 59386d6

File tree

4 files changed

+47
-2
lines changed

4 files changed

+47
-2
lines changed

.github/workflows/smslabs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,37 @@ jobs:
9191
ANSIBLE_FORCE_COLOR: True
9292
TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
9393

94+
- name: Confirm Open Ondemand is up (via SOCKS proxy)
95+
run: |
96+
. venv/bin/activate
97+
. environments/smslabs/activate
98+
99+
# load ansible variables into shell:
100+
ansible-playbook ansible/ci/output_vars.yml \
101+
-e output_vars_hosts=openondemand \
102+
-e output_vars_path=$APPLIANCES_ENVIRONMENT_ROOT/vars.txt \
103+
-e output_vars_items=bastion_ip,bastion_user,openondemand_servername
104+
source $APPLIANCES_ENVIRONMENT_ROOT/vars.txt
105+
106+
# setup ssh proxying:
107+
sudo apt-get --yes install proxychains
108+
echo proxychains installed
109+
ssh -v -fN -D 9050 ${bastion_user}@${bastion_ip}
110+
echo port 9050 forwarded
111+
112+
# check OOD server returns 200:
113+
statuscode=$(proxychains wget \
114+
--quiet \
115+
--spider \
116+
--server-response \
117+
--no-check-certificate \
118+
--http-user=testuser \
119+
--http-password=${TEST_USER_PASSWORD} https://${openondemand_servername} \
120+
2>&1)
121+
(echo $statuscode | grep "200 OK") || (echo $statuscode && exit 1)
122+
env:
123+
TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
124+
94125
- name: Test reimage of login and compute nodes
95126
run: |
96127
. venv/bin/activate

ansible/ci/output_vars.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Output specific hostvars to a file in a form which can be sourced by bash
2+
# NB: obviously the keys and values for the hostvars need to be suitable bash variables
3+
- hosts: "{{ output_vars_hosts }}"
4+
gather_facts: no
5+
tasks:
6+
- copy:
7+
dest: "{{ output_vars_path }}"
8+
content: |
9+
{% for item in output_vars_items.split(',') %}
10+
export {{output_vars_prefix | default('') }}{{ item }}={{ lookup('vars', item) }}
11+
{% endfor %}
12+
delegate_to: localhost
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
ansible_ssh_common_args: '-o ProxyCommand="ssh [email protected] -W %h:%p"'
1+
bastion_user: slurm-app-ci
2+
bastion_ip: 185.45.78.150
3+
ansible_ssh_common_args: '-o ProxyCommand="ssh {{ bastion_user }}@{{ bastion_ip }} -W %h:%p"'

environments/smslabs/terraform/nodes.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ resource "openstack_compute_instance_v2" "login" {
2828
flavor_name = each.value.flavor
2929
key_pair = var.key_pair
3030
config_drive = true
31-
security_groups = ["default", "ssh"]
31+
security_groups = ["default", "ssh", "HTTPS"]
3232

3333
network {
3434
uuid = data.openstack_networking_subnet_v2.cluster_subnet.network_id

0 commit comments

Comments
 (0)