@@ -12,140 +12,153 @@ on:
1212 - ' .github/workflows/**'
1313 - ' demo/demo-1-basics/**'
1414 - ' demo/demo-2-otel/**'
15-
1615 workflow_dispatch :
1716
1817jobs :
1918 podman-compose :
2019 runs-on : ubuntu-latest
2120
2221 env :
23- TMPDIR : /tmp
24- XDG_RUNTIME_DIR : /tmp/podman-run
22+ # ✅ MUST be user-owned paths
23+ XDG_RUNTIME_DIR : ${{ github.workspace }}/podman-runtime
24+ TMPDIR : ${{ github.workspace }}/podman-tmp
25+ PODMAN_STORAGE : ${{ github.workspace }}/podman-storage
2526
2627 steps :
27- # --------------------------------------------------
28- # 1️⃣ Checkout
29- # --------------------------------------------------
30- - name : Checkout repository
31- uses : actions/checkout@v4
32-
33- # --------------------------------------------------
34- # 2️⃣ Install Podman & podman-compose
35- # --------------------------------------------------
36- - name : Install Podman & podman-compose
37- run : |
38- sudo apt-get update -y
39- sudo apt-get install -y podman python3-pip uidmap
40- pip install --upgrade pip
41- pip install podman-compose
42- podman --version
43-
44- # --------------------------------------------------
45- # 3️⃣ Configure Podman runtime (CRITICAL FIX)
46- # --------------------------------------------------
47- - name : Configure Podman runtime (cgroupfs)
48- run : |
49- mkdir -p ~/.config/containers
50- cat <<EOF > ~/.config/containers/containers.conf
51- [engine]
52- cgroup_manager = "cgroupfs"
53- runtime = "crun"
54- EOF
55-
56- mkdir -p $XDG_RUNTIME_DIR
57- chmod 700 $XDG_RUNTIME_DIR
58-
59- podman info | grep -i cgroup
60-
61- # --------------------------------------------------
62- # 4️⃣ Configure Podman storage (avoid disk full)
63- # --------------------------------------------------
64- - name : Configure Podman storage
65- run : |
66- STORAGE_ROOT="/home/runner/work/_containers"
67- sudo mkdir -p "$STORAGE_ROOT" /etc/containers
68-
69- cat <<EOF | sudo tee /etc/containers/storage.conf
70- [storage]
71- driver = "overlay"
72- graphroot = "$STORAGE_ROOT"
73- runroot = "/tmp/podman-runroot"
74- EOF
75-
76- podman system migrate
77-
78- # --------------------------------------------------
79- # 5️⃣ Pre-cleanup (important for CI stability)
80- # --------------------------------------------------
81- - name : Pre-build cleanup
82- run : |
83- podman ps -aq | xargs -r podman stop || true
84- podman ps -aq | xargs -r podman rm -f || true
85- podman images -aq | xargs -r podman rmi -f || true
86- podman volume prune -f || true
87- podman network prune -f || true
88- podman system prune -a -f || true
89-
90- # --------------------------------------------------
91- # 6️⃣ Create required Podman network
92- # --------------------------------------------------
93- - name : Create Podman network
94- run : |
95- podman network exists anomaly-network || \
96- podman network create anomaly-network
97-
98- # --------------------------------------------------
99- # 7️⃣ Build & Run demo-1-basics
100- # --------------------------------------------------
101- - name : Run demo-1-basics
102- working-directory : demo/demo-1-basics
103- run : |
104- echo "Running demo-1-basics..."
105- podman-compose build
106- podman-compose up -d
107-
108- podman ps -a
109- podman-compose logs || true
110-
111- podman-compose down -v
112-
113- # --------------------------------------------------
114- # 8️⃣ Cleanup between demos (VERY IMPORTANT)
115- # --------------------------------------------------
116- - name : Cleanup between demos
117- run : |
118- podman system prune -a -f
119- podman network prune -f || true
120-
121- # --------------------------------------------------
122- # 9️⃣ Re-create network for next demo
123- # --------------------------------------------------
124- - name : Re-create Podman network
125- run : |
126- podman network exists anomaly-network || \
127- podman network create anomaly-network
128-
129- # --------------------------------------------------
130- # 🔟 Build & Run demo-2-otel
131- # --------------------------------------------------
132- - name : Run demo-2-otel
133- working-directory : demo/demo-2-otel
134- run : |
135- echo "Running demo-2-otel..."
136- podman-compose build
137- podman-compose up -d
138-
139- podman ps -a
140- podman-compose logs || true
141-
142- podman-compose down -v
143-
144- # --------------------------------------------------
145- # 1️⃣1️⃣ Final cleanup
146- # --------------------------------------------------
147- - name : Final cleanup
148- if : always()
149- run : |
150- podman system prune -a -f
151- podman network prune -f || true
28+ # --------------------------------------------------
29+ # 1️⃣ Checkout
30+ # --------------------------------------------------
31+ - name : Checkout repository
32+ uses : actions/checkout@v4
33+
34+ # --------------------------------------------------
35+ # 2️⃣ Free disk space (CRITICAL)
36+ # --------------------------------------------------
37+ - name : Free disk space
38+ run : |
39+ sudo rm -rf /usr/share/dotnet
40+ sudo rm -rf /usr/local/lib/android
41+ sudo rm -rf /opt/ghc
42+ sudo docker image prune -a -f || true
43+ df -h
44+
45+ # --------------------------------------------------
46+ # 3️⃣ Install Podman & podman-compose
47+ # --------------------------------------------------
48+ - name : Install Podman & podman-compose
49+ run : |
50+ sudo apt-get update -y
51+ sudo apt-get install -y podman uidmap python3-pip
52+ pip install --upgrade pip
53+ pip install podman-compose
54+ podman --version
55+ podman-compose --version
56+
57+ # --------------------------------------------------
58+ # 4️⃣ Configure Podman runtime (NO systemd)
59+ # --------------------------------------------------
60+ - name : Configure Podman runtime
61+ run : |
62+ mkdir -p ~/.config/containers
63+ cat <<EOF > ~/.config/containers/containers.conf
64+ [engine]
65+ cgroup_manager = "cgroupfs"
66+ runtime = "crun"
67+ events_logger = "file"
68+ EOF
69+
70+ # --------------------------------------------------
71+ # 5️⃣ Configure Podman storage + runtime dirs
72+ # --------------------------------------------------
73+ - name : Configure Podman storage
74+ run : |
75+ mkdir -p "$XDG_RUNTIME_DIR" "$TMPDIR" "$PODMAN_STORAGE"
76+ chmod 700 "$XDG_RUNTIME_DIR"
77+ chmod 777 "$TMPDIR" "$PODMAN_STORAGE"
78+
79+ mkdir -p ~/.config/containers
80+ cat <<EOF > ~/.config/containers/storage.conf
81+ [storage]
82+ driver = "overlay"
83+ graphroot = "$PODMAN_STORAGE"
84+ runroot = "$XDG_RUNTIME_DIR/runroot"
85+ EOF
86+
87+ podman system migrate
88+ podman info
89+
90+ # --------------------------------------------------
91+ # 6️⃣ Hard cleanup before builds
92+ # --------------------------------------------------
93+ - name : Pre-build cleanup
94+ run : |
95+ podman ps -aq | xargs -r podman rm -f || true
96+ podman images -aq | xargs -r podman rmi -f || true
97+ podman volume prune -f || true
98+ podman network prune -f || true
99+ podman system prune -a -f || true
100+
101+ # --------------------------------------------------
102+ # 7️⃣ Create shared network
103+ # --------------------------------------------------
104+ - name : Create Podman network
105+ run : |
106+ podman network exists anomaly-network || \
107+ podman network create anomaly-network
108+
109+ # --------------------------------------------------
110+ # 8️⃣ demo-1-basics
111+ # --------------------------------------------------
112+ - name : Run demo-1-basics
113+ working-directory : demo/demo-1-basics
114+ run : |
115+ echo "Running demo-1-basics..."
116+ podman-compose build --no-cache
117+ podman-compose up -d
118+
119+ podman ps -a
120+ podman-compose logs || true
121+
122+ podman-compose down -v
123+
124+ # --------------------------------------------------
125+ # 9️⃣ Cleanup between demos (MANDATORY)
126+ # --------------------------------------------------
127+ - name : Cleanup between demos
128+ run : |
129+ podman system prune -a -f
130+ podman volume prune -f || true
131+ podman network prune -f || true
132+
133+ # --------------------------------------------------
134+ # 🔟 Re-create network
135+ # --------------------------------------------------
136+ - name : Re-create Podman network
137+ run : |
138+ podman network exists anomaly-network || \
139+ podman network create anomaly-network
140+
141+ # --------------------------------------------------
142+ # 1️⃣1️⃣ demo-2-otel
143+ # --------------------------------------------------
144+ - name : Run demo-2-otel
145+ working-directory : demo/demo-2-otel
146+ run : |
147+ echo "Running demo-2-otel..."
148+ podman-compose build --no-cache
149+ podman-compose up -d
150+
151+ podman ps -a
152+ podman-compose logs || true
153+
154+ podman-compose down -v
155+
156+ # --------------------------------------------------
157+ # 1️⃣2️⃣ Final cleanup
158+ # --------------------------------------------------
159+ - name : Final cleanup
160+ if : always()
161+ run : |
162+ podman system prune -a -f
163+ podman network prune -f || true
164+ df -h
0 commit comments