|
1 | | -# CVMFS-GitHub-Actions-Example |
| 1 | +<img src="https://www.ualberta.ca/en/toolkit/media-library/homepage-assets/ua_logo_green_rgb.png" alt="University of Alberta Logo" width="50%" /> |
| 2 | + |
| 3 | +# Use Compute Canada CVMFS Software Stack in GitHub Actions |
| 4 | + |
| 5 | +[](https://github.com/ualberta-rcg/github-actions-cvmfs-computecanada/actions/workflows/main.yml) |
| 6 | +[](./LICENSE) |
| 7 | + |
| 8 | +**Maintained by:** Rahim Khoja ([khoja1@ualberta.ca](mailto:khoja1@ualberta.ca)) |
| 9 | + |
| 10 | +## 🧰 Description |
| 11 | + |
| 12 | +This GitHub Actions workflow demonstrates how to **use the Compute Canada / Digital Research Alliance CVMFS software stack** directly inside a GitHub-hosted runner. |
| 13 | + |
| 14 | +It mounts the official CVMFS repositories and enables you to load modules like `gcc`, `cmake`, or `python` — just like on a real HPC cluster. |
| 15 | + |
| 16 | +This is especially useful for: |
| 17 | + |
| 18 | +- Building software compatible with Compute Canada environments |
| 19 | +- Testing reproducible workflows before deploying on Alliance clusters |
| 20 | +- Accessing precompiled Alliance tools inside GitHub CI/CD |
| 21 | + |
| 22 | +## 🗂️ Files |
| 23 | + |
| 24 | +- `.github/workflows/main.yml`: The GitHub Actions workflow |
| 25 | +- This `README.md` |
| 26 | + |
| 27 | +## 🚀 How It Works |
| 28 | + |
| 29 | +### 📁 GitHub Actions Workflow |
| 30 | + |
| 31 | +```yaml |
| 32 | +name: Use Compute Canada CVMFS Software Stack |
| 33 | + |
| 34 | +on: |
| 35 | + workflow_dispatch: # Allows manual trigger from the Actions tab |
| 36 | + |
| 37 | +jobs: |
| 38 | + build-with-alliance-stack: |
| 39 | + name: Build with Alliance/Compute Canada Software |
| 40 | + runs-on: ubuntu-latest |
| 41 | + |
| 42 | + steps: |
| 43 | + - name: 🛠️ Checkout Repository |
| 44 | + uses: actions/checkout@v4 |
| 45 | + |
| 46 | + - name: 📂 Mount Compute Canada CVMFS Repositories |
| 47 | + uses: cvmfs-contrib/github-action-cvmfs@v2 |
| 48 | + with: |
| 49 | + cvmfs_repositories: 'soft.computecanada.ca,containers.computecanada.ca' |
| 50 | + |
| 51 | + - name: ✅ Verify Mount & Initialize Environment |
| 52 | + run: | |
| 53 | + echo "--- Verifying CVMFS mounts are available ---" |
| 54 | + ls /cvmfs/ |
| 55 | + if [ ! -d "/cvmfs/soft.computecanada.ca" ]; then |
| 56 | + echo "❌ ERROR: CVMFS repository 'soft.computecanada.ca' not found!" |
| 57 | + exit 1 |
| 58 | + fi |
| 59 | + echo "✅ CVMFS mounts look good." |
| 60 | +
|
| 61 | + echo "--- Sourcing the Alliance environment profile ---" |
| 62 | + source /cvmfs/soft.computecanada.ca/config/profile/bash.sh |
| 63 | + module --version |
| 64 | +
|
| 65 | + - name: ⚙️ Use Software from CVMFS |
| 66 | + run: | |
| 67 | + source /cvmfs/soft.computecanada.ca/config/profile/bash.sh |
| 68 | + echo "--- Searching for available GCC modules ---" |
| 69 | + module avail gcc |
| 70 | +
|
| 71 | + echo "--- Loading GCC 12.3 and checking version ---" |
| 72 | + module load gcc/12.3 |
| 73 | + gcc --version |
| 74 | +```` |
| 75 | + |
| 76 | +## ✅ Example Output |
| 77 | + |
| 78 | +``` |
| 79 | +✅ CVMFS mounts look good. |
| 80 | +--- Sourcing the Alliance environment profile --- |
| 81 | +Modules based on Lmod version 8.5.6 |
| 82 | +--- Searching for available GCC modules --- |
| 83 | +gcc/9.3 gcc/11.2 gcc/12.3 |
| 84 | +--- Loading GCC 12.3 and checking version --- |
| 85 | +gcc (GCC) 12.3.0 |
| 86 | +``` |
| 87 | +
|
| 88 | +## 🧪 Try It Yourself |
| 89 | +
|
| 90 | +Fork this repo or copy the workflow into your own repo, then run it from the **Actions** tab in GitHub. |
| 91 | +
|
| 92 | +No runners, secrets, or billing needed — everything runs on the free `ubuntu-latest` GitHub-hosted runner. |
| 93 | +
|
| 94 | +## 🤝 Support |
| 95 | +
|
| 96 | +If you're deploying this as part of a broader research platform or CI/CD workflow for research computing, feel free to reach out. |
| 97 | +
|
| 98 | +Email **[khoja1@ualberta.ca](mailto:khoja1@ualberta.ca)** for U of A or Alliance-related questions. |
| 99 | +
|
| 100 | +## 📜 License |
| 101 | +
|
| 102 | +This project is licensed under the **MIT License**, meaning: |
| 103 | +
|
| 104 | +* ✅ You can use, modify, and redistribute it freely |
| 105 | +* ✅ Use it in commercial or private projects |
| 106 | +* ✅ Include it in closed-source or public tools |
| 107 | +
|
| 108 | +Just retain the copyright. |
| 109 | +
|
| 110 | +**Full license text:** [MIT License](./LICENSE) |
| 111 | +
|
| 112 | +## 🧠 About University of Alberta Research Computing |
| 113 | +
|
| 114 | +The [Research Computing Group](https://www.ualberta.ca/information-services-and-technology/research-computing/index.html) supports research infrastructure, software workflows, and advanced computing services for U of A and Canadian researchers. |
| 115 | +
|
| 116 | +We build scalable systems, enable reproducible science, and help accelerate discovery. |
0 commit comments