Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 29 additions & 4 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
override-checkout: main
- name: github.com/openstack-k8s-operators/openstack-must-gather
override-checkout: main
pre-run:
- ci/pre-2node.yml
# pre-run:
# - ci/pre-2node.yml
vars:
cifmw_deploy_edpm: false
podified_validation: true
Expand Down Expand Up @@ -87,6 +87,8 @@
- name: github.com/infrawatch/sg-bridge
- name: github.com/infrawatch/sg-core
- name: github.com/infrawatch/prometheus-webhook-snmp
# I think this should be included here, and needs to have the crc credentials passed in.
# ... eventually
pre-run:
- ci/prepare.yml
run:
Expand Down Expand Up @@ -202,10 +204,33 @@
- stf-crc-ocp_416-nightly_bundles-index_deploy
- stf-crc-ocp_418-nightly_bundles-index_deploy

- job:
name: stf-crc-deployment
parent: stf-base-2node
description: |
A provider job that provisions CRC.
pre-run:
- ci/pre-2node.yml
run:
# It might be better to remove this later, since this does some stf-specific things.
- ci/prepare.yml
- ci/pause-the-job.yml
# Keep scenario for now, it sets some vars, which are set again once STF runs.
# This can get removed later
vars:
scenario: local_build

- project:
name: infrawatch/service-telemetry-operator
templates:
- stf-crc-jobs
# templates:
# - stf-crc-jobs
github-check:
jobs:
- stf-crc-deployment:
override-checkout: main
- stf-crc-ocp_416-local_build:
dependencies: stf-crc-deployment
- noop
periodic:
jobs:
- stf-crc-ocp_416-nightly_bundles
Expand Down
1 change: 1 addition & 0 deletions ci/common-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
ansible.builtin.include_vars:
file: "vars-zuul-common.yml"

# TODO: if using prepare for crc-provider, remove dependency on scenario
- name: "Get scenario-specific vars"
ansible.builtin.include_vars:
file: "vars-{{ scenario }}.yml"
16 changes: 16 additions & 0 deletions ci/pause-the-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- hosts: controller
tasks:
#- name: Get credentials
# import_role:
# <openshift_login>
- zuul_return:
data:
zuul:
pause: true
# need to return the login informatin for the crc
# this is needed by stf to access the cluster
# TODO: Change the names of the vars once we know they are set correctly.
provider_openshift_login_api: "https://api.crc.testing:6443"
provider_openshift_login_user: "kubeadmin"
provider_openshift_login_password: "12345678
6 changes: 6 additions & 0 deletions ci/pre-2node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
chdir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/openstack-k8s-operators/ci-framework"].src_dir }}'
target: "{{ item }}"
with_items:

- setup_tests
- setup_molecule

# Need to know what vars have been set.
# openshift_login role needs username/password
# cifmw_openshift_login_user and cifmw_openshift_login_password
# it also needs cifmw_openshift_login_api <- I think this should be returned from a provisioning job, unless it's a fixed value.
#
46 changes: 38 additions & 8 deletions ci/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- name: "Prepare the environment for running stf"
hosts: controller
tasks:
# NOTE: maybe this prepare isn't required in the CRC provider, since it is for STF...
# I can probably split this up into two playbooks, prepare and prepare STF.
# Prepare will run these tasks, common-tasks needs to remove the scenario-specific vars file, and it should be explicitly be included in the STF play
- name: "Setup play vars"
ansible.builtin.include_tasks: "common-tasks.yml"

Expand Down Expand Up @@ -35,16 +38,43 @@
- "kubernetes.core:5.0.0"
- "community.general"

- name: "Show the openshift cluster information from the provider"
ansible.builtin.debug:
msg: |
The provider_openshift_login_api value is {{ provider_openshift_login_api | default('unset')}}.
The provider_openshift_login_user is {{ provider_openshift_login_user | default('unset') }}
The provider_openshift_login_password is {{ provider_openshift_login_password | default('unset')}}


- name: Use creds to log in
shell:
cmd: |
oc login -u {{ provider_openshift_login_user }} -p {{ provider_openshift_login_password }} -s {{ provider_openstack_login_api }}


# this won't succeed, since it needs kubeconfig to be set
# Try using openshift_login instead, since the vars are already set from the provider job.
- name: "Log into the cluster"
ansible.builtin.import_role:
name: rhol_crc
tasks_from: add_crc_creds.yml

- name: "Create the service-telemetry project"
kubernetes.core.k8s:
api_version: v1
kind: Namespace
name: "{{ namespace }}"
state: present
retries: 3
delay: 30
## The vars are hardcoded for now, but will become vars later.
#- name: "Log into the cluster"
# ansible.builtin.import_role:
# name: openshift_login
# vars:
# cifmw_openshift_login_api: "https://api.crc.testing:6443"
# cifmw_openshift_login_user: "kubeadmin"
# cifmw_openshift_login_password: "12345678"

# After this point is specifically STF, which can be removed for now.
# This won't let STF pass, but it will be fine.
# - name: "Create the service-telemetry project"
# kubernetes.core.k8s:
# api_version: v1
# kind: Namespace
# name: "{{ namespace }}"
# state: present
# retries: 3
# delay: 30
2 changes: 1 addition & 1 deletion ci/vars-zuul-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ sgo_dir: "{{ ansible_env.HOME }}/{{ zuul.projects['github.com/infrawatch/smart-g
sg_core_dir: "{{ ansible_env.HOME }}/{{ zuul.projects['github.com/infrawatch/sg-core'].src_dir }}"
sg_bridge_dir: "{{ ansible_env.HOME }}/{{ zuul.projects['github.com/infrawatch/sg-bridge'].src_dir }}"
prometheus_webhook_snmp_dir: "{{ ansible_env.HOME }}/{{ zuul.projects['github.com/infrawatch/prometheus-webhook-snmp'].src_dir }}"
__service_telemetry_storage_persistent_storage_class: "crc-csi-hostpath-provisioner"
__service_telemetry_storage_persistent_storage_class: "crc-csi-hostpath-provisioner"
Loading