Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration No-S2I containers to shared cluster #72

Merged
merged 5 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions deploy-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
xml_file: "{{ testing_dir }}/{{ xml_file_name }}"
xml_testsuite_path: "/testsuite"
xml_testcase_path: "{{ xml_testsuite_path }}/testcase"
oc_project_rhscl: "rhscl-ci-testing"
oc_project_dotnet: "dotnet-ci-testing"
oc_project_rhscl: "core-services-ocp--rhscl-ci"
oc_project_dotnet: "core-services-ocp--dotnet-ci"
java_8:
- java-8-container
java_11:
Expand All @@ -24,6 +24,8 @@
- rhel8-dotnet70-container
dotnet: "{{ dotnet_60 + dotnet_70}}"
tasks:
- debug: var=ext_test
- debug: var=github_repo
- name: Modify OpenShift project to rhscl-ci-testing-s2i if s2i
set_fact:
oc_project_rhscl: "{{ oc_project_rhscl }}-s2i"
Expand Down Expand Up @@ -64,15 +66,6 @@
- name: Clone and test upstream container repositories
include_tasks: ./tasks/verify_in_openshift.yml
loop:
#- rhel7-nodejs-ex-14
- rhel7-nginx-ex-120
- rhel7-postgresql-10-container
- rhel7-mysql-80-container
- rhel7-mariadb-103-container
- rhel7-mariadb-105-container
#- rhel7-s2i-perl-530-container
- rhel7-s2i-ruby-30-container
- rhel7-s2i-python-38-container
- rhel8-nodejs-ex-18
- rhel8-nodejs-ex-18-minimal
- rhel8-nodejs-ex-20
Expand Down Expand Up @@ -128,11 +121,6 @@
- name: Check None-s2i containers
include_tasks: ./tasks/verify_in_openshift.yml
loop:
- rhel7-nginx-ex-120
- rhel7-postgresql-10-container
- rhel7-mysql-80-container
- rhel7-mariadb-103-container
- rhel7-mariadb-105-container
- rhel8-httpd-ex
- rhel8-mariadb-105-container
- rhel8-mariadb-1011-container
Expand All @@ -158,15 +146,10 @@
- name: Check s2i containers
include_tasks: ./tasks/verify_in_openshift.yml
loop:
#- rhel7-nodejs-ex-14
#- rhel7-s2i-perl-530-container
- rhel7-s2i-ruby-30-container
- rhel7-s2i-python-38-container
- rhel8-nodejs-ex-18
- rhel8-nodejs-ex-18-minimal
- rhel8-nodejs-ex-20
- rhel8-nodejs-ex-20-minimal
- rhel8-cakephp-ex-73
- rhel8-cakephp-ex-74
#- rhel8-cakephp-ex-80 It looks like no prepared for PHP-8.0
#- rhel8-cakephp-ex-81 It looks like no prepared for PHP-8.0
Expand Down
2 changes: 1 addition & 1 deletion files/check_pod_running.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ for i in {1..10}; do
exit 1
fi
done <<< "${POD_STATUS}"
sleep 60
sleep 30
done
exit 1
16 changes: 14 additions & 2 deletions tasks/openshift_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
script: "./files/check_pod_running.sh {{ stuff.pod_name }}"
register: cluster_name
until: cluster_name.rc == 0
retries: 40
retries: 30
delay: 30
ignore_errors: yes
when: deploy_cmd.rc == 0
Expand All @@ -35,9 +35,21 @@
changed_when: false
register: route_cmd
until: route_cmd.rc == 0
retries: 30
delay: 10
when: (deploy_cmd.rc == 0) and (cluster_name.rc == 0)

- debug: var=route_cmd

- name: Check service IP for POD {{ stuff.pod_name }}
shell: "oc get svc/{{ stuff.pod_name }} --no-headers -o custom-columns=HOST:.spec.clusterIP"
changed_when: false
register: service_ip
until: service_ip.rc == 0
retries: 10
delay: 20
when: (deploy_cmd.rc == 0) and (cluster_name.rc == 0)

- debug: var=route_cmd
- debug: var=service_ip

when: file_exists.stat.exists
38 changes: 23 additions & 15 deletions tasks/openshift_test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
- block:
- debug: var=stuff
- debug: var=service_ip

