From cec5c94a14714ab02980682fce8ab3de238401f9 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Fri, 5 Apr 2024 11:03:46 +0200 Subject: [PATCH] Re-enable experimental support for cvmfs on macos runners (#28) * Re-enable experimental support for cvmfs on macos runners While macfuse is no longer an option, there is now a nice alternative with fuse-t. This PR adds experimental support (I've successfully tested it with the nightly build, but there is no released cvmfs version with fuse-t support yet). 'Synthetic firmlinks' are used to create /cvmfs , since the root file system is now read-only on macos. One todo: need to check if we actually need the homebrew action or it can be moved somewhere else. * lsb-release only on linux * set id-releas also for macos * direct install of fuse-t instead of using homebrew * update readme * Update action.yml * Update README.md --- .github/workflows/macos.yml | 26 ++++++++++++++++++++++++++ README.md | 4 +++- action.yml | 23 +++++++++++++++-------- setup-cvmfs.sh | 15 ++++++++++++--- 4 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..0a208ae --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,26 @@ +name: macOS +on: + push: + pull_request: + schedule: + - cron: '33 3 * * *' +jobs: + macOS-minimal: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, macos-11] + steps: + - uses: actions/checkout@v2 + - uses: ./ + with: + cvmfs_repositories: 'sft.cern.ch' + - name: Test CernVM-FS + run: | + echo "### Dump default.local ###" + cat /etc/cvmfs/default.local + echo "### Try to ls on /Users/Shared/cvmfs/sft.cern.ch/ ###" + ls /Users/Shared/cvmfs/sft.cern.ch/ + echo "### Try to ls on /cvmfs/sft.cern.ch/ ###" + ls /cvmfs/sft.cern.ch/ diff --git a/README.md b/README.md index 16e1932..c2c5fad 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,9 @@ This GitHub Action installs the [CernVM-FS package](https://cernvm.cern.ch/fs/#d ## Limitations -This GitHub Action is only expected to work in workflows that [run on](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on) ubuntu. This exludes the `macos` and `windows` targets. +This GitHub Action is only expected to work in workflows that [run on](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on) ubuntu. There is experimental support for `macOS` (11+). + + `windows` targets are not supported. ## Use With Docker diff --git a/action.yml b/action.yml index 665f899..96f4bdb 100644 --- a/action.yml +++ b/action.yml @@ -321,9 +321,12 @@ inputs: required: false default: 'https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb' cvmfs_macos_pkg_location: - description: 'Location from where to download the masOS pkg package of CernVM-FS' + description: 'Location from where to download the macOS pkg package of CernVM-FS' required: false - default: 'http://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-latest.pkg' + #default: 'http://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-latest.pkg' + # this nightly build is based on the cvmfs mac-fuse-t branch + # TODO: change back to latest once it is released + default: 'http://ecsft.cern.ch/dist/cvmfs/nightlies/cvmfs-git-1234/cvmfs-2.12.0-0.1234-git-958741c6df468802.pkg' cvmfs_config_package: description: 'URL to the cvmfs config package to install' required: false @@ -337,12 +340,16 @@ runs: steps: - id: lsb-release run: | - source /etc/lsb-release - echo "id=${DISTRIB_ID}" >> $GITHUB_OUTPUT - echo "release=${DISTRIB_RELEASE}" >> $GITHUB_OUTPUT - echo "codename=${DISTRIB_CODENAME}" >> $GITHUB_OUTPUT - echo "description=${DISTRIB_DESCRIPTION}" >> $GITHUB_OUTPUT - echo "id-release=${DISTRIB_ID}-${DISTRIB_DESCRIPTION}" >> $GITHUB_OUTPUT + if [ "$RUNNER_OS" == "Linux" ]; then + source /etc/lsb-release + echo "id=${DISTRIB_ID}" >> $GITHUB_OUTPUT + echo "release=${DISTRIB_RELEASE}" >> $GITHUB_OUTPUT + echo "codename=${DISTRIB_CODENAME}" >> $GITHUB_OUTPUT + echo "description=${DISTRIB_DESCRIPTION}" >> $GITHUB_OUTPUT + echo "id-release=${DISTRIB_ID}-${DISTRIB_DESCRIPTION}" >> $GITHUB_OUTPUT + elif [ "$RUNNER_OS" == "macOS" ]; then + echo "id-release=macOS-$(sw_vers -productVersion)" >> $GITHUB_OUTPUT + fi shell: bash - uses: actions/cache@v4 with: diff --git a/setup-cvmfs.sh b/setup-cvmfs.sh index 9ac8863..cf4738b 100755 --- a/setup-cvmfs.sh +++ b/setup-cvmfs.sh @@ -42,15 +42,24 @@ if [ "$(uname)" == "Linux" ]; then fi elif [ "$(uname)" == "Darwin" ]; then # Warn about the phasing out of MacOS support for this action - echo "::error::The CernVM-FS GitHub Action's support for MacOS has been \ -phased out with macos-10.15." + echo "warning The CernVM-FS GitHub Action's support for MacOS \ + is still experimental." # Temporary fix for macOS until cvmfs 2.8 is released if [ -z "${CVMFS_HTTP_PROXY}" ]; then export CVMFS_HTTP_PROXY='DIRECT' fi - brew install --cask macfuse + + wget -q https://github.com/macos-fuse-t/fuse-t/releases/download/1.0.36/fuse-t-macos-installer-1.0.36.pkg + sudo installer -pkg fuse-t-macos-installer-1.0.36.pkg -target / + curl -L -o cvmfs-latest.pkg ${CVMFS_MACOS_PKG_LOCATION} sudo installer -package cvmfs-latest.pkg -target / + # / is readonly on macos 11+ - do 'synthetic firmlink' to create /cvmfs + sudo zsh -c 'echo -e "cvmfs\tUsers/Shared/cvmfs\n#comment\n" > /etc/synthetic.conf' + sudo chown root:wheel /etc/synthetic.conf + sudo chmod a+r /etc/synthetic.conf + # apfs.util seems to return non-zero error codes also on success + sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t || true else echo "Unsupported platform" exit 1