From 0b606d5128f61c60e6c4f2a310e0b841c8d809c1 Mon Sep 17 00:00:00 2001 From: Brian Lin Date: Fri, 17 Apr 2026 17:52:32 -0500 Subject: [PATCH 1/3] Add support for pushing osg-htc project images --- .github/workflows/build-containers.yml | 17 +++++++++-------- scripts/build-job-matrix.py | 4 +--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index 7809dfe2..5829765b 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -30,7 +30,7 @@ jobs: - id: image-list run: | - ORG_DIR=opensciencegrid + ORG_DIR_REGEX="^(opensciencegrid|osg-htc)/" # Get the list of files changed based on the type of event # kicking off the GHA: # 1. For the main branch, diff the previous state of main vs @@ -54,7 +54,7 @@ jobs: images=$(git diff --name-only \ "$BASE" \ "$GITHUB_SHA" | - egrep "^$ORG_DIR/" | + grep -E "$ORG_DIR_REGEX" | cut -d/ -f -2 | sort | uniq | @@ -64,10 +64,11 @@ jobs: else # List all image root dirs. Example value: # "opensciencegrid/vo-frontend opensciencegrid/ospool-cm" - images=$(find $ORG_DIR -mindepth 1 \ - -maxdepth 1 \ - -type d \ - -printf "$ORG_DIR/%P\n") + images=$(find -mindepth 2 \ + -maxdepth 2 \ + -type d \ + -printf "%P\n" | + grep -E "${ORG_DIR_REGEX}") fi image_json=$(echo -n "${images:-dummy}" | jq -Rcs '.|split("\n") | map(select(. != ""))') @@ -124,7 +125,7 @@ jobs: BASE_OS=$(echo $CONFIG | awk -F'-' '{print $1}') OSG_SERIES=$(echo $CONFIG | awk -F'-' '{print $2}') BASE_REPO=$(echo $CONFIG | awk -F'-' '{print $3}') - CONTEXT="opensciencegrid/${{ matrix.name }}" + CONTEXT="${{ matrix.name }}" echo "BASE_OS=${BASE_OS}" >> $GITHUB_ENV echo "OSG_SERIES=${OSG_SERIES}" >> $GITHUB_ENV echo "BASE_REPO=${BASE_REPO}" >> $GITHUB_ENV @@ -176,7 +177,7 @@ jobs: BASE_OS=$(echo $CONFIG | awk -F'-' '{print $1}') OSG_SERIES=$(echo $CONFIG | awk -F'-' '{print $2}') BASE_REPO=$(echo $CONFIG | awk -F'-' '{print $3}') - CONTEXT="opensciencegrid/${{ matrix.name }}" + CONTEXT="${{ matrix.name }}" echo "BASE_OS=${BASE_OS}" >> $GITHUB_ENV echo "OSG_SERIES=${OSG_SERIES}" >> $GITHUB_ENV echo "BASE_REPO=${BASE_REPO}" >> $GITHUB_ENV diff --git a/scripts/build-job-matrix.py b/scripts/build-job-matrix.py index a8b86388..3b544892 100644 --- a/scripts/build-job-matrix.py +++ b/scripts/build-job-matrix.py @@ -35,8 +35,6 @@ def main(image_dirs): config = load_config(build_config_path, default_config) - image_name = os.path.basename(image_dir) - base_os_list = config['base_os'] osg_series_list = config['osg_series'] base_repo_list = config['base_repo'] @@ -56,7 +54,7 @@ def main(image_dirs): # 1. Simplicity: Using a single string to represent configurations is straightforward and easy to understand. # 2. Integration: A single string is easily passed to external tools and systems that manage builds. configuration_string = f"{base_os}-{osg_series}-{base_repo}-{config['standard_build']}-{config['repo_build']}" - include_list.append({"name": image_name, "config": configuration_string}) + include_list.append({"name": image_dir, "config": configuration_string}) sys.stdout.flush() json_output = json.dumps({"include": include_list}, indent=4) From 0415b8c23dacb76c34fe49e007a6aafebabad9c0 Mon Sep 17 00:00:00 2001 From: Brian Lin Date: Tue, 28 Jul 2026 11:51:39 -0500 Subject: [PATCH 2/3] Get rid of odd 'tail' from image matrix construction pipe line --- .github/workflows/build-containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index 5829765b..dafec15a 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -88,7 +88,7 @@ jobs: id: set-matrix run: | # Run Python script and capture JSON output - matrix_json=$(python scripts/build-job-matrix.py ${{ steps.image-list.outputs.images }} | tail -n +2) + matrix_json=$(python scripts/build-job-matrix.py ${{ steps.image-list.outputs.images }}) # Use jq to extract the 'include' part of the JSON matrix=$(echo "$matrix_json" | jq -c '.include') echo "::set-output name=matrix::$matrix" From 26ba05814ba6e74552bb85bf3f47454b44cb61a7 Mon Sep 17 00:00:00 2001 From: Brian Lin Date: Tue, 28 Jul 2026 11:52:17 -0500 Subject: [PATCH 3/3] Remove extraneous print statement We seemingly drop this on the floor, otherwise jq chokes on this input --- scripts/build-job-matrix.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/build-job-matrix.py b/scripts/build-job-matrix.py index 3b544892..e255c14e 100644 --- a/scripts/build-job-matrix.py +++ b/scripts/build-job-matrix.py @@ -22,8 +22,6 @@ def load_config(config_path, default_config=None): def main(image_dirs): - print("Image directories:", image_dirs) - default_config = load_config(DEFAULT_CONFIG_PATH) include_list = []