Skip to content

Commit ee86bf2

Browse files
authored
feat: Image Build Manager Refactoring (#4860)
* feat(build_manager): complete image build manager refactoring Signed-off-by: Abhishek S A <abhishek.sa3@dell.com> * Github flow update Signed-off-by: Abhishek S A <abhishek.sa3@dell.com> --------- Signed-off-by: Abhishek S A <abhishek.sa3@dell.com>
1 parent 99a5f7f commit ee86bf2

148 files changed

Lines changed: 3764 additions & 2150 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bandit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name: Bandit Security Scan
1212
- pub/telemetry
1313
- pub/q2_upgrade
1414
- pub/q2_ansible
15-
- q3_main
15+
- pub/q3_main
1616

1717
jobs:
1818
bandit:

.github/workflows/gitleaks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name: Secret Leak Scan
1212
- pub/telemetry
1313
- pub/q2_upgrade
1414
- pub/q2_ansible
15-
- q3_main
15+
- pub/q3_main
1616

1717
jobs:
1818
gitleaks:

.github/workflows/pip-audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name: Dependency Vulnerability Scan
1212
- pub/telemetry
1313
- pub/q2_upgrade
1414
- pub/q2_ansible
15-
- q3_main
15+
- pub/q3_main
1616

1717
jobs:
1818
pip-audit:

.github/workflows/pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name: Pylint
1010
- pub/build_stream
1111
- pub/telemetry
1212
- pub/q2_upgrade
13-
- q3_main
13+
- pub/q3_main
1414

1515
jobs:
1616
build:

.github/workflows/pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name: Unit Tests & Coverage
1212
- pub/telemetry
1313
- pub/q2_upgrade
1414
- pub/q2_ansible
15-
- q3_main
15+
- pub/q3_main
1616

1717
jobs:
1818
test:

.github/workflows/shellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name: ShellCheck
1212
- pub/telemetry
1313
- pub/q2_upgrade
1414
- pub/q2_ansible
15-
- q3_main
15+
- pub/q3_main
1616

1717
jobs:
1818
shellcheck:
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
#!/bin/bash
2+
3+
# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# =============================================================================
18+
# build_images.sh — BuildStream Container Build (Self-Contained)
19+
# =============================================================================
20+
# Builds the omnia_build_stream container (FastAPI build automation + S3).
21+
#
22+
# Usage:
23+
# ./build_images.sh # Build (default)
24+
# ./build_images.sh build_stream_tag=1.2 # Custom tag
25+
# ./build_images.sh build_tool=docker # Use docker
26+
# ./build_images.sh build_tool=docker build_action=push # Push to registry
27+
# ./build_images.sh registry=myregistry.io/myrepo # Custom registry
28+
#
29+
# Parameters:
30+
# build_stream_tag=<tag> Image tag (default: 1.1)
31+
# build_tool=<tool> podman | docker (default: podman)
32+
# build_action=<action> load | push (default: load)
33+
# registry=<url> Registry URL (default: docker.io/dellhpcomniaaisolution)
34+
# =============================================================================
35+
36+
set -euo pipefail
37+
38+
# ── Resolve paths ──
39+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
40+
41+
# ── Color codes ──
42+
RED='\033[0;31m'
43+
GREEN='\033[0;32m'
44+
BLUE='\033[34m'
45+
YELLOW='\033[1;33m'
46+
NC='\033[0m'
47+
48+
# =============================================================================
49+
# Show help
50+
# =============================================================================
51+
show_help() {
52+
echo -e "${GREEN}BuildStream Container Build Script${NC}"
53+
echo -e "${GREEN}======================================${NC}"
54+
echo ""
55+
echo -e "${BLUE}USAGE:${NC}"
56+
echo " ./build_images.sh [parameters]"
57+
echo ""
58+
echo -e "${BLUE}PARAMETERS (key=value format):${NC}"
59+
echo " build_stream_tag=<tag> Image tag (default: 1.1)"
60+
echo " build_tool=<tool> podman | docker (default: podman)"
61+
echo " build_action=<action> load | push (default: load)"
62+
echo " registry=<url> Registry URL (default: docker.io/dellhpcomniaaisolution)"
63+
echo ""
64+
echo -e "${BLUE}EXAMPLES:${NC}"
65+
echo " ./build_images.sh"
66+
echo " ./build_images.sh build_stream_tag=1.2"
67+
echo " ./build_images.sh build_tool=docker"
68+
echo " ./build_images.sh build_tool=docker build_action=push"
69+
echo " ./build_images.sh registry=myregistry.io/myrepo"
70+
echo ""
71+
echo -e "${BLUE}NOTES:${NC}"
72+
echo " - build_action=push requires build_tool=docker"
73+
echo " - Default registry: docker.io/dellhpcomniaaisolution"
74+
echo " - Builds the omnia_build_stream container (FastAPI + S3)"
75+
exit 0
76+
}
77+
78+
# =============================================================================
79+
# Default parameterized values
80+
# =============================================================================
81+
BUILD_TOOL="podman"
82+
BUILD_ACTION="load"
83+
OMNIA_DOCKER_REGISTERY="docker.io/dellhpcomniaaisolution"
84+
BUILD_STREAM_TAG="1.1"
85+
86+
# =============================================================================
87+
# Parse command-line parameters (key=value format)
88+
# =============================================================================
89+
for arg in "$@"; do
90+
case "$arg" in
91+
build_tool=*) BUILD_TOOL="${arg#*=}" ;;
92+
build_action=*) BUILD_ACTION="${arg#*=}" ;;
93+
registry=*) OMNIA_DOCKER_REGISTERY="${arg#*=}" ;;
94+
build_stream_tag=*) BUILD_STREAM_TAG="${arg#*=}" ;;
95+
-h|--help)
96+
show_help
97+
;;
98+
*)
99+
echo -e "${RED}Error: Unknown parameter '$arg'${NC}"
100+
echo -e "${YELLOW}Valid: build_stream_tag, build_tool, build_action, registry${NC}"
101+
exit 1
102+
;;
103+
esac
104+
done
105+
106+
# =============================================================================
107+
# Validate inputs
108+
# =============================================================================
109+
if [[ "$BUILD_TOOL" != "podman" && "$BUILD_TOOL" != "docker" ]]; then
110+
echo -e "${RED}Error: Invalid build_tool '${BUILD_TOOL}'. Valid: podman, docker${NC}"
111+
exit 1
112+
fi
113+
114+
if [[ "$BUILD_ACTION" != "load" && "$BUILD_ACTION" != "push" ]]; then
115+
echo -e "${RED}Error: Invalid build_action '${BUILD_ACTION}'. Valid: load, push${NC}"
116+
exit 1
117+
fi
118+
119+
if [[ "$BUILD_ACTION" == "push" && "$BUILD_TOOL" != "docker" ]]; then
120+
echo -e "${RED}Error: build_action=push requires build_tool=docker${NC}"
121+
exit 1
122+
fi
123+
124+
# =============================================================================
125+
# Build omnia_build_stream container
126+
# =============================================================================
127+
echo -e "${GREEN}=======================================${NC}"
128+
echo -e "${GREEN} BuildStream — Container Build ${NC}"
129+
echo -e "${GREEN}=======================================${NC}"
130+
echo -e "${BLUE}Build tool: ${BUILD_TOOL}${NC}"
131+
echo -e "${BLUE}Build action: ${BUILD_ACTION}${NC}"
132+
echo -e "${BLUE}Tag: ${BUILD_STREAM_TAG}${NC}"
133+
echo ""
134+
135+
BUILD_DIR="${SCRIPT_DIR}/omnia_build_stream"
136+
137+
cd "$BUILD_DIR" || exit 1
138+
139+
BUILD_RESULT=0
140+
141+
if [ "$BUILD_TOOL" = "podman" ]; then
142+
podman build -t "omnia_build_stream:${BUILD_STREAM_TAG}" -f "Containerfile" .
143+
BUILD_RESULT=$?
144+
elif [ "$BUILD_TOOL" = "docker" ]; then
145+
if [ "$BUILD_ACTION" = "load" ]; then
146+
docker buildx build --no-cache -t "omnia_build_stream:${BUILD_STREAM_TAG}" \
147+
--file "Containerfile" --platform "linux/amd64" --network=host --load .
148+
BUILD_RESULT=$?
149+
elif [ "$BUILD_ACTION" = "push" ]; then
150+
docker buildx build --no-cache \
151+
-t "${OMNIA_DOCKER_REGISTERY}/omnia_build_stream:${BUILD_STREAM_TAG}" \
152+
--file "Containerfile" --platform "linux/amd64" --network=host \
153+
--provenance=true --sbom=true --push .
154+
BUILD_RESULT=$?
155+
fi
156+
fi
157+
158+
cd - > /dev/null || exit 1
159+
160+
if [ $BUILD_RESULT -eq 0 ]; then
161+
echo -e "\n${GREEN}omnia_build_stream:${BUILD_STREAM_TAG} built successfully.${NC}"
162+
if [ "$BUILD_TOOL" = "docker" ] && [ "$BUILD_ACTION" = "push" ]; then
163+
echo -e "${GREEN}Pushed: ${OMNIA_DOCKER_REGISTERY}/omnia_build_stream:${BUILD_STREAM_TAG}${NC}"
164+
fi
165+
else
166+
echo -e "\n${RED}omnia_build_stream:${BUILD_STREAM_TAG} build FAILED.${NC}"
167+
exit 1
168+
fi

src/containers/omnia_build_stream/Containerfile renamed to src/build_stream/containers/omnia_build_stream/Containerfile

File renamed without changes.

src/containers/omnia_build_stream/init_s3cfg.sh renamed to src/build_stream/containers/omnia_build_stream/init_s3cfg.sh

File renamed without changes.

src/containers/omnia_build_stream/pyproject.toml renamed to src/build_stream/containers/omnia_build_stream/pyproject.toml

File renamed without changes.

0 commit comments

Comments
 (0)