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

create pvs in crc #540

Closed
wants to merge 19 commits into from
Closed
11 changes: 11 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
# 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

- job:
name: pvs_crc
parent: stf-base
description: |
Create Pvs in crc Cluster
run:
- ci/define_pvs.yml
vars:
scenario: "nightly_bundles"
elfiesmelfie marked this conversation as resolved.
Show resolved Hide resolved

- job:
name: stf-crc-nightly_bundles
parent: stf-base
Expand Down Expand Up @@ -87,6 +97,7 @@
STF CRC jobs that build and deploy STF
github-check:
jobs:
- pvs_crc
- stf-crc-ocp_412-nightly_bundles
- stf-crc-ocp_412-local_build
- stf-crc-ocp_413-nightly_bundles
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These jobs take quite a while to run.

For testing, I recommend that you comment them out so that you can get results faster from the pvs_crc job.

Suggested change
- stf-crc-ocp_412-nightly_bundles
- stf-crc-ocp_412-local_build
- stf-crc-ocp_413-nightly_bundles
#- stf-crc-ocp_412-nightly_bundles
#- stf-crc-ocp_412-local_build
#- stf-crc-ocp_413-nightly_bundles

Expand Down
49 changes: 49 additions & 0 deletions ci/define_pvs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
- name: "Define Pvs"
hosts: controller
vars:
base_dir: "{{ ansible_user_dir }}"
tasks:
- name: "Log into the cluster"
ansible.builtin.import_role:
name: rhol_crc
tasks_from: add_crc_creds.yml

- name: Check if the install_yamls already exists
ansible.builtin.stat:
path: "{{ base_dir }}/install_yamls"
register: check_install_yamls_dir

- name: "Get Install yaml repo"
when: not check_install_yamls_dir.stat.exists
ansible.builtin.git:
repo: https://github.com/openstack-k8s-operators/install_yamls
dest: "{{ base_dir }}/install_yamls"

- name: Check if make command exists
ansible.builtin.command: "command -v make"
register: make_check_result
ignore_errors: true

- name: Install make if not present
ansible.builtin.package:
name: make
state: present
when: make_check_result.rc != 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package module should only install make if it doesn't already exist.
So this check and when are not needed

Suggested change
- name: Check if make command exists
ansible.builtin.command: "command -v make"
register: make_check_result
ignore_errors: true
- name: Install make if not present
ansible.builtin.package:
name: make
state: present
when: make_check_result.rc != 0
- name: Install make if not present
ansible.builtin.package:
name: make
state: present

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot that, thanks emma 😅


- name: Creating the Pvs
ansible.builtin.shell: make crc_storage
args:
chdir: "{{ base_dir }}/install_yamls/"

- name: Print make result
ansible.builtin.debug:
var: make_output

- name: Confirm Pvs exist
ansible.builtin.shell:
cmd: |
oc get pv | grep "storage..-crc"| wc -l
register: cmd_output
failed_when: "cmd_output.stdout|int !=12"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see some output here as well e.g. a debug.
You can use the ansible.builtin.fail module to check cmd_output.stdout_lines | length

Since we don't control the creation of the PVs, I would revise this test, since the number of lines may change without changing the PVs, for example.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IINM, we want to be able to use the PVs in the {{ namespace }} namespace/project [1], so there should be a check for that.

[1]

namespace: "service-telemetry"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes , this is not the final test , I believe I still need to create pvc to be used directly in the pods this create only the pvs , but wanted to check how the zuul will run it , so I created it as a draft pull request but this is not done yet


2 changes: 1 addition & 1 deletion ci/vars-nightly_bundles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__local_build_enabled: false
__deploy_from_bundles_enabled: true
__service_telemetry_storage_ephemeral_enabled: true
__service_telemetry_storage_ephemeral_enabled: false