From 99cbf98fe79e656ff22d9e04fe8eedb43bd5cc48 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Wed, 31 Dec 2025 12:54:15 -0500 Subject: [PATCH 1/7] Update to ubuntu-24.04 --- .github/workflows/docker-openstudio.yml | 2 +- .github/workflows/manual_installer_test.yml | 2 +- Dockerfile | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-openstudio.yml b/.github/workflows/docker-openstudio.yml index ceb18f5..c9f9151 100644 --- a/.github/workflows/docker-openstudio.yml +++ b/.github/workflows/docker-openstudio.yml @@ -17,7 +17,7 @@ env: OPENSTUDIO_VERSION: 3.11.0 OPENSTUDIO_SHA: dee62bf9dd OPENSTUDIO_VERSION_EXT: "-rc1" - OPENSTUDIO_DOWNLOAD_URL: "https://openstudio-ci-builds.s3-us-west-2.amazonaws.com/develop/OpenStudio-3.11.0-rc1%2Bdee62bf9dd-Ubuntu-22.04-x86_64.deb" + OPENSTUDIO_DOWNLOAD_URL: "https://openstudio-ci-builds.s3-us-west-2.amazonaws.com/develop/OpenStudio-3.11.0-rc1%2Bdee62bf9dd-Ubuntu-24.04-x86_64.deb" permissions: contents: read diff --git a/.github/workflows/manual_installer_test.yml b/.github/workflows/manual_installer_test.yml index 459a093..01b4374 100644 --- a/.github/workflows/manual_installer_test.yml +++ b/.github/workflows/manual_installer_test.yml @@ -6,7 +6,7 @@ on: os_installer_link: description: 'The Link where to download the LINUX OpenStudio SDK Installer (.DEB)' required: true - default: 'https://github.com/NREL/OpenStudio/releases/download/v3.4.0/OpenStudio-3.4.0+4bd816f785-Ubuntu-20.04.deb' + default: 'https://github.com/NREL/OpenStudio/releases/download/v3.4.0/OpenStudio-3.4.0+4bd816f785-Ubuntu-24.04.deb' os_version: description: 'OS version (e.g. 3.4.0). Must match .deb installer' required: true diff --git a/Dockerfile b/Dockerfile index a753137..fcc555e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 AS base +FROM ubuntu:24.04 AS base LABEL maintainer="Nicholas Long nicholas.long@nrel.gov" @@ -34,9 +34,9 @@ RUN apt-get update && apt-get install -y \ && if [ -z "${OPENSTUDIO_DOWNLOAD_URL}" ]; then \ ESC_VERSION=$(echo "${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}" | sed 's/+/%2B/g'); \ if [ -n "${OPENSTUDIO_SHA}" ]; then \ - OPENSTUDIO_DOWNLOAD_URL="https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-${ESC_VERSION}%2B${OPENSTUDIO_SHA}-Ubuntu-22.04-x86_64.deb"; \ + OPENSTUDIO_DOWNLOAD_URL="https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-${ESC_VERSION}%2B${OPENSTUDIO_SHA}-Ubuntu-24.04-x86_64.deb"; \ else \ - OPENSTUDIO_DOWNLOAD_URL="https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-${ESC_VERSION}-Ubuntu-22.04-x86_64.deb"; \ + OPENSTUDIO_DOWNLOAD_URL="https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-${ESC_VERSION}-Ubuntu-24.04-x86_64.deb"; \ fi; \ fi \ && echo "OpenStudio Package Download URL is ${OPENSTUDIO_DOWNLOAD_URL}" \ From 97a715f0b94ebf6a5b1a5d3b25b0451da65a6168 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Thu, 8 Jan 2026 09:50:55 -0500 Subject: [PATCH 2/7] refine docker image tag logic in manual installer workflow and deploy script --- .github/workflows/manual_installer_test.yml | 2 +- deploy_docker.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual_installer_test.yml b/.github/workflows/manual_installer_test.yml index 01b4374..c648b8d 100644 --- a/.github/workflows/manual_installer_test.yml +++ b/.github/workflows/manual_installer_test.yml @@ -14,7 +14,7 @@ on: description: 'OS version extension (e.g. -alpha). Must match .deb installer' required: false docker_image_tag: - description: 'Docker image tag. Tag name will be prefixed with "dev-" unless tag = "develop"' + description: 'Docker image tag. If tag is "develop", it will be "develop". If tag matches a version pattern (e.g. 3.11.0-rc3), it will be used as-is. Otherwise, tag will be prefixed with "dev-".' required: true env: diff --git a/deploy_docker.sh b/deploy_docker.sh index 8490e1a..37342d0 100755 --- a/deploy_docker.sh +++ b/deploy_docker.sh @@ -23,6 +23,8 @@ fi if [ ! -z "${DOCKER_MANUAL_IMAGE_TAG}" ]; then if [ "${DOCKER_MANUAL_IMAGE_TAG}" == "develop" ]; then IMAGETAG="develop" + elif [[ "${DOCKER_MANUAL_IMAGE_TAG}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then + IMAGETAG="${DOCKER_MANUAL_IMAGE_TAG}" else IMAGETAG="dev-${DOCKER_MANUAL_IMAGE_TAG}" fi From 0576851c0ee7f680d4ffcddfc091f703aab1ddf0 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Mon, 18 May 2026 14:38:00 -0400 Subject: [PATCH 3/7] feat: add workflow_dispatch trigger with version inputs and apptainer_only flag Allows manually triggering a .sif build for any OpenStudio version (e.g. 3.10.0 final) without requiring a push to master/develop. - workflow_dispatch inputs: openstudio_version, openstudio_sha, openstudio_version_ext, apptainer_only - apptainer_only=true skips docker build/test, pulling directly from an existing Docker Hub image (nrel/openstudio:) - apptainer job now also runs on workflow_dispatch events - Resolve version inputs step writes dispatch inputs to GITHUB_ENV so empty openstudio_version_ext is handled correctly for final releases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/docker-openstudio.yml | 42 +++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-openstudio.yml b/.github/workflows/docker-openstudio.yml index c9f9151..9dc2022 100644 --- a/.github/workflows/docker-openstudio.yml +++ b/.github/workflows/docker-openstudio.yml @@ -1,6 +1,27 @@ name: openstudio-docker -on: [push, pull_request] +on: + push: + pull_request: + workflow_dispatch: + inputs: + openstudio_version: + description: 'OpenStudio version (e.g. 3.10.0)' + required: true + default: '3.11.0' + openstudio_sha: + description: 'OpenStudio git SHA' + required: true + default: 'dee62bf9dd' + openstudio_version_ext: + description: 'Version extension (e.g. -rc1). Leave empty for a final release.' + required: false + default: '-rc1' + apptainer_only: + description: 'Skip docker build/test and only build the .sif from an existing Docker Hub image' + required: false + default: 'false' + type: boolean # example of how to restrict to one branch and push event #on: @@ -31,7 +52,16 @@ jobs: with: python-version: '3.12.x' + - name: Resolve version inputs + if: ${{ github.event_name == 'workflow_dispatch' }} + shell: bash + run: | + echo "OPENSTUDIO_VERSION=${{ github.event.inputs.openstudio_version }}" >> $GITHUB_ENV + echo "OPENSTUDIO_SHA=${{ github.event.inputs.openstudio_sha }}" >> $GITHUB_ENV + echo "OPENSTUDIO_VERSION_EXT=${{ github.event.inputs.openstudio_version_ext }}" >> $GITHUB_ENV + - name: test and build + if: ${{ github.event.inputs.apptainer_only != 'true' }} shell: bash run: | set -euo pipefail @@ -57,7 +87,7 @@ jobs: apptainer: runs-on: ubuntu-24.04 needs: docker - if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/custom_branch_name' }} + if: ${{ github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/custom_branch_name' }} permissions: contents: read id-token: write @@ -67,6 +97,14 @@ jobs: with: python-version: '3.12.x' + - name: Resolve version inputs + if: ${{ github.event_name == 'workflow_dispatch' }} + shell: bash + run: | + echo "OPENSTUDIO_VERSION=${{ github.event.inputs.openstudio_version }}" >> $GITHUB_ENV + echo "OPENSTUDIO_SHA=${{ github.event.inputs.openstudio_sha }}" >> $GITHUB_ENV + echo "OPENSTUDIO_VERSION_EXT=${{ github.event.inputs.openstudio_version_ext }}" >> $GITHUB_ENV + - name: install apptainer shell: bash run: | From 04e38733710facb9d93ba31f50bdfdffc35dfb16 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Mon, 18 May 2026 14:55:37 -0400 Subject: [PATCH 4/7] fix: use setup job with GITHUB_OUTPUT to correctly resolve workflow_dispatch version inputs The previous approach used GITHUB_ENV writes to override top-level env: block vars, but empty string inputs were silently replaced with the input default value by GitHub before bash ever ran. Root cause (from research): when gh CLI passes --field key="" or a user leaves an input blank, GitHub substitutes the input's default: value. Also, the || operator in GHA expressions treats "" as falsy, so expressions like ${{ inputs.x || env.X }} always fall back to the env: value for empty inputs. Fix: introduce a setup job that uses GITHUB_OUTPUT to resolve version vars once in bash (where empty string is genuinely empty), and have docker and apptainer jobs consume them via needs.setup.outputs. Empty openstudio_version_ext (= final release) is now handled correctly because: - input default changed from '-rc1' to '' (so blank input stays blank) - bash assignment EXT="${{ inputs.openstudio_version_ext }}" with no || fallback preserves the empty string in GITHUB_OUTPUT Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/docker-openstudio.yml | 61 +++++++++++++++++-------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-openstudio.yml b/.github/workflows/docker-openstudio.yml index 9dc2022..e44e770 100644 --- a/.github/workflows/docker-openstudio.yml +++ b/.github/workflows/docker-openstudio.yml @@ -14,9 +14,9 @@ on: required: true default: 'dee62bf9dd' openstudio_version_ext: - description: 'Version extension (e.g. -rc1). Leave empty for a final release.' + description: 'Version extension (e.g. -rc1). Leave blank for a final release. Default: -rc1' required: false - default: '-rc1' + default: '' apptainer_only: description: 'Skip docker build/test and only build the .sif from an existing Docker Hub image' required: false @@ -44,22 +44,49 @@ permissions: contents: read jobs: + setup: + runs-on: ubuntu-24.04 + outputs: + openstudio_version: ${{ steps.resolve.outputs.openstudio_version }} + openstudio_sha: ${{ steps.resolve.outputs.openstudio_sha }} + openstudio_version_ext: ${{ steps.resolve.outputs.openstudio_version_ext }} + steps: + - name: Resolve version + id: resolve + shell: bash + run: | + # Start from workflow-level defaults + VERSION="${OPENSTUDIO_VERSION}" + SHA="${OPENSTUDIO_SHA}" + EXT="${OPENSTUDIO_VERSION_EXT}" + + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + # Override version/sha if provided (they are required inputs so always non-empty) + VERSION="${{ inputs.openstudio_version }}" + SHA="${{ inputs.openstudio_sha }}" + # Unconditionally assign ext — empty string IS a valid value (final release) + # Do NOT use || here: "" || "-rc1" evaluates to "-rc1" in GHA expressions + EXT="${{ inputs.openstudio_version_ext }}" + fi + + echo "openstudio_version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "openstudio_sha=${SHA}" >> "$GITHUB_OUTPUT" + echo "openstudio_version_ext=${EXT}" >> "$GITHUB_OUTPUT" + echo "Resolved: OpenStudio ${VERSION}${EXT} (${SHA})" + docker: + needs: setup runs-on: ubuntu-24.04 + env: + OPENSTUDIO_VERSION: ${{ needs.setup.outputs.openstudio_version }} + OPENSTUDIO_SHA: ${{ needs.setup.outputs.openstudio_sha }} + OPENSTUDIO_VERSION_EXT: ${{ needs.setup.outputs.openstudio_version_ext }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.12.x' - - name: Resolve version inputs - if: ${{ github.event_name == 'workflow_dispatch' }} - shell: bash - run: | - echo "OPENSTUDIO_VERSION=${{ github.event.inputs.openstudio_version }}" >> $GITHUB_ENV - echo "OPENSTUDIO_SHA=${{ github.event.inputs.openstudio_sha }}" >> $GITHUB_ENV - echo "OPENSTUDIO_VERSION_EXT=${{ github.event.inputs.openstudio_version_ext }}" >> $GITHUB_ENV - - name: test and build if: ${{ github.event.inputs.apptainer_only != 'true' }} shell: bash @@ -86,8 +113,12 @@ jobs: apptainer: runs-on: ubuntu-24.04 - needs: docker + needs: [setup, docker] if: ${{ github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/custom_branch_name' }} + env: + OPENSTUDIO_VERSION: ${{ needs.setup.outputs.openstudio_version }} + OPENSTUDIO_SHA: ${{ needs.setup.outputs.openstudio_sha }} + OPENSTUDIO_VERSION_EXT: ${{ needs.setup.outputs.openstudio_version_ext }} permissions: contents: read id-token: write @@ -97,14 +128,6 @@ jobs: with: python-version: '3.12.x' - - name: Resolve version inputs - if: ${{ github.event_name == 'workflow_dispatch' }} - shell: bash - run: | - echo "OPENSTUDIO_VERSION=${{ github.event.inputs.openstudio_version }}" >> $GITHUB_ENV - echo "OPENSTUDIO_SHA=${{ github.event.inputs.openstudio_sha }}" >> $GITHUB_ENV - echo "OPENSTUDIO_VERSION_EXT=${{ github.event.inputs.openstudio_version_ext }}" >> $GITHUB_ENV - - name: install apptainer shell: bash run: | From 8cce87e9d6d5cb691e4c557bb0d69d5967e8e048 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Mon, 18 May 2026 15:15:53 -0400 Subject: [PATCH 5/7] fix: only run CI once per PR by restricting push trigger to master/develop Previously the workflow triggered on all pushes AND pull_requests, causing every PR to show duplicate CI checks (one with '(push)' and one with '(pull_request)'). Restricting the push trigger to master/develop means: - PRs: CI runs once via pull_request event - Merges to master/develop: CI runs once via push event - Manual runs: workflow_dispatch still works as before Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/docker-openstudio.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker-openstudio.yml b/.github/workflows/docker-openstudio.yml index e44e770..f62b10c 100644 --- a/.github/workflows/docker-openstudio.yml +++ b/.github/workflows/docker-openstudio.yml @@ -2,6 +2,9 @@ name: openstudio-docker on: push: + branches: + - master + - develop pull_request: workflow_dispatch: inputs: From c834faf1cd9a0fddbaa4d68c35a07fcc5854616f Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Mon, 18 May 2026 15:17:47 -0400 Subject: [PATCH 6/7] ci: update workflow trigger to include pull requests on master and develop branches --- .github/workflows/docker-openstudio.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-openstudio.yml b/.github/workflows/docker-openstudio.yml index f62b10c..d465221 100644 --- a/.github/workflows/docker-openstudio.yml +++ b/.github/workflows/docker-openstudio.yml @@ -2,10 +2,10 @@ name: openstudio-docker on: push: + pull_request: branches: - master - develop - pull_request: workflow_dispatch: inputs: openstudio_version: From 66b15f81ed559dc0ce0e31fa15ab74afc9854993 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Mon, 18 May 2026 15:25:45 -0400 Subject: [PATCH 7/7] fix: restore pull_request trigger to correct workflow execution sequence --- .github/workflows/docker-openstudio.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-openstudio.yml b/.github/workflows/docker-openstudio.yml index d465221..f62b10c 100644 --- a/.github/workflows/docker-openstudio.yml +++ b/.github/workflows/docker-openstudio.yml @@ -2,10 +2,10 @@ name: openstudio-docker on: push: - pull_request: branches: - master - develop + pull_request: workflow_dispatch: inputs: openstudio_version: