Skip to content

Commit cec5c94

Browse files
authored
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
1 parent 7b55d30 commit cec5c94

File tree

4 files changed

+56
-12
lines changed

4 files changed

+56
-12
lines changed

.github/workflows/macos.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: macOS
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: '33 3 * * *'
7+
jobs:
8+
macOS-minimal:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [macos-latest, macos-11]
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: ./
17+
with:
18+
cvmfs_repositories: 'sft.cern.ch'
19+
- name: Test CernVM-FS
20+
run: |
21+
echo "### Dump default.local ###"
22+
cat /etc/cvmfs/default.local
23+
echo "### Try to ls on /Users/Shared/cvmfs/sft.cern.ch/ ###"
24+
ls /Users/Shared/cvmfs/sft.cern.ch/
25+
echo "### Try to ls on /cvmfs/sft.cern.ch/ ###"
26+
ls /cvmfs/sft.cern.ch/

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ This GitHub Action installs the [CernVM-FS package](https://cernvm.cern.ch/fs/#d
135135

136136
## Limitations
137137

138-
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.
138+
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+).
139+
140+
`windows` targets are not supported.
139141

140142
## Use With Docker
141143

action.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,12 @@ inputs:
321321
required: false
322322
default: 'https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb'
323323
cvmfs_macos_pkg_location:
324-
description: 'Location from where to download the masOS pkg package of CernVM-FS'
324+
description: 'Location from where to download the macOS pkg package of CernVM-FS'
325325
required: false
326-
default: 'http://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-latest.pkg'
326+
#default: 'http://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-latest.pkg'
327+
# this nightly build is based on the cvmfs mac-fuse-t branch
328+
# TODO: change back to latest once it is released
329+
default: 'http://ecsft.cern.ch/dist/cvmfs/nightlies/cvmfs-git-1234/cvmfs-2.12.0-0.1234-git-958741c6df468802.pkg'
327330
cvmfs_config_package:
328331
description: 'URL to the cvmfs config package to install'
329332
required: false
@@ -337,12 +340,16 @@ runs:
337340
steps:
338341
- id: lsb-release
339342
run: |
340-
source /etc/lsb-release
341-
echo "id=${DISTRIB_ID}" >> $GITHUB_OUTPUT
342-
echo "release=${DISTRIB_RELEASE}" >> $GITHUB_OUTPUT
343-
echo "codename=${DISTRIB_CODENAME}" >> $GITHUB_OUTPUT
344-
echo "description=${DISTRIB_DESCRIPTION}" >> $GITHUB_OUTPUT
345-
echo "id-release=${DISTRIB_ID}-${DISTRIB_DESCRIPTION}" >> $GITHUB_OUTPUT
343+
if [ "$RUNNER_OS" == "Linux" ]; then
344+
source /etc/lsb-release
345+
echo "id=${DISTRIB_ID}" >> $GITHUB_OUTPUT
346+
echo "release=${DISTRIB_RELEASE}" >> $GITHUB_OUTPUT
347+
echo "codename=${DISTRIB_CODENAME}" >> $GITHUB_OUTPUT
348+
echo "description=${DISTRIB_DESCRIPTION}" >> $GITHUB_OUTPUT
349+
echo "id-release=${DISTRIB_ID}-${DISTRIB_DESCRIPTION}" >> $GITHUB_OUTPUT
350+
elif [ "$RUNNER_OS" == "macOS" ]; then
351+
echo "id-release=macOS-$(sw_vers -productVersion)" >> $GITHUB_OUTPUT
352+
fi
346353
shell: bash
347354
- uses: actions/cache@v4
348355
with:

setup-cvmfs.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,24 @@ if [ "$(uname)" == "Linux" ]; then
4242
fi
4343
elif [ "$(uname)" == "Darwin" ]; then
4444
# Warn about the phasing out of MacOS support for this action
45-
echo "::error::The CernVM-FS GitHub Action's support for MacOS has been \
46-
phased out with macos-10.15."
45+
echo "warning The CernVM-FS GitHub Action's support for MacOS \
46+
is still experimental."
4747
# Temporary fix for macOS until cvmfs 2.8 is released
4848
if [ -z "${CVMFS_HTTP_PROXY}" ]; then
4949
export CVMFS_HTTP_PROXY='DIRECT'
5050
fi
51-
brew install --cask macfuse
51+
52+
wget -q https://github.com/macos-fuse-t/fuse-t/releases/download/1.0.36/fuse-t-macos-installer-1.0.36.pkg
53+
sudo installer -pkg fuse-t-macos-installer-1.0.36.pkg -target /
54+
5255
curl -L -o cvmfs-latest.pkg ${CVMFS_MACOS_PKG_LOCATION}
5356
sudo installer -package cvmfs-latest.pkg -target /
57+
# / is readonly on macos 11+ - do 'synthetic firmlink' to create /cvmfs
58+
sudo zsh -c 'echo -e "cvmfs\tUsers/Shared/cvmfs\n#comment\n" > /etc/synthetic.conf'
59+
sudo chown root:wheel /etc/synthetic.conf
60+
sudo chmod a+r /etc/synthetic.conf
61+
# apfs.util seems to return non-zero error codes also on success
62+
sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t || true
5463
else
5564
echo "Unsupported platform"
5665
exit 1

0 commit comments

Comments
 (0)