Skip to content

Commit

Permalink
Add RHEL base CI jobs; do not install some packages; add golang worka…
Browse files Browse the repository at this point in the history
…round

Part of our infra is already running on RHEL. We should
run tests also on that system.
Also removed packages that should be already installed in the system
or they are replaced later by pip package and updated
ansible-microshift-role commit SHA1 that contains patches to enable RHEL
support.

Change-Id: I6b3715335ccc606cba40b88f85f7aad1f0e7764c
  • Loading branch information
danpawlik committed Jan 16, 2025
1 parent a3fbc91 commit 9b23c92
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/dev/microshift/static/all.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sf_fqdn: {{ .FQDN }}

# The following variables will be used to check out the ansible-microshift-role role at a pinned version
microshift_role_path: "{{ .MicroshiftRolePath }}"
microshift_role_version: af71ceef51ad42b881dfdb3fd025839e6f9563ca
microshift_role_version: 6d8be500b4d434b9d98564e0f0a4d8739a328fce

# The following variables are used when the ansible-microshift-role role is called
disk_file_sparsed: true
Expand Down
1 change: 1 addition & 0 deletions roles/setup-env/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ install_requirements: true
microshift_fqdn: microshift.dev
microshift_role_path: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ansible-microshift-role"
os_host: ''
microshift_version: 4.16
60 changes: 58 additions & 2 deletions roles/setup-env/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
- name: Install packages
ansible.builtin.package:
name:
- git-review
- golang
- jq
- make
- podman
Expand All @@ -65,6 +63,24 @@
- kubernetes-client
when: ansible_distribution == "Fedora"

# NOTE: Tasks are required on multinode-deployment to get kubectl binary
# NOTE: The command needs to be executed via shell/command module
# not rhsm_repository modue, because it will raise an error on
# Centos deployment.
- name: Install openshift-client when RHEL
when: ansible_distribution | lower == 'redhat'
block:
- name: Enable RHOCP subscription using command
become: true
ansible.builtin.command: |
subscription-manager repos --enable rhocp-{{ microshift_version }}-for-rhel-9-{{ ansible_architecture }}-rpms
- name: Install openshift-clients
become: true
ansible.builtin.package:
name: openshift-clients
state: present

- name: Install python3-pip
ansible.builtin.package:
name:
Expand All @@ -78,3 +94,43 @@
- kubernetes
- oauthlib>=3.2.2
- websocket-client

# FIXME: Install golang package when 1.21 is available
# ERROR on `go build` for sf-operator:
# go: go.mod requires go >= 1.22.0 (running go 1.21.13; GOTOOLCHAIN=local)
- name: Configure TEMPORARY solution for Golang 1.22
when: ansible_distribution | lower == 'redhat'
block:
- name: Check golang version
ansible.builtin.package_facts:

- name: Install minimum version when Go binary is old
when:
- "'golang' in ansible_facts.packages"
- "ansible_facts.packages['golang'][0]['version'] is version('1.22.0', 'lt')"
block:
- name: Remove golang
become: true
ansible.builtin.package:
name: golang
state: absent

- name: Extract Go archive
become: true
ansible.builtin.unarchive:
src: https://go.dev/dl/go1.22.10.linux-amd64.tar.gz
dest: /usr/local
remote_src: true

- name: Create symlinks for go binary
become: true
ansible.builtin.file:
src: "/usr/local/go/bin/{{ item }}"
dest: "/usr/bin/{{ item }}"
state: link
loop:
- go
- gofmt

- name: Print golang version
ansible.builtin.command: go version
47 changes: 47 additions & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@
- 199.204.47.54
inject_dev_ssh_keys: true


- job:
name: sf-operator-rhel
parent: sf-operator-microshift-rhel
pre-run: *pre-run
post-run: *post-run
timeout: 5200
attempts: 5
run: playbooks/main.yaml
abstract: true
irrelevant-files: *irrelevant-files
vars: *vars

- job:
name: sf-operator-multinode
parent: sf-operator-microshift-multinode
Expand All @@ -53,6 +66,18 @@
irrelevant-files: *irrelevant-files
vars: *vars

- job:
name: sf-operator-multinode-rhel
parent: sf-operator-microshift-multinode-rhel
pre-run: *pre-run
post-run: *post-run
timeout: 5200
attempts: 5
run: playbooks/main.yaml
abstract: true
irrelevant-files: *irrelevant-files
vars: *vars

- secret:
name: zuul_quay_sf
data:
Expand Down Expand Up @@ -108,6 +133,28 @@
vars:
mode: "standalone"

- job:
name: sf-operator-olm-rhel
description: Validates a sf-operator deployment via OLM on RHEL
parent: sf-operator-rhel
vars:
mode: "olm"

- job:
name: sf-operator-upgrade-rhel
description: Validates a sf-operator upgrade via OLM on RHEL
parent: sf-operator-rhel
run: playbooks/upgrade.yaml
vars:
mode: "olm"

- job:
name: sf-operator-standalone-rhel
description: Validates a sf-operator standalone deployment in multinode on RHEL
parent: sf-operator-multinode-rhel
vars:
mode: "standalone"

- job:
name: sf-operator-ansible-lint
description: Lint Ansible playbooks located in playbooks directory
Expand Down
6 changes: 6 additions & 0 deletions zuul.d/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
- sf-operator-upgrade
- sf-operator-standalone
- sf-operator-ansible-lint
- sf-operator-olm-rhel
- sf-operator-upgrade-rhel
- sf-operator-standalone-rhel
gate:
jobs:
- sf-operator-vuln-check
- sf-operator-olm
- sf-operator-upgrade
- sf-operator-standalone
- sf-operator-ansible-lint
- sf-operator-olm-rhel
- sf-operator-upgrade-rhel
- sf-operator-standalone-rhel
release:
jobs:
- sf-operator-publish-olm-bundle-image
Expand Down

0 comments on commit 9b23c92

Please sign in to comment.