Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 68 additions & 4 deletions .github/workflows/docker-openstudio.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
name: openstudio-docker

on: [push, pull_request]
on:
push:
branches:
- master
- develop
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 blank for a final release. Default: -rc1'
required: false
default: ''
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:
Expand All @@ -17,21 +41,57 @@ 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

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: test and build
if: ${{ github.event.inputs.apptainer_only != 'true' }}
shell: bash
run: |
set -euo pipefail
Expand All @@ -56,8 +116,12 @@ 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' }}
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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manual_installer_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ 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
os_version_ext:
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:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04 AS base
FROM ubuntu:24.04 AS base

LABEL maintainer="Nicholas Long nicholas.long@nrel.gov"

Expand Down Expand Up @@ -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}" \
Expand Down
2 changes: 2 additions & 0 deletions deploy_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading