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

[zuul] Add ocp 4.14 jobs #523

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c770000
[zuul] Add job to test deploying a specific version of OCP
elfiesmelfie Jun 2, 2023
3a722bf
zuul: add log collection post-task to get crc logs
elfiesmelfie Sep 26, 2023
22caefe
Add ocp v13 and a timeout to the job
elfiesmelfie Sep 26, 2023
69be262
Add an explicit check for the ocp version
elfiesmelfie Sep 26, 2023
9fa3837
Update 4.10 version and fix var name
elfiesmelfie Sep 26, 2023
bfe93ba
Merge branch 'master' into efoley_add_crc_multiversion
elfiesmelfie Sep 26, 2023
3dcf8fa
add 4.11 and use a temp base job
elfiesmelfie Sep 27, 2023
773a016
Update versions and vars
elfiesmelfie Sep 27, 2023
784e7b3
Update ocp-411 to v4.11.18
elfiesmelfie Sep 29, 2023
fe3561d
Merge remote-tracking branch 'origin/master' into efoley_add_crc_mult…
elfiesmelfie Oct 31, 2023
fc8e1fc
[zuul] Set scenario for CRC version test job
elfiesmelfie Nov 1, 2023
f62971d
Merge branch 'master' into efoley_add_crc_multiversion
elfiesmelfie Nov 1, 2023
0a42470
Merge branch 'master' into efoley_add_crc_multiversion
elfiesmelfie Nov 2, 2023
4863cfc
[zuul] Enable nightly_bundles with different ocp versions
elfiesmelfie Nov 3, 2023
5b6b66d
[zuul] Remove 4.11 jobs
elfiesmelfie Nov 3, 2023
01c8299
[zuul] update jobs
elfiesmelfie Nov 3, 2023
1fec530
Merge remote-tracking branch 'origin/master' into efoley_add_crc_mult…
elfiesmelfie Nov 6, 2023
8fe8f54
[zuul] Remove experimental microshift job
elfiesmelfie Nov 6, 2023
cdbd399
[zuul] Remove the low-op crc jobs
elfiesmelfie Nov 6, 2023
83531cf
Merge branch 'master' into efoley_add_crc_multiversion
elfiesmelfie Nov 7, 2023
016048d
[zuul] Add 4.14 jobs
elfiesmelfie Nov 7, 2023
14ddbc3
[zuul] Actually enable 4.14 jobs
elfiesmelfie Nov 7, 2023
6c378c0
Add the low-op zuul job to test 4.14 bundle
elfiesmelfie Nov 7, 2023
f517985
Revert "[zuul] Actually enable 4.14 jobs"
elfiesmelfie Nov 7, 2023
f3d4001
Revert "[zuul] Add 4.14 jobs"
elfiesmelfie Nov 7, 2023
95c75a9
[zuul] update
elfiesmelfie Nov 7, 2023
5d845f3
Merge branch 'efoley_add_crc_multiversion' into efoley_zuul_test_414
elfiesmelfie Nov 7, 2023
04894ad
Add the low-op jobs back in
elfiesmelfie Nov 7, 2023
681a560
[zuul] Rename dupe job
elfiesmelfie Nov 7, 2023
c604da7
[stf-collect-logs] Add ignore_errors to task
elfiesmelfie Nov 7, 2023
332c3b4
[debug] Add a task to get crc info post-run
elfiesmelfie Nov 8, 2023
ce8bec3
[debug] Get crc info
elfiesmelfie Nov 9, 2023
9304c4c
[debug] Updatge command
elfiesmelfie Nov 9, 2023
5deafa1
[debug] Fix command again
elfiesmelfie Nov 9, 2023
7ac6fcd
[debug] Link up kubeconfig and use oc without KUBECONFIG var set
elfiesmelfie Nov 10, 2023
10f2f7f
[debug] Fix typo; it's split ext not split text
elfiesmelfie Nov 10, 2023
78cdb5e
[debug] Remove leading whitespace in cache_dir
elfiesmelfie Nov 10, 2023
90094fa
[debug] Add retry to oc status
elfiesmelfie Nov 10, 2023
96c17ed
[debug] Add ignore_errors: true to the retried task
elfiesmelfie Nov 10, 2023
b7579cb
[debug] Remove link for kubeconfig
elfiesmelfie Nov 10, 2023
b8ae2e0
[zuul] Run the job playbooks, but in post
elfiesmelfie Nov 10, 2023
c9b7b2e
[zuul][follow-up] Use import playbook properly
elfiesmelfie Nov 10, 2023
9b975cf
Merge branch 'master' into efoley_zuul_test_414
elfiesmelfie Nov 16, 2023
c73707f
Put back in the bits I need
elfiesmelfie Nov 16, 2023
93d52f6
[zuul] Do deploy, test in post, not in collect-logs playbook
elfiesmelfie Nov 16, 2023
b3312a1
[zuul] Add prepare in post
elfiesmelfie Nov 16, 2023
6ba2b85
try using crc-base instead of crc-simple-base
elfiesmelfie Nov 16, 2023
7fb5015
Merge branch 'master' into efoley_zuul_test_414
elfiesmelfie Nov 17, 2023
b850b2a
[zuul] Try adding more memory for OCP 4.14 jobs
elfiesmelfie Nov 27, 2023
f95896a
Merge branch 'master' into efoley_zuul_test_414
elfiesmelfie Nov 27, 2023
e40ef96
zuul update nodeset
elfiesmelfie Nov 27, 2023
a8e68c1
Update stf-base base
elfiesmelfie Nov 27, 2023
ceb070f
zuul: update CRC params to pass more memory
elfiesmelfie Nov 27, 2023
9c74836
zuul: ocp 4.14, add more ram to the crc
elfiesmelfie Nov 27, 2023
f595330
zuul add separate playbooks for debugging 4.14 and getting logs
elfiesmelfie Nov 27, 2023
d690c59
zuul: split upload from collect logs
elfiesmelfie Nov 27, 2023
4f160d7
cat crc-start logs in post
elfiesmelfie Nov 27, 2023
b665e9c
Update nodeset
elfiesmelfie Nov 28, 2023
dfed5d4
Revert "Update nodeset"
elfiesmelfie Nov 28, 2023
91fd6d6
Update ram 50G -> 40G
elfiesmelfie Nov 28, 2023
c816686
update crc ram
elfiesmelfie Nov 28, 2023
6184bab
Clean up some tasks
elfiesmelfie Nov 29, 2023
73659d3
Experiment with different ways to get the crc status
elfiesmelfie Nov 29, 2023
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
53 changes: 49 additions & 4 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
name: stf-base
# defined in: https://review.rdoproject.org/cgit/config/tree/zuul.d/_jobs-crc.yaml
parent: base-simple-crc
#This can't be used because the bundle can't be passed
#parent: base-crc
abstract: true
description: |
Run the stf-run-ci role, and then test stf
Expand Down Expand Up @@ -31,6 +33,27 @@
# Pass vars to crc cli https://review.rdoproject.org/cgit/config/tree/playbooks/crc/simple-start.yaml#n30
crc_parameters: '--memory 16000 --disk-size 80 --cpus 6' # Increase from 14336