- name: Check curl command is working
uri:
url: "http://{{ route_cmd.stdout }}"
return_content: yes
status_code: 200
body_format: "{{ stuff.curl_output_format | default('json') }}"
retries: 20
- name: Check if curl command is working
script: "./files/check_oc_exec_output.sh 'curl {{ service_ip.stdout | trim }}:8080' '{{ cluster_name.stdout | trim }}' '{{ stuff.check_curl_output }}'"
retries: 10
delay: 20
register: curl_output
ignore_errors: yes
until: ("status" in curl_output) and (curl_output.status == 200)

- name: Check proper output in json
until: (curl_output.rc == 0) and ("Connection refused" not in curl_output["stderr"])
# - name: Check curl command is working
# uri:
# url: "http://{{ route_cmd.stdout }}"
# return_content: yes
# status_code: 200
# body_format: "{{ stuff.curl_output_format | default('json') }}"
# retries: 19
# delay: 20
# register: curl_output
# ignore_errors: yes
# until: ("status" in curl_output) and (curl_output.status == 200)

- name: Check proper output
debug:
var: curl_output

Expand All @@ -26,24 +34,24 @@
add_children:
- failure:
message: "Check curl Test failed"
- system-err: "{{ curl_output.msg | trim }}"
- system-err: "{{ curl_output.stdout | trim }}"

- name: Increment testsuite failures attribute
xml:
path: "{{ xml_file }}"
xpath: "{{ xml_testsuite_path }}"
attribute: failures
value: "{{ testsuite_attrs.failures|int + 1 }}"
when: (curl_output["content"] is not defined) or ("{{ stuff.check_curl_output }}" not in curl_output["content"])
when: (curl_output["stdout"] is not defined) or ("{{ stuff.check_curl_output }}" not in curl_output["stdout"])

- name: Write test case passed elements
xml:
path: "{{ xml_file }}"
xpath: "{{ xml_testcase_path }}"
pretty_print: yes
add_children:
- system-out: "{{ curl_output.msg | trim }}"
when: '"{{ stuff.check_curl_output }}" in curl_output["content"]'
- system-out: "FINE"
when: '"{{ stuff.check_curl_output }}" in curl_output["stdout"]'

when: (stuff.check_curl_output is defined)

Expand All @@ -54,7 +62,7 @@
script: "{{ stuff.test_exec_command }} {{ cluster_name.stdout | trim }} '{{ stuff.expected_exec_result }}'"
ignore_errors: yes
register: command_out
retries: 20
retries: 5
delay: 20
until: command_out.rc == 0

Expand Down
2 changes: 1 addition & 1 deletion tasks/verify_in_openshift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
when: (ext_test == "") or (ext_test == "s2i") or (ext_test == "nos2i")

