From deac69fb920f59f4b3ccf7123ff7eb8351dc0590 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Wed, 3 Apr 2024 13:16:43 +0200 Subject: [PATCH 1/7] 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. --- .github/workflows/macos.yml | 27 +++++++++++++++++++++++++++ action.yml | 5 ++++- setup-cvmfs.sh | 13 ++++++++++--- 3 files changed, 41 insertions(+), 4 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..e7d7e5d --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,27 @@ +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: Homebrew/actions/setup-homebrew@master + - 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/action.yml b/action.yml index 665f899..2d69a3b 100644 --- a/action.yml +++ b/action.yml @@ -323,7 +323,10 @@ inputs: cvmfs_macos_pkg_location: description: 'Location from where to download the masOS 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 diff --git a/setup-cvmfs.sh b/setup-cvmfs.sh index 9ac8863..3cf6c68 100755 --- a/setup-cvmfs.sh +++ b/setup-cvmfs.sh @@ -42,15 +42,22 @@ 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 + brew tap macos-fuse-t/homebrew-cask + brew install fuse-t 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 From 4b0b51b718ab97eb2227b9306f39241bceded9a4 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Wed, 3 Apr 2024 13:25:57 +0200 Subject: [PATCH 2/7] lsb-release only on linux --- action.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 2d69a3b..e9bf7e0 100644 --- a/action.yml +++ b/action.yml @@ -340,12 +340,14 @@ 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 + fi shell: bash - uses: actions/cache@v4 with: From f66fa0646778e2b72468d3758a18509dde145528 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Wed, 3 Apr 2024 22:13:45 +0200 Subject: [PATCH 3/7] set id-releas also for macos --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index e9bf7e0..65470e3 100644 --- a/action.yml +++ b/action.yml @@ -347,6 +347,8 @@ runs: 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 From 128a43cab78b4714cf4b42c11a2d44d3cd8da931 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Thu, 4 Apr 2024 09:24:50 +0200 Subject: [PATCH 4/7] direct install of fuse-t instead of using homebrew --- .github/workflows/macos.yml | 1 - setup-cvmfs.sh | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e7d7e5d..0a208ae 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -13,7 +13,6 @@ jobs: os: [macos-latest, macos-11] steps: - uses: actions/checkout@v2 - - uses: Homebrew/actions/setup-homebrew@master - uses: ./ with: cvmfs_repositories: 'sft.cern.ch' diff --git a/setup-cvmfs.sh b/setup-cvmfs.sh index 3cf6c68..cf4738b 100755 --- a/setup-cvmfs.sh +++ b/setup-cvmfs.sh @@ -48,8 +48,10 @@ elif [ "$(uname)" == "Darwin" ]; then if [ -z "${CVMFS_HTTP_PROXY}" ]; then export CVMFS_HTTP_PROXY='DIRECT' fi - brew tap macos-fuse-t/homebrew-cask - brew install fuse-t + + 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 From ca581e25ca185b9569c9ef5551382b0a2ddf4f4f Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Thu, 4 Apr 2024 09:29:28 +0200 Subject: [PATCH 5/7] update readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 16e1932..dfa4d91 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`. + + `windows` targets are not supported. ## Use With Docker From 04bfa0e41010f8e2aef6054a87e59b1ee6b1d149 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Fri, 5 Apr 2024 11:01:31 +0200 Subject: [PATCH 6/7] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 65470e3..96f4bdb 100644 --- a/action.yml +++ b/action.yml @@ -321,7 +321,7 @@ 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' # this nightly build is based on the cvmfs mac-fuse-t branch From fb0c3875896999083409094a13819881e53f2c53 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Fri, 5 Apr 2024 11:02:05 +0200 Subject: [PATCH 7/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dfa4d91..c2c5fad 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ 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. There is experimental support for `macOS`. +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.