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

MGMT-19450: Update oci e2e test #2573

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d8406b2
NO-ISSUE: Update oci e2e test
adriengentil Nov 22, 2024
5d2915d
wait
adriengentil Nov 22, 2024
9cc7f3e
remove pause
adriengentil Nov 22, 2024
6abf4b4
upgrade all packages and reboot
adriengentil Nov 22, 2024
acc6f5a
create shared dir with tes-infra to store OCI artifacts
adriengentil Nov 22, 2024
7c10d67
update terraform URL
adriengentil Nov 25, 2024
f0c6677
set service url
adriengentil Nov 25, 2024
cf65194
infra is at the root of zip
adriengentil Nov 25, 2024
0ffc7b3
test
adriengentil Nov 29, 2024
a4a5418
use log instead of print
adriengentil Dec 2, 2024
c20fa1d
increase timeout
adriengentil Dec 3, 2024
6e18d39
add OCI custom manifests to cluster
adriengentil Dec 3, 2024
be716b6
add cleanup back
adriengentil Dec 6, 2024
0bfedd9
exclude preauth request from cleanup
adriengentil Dec 6, 2024
0396232
specify right service and image base url
adriengentil Dec 6, 2024
c95fba4
update success condition after stack is applied
adriengentil Dec 6, 2024
784435c
oci returns no nodes
adriengentil Dec 9, 2024
474865f
don't change that
adriengentil Dec 9, 2024
dd090fa
list and extract nics from OCI
adriengentil Dec 10, 2024
b2fe8c9
fix
adriengentil Dec 10, 2024
7f157e3
fix
adriengentil Dec 11, 2024
778bee3
fix
adriengentil Dec 11, 2024
485d641
fix
adriengentil Dec 11, 2024
26456ad
don't delete resources
adriengentil Dec 11, 2024
5db081c
add role property to node object
adriengentil Dec 12, 2024
68f05ba
fix
adriengentil Dec 12, 2024
6220e90
fix
adriengentil Dec 12, 2024
f31e96e
fix
adriengentil Dec 12, 2024
a73e064
fix
adriengentil Dec 12, 2024
29b5f2c
fix
adriengentil Dec 12, 2024
447e41f
fix
adriengentil Dec 13, 2024
42fce11
fix
adriengentil Dec 13, 2024
cb15874
fix
adriengentil Dec 13, 2024
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
1 change: 0 additions & 1 deletion ansible_files/oci_generic_create_ci_machine_playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@
- name: oci/setup_oci_for_test_infra
vars:
ci_machine: "{{ groups['primary'][0] }}"
infra: "{{ deployed_tf.outputs.infra.value }}"
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ excluded_types:
- oci_network_load_balancer_backend
- oci_network_load_balancer_backend_set
- oci_network_load_balancer_listener
- oci_objectstorage_preauthrequest
expired_after_hours: 7
14 changes: 12 additions & 2 deletions ansible_files/roles/oci/create_infra/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ansible.builtin.template:
src: "terraform.tfvars.j2"
dest: "{{ oci_tf_vars_file }}"
mode: 0644
mode: '0644'

- name: "Deploy Terraform Instance"
community.general.terraform:
Expand All @@ -17,7 +17,7 @@
ansible.builtin.copy:
src: "{{ oci_terraform_workdir }}/terraform.tfstate"
dest: "{{ oci_tf_state_file }}"
mode: 0644
mode: '0644'
when: oci_tf_state_file is defined

- name: "Add ci_machine to inventory"
Expand All @@ -36,3 +36,13 @@
delay: 30
register: result
until: result is succeeded

- name: Update all packages on host
ansible.builtin.dnf:
name: "*"
state: latest
delegate_to: "{{ deployed_tf.outputs.ci_machine_inventory.value.display_name }}"

- name: Reboot machine
ansible.builtin.reboot:
delegate_to: "{{ deployed_tf.outputs.ci_machine_inventory.value.display_name }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
oci_compute_shape: "VM.Standard.E4.Flex"
oci_control_plane_shape: "VM.Standard.E4.Flex"

