Skip to content

Commit 8745ace

Browse files
authored
Merge pull request #652 from gdsfactory/copilot/fix-651
2 parents 55b3065 + 94aed4a commit 8745ace

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/pages.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,55 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v5
1818
- uses: astral-sh/setup-uv@v7
19+
- name: Setup Apptainer
20+
uses: eWaterCycle/setup-apptainer@3f706d898c9db585b1d741b4692e66755f3a1b40
21+
with:
22+
apptainer-version: 1.4.2
1923
- name: Install libglu1-mesa
2024
run: |
2125
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
2268
- name: Build docs
2369
env:
2470
SIMCLOUD_APIKEY: ${{ secrets.SIMCLOUD_APIKEY }}

0 commit comments

Comments
 (0)