|
16 | 16 | steps: |
17 | 17 | - uses: actions/checkout@v5 |
18 | 18 | - uses: astral-sh/setup-uv@v7 |
| 19 | + - name: Setup Apptainer |
| 20 | + uses: eWaterCycle/setup-apptainer@3f706d898c9db585b1d741b4692e66755f3a1b40 |
| 21 | + with: |
| 22 | + apptainer-version: 1.4.2 |
19 | 23 | - name: Install libglu1-mesa |
20 | 24 | run: | |
21 | 25 | sudo apt-get install -y libglu1-mesa |
| 26 | + - name: Download Palace singularity definition |
| 27 | + run: wget https://raw.githubusercontent.com/awslabs/palace/main/singularity/singularity.def |
| 28 | + - name: Cache Palace container restore |
| 29 | + id: cache-palace-restore |
| 30 | + uses: actions/cache/restore@v4 |
| 31 | + with: |
| 32 | + path: palace.sif |
| 33 | + key: palace-container-${{ runner.os }}-${{ hashFiles('singularity.def') }} |
| 34 | + - name: Build palace from source |
| 35 | + if: steps.cache-palace-restore.outputs.cache-hit != 'true' |
| 36 | + run: | |
| 37 | + echo "Building Palace container from source (this may take a while)…" |
| 38 | + echo "Note: This is a one-time build that will be cached for future runs" |
| 39 | + timeout 3600 sudo apptainer build palace.sif singularity.def || { |
| 40 | + echo "Build timed out or failed after 60 minutes. Palace will not be available for docs." |
| 41 | + exit 0 |
| 42 | + } |
| 43 | + - name: Cache Palace container save |
| 44 | + uses: actions/cache/save@v4 |
| 45 | + if: steps.cache-palace-restore.outputs.cache-hit != 'true' && hashFiles('palace.sif') != '' |
| 46 | + with: |
| 47 | + path: palace.sif |
| 48 | + key: palace-container-${{ runner.os }}-${{ hashFiles('singularity.def') }} |
| 49 | + - name: Create palace alias |
| 50 | + run: | |
| 51 | + if [ -f "palace.sif" ]; then |
| 52 | + # Create a shell script that acts as an alias for palace |
| 53 | + echo '#!/bin/bash' > palace |
| 54 | + echo "exec apptainer run $GITHUB_WORKSPACE/palace.sif \"\$@\" " >> palace |
| 55 | + chmod +x palace |
| 56 | + echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH |
| 57 | + echo "Palace executable created successfully" |
| 58 | + else |
| 59 | + echo "Palace container not available - notebooks requiring Palace will be skipped" |
| 60 | + fi |
| 61 | + - name: Verify Palace installation |
| 62 | + run: | |
| 63 | + if [ -f "palace.sif" ]; then |
| 64 | + palace --help || echo "Palace help failed but container exists" |
| 65 | + else |
| 66 | + echo "Palace container not found, skipping verification" |
| 67 | + fi |
22 | 68 | - name: Build docs |
23 | 69 | env: |
24 | 70 | SIMCLOUD_APIKEY: ${{ secrets.SIMCLOUD_APIKEY }} |
|
0 commit comments