# this will go away eventually
- job:
name: stf-multi-crc-base
abstract: true
description: |
Temperory base job for crc jobs; the crc jobs will eventually use stf-base as a job, once PRs have merged
parent: stf-base
# Little hacky-hack so it won't complain about scenario not being defined.
vars:
scenario: "zuul-common"
run:
- ci/check_ocp_version.yml
post-run:
- ci/post-debug_crc.yml
# Add these steps so we can work around the pre stage failing, and investigate whether CRC actually comes up, and whether it runs STF
#- ci/prepare.yml
#- ci/deploy_stf.yml
#- ci/test_stf.yml
- ci/post-collect_logs.yml
- ci/post-upload_logs.yml

- job:
name: stf-crc-nightly_bundles
parent: stf-base
Expand All @@ -39,7 +62,7 @@
Deploy STF using the nightly bundles
vars:
scenario: "nightly_bundles"

- job:
name: stf-crc-local_build
parent: stf-base
Expand Down Expand Up @@ -106,6 +129,25 @@
vars:
crc_ocp_bundle: 'https://mirror.openshift.com/pub/openshift-v4/clients/crc/bundles/openshift/4.13.14/crc_libvirt_4.13.14_amd64.crcbundle'

- job:
name: stf-crc-ocp414
parent: stf-multi-crc-base
nodeset: centos-9-crc-3xl
vars:
# get oc status took 25 attempts/2min 39 sec with 16GB ram
# https://review.rdoproject.org/zuul/build/6162196471fe4db6891635f324eb8c30/console#4/1/4/controller
# get oc status took 19 attempts/1m58sec
# https://review.rdoproject.org/zuul/build/b2e3082a56ca43a5815acbe0c074b0eb/console#4/1/4/controller
# crc_parameters: '--memory 20000 --disk-size 80 --cpus 8'
# https://review.rdoproject.org/zuul/build/78feca3ce9e5495fbb3ebf811fabaa78/console#4/1/4/controller
# 16 attempts/1m36s
# crc_parameters: '--memory 25000 --disk-size 80 --cpus 8'
# node only has 30GB
# https://review.rdoproject.org/zuul/build/bc1b6c41fb1b47208958469bb39fa1f1/console
crc_parameters: '--memory 30000 --disk-size 80 --cpus 8'
crc_ocp_bundle: 'https://mirror.openshift.com/pub/openshift-v4/clients/crc/bundles/openshift/4.14.1/crc_libvirt_4.14.1_amd64.crcbundle'
ocp_version: '4.14.1'

