Skip to content

Commit 6d42a61

Browse files
Merge branch 'dell:pub/k8s_telemetry' into pub/k8s_telemetry
2 parents 5b88d9e + 69a485d commit 6d42a61

File tree

8 files changed

+70
-9
lines changed

8 files changed

+70
-9
lines changed

build_image_aarch64/roles/image_creation/tasks/build_compute_image.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
ansible-playbook {{ openchami_clone_path }}/dell/podman-quadlets/image.yaml \
5050
-i {{ aarch64_inventory_file }} -v \
5151
--extra-vars '@{{ openchami_dir }}/{{ item.key }}_compute_images.yaml' \
52-
-e "minio_s3_username={{ minio_s3_username }}" \
53-
-e "minio_s3_password={{ minio_s3_password }}" \
5452
--tags compute_image -v | \
5553
/usr/bin/tee '{{ openchami_log_dir }}/{{ item.key }}_compute_image.log'
5654
async: 3600 # Set async timeout (e.g., 1 hour)
@@ -68,14 +66,15 @@
6866
jid: "{{ item.ansible_job_id }}"
6967
register: job_result
7068
until: job_result.finished
69+
no_log: true
7170
retries: "{{ job_retry }}"
7271
delay: "{{ job_delay }}"
7372
loop: "{{ compute_image_build_job.results }}"
7473
loop_control:
7574
label: "{{ item.item.key }}"
7675

7776
rescue:
78-
- name: Fail explicitly if job failed
77+
- name: Failed to build the aarch64 compute image
7978
ansible.builtin.fail:
8079
msg: "{{ compute_image_failure_msg }}"
8180

build_image_aarch64/roles/image_creation/templates/compute_images_templates.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ group_name: "{{ item.key }}"
99
rhel_base_compute_mounts: {{ ochami_compute_mounts | join(' ') }}
1010
image_build_name: {{ ochami_aarch64_image | join (' ') }}
1111
rhel_base_compute_command_options: {{ ochami_base_command | join (' ') }}
12+
minio_s3_username: "{{ minio_s3_username }}"
13+
minio_s3_password: "{{ minio_s3_password }}"
1214

1315
rhel_repos:
1416
{% set rhel_repo = rhel_aarch64_repos %}

build_image_aarch64/roles/image_creation/vars/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ openchami_base_image_vars_template: "{{ role_path }}/templates/base_image_templa
4444
openchami_aarch64_base_image_vars_path: "/opt/omnia/openchami/aarch64_base_image_template.yaml"
4545
aarch64_inventory_file: "/tmp/temp_ochami_inventory.ini"
4646
base_image_failure_msg: "Base aarch64 image build job failed or timed out. Check logs at path {{ openchami_aarch64_base_image_log_path }} for details."
47-
compute_image_failure_msg: "Compute aarch64 image build job did not completed successfully."
47+
compute_image_failure_msg:
48+
"aarch64 compute image build job did not complete successfully.
49+
Check logs at {{ openchami_log_dir }} for respective functional group for more details."
4850

4951
# Usage: build_compute_image.yml
5052
openchami_compute_image_vars_template: "{{ role_path }}/templates/compute_images_templates.j2"

build_image_x86_64/roles/image_creation/tasks/build_compute_image.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@
5858
jid: "{{ item.ansible_job_id }}"
5959
register: job_result
6060
until: job_result.finished
61+
no_log: true
6162
retries: "{{ job_retry }}"
6263
delay: "{{ job_delay }}"
6364
loop: "{{ compute_image_build_job.results }}"
6465
loop_control:
6566
label: "{{ item.item.key }}"
6667

6768
rescue:
68-
- name: Fail explicitly if job failed
69+
- name: Failed to build the x86_64 compute image
6970
ansible.builtin.fail:
7071
msg: "{{ compute_image_failure_msg }}"
7172

build_image_x86_64/roles/image_creation/vars/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ openchami_x86_64_base_image_log_path: "{{ openchami_log_dir }}/x86_64_base_image
4343
openchami_base_image_vars_template: "{{ role_path }}/templates/base_image_template.j2"
4444
openchami_x86_64_base_image_vars_path: "/opt/omnia/openchami/x86_64_base_image_template.yaml"
4545
base_image_failure_msg: "Base x86_64 image build job failed or timed out. Check logs at path {{ openchami_x86_64_base_image_log_path }} for details."
46-
compute_image_failure_msg: "x86 image build job did not completed successfully. Check logs at path {{ openchami_log_dir }} for respective item"
46+
compute_image_failure_msg:
47+
"x86_64 compute image build job did not complete successfully.
48+
Check logs at {{ openchami_log_dir }} for respective functional group for more details."
4749

4850
# build_compute_image.yml
4951
openchami_compute_image_vars_template: "{{ role_path }}/templates/compute_images_templates.j2"