oci_infrastructure_zip_url: "https://github.com/dfoster-oracle/oci-openshift/releases/download/v1.0.0-preview/create-cluster-v0.1.0.zip"
oci_infrastructure_zip_file: "{{ hostvars[ci_machine].ansible_user_dir }}/oci/infrastructure.zip"

This file was deleted.

22 changes: 16 additions & 6 deletions ansible_files/roles/oci/setup_oci_for_test_infra/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: Directory where OCI private key will be stored
ansible.builtin.set_fact:
oci_private_key_path_ci_machine: "{{ hostvars[ci_machine].ansible_user_dir }}/.oci/{{ oci_private_key_path | basename }}"
custom_manifests_dir: "{{ hostvars[ci_machine].ansible_user_dir }}/custom_manifests"
oci_ci_machine_public_ip: "{{ hostvars[ci_machine].ansible_host }}"

- name: Create directory where OCI private key will be stored on CI machine
ansible.builtin.file:
Expand All @@ -17,14 +17,24 @@
mode: '0600'
delegate_to: "{{ ci_machine }}"

- name: Create directory where OCI infrastructure archive will be stored on CI machine
ansible.builtin.file:
path: "{{ oci_infrastructure_zip_file | dirname }}"
state: directory
mode: '0700'
delegate_to: "{{ ci_machine }}"

- name: Download terraform template to create the infrastructure on OCI
ansible.builtin.get_url:
url: "{{ oci_infrastructure_zip_url }}"
dest: "{{ oci_infrastructure_zip_file }}"
mode: '0600'
delegate_to: "{{ ci_machine }}"

- name: Export OCI configuration in assisted-additional-config to shared_dir
ansible.builtin.template:
src: "assisted-additional-config.j2"
dest: "{{ shared_dir }}/assisted-additional-config"
mode: 0644
mode: '0644'
when: shared_dir is defined

- name: Create OCI custom manifests
ansible.builtin.import_tasks:
file: custom_manifests.yml
delegate_to: "{{ ci_machine }}"
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,13 @@ export OCI_PRIVATE_KEY_PATH="{{ oci_private_key_path_ci_machine }}"
export OCI_PUBLIC_KEY_FINGERPRINT="{{ oci_fingerprint }}"
export OCI_TENANCY="{{ oci_tenancy_id }}"
export OCI_REGION="{{ oci_region }}"
export OCI_VCN="{{ infra.oci_vcn_id }}"
export OCI_PUBLIC_SUBNET="{{ infra.oci_public_subnet_id }}"
export OCI_PRIVATE_SUBNET="{{ infra.oci_private_subnet_id }}"

# CI machine to access nodes (connect on them through SSH)
# Nodes to access CI machine (assisted-service API through HTTP/HTTPS)
export OCI_EXTRA_NODE_NSG_IDS="{{ infra.oci_ci_machine_access_nsg_id }},{{ infra.oci_cluster_ci_nsg_id }}"
export OCI_INFRASTRUCTURE_ZIP_FILE="{{ oci_infrastructure_zip_file }}"
export OCI_COMPUTE_SHAPE="{{ oci_compute_shape }}"
export OCI_CONTROL_PLANE_SHAPE="{{ oci_control_plane_shape }}"

# CI machine to access load balancer (cluster access through HTTP/HTTPS/MCS/API)
export OCI_EXTRA_LOAD_BALANCER_NSG_IDS="{{ infra.oci_load_balancer_ci_nsg_id }}"

export BASE_DOMAIN="{{ oci_dns_zone }}"

export CUSTOM_MANIFESTS_FILES="{{ custom_manifests_dir }}"
export BASE_DOMAIN="{{ unique_id }}.{{ oci_dns_zone }}"
export SERVICE_URL="{{ oci_ci_machine_public_ip }}"

export HOST_INSTALLER_ARGS='{"args": ["--append-karg", "console=ttyS0"]}'
export KERNEL_ARGUMENTS='[{"operation": "append", "value": "console=ttyS0"}]'

This file was deleted.

This file was deleted.

Loading