- project-template:
name: stf-crc-jobs
description: |
Expand All @@ -118,8 +160,11 @@
- stf-crc-ocp_413-nightly_bundles
- stf-crc-ocp_413-local_build
- stf-crc-ocp_413-local_build-index_deploy

- project:
name: infrawatch/service-telemetry-operator
templates:
- stf-crc-jobs
#templates:
# - stf-crc-jobs
github-check:
jobs:
- stf-crc-ocp414
18 changes: 18 additions & 0 deletions ci/check_ocp_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- hosts: controller
tasks:
- name: "Log into the cluster"
ansible.builtin.import_role:
name: rhol_crc
tasks_from: add_crc_creds.yml

- name: "Get the oc version info"
ansible.builtin.shell:
cmd: |
oc version | grep Server | cut -d' ' -f3
register: oc_version

- name: "Fail if the version is not the expected one"
when: oc_version.stdout != ocp_version
fail:
msg: "The ocp version ({{ oc_version.stdout }}) is not the expected one ({{ ocp_version }})"
83 changes: 83 additions & 0 deletions ci/post-debug_crc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
- hosts: controller
name: "Wait for 4.14 to work"
tasks:
- name: Get crc logs
ansible.builtin.shell:
cmd: |
cat ~/crc-start.log
register: cat

- name: "Show crc start logs"
ansible.builtin.debug:
var: cat.stdout

- name: "Get crc info"
ansible.builtin.shell:
cmd: |
crc version

- name: "Run crc status"
ansible.builtin.shell:
cmd: |
crc status

- name: "Get the cache dir for crc"
ansible.builtin.shell:
cmd: |
crc status | grep "Cache Directory" | cut -d' ' -f3
register: cache_dir

- name: Get crc status in json format
ansible.builtin.shell:
cmd: |
crc status -o json

- name: "Show the contents of of cache dir"
ansible.builtin.shell:
cmd: |
ls {{ cache_dir.stdout }} | grep {{ crc_ocp_bundle | basename }}
ls {{ cache_dir.stdout }}/{{ crc_ocp_bundle | basename | splitext | first }}/

- name: "Set the name for kubeconfig"
ansible.builtin.set_fact:
kubeconfig: "{{ cache_dir.stdout }}/{{ crc_ocp_bundle | basename | splitext | first }}/kubeconfig"

- name: Get oc status from crc
ansible.builtin.shell:
cmd:
crc status -o json

- name: "Get oc status"
ansible.builtin.shell:
cmd: |
KUBECONFIG={{ kubeconfig }} oc status
register: output
ignore_errors: true
retries: 100
delay: 6
until: output.rc == 0

- name: Get oc status from crc
ansible.builtin.shell:
cmd:
crc status -o json
register: crc_status

- ansible.builtin.debug:
var: crc_status | from_json

- ansible.builtin.set_fact:
crc_status_json: "{{ crc_status | from_json }}"

- name: "Link the KUBECONFIG file to ~/.kube/config"
ansible.builtin.shell:
cmd: |
unlink ~/.kube/config || true
ln -s {{ kubeconfig }} ~/.kube/config
ignore_errors: true

- name: "Get oc status"
ansible.builtin.shell:
cmd: |
oc status
35 changes: 35 additions & 0 deletions ci/post-upload_logs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- hosts: all
name: Copy files from controller on node
gather_facts: false
tasks:
- name: "Set the sto_dir if it isn't already set"
ansible.builtin.set_fact:
sto_dir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/infrawatch/service-telemetry-operator"].src_dir }}'
when: sto_dir | default('') | length == 0

- name: "Get vars common to all jobs"
ansible.builtin.include_vars:
file: "vars-zuul-common.yml"

- name: "Get scenario-specific vars"
ansible.builtin.include_vars:
file: "vars-{{ scenario }}.yml"

- name: "Create log dir"
ansible.builtin.file:
path: "{{ logfile_dir }}"
state: directory
mode: "0755"

- name: "Copy generated logs"
ansible.builtin.shell: |
cp {{ ansible_env.HOME }}/*.log .
args:
chdir: "{{ logfile_dir }}"
changed_when: true
ignore_errors: true

- name: Copy files from controller on node
ansible.builtin.include_role:
name: fetch-output