From 99cbf98fe79e656ff22d9e04fe8eedb43bd5cc48 Mon Sep 17 00:00:00 2001 From: Alex Chapin Date: Wed, 31 Dec 2025 12:54:15 -0500 Subject: [PATCH 1/3] 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/3] 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 bf2400ae808fd929f9cf0028cd7009b0ed9e4cb0 Mon Sep 17 00:00:00 2001 From: Steven K Date: Thu, 5 Feb 2026 11:44:48 -0700 Subject: [PATCH 3/3] Add multi-architecture support (amd64 + arm64) This enables building Docker images for both linux/amd64 and linux/arm64 platforms, addressing the need for ARM64 support. Changes: - Dockerfile: Use TARGETARCH to dynamically select the correct OpenStudio package (x86_64 or arm64) based on the target platform - CI workflow: Add QEMU and Docker Buildx setup for cross-platform builds - deploy_docker.sh: Use `docker buildx build --push` with multi-platform support instead of separate tag/push commands This is possible because OpenStudio now provides ARM64 builds for Ubuntu (available since v3.8.0). Closes #85 Co-Authored-By: Claude Opus 4.5 --- .github/workflows/docker-openstudio.yml | 8 ++++++- Dockerfile | 8 +++++-- deploy_docker.sh | 32 +++++++++++++++---------- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker-openstudio.yml b/.github/workflows/docker-openstudio.yml index c9f9151..3b533db 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-24.04-x86_64.deb" + # Note: OPENSTUDIO_DOWNLOAD_URL is now constructed dynamically in the Dockerfile permissions: contents: read @@ -31,6 +31,12 @@ jobs: with: python-version: '3.12.x' + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: test and build shell: bash run: | diff --git a/Dockerfile b/Dockerfile index fcc555e..5d7bd07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,8 @@ ARG OPENSTUDIO_SHA="dee62bf9dd" # If OPENSTUDIO_DOWNLOAD_URL is not provided, construct a reasonable default using the # OpenStudio CI S3 pattern. Users can override by passing --build-arg OPENSTUDIO_DOWNLOAD_URL=... ARG OPENSTUDIO_DOWNLOAD_URL="" +# TARGETARCH is automatically set by Docker buildx (amd64, arm64, etc.) +ARG TARGETARCH ENV RC_RELEASE=TRUE ENV OS_BUNDLER_VERSION=2.4.10 ENV RUBY_VERSION=3.2.2 @@ -33,10 +35,12 @@ RUN apt-get update && apt-get install -y \ sudo \ && if [ -z "${OPENSTUDIO_DOWNLOAD_URL}" ]; then \ ESC_VERSION=$(echo "${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}" | sed 's/+/%2B/g'); \ + # Map Docker's TARGETARCH to OpenStudio's architecture naming convention \ + OS_ARCH=$([ "${TARGETARCH}" = "arm64" ] && echo "arm64" || echo "x86_64"); \ if [ -n "${OPENSTUDIO_SHA}" ]; then \ - OPENSTUDIO_DOWNLOAD_URL="https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-${ESC_VERSION}%2B${OPENSTUDIO_SHA}-Ubuntu-24.04-x86_64.deb"; \ + OPENSTUDIO_DOWNLOAD_URL="https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-${ESC_VERSION}%2B${OPENSTUDIO_SHA}-Ubuntu-24.04-${OS_ARCH}.deb"; \ else \ - OPENSTUDIO_DOWNLOAD_URL="https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-${ESC_VERSION}-Ubuntu-24.04-x86_64.deb"; \ + OPENSTUDIO_DOWNLOAD_URL="https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-${ESC_VERSION}-Ubuntu-24.04-${OS_ARCH}.deb"; \ fi; \ fi \ && echo "OpenStudio Package Download URL is ${OPENSTUDIO_DOWNLOAD_URL}" \ diff --git a/deploy_docker.sh b/deploy_docker.sh index 37342d0..9c6d942 100755 --- a/deploy_docker.sh +++ b/deploy_docker.sh @@ -32,29 +32,37 @@ fi # GITHUB_BASE_REF is only set on Pull Request events. Do not build those if [ "${IMAGETAG}" != "skip" ] && [[ -z "${GITHUB_BASE_REF}" ]]; then - echo "Tagging image as $IMAGETAG and pushing to ${DOCKER_REPO}" + echo "Building and pushing multi-arch image as $IMAGETAG to ${DOCKER_REPO}" echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin - # Tag versioned image - docker tag openstudio:latest ${DOCKER_REPO}:$IMAGETAG; (( exit_status = exit_status || $? )) + + # Build tags list + TAGS="--tag ${DOCKER_REPO}:${IMAGETAG}" # Only update and push 'latest' if this is a stable release (no extension) if [ -z "${OPENSTUDIO_VERSION_EXT}" ]; then - echo "Stable release detected. Updating and pushing '${DOCKER_REPO}:latest'" - docker tag openstudio:latest ${DOCKER_REPO}:latest; (( exit_status = exit_status || $? )) - docker push ${DOCKER_REPO}:latest; (( exit_status = exit_status || $? )) + echo "Stable release detected. Will also push '${DOCKER_REPO}:latest'" + TAGS="${TAGS} --tag ${DOCKER_REPO}:latest" else - echo "Pre-release detected (extension: '${OPENSTUDIO_VERSION_EXT}'). Skipping 'latest' tag update." + echo "Pre-release detected (extension: '${OPENSTUDIO_VERSION_EXT}'). Skipping 'latest' tag." fi - # Push versioned tag - docker push ${DOCKER_REPO}:$IMAGETAG; (( exit_status = exit_status || $? )) - # If on develop branch, also push the develop tag pointing to this image + # If on develop branch, also add the develop tag if [ "${IMAGETAG}" == "develop" ] || [ "${GITHUB_REF}" == "refs/heads/develop" ]; then - docker tag openstudio:latest ${DOCKER_REPO}:develop; (( exit_status = exit_status || $? )) - docker push ${DOCKER_REPO}:develop; (( exit_status = exit_status || $? )) + TAGS="${TAGS} --tag ${DOCKER_REPO}:develop" fi + # Build and push multi-arch image in one step (required for multi-platform manifests) + docker buildx build \ + --platform=linux/amd64,linux/arm64 \ + --build-arg OPENSTUDIO_VERSION=${OPENSTUDIO_VERSION} \ + --build-arg OPENSTUDIO_SHA=${OPENSTUDIO_SHA} \ + --build-arg OPENSTUDIO_VERSION_EXT=${OPENSTUDIO_VERSION_EXT} \ + ${TAGS} \ + --push \ + . + exit_status=$? + exit $exit_status else echo "Not on a deployable branch, this is a pull request or has been explicity skipped"