Skip to content

Commit db8f1f2

Browse files
committed
macos-15 arm64 build
1 parent a0c7978 commit db8f1f2

File tree

4 files changed

+115
-20
lines changed

4 files changed

+115
-20
lines changed

.github/workflows/openstudio-server-tests.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
name: openstudio-server-gems-linux
5757
path: build/NREL/export/*.tar.gz
5858
macos-test:
59-
runs-on: macos-15-intel
59+
runs-on: macos-15
6060
steps:
6161
- name: Check out repository
6262
uses: actions/checkout@v4
@@ -65,16 +65,19 @@ jobs:
6565
run: ./ci/github-actions/setup.sh
6666
env:
6767
BUILD_TYPE: test
68+
INTEL: false
6869
- name: unit-test
6970
shell: bash
7071
run: ./ci/github-actions/test.sh
7172
env:
7273
BUILD_TYPE: test
74+
INTEL: false
7375
- name: integration
7476
shell: bash
7577
run: ./ci/github-actions/test.sh
7678
env:
7779
BUILD_TYPE: integration
80+
INTEL: false
7881
SKIP_URBANOPT_ALGO: true # Set this when excluding urbanopt-cli gem from server.
7982
- name: logs
8083
if: ${{ failure() }}
@@ -84,12 +87,54 @@ jobs:
8487
if: ${{ success() }}
8588
shell: bash
8689
run: ./ci/github-actions/export_build_osx.sh
90+
env:
91+
INTEL: false
8792
- name: upload gem package
8893
if: ${{ success() }}
8994
uses: actions/upload-artifact@v4
9095
with:
91-
name: openstudio-server-gems-darwin
96+
name: openstudio-server-gems-darwin-arm64
9297
path: build/NREL/export/*.tar.gz
98+
macos-intel-test:
99+
runs-on: macos-15-intel
100+
steps:
101+
- name: Check out repository
102+
uses: actions/checkout@v4
103+
- name: setup
104+
shell: bash
105+
run: ./ci/github-actions/setup.sh
106+
env:
107+
BUILD_TYPE: test
108+
INTEL: true
109+
- name: unit-test
110+
shell: bash
111+
run: ./ci/github-actions/test.sh
112+
env:
113+
BUILD_TYPE: test
114+
INTEL: true
115+
- name: integration
116+
shell: bash
117+
run: ./ci/github-actions/test.sh
118+
env:
119+
BUILD_TYPE: integration
120+
INTEL: true
121+
SKIP_URBANOPT_ALGO: true # Set this when excluding urbanopt-cli gem from server.
122+
- name: logs
123+
if: ${{ failure() }}
124+
shell: bash
125+
run: ./ci/github-actions/print_logs.sh
126+
- name: build gem package
127+
if: ${{ success() }}
128+
shell: bash
129+
run: ./ci/github-actions/export_build_osx.sh
130+
env:
131+
INTEL: true
132+
- name: upload gem package
133+
if: ${{ success() }}
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: openstudio-server-gems-darwin-x64
137+
path: build/NREL/export/*.tar.gz
93138
docker:
94139
runs-on: ubuntu-22.04
95140
steps:

ci/github-actions/export_build_osx.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,31 @@
22
mkdir -p $GITHUB_WORKSPACE/build/NREL/export
33
mkdir -p $HOME/build/NREL/export
44

5+
if [[ "${INTEL}" == "true" ]]; then
6+
echo "macos15 INTEL=true => x86_64 dependencies"
7+
OS_ARCH_SUFFIX="Darwin-x86_64"
8+
DARWIN_ARCH="x64"
9+
else
10+
echo "macos15 INTEL=false => arm64 dependencies"
11+
OS_ARCH_SUFFIX="Darwin-arm64"
12+
DARWIN_ARCH="arm64"
13+
fi
514

6-
export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64
15+
export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-${OS_ARCH_SUFFIX}
16+
#export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64
717
export PATH="$GITHUB_WORKSPACE/gems/bin:/usr/local/ruby/bin:$HOME/$OS_NAME_WITH_PLUS/bin:$PATH"
818
export RUBYLIB="$HOME/$OS_NAME_WITH_PLUS/Ruby"
919
export GEM_HOME="$GITHUB_WORKSPACE/gems"
1020
export GEM_PATH="$GITHUB_WORKSPACE/gems:$GITHUB_WORKSPACE/gems/bundler/gems"
11-
oss_filename="OpenStudio-server-$(git -C "${GITHUB_WORKSPACE}" rev-parse --short=10 HEAD)-darwin.tar.gz"
21+
#oss_filename="OpenStudio-server-$(git -C "${GITHUB_WORKSPACE}" rev-parse --short=10 HEAD)-darwin.tar.gz"
1222

1323
# Build the gems and output to tar gz file. You need to specify a dir outside of the repo to export or
1424
# openstudio_meta will error. Then for sake of using relative dirs with GitHub upload-artifacts, cp the file to
1525
# the repo working directory.
1626
/usr/local/ruby/bin/ruby "${GITHUB_WORKSPACE}/bin/openstudio_meta" install_gems --export="${HOME}/build/NREL/export"
17-
cp $HOME/build/NREL/export/$oss_filename $GITHUB_WORKSPACE/build/NREL/export/$oss_filename
27+
#cp $HOME/build/NREL/export/$oss_filename $GITHUB_WORKSPACE/build/NREL/export/$oss_filename
28+
sha10="$(git -C "${GITHUB_WORKSPACE}" rev-parse --short=10 HEAD)"
29+
src_tgz="${HOME}/build/NREL/export/OpenStudio-server-${sha10}-darwin.tar.gz"
30+
dst_tgz="${GITHUB_WORKSPACE}/build/NREL/export/OpenStudio-server-${sha10}-darwin-${DARWIN_ARCH}.tar.gz"
31+
32+
cp -v "${src_tgz}" "${dst_tgz}"

ci/github-actions/setup.sh

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
set -euo pipefail
33
echo "The build architecture is ${ImageOS}"
44

5+
# macOS 15 runner setup (arm64 host). We support both:
6+
# - INTEL=true => x86_64 portable Ruby (Rosetta) + x86_64 Homebrew (/usr/local)
7+
# - INTEL=false => arm64 portable Ruby (native) + arm64 Homebrew (/opt/homebrew)
8+
INTEL="${INTEL:-false}"
9+
510
if [ "${ImageOS}" == "ubuntu22" ] && [ "${BUILD_TYPE}" == "docker" ]; then
611
echo "Installing docker compose"
712
sudo rm -f /usr/local/bin/docker-compose
@@ -19,33 +24,55 @@ else
1924
brew update > $GITHUB_WORKSPACE/spec/files/logs/brew-update.log
2025
brew install pv tree coreutils shared-mime-info
2126

27+
if [[ "${INTEL}" == "true" ]]; then
28+
echo "macos15 INTEL=true => x86_64 dependencies"
29+
OS_ARCH_SUFFIX="Darwin-x86_64"
30+
MONGO_ARCH="x86_64"
31+
RUBY_ARCH_TARBALL="ruby-3.2.2-darwin.tar.gz"
32+
else
33+
echo "macos15 INTEL=false => arm64 dependencies"
34+
OS_ARCH_SUFFIX="Darwin-arm64"
35+
MONGO_ARCH="arm64"
36+
RUBY_ARCH_TARBALL="ruby-3.2.2-darwin-arm64.tar.gz"
37+
fi
38+
2239
# install portable ruby - required for build that will eventually be published
2340
# see https://github.com/NREL/OpenStudio-PAT/wiki/Pat-Build-Notes
24-
curl -SLO --insecure https://openstudio-resources.s3.amazonaws.com/pat-dependencies3/ruby-3.2.2-darwin.tar.gz
25-
tar xzf ruby-3.2.2-darwin.tar.gz
41+
# --- install portable ruby (arch-specific) ---
42+
# NOTE: you need these tarballs available in S3. If you only have ruby-3.2.2-darwin.tar.gz today,
43+
# you’ll need to publish per-arch names (recommended) or keep a conditional mapping.
44+
curl -SLO --insecure "https://openstudio-resources.s3.amazonaws.com/pat-dependencies3/${RUBY_ARCH_TARBALL}"
45+
tar xzf "${RUBY_ARCH_TARBALL}"
2646
exit_status_tar=$?
2747
if [ $exit_status_tar -ne 0 ]; then
28-
echo "Error: Failed to extract Ruby 3.2.2 archive"
29-
exit $exit_status_tar
48+
echo "Error: Failed to extract Ruby 3.2.2 archive"
49+
exit $exit_status_tar
3050
fi
51+
sudo rm -rf /usr/local/ruby
3152
sudo mv ruby /usr/local/
3253
otool -L /usr/local/ruby/bin/ruby
33-
rm ruby-3.2.2-darwin.tar.gz
54+
rm "${RUBY_ARCH_TARBALL}"
3455

35-
# Install mongodb from a download. Brew is hanging and requires building mongo. This also speeds up the builds.
36-
curl -SLO https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-6.0.7.tgz
37-
tar xvzf mongodb-macos-x86_64-6.0.7.tgz
56+
# --- Install mongodb from a download (arch-specific) ---
57+
MONGO_TARBALL="mongodb-macos-${MONGO_ARCH}-6.0.7.tgz"
58+
curl -SLO "https://fastdl.mongodb.org/osx/${MONGO_TARBALL}"
59+
tar xvzf "${MONGO_TARBALL}"
3860
exit_status_tar=$?
3961
if [ $exit_status_tar -ne 0 ]; then
40-
echo "Error: Failed to extract Mongo 6.0.7 archive"
41-
exit $exit_status_tar
62+
echo "Error: Failed to extract Mongo 6.0.7 archive"
63+
exit $exit_status_tar
4264
fi
43-
sudo cp mongodb-macos-x86_64-6.0.7/bin/* /usr/local/bin/
44-
rm -r mongodb-macos*
65+
66+
# The extracted folder name usually matches the tarball stem.
67+
# Using a glob keeps it simple across arch.
68+
sudo cp mongodb-macos-*/bin/* /usr/local/bin/
69+
rm -rf mongodb-macos*
4570

4671
# Install openstudio -- Use the install script that is in this repo now, the one on OpenStudio/develop has changed
47-
export OS_NAME=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64
48-
export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64
72+
export OS_NAME="OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-${OS_ARCH_SUFFIX}"
73+
export OS_NAME_WITH_PLUS="$OS_NAME"
74+
#export OS_NAME=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64
75+
#export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64
4976
#curl -SL --insecure https://openstudio-ci-builds.s3-us-west-2.amazonaws.com/develop/${OS_NAME}.tar.gz -o $OS_NAME_WITH_PLUS.tar.gz
5077
#curl -SL --insecure https://github.com/NREL/OpenStudio/releases/download/v3.8.0/${OS_NAME}.tar.gz -o $OS_NAME_WITH_PLUS.tar.gz
5178
#curl -SL --insecure https://github.com/NREL/OpenStudio/releases/download/v${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}/${OS_NAME}.tar.gz -o $OS_NAME_WITH_PLUS.tar.gz

ci/github-actions/test.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
# platform-specific config here (also in setup.sh):
44
if [ "${ImageOS}" == "macos15" ]; then
55
# Dir containing openstudio
6-
export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64
6+
if [[ "${INTEL}" == "true" ]]; then
7+
echo "macos15 INTEL=true => x86_64 dependencies"
8+
OS_ARCH_SUFFIX="Darwin-x86_64"
9+
else
10+
echo "macos15 INTEL=false => arm64 dependencies"
11+
OS_ARCH_SUFFIX="Darwin-arm64"
12+
fi
13+
export OS_NAME_WITH_PLUS="OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-${OS_ARCH_SUFFIX}"
14+
#export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64
715
export RUBYLIB="$HOME/$OS_NAME_WITH_PLUS/Ruby"
816
export OPENSTUDIO_TEST_EXE="$HOME/$OS_NAME_WITH_PLUS/bin/openstudio"
917
# re-export PATH, even though it's set in setup.sh.

0 commit comments

Comments
 (0)