-
Notifications
You must be signed in to change notification settings - Fork 142
Add new download cache validation #3528
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
Open
drosenfe
wants to merge
1
commit into
openstack-k8s-operators:main
Choose a base branch
from
drosenfe:downloadcache
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+103
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
roles/validations/tasks/edpm/download-cache-service.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| - name: Determine name of deployed NodeSet | ||
| environment: | ||
| KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" | ||
| PATH: "{{ cifmw_path }}" | ||
| cifmw.general.ci_script: | ||
| output_dir: "{{ cifmw_validations_basedir }}/artifacts" | ||
| script: >- | ||
| oc get -n {{ cifmw_validations_namespace }} osdpns --no-headers -o custom-columns=":metadata.name" | ||
| register: deployed_nodeset_name | ||
|
|
||
| - name: Clean cache on a compute node | ||
| become: true | ||
| ansible.builtin.command: | ||
| cmd: dnf clean all | ||
| delegate_to: "{{ cifmw_validations_edpm_check_node }}" | ||
|
|
||
| - name: Uninstall requested packages on a compute node | ||
| become: true | ||
| ansible.builtin.dnf: | ||
| name: "{{ item_cached_package }}" | ||
| state: absent | ||
| loop: "{{ cifmw_validations_cached_packages }}" | ||
| loop_control: | ||
| loop_var: item_cached_package | ||
| delegate_to: "{{ cifmw_validations_edpm_check_node }}" | ||
|
|
||
| # Packages are removed from cache when they are installed. Create a custom service | ||
| # that checks for cached packages. This service can be used to verify that packages | ||
| # have been properly cached by executing before a service that loads packages. | ||
| - name: Create custom service to verify cache on a compute node | ||
| environment: | ||
| KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" | ||
| PATH: "{{ cifmw_path }}" | ||
| cifmw.general.ci_script: | ||
| output_dir: "{{ cifmw_validations_basedir }}/artifacts" | ||
| script: | | ||
| oc apply -f - <<EOF | ||
| apiVersion: dataplane.openstack.org/v1beta1 | ||
| kind: OpenStackDataPlaneService | ||
| metadata: | ||
| name: check-cache | ||
| namespace: {{ cifmw_validations_namespace }} | ||
| spec: | ||
| playbookContents: | | ||
| - hosts: all | ||
| vars: | ||
| cached_package_list: {{ cifmw_validations_cached_packages }} | ||
| become: true | ||
| tasks: | ||
| {% raw %} | ||
| - name: Find all rpm packages cached on compute node | ||
| ansible.builtin.command: | ||
| cmd: find /var/cache/dnf/ -name "*.rpm" | ||
| register: dnf_cached_packages | ||
|
|
||
| - name: Verify all requested packages were cached | ||
| ansible.builtin.fail: | ||
| msg: "'{{ item_cached_package }}' package was not cached" | ||
| loop: "{{ cached_package_list }}" | ||
| loop_control: | ||
| loop_var: item_cached_package | ||
| when: item_cached_package+'-' not in dnf_cached_packages.stdout | ||
| {% endraw %} | ||
| EOF | ||
|
|
||
| - name: Create openstackdataplanedeployment for download cache service | ||
| environment: | ||
| KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" | ||
| PATH: "{{ cifmw_path }}" | ||
| cifmw.general.ci_script: | ||
| output_dir: "{{ cifmw_validations_basedir }}/artifacts" | ||
| script: | | ||
| oc apply -f - <<EOF | ||
| apiVersion: dataplane.openstack.org/v1beta1 | ||
| kind: OpenStackDataPlaneDeployment | ||
| metadata: | ||
| name: download-cache-service | ||
| namespace: {{ cifmw_validations_namespace }} | ||
| spec: | ||
| nodeSets: | ||
| - "{{ deployed_nodeset_name.stdout | trim }}" | ||
| ansibleLimit: | ||
| "{{ cifmw_validations_edpm_check_node }}" | ||
| servicesOverride: | ||
| - download-cache | ||
| - check-cache | ||
| - bootstrap | ||
| EOF | ||
|
|
||
| - name: Wait for download cache service deployment to be complete | ||
| environment: | ||
| KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" | ||
| PATH: "{{ cifmw_path }}" | ||
| cifmw.general.ci_script: | ||
| output_dir: "{{ cifmw_validations_basedir }}/artifacts" | ||
| script: >- | ||
| oc wait openstackdataplanedeployment download-cache-service | ||
| --namespace={{ cifmw_validations_namespace }} | ||
| --for=condition=ready | ||
| --timeout={{ 4 * cifmw_validations_timeout }}s | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.