- name: Get list of projects for DOTNET
shell: "oc projects | grep dotnet-ci-testing"
shell: "oc projects | grep dotnet-ci"
changed_when: false
register: oc_projects
ignore_errors: yes
Expand Down
2 changes: 1 addition & 1 deletion vars/rhel7-nginx-ex-118.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
registry_redhat_io: "ubi7/nginx-118"
tag_name: "nginx:1.18-ubi7"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/nginx-ex/master/openshift/templates/nginx.json -p NGINX_VERSION=1.18-ubi7 -p NAMESPACE={{ oc_project_rhscl }} | oc apply -f -"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/nginx-ex/master/openshift/templates/nginx.json -p NGINX_VERSION=1.18-ubi7 -p NAMESPACE={{ oc_project_rhscl }} --name=nginx-example | oc apply -f -"
pod_name: "nginx-example"
check_curl_output: "Welcome to your static nginx application"
scl_url: "nginx-container"
Expand Down
2 changes: 1 addition & 1 deletion vars/rhel7-nginx-ex-120.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
registry_redhat_io: "ubi7/nginx-120"
tag_name: "nginx:1.20-ubi7"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/nginx-ex/master/openshift/templates/nginx.json -p NGINX_VERSION=1.20-ubi7 -p NAMESPACE={{ oc_project_rhscl }} | oc apply -f -"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/nginx-ex/master/openshift/templates/nginx.json --name=nginx-example -p NGINX_VERSION=1.20-ubi7 -p NAMESPACE={{ oc_project_rhscl }} | oc apply -f -"
pod_name: "nginx-example"
check_curl_output: "Welcome to your static nginx application"
scl_url: "nginx-container"
Expand Down
2 changes: 1 addition & 1 deletion vars/rhel7-nodejs-ex-14.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
registry_redhat_io: "ubi7/nodejs-14"
tag_name: "nodejs:14"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/nodejs-ex/master/openshift/templates/nodejs.json -p NODEJS_VERSION=14 -p NAMESPACE={{ oc_project_rhscl }} | oc apply -f -"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/nodejs-ex/master/openshift/templates/nodejs.json --name=nodejs-example -p NODEJS_VERSION=14 -p NAMESPACE={{ oc_project_rhscl }} | oc apply -f -"
pod_name: "nodejs-example"
check_curl_output: "Node.js Crud Application"
scl_url: "nodejs-ex"
Expand Down
2 changes: 1 addition & 1 deletion vars/rhel7-s2i-perl-530-container.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
registry_redhat_io: "rhscl/perl-530-rhel7"
tag_name: "perl:5.30"
deployment: "oc new-app perl:5.30~https://github.com/sclorg/dancer-ex.git"
deployment: "oc new-app perl:5.30~https://github.com/sclorg/dancer-ex.git --name=dancer-ex"
pod_name: "dancer-ex"
add_route: true
check_curl_output: "Welcome to your Dancer application"
Expand Down
6 changes: 4 additions & 2 deletions vars/rhel7-s2i-python-38-container.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
deployment: "oc new-app python:3.8~https://github.com/sclorg/s2i-python-container.git --context-dir=3.8/test/setup-test-app/"
pod_name: "s2i-python-container"
registry_redhat_io: "ubi7/python-38"
tag_name: "python:3.8"
deployment: "oc new-app python:3.8~https://github.com/sclorg/s2i-python-container.git --context-dir=3.8/test/setup-test-app/ --name=python-example"
pod_name: "python-example"
add_route: true
check_curl_output: "Hello from gunicorn WSGI application"
scl_url: "s2i-python-container"
Expand Down
4 changes: 2 additions & 2 deletions vars/rhel7-s2i-ruby-30-container.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
registry_redhat_io: "ubi7/ruby-30"
tag_name: "ruby:3.0"
deployment: "oc new-app ruby:3.0~https://github.com/sclorg/s2i-ruby-container.git --context-dir=3.0/test/puma-test-app/"
pod_name: "s2i-ruby-container"
deployment: "oc new-app ruby:3.0~https://github.com/sclorg/s2i-ruby-container.git --context-dir=3.0/test/puma-test-app/ --name=ruby-example"
pod_name: "ruby-example"
add_route: true
check_curl_output: "Hello world"
scl_url: "s2i-ruby-container"
Expand Down
2 changes: 1 addition & 1 deletion vars/rhel8-django-ex-python-36.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
registry_redhat_io: "ubi8/python-36"
tag_name: "python:3.6-ubi8"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/django-ex/3.2.x/openshift/templates/django.json -p PYTHON_VERSION=3.6-ubi8 -p NAMESPACE={{ oc_project_rhscl }} | oc apply -f -"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/django-ex/2.2.x/openshift/templates/django.json -p PYTHON_VERSION=3.6-ubi8 -p NAMESPACE={{ oc_project_rhscl }} | oc apply -f -"
pod_name: "django-example"
check_curl_output: "Welcome to your Django application on OpenShift"
scl_url: "django-ex"
2 changes: 1 addition & 1 deletion vars/rhel8-django-ex-python-38.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
registry_redhat_io: "ubi8/python-38"
tag_name: "python:3.8-ubi8"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/django-ex/3.2.x/openshift/templates/django.json -p PYTHON_VERSION=3.8-ubi8 -p NAMESPACE={{ oc_project_rhscl }} | oc apply -f -"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/django-ex/2.2.x/openshift/templates/django.json -p PYTHON_VERSION=3.8-ubi8 -p NAMESPACE={{ oc_project_rhscl }} | oc apply -f -"
pod_name: "django-example"
check_curl_output: "Welcome to your Django application on OpenShift"
scl_url: "django-ex"
15 changes: 6 additions & 9 deletions vars/rhel8-mariadb-1011-container.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
registry_redhat_io: "rhel8/mariadb-1011"
tag_name: "mariadb:10.11-el8"
deployment: "oc new-app mariadb:10.11-el8~https://github.com/sclorg/mariadb-container.git \
--name rhel8-mariadb-1011 \
--context-dir=examples/extend-image \
--env MYSQL_OPERATIONS_USER=opuser \
--env MYSQL_OPERATIONS_PASSWORD=oppass \
--env MYSQL_DATABASE=opdb \
--env MYSQL_USER=user \
--env MYSQL_PASSWORD=pass"
pod_name: "rhel8-mariadb-1011"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/mariadb-container/master/examples/mariadb-persistent-template.json -p MARIADB_VERSION=10.11-el8 -p NAMESPACE={{ oc_project_rhscl }} \
-p DATABASE_SERVICE_NAME=mariadb-1011 \
-p MYSQL_DATABASE=opdb \
-p MYSQL_USER=user \
-p MYSQL_PASSWORD=pass | oc apply -f -"
pod_name: "mariadb-1011"
add_route: true
test_exec_command: "./files/check_mariadb_container.sh"
expected_exec_result: "FINE"
Expand Down
15 changes: 6 additions & 9 deletions vars/rhel8-mariadb-105-container.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
registry_redhat_io: "rhel8/mariadb-105"
tag_name: "mariadb:10.5-el8"
deployment: "oc new-app mariadb:10.5-el8~https://github.com/sclorg/mariadb-container.git \
--name rhel8-mariadb-105 \
--context-dir=examples/extend-image \
--env MYSQL_OPERATIONS_USER=opuser \
--env MYSQL_OPERATIONS_PASSWORD=oppass \
--env MYSQL_DATABASE=opdb \
--env MYSQL_USER=user \
--env MYSQL_PASSWORD=pass"
pod_name: "rhel8-mariadb-105"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/mariadb-container/master/examples/mariadb-persistent-template.json -p MARIADB_VERSION=10.5-el8 -p NAMESPACE={{ oc_project_rhscl }} \
-p DATABASE_SERVICE_NAME=mariadb-105 \
-p MYSQL_DATABASE=opdb \
-p MYSQL_USER=user \
-p MYSQL_PASSWORD=pass | oc apply -f -"
pod_name: "mariadb-105"
add_route: true
test_exec_command: "./files/check_mariadb_container.sh"
expected_exec_result: "FINE"
Expand Down
17 changes: 7 additions & 10 deletions vars/rhel8-mysql-80-container.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
registry_redhat_io: "rhel8/mysql-80"
tag_name: "mysql:8.0"
deployment: "oc new-app mysql:8.0~https://github.com/sclorg/mysql-container.git \
--name my-mysql-rhel8 \
--context-dir=examples/extend-image \
--env MYSQL_OPERATIONS_USER=opuser \
--env MYSQL_OPERATIONS_PASSWORD=oppass \
--env MYSQL_DATABASE=opdb \
--env MYSQL_USER=user \
--env MYSQL_PASSWORD=pass"
pod_name: "my-mysql-rhel8"
tag_name: "mysql:8.0-el8"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/mysql-container/master/examples/mysql-persistent-template.json -p MYSQL_VERSION=8.0-el8 -p NAMESPACE={{ oc_project_rhscl }} \
-p DATABASE_SERVICE_NAME=mysql-80 \
-p MYSQL_DATABASE=opdb \
-p MYSQL_USER=user \
-p MYSQL_PASSWORD=pass | oc apply -f -"
pod_name: "mysql-80"
add_route: true
test_exec_command: "./files/check_mysql_container.sh"
expected_exec_result: "FINE"
Expand Down
13 changes: 6 additions & 7 deletions vars/rhel8-postgresql-10-container.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
registry_redhat_io: "rhel8/postgresql-10"
tag_name: "postgresql:10-el8"
deployment: "oc new-app postgresql:10-el8~https://github.com/sclorg/postgresql-container.git \
--name rhel8-postgresql-10 \
--context-dir examples/extending-image/ \
-e POSTGRESQL_USER=user \
-e POSTGRESQL_DATABASE=db \
-e POSTGRESQL_PASSWORD=password"
pod_name: "rhel8-postgresql-10"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/postgresql-container/master/examples/postgresql-persistent-template.json -p POSTGRESQL_VERSION=10-el8 -p NAMESPACE={{ oc_project_rhscl }} \
-p DATABASE_SERVICE_NAME=postgresql-10 \
-p POSTGRESQL_DATABASE=opdb \
-p POSTGRESQL_USER=user \
-p POSTGRESQL_PASSWORD=pass | oc apply -f -"
pod_name: "postgresql-10"
add_route: true
test_exec_command: "./files/check_postgresql_container.sh"
expected_exec_result: "FINE"
Expand Down
13 changes: 6 additions & 7 deletions vars/rhel8-postgresql-12-container.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
registry_redhat_io: "rhel8/postgresql-12"
tag_name: "postgresql:12-el8"
deployment: "oc new-app postgresql:12-el8~https://github.com/sclorg/postgresql-container.git \
--name rhel8-postgresql-12 \
--context-dir examples/extending-image/ \
-e POSTGRESQL_USER=user \
-e POSTGRESQL_DATABASE=db \
-e POSTGRESQL_PASSWORD=password"
pod_name: "rhel8-postgresql-12"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/postgresql-container/master/examples/postgresql-persistent-template.json -p POSTGRESQL_VERSION=12-el8 -p NAMESPACE={{ oc_project_rhscl }} \
-p DATABASE_SERVICE_NAME=postgresql-12 \
-p POSTGRESQL_DATABASE=opdb \
-p POSTGRESQL_USER=user \
-p POSTGRESQL_PASSWORD=pass | oc apply -f -"
pod_name: "postgresql-12"
add_route: true
test_exec_command: "./files/check_postgresql_container.sh"
expected_exec_result: "FINE"
Expand Down
13 changes: 6 additions & 7 deletions vars/rhel8-postgresql-13-container.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
registry_redhat_io: "rhel8/postgresql-13"
tag_name: "postgresql:13-el8"
deployment: "oc new-app postgresql:13-el8~https://github.com/sclorg/postgresql-container.git \
--name rhel8-postgresql-13 \
--context-dir examples/extending-image/ \
-e POSTGRESQL_USER=user \
-e POSTGRESQL_DATABASE=db \
-e POSTGRESQL_PASSWORD=password"
pod_name: "rhel8-postgresql-13"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/postgresql-container/master/examples/postgresql-persistent-template.json -p POSTGRESQL_VERSION=13-el8 -p NAMESPACE={{ oc_project_rhscl }} \
-p DATABASE_SERVICE_NAME=postgresql-13 \
-p POSTGRESQL_DATABASE=opdb \
-p POSTGRESQL_USER=user \
-p POSTGRESQL_PASSWORD=pass | oc apply -f -"
pod_name: "postgresql-13"
add_route: true
test_exec_command: "./files/check_postgresql_container.sh"
expected_exec_result: "FINE"
Expand Down
13 changes: 6 additions & 7 deletions vars/rhel8-postgresql-15-container.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
registry_redhat_io: "rhel8/postgresql-15"
tag_name: "postgresql:15-el8"
deployment: "oc new-app postgresql:15-el8~https://github.com/sclorg/postgresql-container.git \
--name rhel8-postgresql-15 \
--context-dir examples/extending-image/ \
-e POSTGRESQL_USER=user \
-e POSTGRESQL_DATABASE=db \
-e POSTGRESQL_PASSWORD=password"
pod_name: "rhel8-postgresql-15"
deployment: "oc process -f https://raw.githubusercontent.com/sclorg/postgresql-container/master/examples/postgresql-persistent-template.json -p POSTGRESQL_VERSION=15-el8 -p NAMESPACE={{ oc_project_rhscl }} \
-p DATABASE_SERVICE_NAME=postgresql-15 \
-p POSTGRESQL_DATABASE=opdb \
-p POSTGRESQL_USER=user \
-p POSTGRESQL_PASSWORD=pass | oc apply -f -"
pod_name: "postgresql-15"
add_route: true
test_exec_command: "./files/check_postgresql_container.sh"
expected_exec_result: "FINE"
Expand Down
Loading