-
Notifications
You must be signed in to change notification settings - Fork 162
Deploy build stream container #3869
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
Merged
abhishek-sa1
merged 18 commits into
dell:pub/build_stream
from
priti-parate:pub/build_stream
Jan 20, 2026
Merged
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c3079c8
deploy build stream container
priti-parate 29a8b7c
updating prepare oim
priti-parate 4285dd9
prepare OIM changes
priti-parate fef37c3
build stream container should be deployed after pulp container deploy…
priti-parate 43e24e6
add omnia_build_stream target
priti-parate 7dc979e
adding omnia build stream target
priti-parate f5daff7
adding cleanup
priti-parate 78fbef7
update copyright
priti-parate 851863d
pulp certification
priti-parate f92d4b5
Read pulp certification
priti-parate 8f72aaa
updating build stream deployment
priti-parate 1a25a5d
updating cleanup files
priti-parate 148038c
update copyright year
priti-parate 7e319c0
removing build stream files
priti-parate f6530bb
Updating verbosity and msgs in vars
priti-parate bb4ad6d
revert gather fact changes
priti-parate 8f2f8ab
adding rescue block
priti-parate e15a2fd
removed application based env variables
priti-parate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
181 changes: 181 additions & 0 deletions
181
prepare_oim/roles/deploy_containers/build_stream/tasks/deploy_build_stream.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| --- | ||
|
|
||
| # Check and remove existing build_stream container if running | ||
| - name: Check if omnia_build_stream service exists | ||
| ansible.builtin.systemd: | ||
| name: "{{ build_stream_container_name }}.service" | ||
| register: build_stream_service_status | ||
| failed_when: false | ||
|
|
||
| - name: Stop omnia_build_stream service if running | ||
| ansible.builtin.systemd: | ||
| name: "{{ build_stream_container_name }}.service" | ||
| state: stopped | ||
| enabled: false | ||
| when: build_stream_service_status.status is defined | ||
| failed_when: false | ||
|
|
||
| - name: Check if omnia_build_stream container exists | ||
| containers.podman.podman_container_info: | ||
| name: "{{ build_stream_container_name }}" | ||
| register: existing_container_info | ||
| failed_when: false | ||
|
|
||
| - name: Remove existing omnia_build_stream container | ||
| containers.podman.podman_container: | ||
| name: "{{ build_stream_container_name }}" | ||
| state: absent | ||
| when: existing_container_info.containers | length > 0 | ||
|
|
||
| # Get metadata and configuration | ||
| - name: Get metadata from omnia_core | ||
| containers.podman.podman_container_exec: | ||
| name: omnia_core | ||
| command: cat /opt/omnia/.data/oim_metadata.yml | ||
priti-parate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| register: metadata_content | ||
| changed_when: false | ||
|
|
||
| - name: Extract configuration from metadata | ||
| ansible.builtin.set_fact: | ||
| omnia_path: "{{ metadata_content.stdout | regex_search('oim_shared_path:\\s*(\\S+)', '\\1') | first }}" | ||
| share_option: "{{ metadata_content.stdout | regex_search('omnia_share_option:\\s*(\\S+)', '\\1') | first | default('') }}" | ||
| nfs_type: "{{ metadata_content.stdout | regex_search('nfs_type:\\s*(\\S+)', '\\1') | first | default('') }}" | ||
| pulp_server_ip: "{{ hostvars['localhost']['admin_nic_ip'] }}" | ||
| pulp_password: "{{ hostvars['localhost']['pulp_password'] }}" | ||
| no_log: true | ||
|
|
||
| - name: Set SELinux option for volume mounts | ||
| ansible.builtin.set_fact: | ||
| selinux_option: "{{ ':z' if (share_option != 'NFS' or nfs_type | default('') != 'external') else '' }}" | ||
|
|
||
| - name: Set Pulp base URL | ||
| ansible.builtin.set_fact: | ||
| pulp_base_url: "https://{{ pulp_server_ip }}:2225" | ||
|
|
||
| # Pull container image | ||
| - name: Pull omnia_build_stream image from Docker Hub | ||
| containers.podman.podman_image: | ||
| name: "{{ build_stream_image_name }}" | ||
| tag: "{{ build_stream_image_tag }}" | ||
| state: present | ||
| register: image_pull_result | ||
|
|
||
| - name: Display image pull result | ||
| ansible.builtin.debug: | ||
| msg: | ||
|
||
| - "Successfully pulled image from Docker Hub" | ||
| - "Image: {{ build_stream_image_name }}:{{ build_stream_image_tag }}" | ||
| when: image_pull_result is succeeded | ||
|
|
||
| # Create required directories | ||
| - name: Create log directory for omnia_build_stream | ||
| ansible.builtin.file: | ||
| path: "{{ build_stream_log_dir }}" | ||
| state: directory | ||
| mode: '0755' | ||
|
|
||
| - name: Create SSL certificate directory | ||
| ansible.builtin.file: | ||
| path: "{{ build_stream_ssl_dir }}" | ||
| state: directory | ||
| mode: '0755' | ||
|
|
||
| # Generate SSL certificates | ||
| - name: Check if SSL certificates already exist | ||
| ansible.builtin.stat: | ||
| path: "{{ build_stream_ssl_cert }}" | ||
| register: ssl_cert_stat | ||
|
|
||
| - name: Generate self-signed SSL certificate | ||
| ansible.builtin.command: | | ||
| openssl req -x509 -newkey rsa:4096 -nodes -days {{ build_stream_ssl_days }} | ||
| -keyout {{ build_stream_ssl_key }} | ||
| -out {{ build_stream_ssl_cert }} | ||
| -subj "/C=US/ST=State/L=City/O=Omnia/CN={{ ansible_hostname }}" | ||
| -addext "subjectAltName=DNS:{{ ansible_hostname }},DNS:localhost,IP:{{ ansible_default_ipv4.address }}" | ||
| when: not ssl_cert_stat.stat.exists | ||
| changed_when: true | ||
|
|
||
| - name: Set permissions on SSL certificates | ||
| ansible.builtin.file: | ||
| path: "{{ item }}" | ||
| mode: '0600' | ||
| loop: | ||
| - "{{ build_stream_ssl_cert }}" | ||
| - "{{ build_stream_ssl_key }}" | ||
|
|
||
| # Deploy container using Quadlet | ||
| - name: Create Quadlet service file | ||
| ansible.builtin.template: | ||
| src: build_stream.j2 | ||
| dest: "{{ build_stream_quadlet_path }}" | ||
| mode: '0644' | ||
|
|
||
| - name: Reload systemd to recognize Quadlet | ||
| ansible.builtin.systemd: | ||
| daemon_reexec: true | ||
|
|
||
| - name: Reload systemd daemon | ||
| ansible.builtin.systemd: | ||
| daemon_reload: true | ||
|
|
||
| - name: Start omnia_build_stream service | ||
| ansible.builtin.systemd: | ||
| name: "{{ build_stream_container_name }}.service" | ||
| state: started | ||
| enabled: true | ||
|
|
||
| # TODO: Uncomment when API server is implemented | ||
| # - name: Wait for container to be ready | ||
| # ansible.builtin.pause: | ||
| # seconds: "{{ container_ready_wait_seconds }}" | ||
| # | ||
| # - name: Verify API endpoint health | ||
| # ansible.builtin.uri: | ||
| # url: "{{ build_stream_health_endpoint }}" | ||
| # method: GET | ||
| # return_content: true | ||
| # status_code: "{{ health_check_status_code }}" | ||
| # validate_certs: false | ||
| # register: health_check | ||
| # retries: "{{ health_check_retries }}" | ||
| # delay: "{{ health_check_delay }}" | ||
| # until: health_check.status == health_check_status_code | ||
|
|
||
| # Configure firewall | ||
| - name: Ensure firewalld is running | ||
| ansible.builtin.systemd: | ||
| name: firewalld | ||
| state: started | ||
| enabled: true | ||
|
|
||
| - name: Open build_stream port in firewall | ||
| ansible.posix.firewalld: | ||
| port: "{{ build_stream_firewall_port }}" | ||
| permanent: true | ||
| state: enabled | ||
| immediate: true | ||
|
|
||
| # Display deployment status | ||
| - name: Display deployment status | ||
| ansible.builtin.debug: | ||
priti-parate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| msg: | ||
| - "{{ build_stream_deployment_success_msg }}" | ||
| - "Container: {{ build_stream_container_name }}" | ||
| - "Image: {{ build_stream_image_name }}:{{ build_stream_image_tag }}" | ||
| - "Pulp Server: {{ pulp_base_url }}" | ||
| - "SSL Verification: Enabled (using REQUESTS_CA_BUNDLE and SSL_CERT_FILE)" | ||
20 changes: 20 additions & 0 deletions
20
prepare_oim/roles/deploy_containers/build_stream/tasks/main.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| --- | ||
|
|
||
| - name: Deploy omnia_build_stream container | ||
| ansible.builtin.include_tasks: deploy_build_stream.yml | ||
| tags: | ||
| - build_stream |
36 changes: 36 additions & 0 deletions
36
prepare_oim/roles/deploy_containers/build_stream/templates/build_stream.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # =============================================================== | ||
| # omnia_build_stream Quadlet Service | ||
| # FastAPI Service for Omnia Build Stream Automation | ||
| # =============================================================== | ||
| [Unit] | ||
| Description=Omnia Build Stream FastAPI Container | ||
| After=omnia_core.service | ||
| Requires=omnia_core.service | ||
|
|
||
| [Container] | ||
| ContainerName={{ build_stream_container_name }} | ||
| HostName={{ build_stream_container_name }} | ||
| Image={{ build_stream_image_name }}:{{ build_stream_image_tag }} | ||
| Network=host | ||
|
|
||
| # Environment variables | ||
| Environment=OMNIA_ENV=production | ||
priti-parate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Environment=OMNIA_DEBUG=false | ||
| Environment=PULP_BASE_URL={{ pulp_base_url }} | ||
| Environment=PULP_USERNAME=admin | ||
| Environment=PULP_PASSWORD={{ pulp_password }} | ||
| Environment=PULP_VERIFY_SSL=true | ||
| Environment=REQUESTS_CA_BUNDLE=/etc/pulp/certs/pulp_webserver.crt | ||
| Environment=SSL_CERT_FILE=/etc/pulp/certs/pulp_webserver.crt | ||
|
|
||
| # Volume mounts (shared from omnia_core) | ||
| Volume={{ omnia_path }}/omnia:/opt/omnia{{ selinux_option }} | ||
| Volume={{ build_stream_log_dir }}:/var/log/omnia_build_stream{{ selinux_option }} | ||
| Volume={{ build_stream_ssl_dir }}:/etc/ssl/omnia:ro{{ selinux_option }} | ||
| Volume={{ pulp_certs_dir }}:/etc/pulp/certs:ro{{ selinux_option }} | ||
|
|
||
| [Service] | ||
| Restart=always | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target default.target | ||
54 changes: 54 additions & 0 deletions
54
prepare_oim/roles/deploy_containers/build_stream/vars/main.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| --- | ||
|
|
||
| # Build Stream Container Configuration | ||
| build_stream_container_name: "omnia_build_stream" | ||
|
|
||
| # Docker Hub configuration | ||
| build_stream_dockerhub_registry: "docker.io/dellhpcomniaaisolution" | ||
| build_stream_image_name: "{{ build_stream_dockerhub_registry }}/omnia_build_stream" | ||
| build_stream_image_tag: "1.0" | ||
| build_stream_port: 443 | ||
priti-parate marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| build_stream_log_dir: "{{ omnia_path }}/log/build_stream" | ||
|
|
||
| # SSL certificate configuration | ||
| build_stream_ssl_dir: "/opt/omnia/build_stream/ssl" | ||
| build_stream_ssl_cert: "{{ build_stream_ssl_dir }}/cert.pem" | ||
| build_stream_ssl_key: "{{ build_stream_ssl_dir }}/key.pem" | ||
| build_stream_ssl_days: 365 | ||
|
|
||
| # Pulp certificate configuration | ||
| pulp_certs_dir: "/opt/omnia/pulp/settings/certs" | ||
| pulp_webserver_cert: "{{ pulp_certs_dir }}/pulp_webserver.crt" | ||
|
|
||
| # Pulp server configuration - will be set dynamically during deployment | ||
| pulp_base_url: "https://{{ admin_nic_ip }}:2225" | ||
|
|
||
| # Quadlet service file path | ||
| build_stream_quadlet_path: "/etc/containers/systemd/{{ build_stream_container_name }}.container" | ||
|
|
||
| # Health check endpoint | ||
| build_stream_health_endpoint: "https://localhost:{{ build_stream_port }}/health" | ||
| container_ready_wait_seconds: 5 | ||
| health_check_retries: 5 | ||
| health_check_delay: 10 | ||
| health_check_status_code: 200 | ||
|
|
||
| # Firewall configuration | ||
| build_stream_firewall_port: "{{ build_stream_port }}/tcp" | ||
|
|
||
| # Messages | ||
| build_stream_deployment_success_msg: "omnia_build_stream container deployed successfully" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
prepare_oim/roles/deploy_containers/common/templates/omnia.service.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.