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 37 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
168ed71
NO-ISSUE: Update oci e2e test
adriengentil Nov 22, 2024
878cb9e
wait
adriengentil Nov 22, 2024
6c50890
remove pause
adriengentil Nov 22, 2024
3bf8392
upgrade all packages and reboot
adriengentil Nov 22, 2024
56b67b9
create shared dir with tes-infra to store OCI artifacts
adriengentil Nov 22, 2024
6f1f19f
update terraform URL
adriengentil Nov 25, 2024
b8f5e29
set service url
adriengentil Nov 25, 2024
415d13e
infra is at the root of zip
adriengentil Nov 25, 2024
d256243
test
adriengentil Nov 29, 2024
e53d022
use log instead of print
adriengentil Dec 2, 2024
780e2e9
increase timeout
adriengentil Dec 3, 2024
a32b733
add OCI custom manifests to cluster
adriengentil Dec 3, 2024
82f2aac
add cleanup back
adriengentil Dec 6, 2024
b29bdf0
exclude preauth request from cleanup
adriengentil Dec 6, 2024
840a8e5
specify right service and image base url
adriengentil Dec 6, 2024
06b10f8
update success condition after stack is applied
adriengentil Dec 6, 2024
bddf8ea
oci returns no nodes
adriengentil Dec 9, 2024
60b2cac
don't change that
adriengentil Dec 9, 2024
c839bc4
list and extract nics from OCI
adriengentil Dec 10, 2024
b47bfb1
fix
adriengentil Dec 10, 2024
8d2420b
fix
adriengentil Dec 11, 2024
cc3f642
fix
adriengentil Dec 11, 2024
ede220e
fix
adriengentil Dec 11, 2024
144830f
don't delete resources
adriengentil Dec 11, 2024
b2fb661
add role property to node object
adriengentil Dec 12, 2024
ac41fa3
fix
adriengentil Dec 12, 2024
75e77a9
fix
adriengentil Dec 12, 2024
cfad37e
fix
adriengentil Dec 12, 2024
c38339a
fix
adriengentil Dec 12, 2024
f63b976
fix
adriengentil Dec 12, 2024
3ab5bc9
fix
adriengentil Dec 13, 2024
26a234d
fix
adriengentil Dec 13, 2024
748506c
fix
adriengentil Dec 13, 2024
f825841
remove old terraform oci controller
adriengentil Jan 30, 2025
54d97b8
destroy OCI nodes
adriengentil Feb 4, 2025
1898d9b
use oracle linux using other OSes is painful because of the agreement…
adriengentil Feb 4, 2025
e0a44ac
pin rocky linux image
adriengentil Feb 5, 2025
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
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ destroy_nutanix:
destroy_vsphere:
PLATFORM=vsphere make destroy_terraform_controller

destroy_oci:
PLATFORM=oci make destroy_terraform_controller

#######
# Run #
#######
Expand Down
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 }}"
4 changes: 2 additions & 2 deletions ansible_files/oci_generic_destroy_ci_machine_playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- name: Destroy OCI instrastructure provisionned by test-infra
ansible.builtin.shell: |
source /root/config.sh
make destroy_oci
make destroy_nodes_oci
args:
chdir: /home/assisted
retries: 5
Expand All @@ -24,4 +24,4 @@
vars:
oci_terraform_workdir: "{{ [playbook_dir, '..', 'terraform_files', 'oci-ci-machine'] | path_join | realpath }}"
roles:
- name: oci/destroy_infra
- name: oci/destroy_infra
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