Skip to content

feat(ci): add macOS CI workflow - #95

Open
wdconinc wants to merge 110 commits into
masterfrom
macos-ci-workflow
Open

wdconinc wants to merge 110 commits into
masterfrom
macos-ci-workflow

Conversation

@wdconinc

@wdconinc wdconinc commented Dec 18, 2025 •

Copy link
Copy Markdown
Contributor

This PR adds a GitHub Actions workflow to build the ci, tf, and xl environments on macOS.

Features

  • Matrix strategy testing ci, tf, and xl environments
  • Automatic buildcache push/pull for faster rebuilds

Copilot AI lite review requested due to automatic review settings December 18, 2025 22:30
Comment thread .github/workflows/macos-ci.yml Outdated
Comment thread .github/workflows/macos-ci.yml Outdated
Comment thread .github/workflows/macos-ci.yml Outdated
Comment thread .github/workflows/macos-ci.yml Outdated
Comment thread .github/workflows/macos-ci.yml Outdated

This comment was marked as resolved.

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings August 9, 2026 17:47
@wdconinc
wdconinc force-pushed the macos-ci-workflow branch from 24f3357 to 61b57b4 Compare August 9, 2026 17:47

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings August 9, 2026 18:01
@wdconinc wdconinc changed the title Add macOS CI workflow feat(ci): add macOS CI workflow Aug 9, 2026

This comment was marked as low quality.

Copilot AI review requested due to automatic review settings August 9, 2026 18:06

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings August 9, 2026 18:16

This comment was marked as low quality.

Copilot AI review requested due to automatic review settings August 9, 2026 18:38

This comment was marked as low quality.

Copilot AI review requested due to automatic review settings August 9, 2026 18:42

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings August 9, 2026 18:51

This comment was marked as low quality.

Copilot AI review requested due to automatic review settings August 9, 2026 18:58

This comment was marked as outdated.

This comment was marked as outdated.

…refix

- Set CVMFS publish location to unpacked.cern.ch/ghcr.io/eic/mac_<env>:nightly
- Phase 1: Build packages into /opt/software with 128-byte padding and populate local/remote buildcaches
- Phase 2: Relocate and install environment specs from buildcache into target prefix with colons in path
- Hardcode tag to nightly for testing deployment to unpacked.cern.ch

This comment was marked as outdated.

- Job 1 (build): Builds missing packages into /opt/software with padding and autopushes to GHCR buildcache
- Job 2 (install): Installs environment specs from network buildcache into CVMFS target prefix, regenerates views, tests, and publishes container image
- Only the remote buildcache serves as intermediary between the jobs

This comment was marked as outdated.

…as artifacts

- Use actions/cache@v4 for Spack repositories across jobs
- Use actions/cache@v4 for Spack concretization cache (~/.spack/cache/concretization)
- Upload spack.lock files as workflow artifacts in build job
- Download lockfiles in install job and skip concretization entirely

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The macOS workflow’s lockfile download path is very likely to produce a nested directory layout and break subsequent steps, so the CI workflow would not function as intended.

17 open issues

Review effort: Lite

Comment on lines +504 to +509
- name: Download Spack lockfiles
uses: actions/download-artifact@v4
with:
name: spack-locks-${{ matrix.ENV }}
path: spack-environment/${{ matrix.ENV }}

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new macOS workflow’s publish step can overwrite nightly from unmerged PR runs and currently publishes a macOS-built tree as a linux/arm64 OCI image, which is operationally unsafe/misleading.

16 open issues

Review effort: Lite


- name: Package and publish container
env:
PUSH_CONTAINER: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new macOS workflow and buildcache-check script include reliability gaps (silent patching, inconsistent install-tree config, and missing exception handling) that can cause hard-to-diagnose CI failures or unnecessary full rebuilds.

16 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Mirror padded install_tree length in install job

.github/​workflows/​macos-ci.yml:546

The build job configures config:install_tree:padded_length:128, but the install/publish job does not. If buildcache entries rely on padded prefixes for relocation, installs in the second job may be more likely to hit relocation failures.

Add the same padded_length setting in the install job for consistency with the build job's install tree configuration.

Medium severity Handle per-spec registry query failures in thread pool

scripts/​check-buildcache.py:49

_oci_get_blob_info(ref) is called inside a ThreadPoolExecutor without any exception handling. If one query hits a transient registry/auth/network error, pool.map(...) will raise and abort the whole check, causing CI to fall back to a full spack install even when most specs are already present in the buildcache.

Catch exceptions per-spec and treat failures as "missing" (and optionally warn), so the script degrades gracefully and still produces a usable rebuild list.

Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new macOS workflow and buildcache-check helper need small robustness fixes (CVMFS mount verification and per-spec OCI lookup error handling) to avoid brittle CI failures.

15 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Check /cvmfs availability before using it as install prefix

.github/​workflows/​macos-ci.yml:518

The /cvmfs firmlink setup ignores failures and does not verify that /cvmfs is actually available before constructing INSTALL_PREFIX under /cvmfs. On macOS runners, synthetic.conf changes can require a reboot; if /cvmfs isn't present, the later mkdir under ${INSTALL_PREFIX} can fail with a confusing error. Add an explicit check/fallback after apfs.util so the workflow uses a writable base path deterministically.

Medium severity Handle registry lookup failures without crashing the script

scripts/​check-buildcache.py:42

Registry lookups in the thread pool can raise (network/auth/transient OCI errors), which will currently fail the entire script with a traceback. Since the workflow already has a fallback path on nonzero status, it's more robust to catch per-spec lookup errors, log a warning, and treat that spec as missing (or at least avoid crashing).

1 resolved since last review

Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The macOS workflow currently risks producing misleading/potentially unsafe artifacts (Linux-labeled image containing macOS build output and a PATH rewrite that can introduce an empty PATH element).

16 open issues

Review effort: Lite

Comment on lines +623 to +630
def clean_path(match):
val = match.group(1).strip("\"'")
placeholder = "__INSTALL_PREFIX__"
val_safe = val.replace(prefix, placeholder)
parts = val_safe.split(":")
dirs = [p.replace(placeholder, prefix) for p in parts if p.startswith(placeholder) or p.startswith("/cvmfs")]
bin_dirs = ":".join(dirs)
return f"export PATH={bin_dirs}:" + "${PATH};"

This branch was successfully deployed

1 active deployment
github-pages — f7ae2a13 Deployed Oct 18, 2026 by wdconinc via deploy-artifacts-page #4393
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants