Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

- name: Set base image suffix when build stream inputs present
ansible.builtin.set_fact:
base_image_suffix: "{{ ('-' ~ build_stream_job_id ~ '-' ~ (image_key | default(''))) | regex_replace('^-+', '') }}"
rhel_base_image_name: "{{ rhel_aarch64_base_image_name ~ ('-' ~ build_stream_job_id ~ '-' ~ (image_key | default(''))) | regex_replace('^-+', '') }}"
base_image_suffix: "_{{ build_stream_job_id }}-{{ image_key | default('') }}"
rhel_base_image_name: "{{ rhel_aarch64_base_image_name }}_{{ build_stream_job_id }}-{{ image_key | default('') }}"
when:
- enable_build_stream | bool
- (build_stream_job_id | default('') | length) > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- name: Set compute image suffix when build stream inputs present
ansible.builtin.set_fact:
compute_image_suffix: "{{ ('-' ~ build_stream_job_id ~ '-' ~ (image_key | default(''))) | regex_replace('^-+', '') }}"
compute_image_suffix: "_{{ build_stream_job_id }}-{{ image_key | default('') }}"
when:
- enable_build_stream | bool
- (build_stream_job_id | default('') | length) > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

- name: Set base image suffix when build stream inputs present
ansible.builtin.set_fact:
base_image_suffix: "{{ ('-' ~ build_stream_job_id ~ '-' ~ (image_key | default(''))) | regex_replace('^-+', '') }}"
rhel_base_image_name: "{{ rhel_x86_64_base_image_name ~ ('-' ~ build_stream_job_id ~ '-' ~ (image_key | default(''))) | regex_replace('^-+', '') }}"
base_image_suffix: "_{{ build_stream_job_id }}-{{ image_key | default('') }}"
rhel_base_image_name: "{{ rhel_x86_64_base_image_name }}_{{ build_stream_job_id }}-{{ image_key | default('') }}"
when:
- enable_build_stream | bool
- (build_stream_job_id | default('') | length) > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- name: Set compute image suffix when build stream inputs present
ansible.builtin.set_fact:
compute_image_suffix: "{{ ('-' ~ build_stream_job_id ~ '-' ~ (image_key | default(''))) | regex_replace('^-+', '') }}"
compute_image_suffix: "_{{ build_stream_job_id }}-{{ image_key | default('') }}"
when:
- enable_build_stream | bool
- (build_stream_job_id | default('') | length) > 0
Expand Down
2 changes: 1 addition & 1 deletion build_stream/infra/repositories/nfs_input_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def create_inventory_file(self, inventory_host: InventoryHost, job_id: str) -> P
inventory_file = inventory_dir / "inv"

# Create inventory content
inventory_content = f"[build_hosts]\n{inventory_host.value}\n"
inventory_content = f"[admin_aarch64]\n{inventory_host.value}\n"

# Write inventory file
with open(inventory_file, "w", encoding="utf-8") as f:
Expand Down
11 changes: 10 additions & 1 deletion discovery/roles/slurm_config/tasks/drain_and_remove_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,16 @@
Options:
1. Press Ctrl+C then 'A' to abort
2. Press Enter to force removal (jobs will be killed)
when: not force_scancel_node
when:
- not force_scancel_node
- not (enable_build_stream | default(false) | bool)

- name: Auto-force removal when build stream is enabled
ansible.builtin.debug:
msg: "{{ build_stream_auto_force_node_msg }}"
when:
- not force_scancel_node
- enable_build_stream | default(false) | bool

- name: Force cancel jobs if timeout reached
ansible.builtin.command: scancel -f -w {{ node_to_remove }}
Expand Down
12 changes: 11 additions & 1 deletion local_repo/roles/validation/tasks/validate_metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,21 @@
{{ metadata_warn_msg }}
Do you want to continue? (yes/no)
register: user_input
when: not metadata_compare.identical
when:
- not metadata_compare.identical
- not (enable_build_stream | default(false) | bool)

- name: Auto-continue when build stream is enabled
ansible.builtin.debug:
msg: "{{ build_stream_auto_accept_metadata_msg }}"
when:
- not metadata_compare.identical
- enable_build_stream | default(false) | bool

- name: Fail if user chooses not to continue
ansible.builtin.fail:
msg: "User choose not to continue due to metadata change."
when:
- not metadata_compare.identical
- not (enable_build_stream | default(false) | bool)
- user_input.user_input | lower != 'yes'
24 changes: 18 additions & 6 deletions prepare_oim/prepare_oim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
- name: Check if upgrade is in progress
ansible.builtin.import_playbook: ../utils/upgrade_checkup.yml

