-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add job to run kuttl without install_yamls #2571
base: main
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9758ec8
to
df95669
Compare
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/8cb680713d79422991d1aa87aaac0caa ✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 42m 00s |
403e323
to
61a85b4
Compare
In the depends-on PR, a new job definition is introduced that runs kuttl tests following the pattern used in nova-operator. This is done mainly to reuse the job definition for watcher-operator, which has just introduced kuttl testing following the same pattern. This change modifies the nova job to use the same parent. Depends-On: openstack-k8s-operators/ci-framework#2571
61a85b4
to
b66bb52
Compare
tested the job definition by changing the nova-operator kuttl job to use it in openstack-k8s-operators/nova-operator#902 , job is passing openstack-k8s-operators/nova-operator#902 (comment) |
also got a green run from the watcher-operator version https://softwarefactory-project.io/zuul/t/rdoproject.org/build/6ed0fe8ce7ed433ca20ec7bbd71e9095 via openstack-k8s-operators/watcher-operator#14 |
This job uses a parent job defined in [1] based on the existing nova-operator. [1] openstack-k8s-operators/ci-framework#2571
ci/playbooks/kuttl/deploy-deps.yaml
Outdated
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" | ||
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not passing this environment vars as part of the block to avoid repeating the same thing 4 times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, done
ci/playbooks/kuttl/deploy-deps.yaml
Outdated
- name: Check we have some compute in inventory | ||
ansible.builtin.set_fact: | ||
has_compute: >- | ||
{% set ns = namespace(found=false) -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use a namespace, a regular var is enough. Moreover, this can be done without jinja2 scripts with plain ansible-jinja2 filters:
hostvars.keys() | select('search', '^compute.*') | length > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually we don't set a compute in the nodeset for this job. I carried this from the nova kuttl job, but it must be there for a different reason, since the kuttl nodeset does not have compute nodes. I'm removing this task
ci/playbooks/kuttl/deploy-deps.yaml
Outdated
- name: Assert that operator_name is set | ||
ansible.builtin.assert: | ||
that: | ||
- operator_name is defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we move this to line 8 we can safe some time/resources/bandwith if the assertion is not met.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks
ci/playbooks/kuttl/deploy-deps.yaml
Outdated
ansible.builtin.import_playbook: "../../../playbooks/01-bootstrap.yml" | ||
|
||
- hosts: "{{ cifmw_target_host | default('localhost') }}" | ||
name: install dev tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An un-capitalized playbook name looks strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ci/playbooks/kuttl/deploy-deps.yaml
Outdated
- has_compute | bool | ||
ansible.builtin.assert: | ||
that: | ||
- "'compute' in crc_ci_bootstrap_networks_out" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why enforcing the instance name? I mean, you already used a different criteria to check if a compute is available, based on a regex. I'd vote to stick to a fixed name or pick the first one that is called ^compute.*
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, removing this tasks as we won't have computes for kuttl
This change attempts to make the approach that nova-operator uses to run kuttl more generic, so it can be used in other operators that follow a similar patter in their tests, like watcher-operator.
b66bb52
to
903bc91
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have one comemnt inline but i bleive this is more or less good as is.
we can hook this via a zuul pre-run playbook in a child job but wanted to see if people tough having an actually ci framework hook was warranted or not.
oc wait InstallPlan {{ cifmw_edpm_prepare_wait_installplan_out.stdout }} | ||
--namespace=openstack-operators | ||
--for=jsonpath='{.status.phase}'=Complete --timeout=20m | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may want to have a hook here to install operators that are not part of the meta operator or other customisation.
i.e. we need to be able to install watcher operator here after the OpenStack operator is installed.
the "make kuttl-test-prep" should not actually depend on the operator its testing being installed so this will still work as we can add a pre-run playbook to the job that inherits form this so its not a blocker.
we have a hookpoint as a result of that but just wanted to highlight this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to illustrate how we do it in watcher-operator here is the hook to install it https://github.com/openstack-k8s-operators/watcher-operator/pull/14/files#diff-108978819c05ae183d88ec87959c2341a94cfc3f9465e3aeee82d554217b4f58R56
This change attempts to make the approach that nova-operator uses to run
kuttl more generic, so it can be used in other operators that follow
a similar patter in their tests, like watcher-operator.
Related: OSPRH-11424