common/library/module_utils/input_validation/schema/telemetry_config.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,18 @@
4747
"properties": {
4848
"plugin_name": {
4949
"type": "string",
50-
"description": "Name of the LDMS sampler plugin"
50+
"enum": [
51+
"meminfo",
52+
"procstat2",
53+
"vmstat",
54+
"loadavg",
55+
"slurm_sampler",
56+
"procnetdev2"
57+
],
58+
"description": "Name of the LDMS sampler plugin. Must be one of the 6 supported plugin types: meminfo (memory usage), procstat2 (process statistics), vmstat (virtual memory), loadavg (system load), slurm_sampler (HPC workload monitoring), procnetdev2 (network interface statistics).",
59+
"errorMessage": {
60+
"enum": "Invalid plugin_name. Only 6 plugins are supported: meminfo, procstat2, vmstat, loadavg, slurm_sampler, procnetdev2"
61+
}
5162
},
5263
"config_parameters": {
5364
"type": "string",
@@ -101,7 +112,7 @@
101112
}
102113
}
103114
},
104-
"required": ["idrac_telemetry_support"],
115+
"required": ["idrac_telemetry_support", "ldms_sampler_configurations"],
105116
"$defs": {
106117
"kafka_configurations": {
107118
"type": "object",

common/library/module_utils/input_validation/validation_flows/provision_validation.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import re
2121
import itertools
2222
import csv
23+
import yaml
24+
from io import StringIO
2325
from ansible.module_utils.input_validation.common_utils import validation_utils
2426
from ansible.module_utils.input_validation.common_utils import config
2527
from ansible.module_utils.input_validation.common_utils import en_us_validation_msg
@@ -29,6 +31,15 @@
2931
create_error_msg = validation_utils.create_error_msg
3032
create_file_path = validation_utils.create_file_path
3133

34+
def load_oim_metadata(metadata_file_path):
35+
with open(metadata_file_path, 'r') as file:
36+
metadata = yaml.safe_load(file)
37+
return metadata
38+
39+
metadata_file_path = '/opt/omnia/.data/oim_metadata.yml'
40+
metadata = load_oim_metadata(metadata_file_path)
41+
oim_timezone = metadata['oim_timezone']
42+
3243
# Expected header columns (case-insensitive)
3344
required_headers = [
3445
"FUNCTIONAL_GROUP_NAME",
@@ -459,7 +470,26 @@ def validate_provision_config(
459470
timezone = data["timezone"]
460471
if not validation_utils.validate_timezone(timezone, timezone_file_path):
461472
errors.append(
462-
create_error_msg("timezone", timezone, en_us_validation_msg.TIMEZONE_FAIL_MSG)
473+
create_error_msg(
474+
"timezone",
475+
timezone,
476+
en_us_validation_msg.TIMEZONE_FAIL_MSG,
477+
)
478+
)
479+
480+
# Normalize input and system timezones for comparison
481+
input_timezone = (timezone or "").strip()
482+
system_timezone = (oim_timezone or "").strip()
483+
484+
# Compare both timezones (case-insensitive)
485+
if system_timezone.lower() != input_timezone.lower():
486+
errors.append(
487+
create_error_msg(
488+
""
489+
"timezone_mismatch detected between OIM host and provision_config.yml.",
490+
f"Provided input timezone : {input_timezone}, Detected oim timezone: {system_timezone}",
491+
"Timezone mismatch detected. Please ensure both timezones match; refer to timezone.txt.",
492+
)
463493
)
464494

465495
default_lease_time = data["default_lease_time"]

omnia.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,19 @@ validate_oim() {
620620
exit 1
621621
fi
622622

623+
# Detect OIM timezone from systemd in a stable, case‑independent way
624+
oim_timezone=$(timedatectl show -p Timezone --value 2>/dev/null)
625+
626+
# Fallbacks if needed (non‑systemd or old timedatectl)
627+
if [[ -z "$oim_timezone" ]]; then
628+
if [[ -f /etc/timezone ]]; then
629+
# Debian/Ubuntu style
630+
oim_timezone=$(< /etc/timezone)
631+
elif [[ -L /etc/localtime ]]; then
632+
# Derive from /etc/localtime symlink
633+
oim_timezone=$(readlink -f /etc/localtime | sed -n 's|^.*zoneinfo/||p')
634+
fi
635+
fi
623636

624637
podman --version
625638

@@ -740,6 +753,7 @@ EOF
740753
echo "oim_hostname: $(hostname)"
741754
echo "oim_node_name: $(hostname -s)"
742755
echo "domain_name: $domain_name"
756+
echo "oim_timezone: $oim_timezone"
743757
echo "omnia_core_hashed_passwd: $hashed_passwd"
744758
echo "omnia_share_option: $share_option"
745759
} >> "$oim_metadata_file"

0 commit comments

Comments
 (0)