- name: Include input project directory
when: not project_dir_status | default(false) | bool
ansible.builtin.import_playbook: ../utils/include_input_dir.yml
tags: always

- name: Set_fact for fetch omnia config credentials
hosts: localhost
connection: local
Expand All @@ -24,7 +29,19 @@
- name: Set dynamic run tags including 'prepare_oim'
when: not config_file_status | default(false) | bool
ansible.builtin.set_fact:
omnia_run_tags: "{{ (ansible_run_tags | default([]) + ['prepare_oim']) + ['openldap'] | unique }}"
omnia_run_tags: >-
{{
(
ansible_run_tags | default([]) +
['prepare_oim', 'openldap', 'provision'] +
(
['slurm', 'slurm_custom', 'csi_driver_powerscale', 'ldms', 'telemetry']
if (lookup('file', hostvars['localhost']['input_project_dir'] ~ '/software_config.json')
| from_json).softwares | map(attribute='name') | list
else []
)
) | unique
}}
cacheable: true

- name: Invoke validate_config.yml to perform L1 and L2 validations with prepare_oim tag
Expand All @@ -34,11 +51,6 @@
- name: Invoke get_config_credentials.yml
ansible.builtin.import_playbook: ../utils/credential_utility/get_config_credentials.yml

- name: Include input project directory
when: not project_dir_status | default(false) | bool
ansible.builtin.import_playbook: ../utils/include_input_dir.yml
tags: always

- name: Create oim group and provision group
ansible.builtin.import_playbook: ../utils/create_container_group.yml
vars:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ watcher_cpu_quota: "50%"
build_stream_watcher_playbook_queue_base: "{{ oim_shared_path }}/omnia/playbook_queue"
watcher_poll_interval_seconds: 2
watcher_max_concurrent_jobs: 5
watcher_default_timeout_minutes: 30
watcher_default_timeout_minutes: 150
watcher_log_level: "INFO"

# Directory & File Modes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- >-
(field.file is not defined or field.file != credential_files[1].file_path) and
((vars[field.username] is not defined or vars[field.username] == "" or (vars[field.username] | length == 0)) and
(mandatory_credentials_status or conditional_mandatory_credentials_status))
(mandatory_credentials_status or conditional_mandatory_credentials_status or optional_credentials_status))
or
(field.file is defined and field.file == credential_files[1].file_path) and
(vars['build_stream_auth_username'] is not defined or vars['build_stream_auth_username'] == "" or
Expand All @@ -51,9 +51,26 @@
(vars['build_stream_auth_password_hash'] is not defined or vars['build_stream_auth_password_hash'] == "" or
(vars['build_stream_auth_password_hash'] is defined and (vars['build_stream_auth_password_hash'] | length == 0)))

# Initialize password status for optional credentials when username is provided and password is empty
- name: Initialize password status for optional credentials
ansible.builtin.set_fact:
password_status: true
when:
- field.password is defined
- field.password is not search('switch')
- field.file is not defined or field.file != credential_files[1].file_path
- optional_credentials_status | default(false) | bool
- vars[field.username] is defined
- vars[field.username] != ""
- vars[field.password] is defined
- (vars[field.password] == "" or (vars[field.password] | length == 0))

# Reset credential status after processing
- name: Reset credentials status
ansible.builtin.set_fact:
mandatory_credentials_status: false
conditional_mandatory_credentials_status: false
optional_credentials_status: false
username_status: false
password_status: false
when: reset_status | default(false)
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
ansible.builtin.set_fact:
mandatory_credentials_status: false
conditional_mandatory_credentials_status: false
optional_credentials_status: false
username_status: false
password_status: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# limitations under the License.
---

- name: Set optional credentials status
ansible.builtin.set_fact:
optional_credentials_status: true

- name: Notify user about optional inputs
ansible.builtin.debug:
msg: "{{ optional_warning_msg }}"
Expand All @@ -22,3 +26,7 @@
loop: "{{ type.value }}"
loop_control:
loop_var: field

- name: Reset optional credentials status
ansible.builtin.set_fact:
optional_credentials_status: false
4 changes: 4 additions & 0 deletions utils/credential_utility/roles/update_config/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ docker_hub_warning: |
Proceed to enter your Docker credentials if you want to avoid pull rate limits.
Press Enter.

# Build stream automation messages
build_stream_auto_force_node_msg: "Build stream is enabled, automatically forcing removal of node {{ node_to_remove }} (jobs will be killed)."
build_stream_auto_accept_metadata_msg: "Build stream is enabled, automatically accepting metadata changes."

omnia_credentials:
provision:
mandatory:
Expand Down