6767 needs : changes
6868 if : ${{ needs.changes.outputs.e2e == 'true' || needs.changes.outputs.integration == 'true' || github.event_name == 'workflow_dispatch' }}
6969 runs-on :
70- labels : ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
70+ labels : " ubuntu-latest "
7171 steps :
72+ - name : Maximize build space
73+ uses : easimon/maximize-build-space@v10
74+ continue-on-error : true
75+ with :
76+ root-reserve-mb : 40960
77+ temp-reserve-mb : 30720
78+ remove-dotnet : ' true'
79+ remove-android : ' true'
80+ remove-haskell : ' true'
81+ remove-codeql : ' true'
82+ remove-docker-images : ' true'
83+ build-mount-path : ' /var/lib/docker'
84+
85+ - name : Restart Docker
86+ continue-on-error : true
87+ run : sudo service docker restart || sudo systemctl restart docker || true
88+
7289 - run : df -h
7390
7491 - name : Cleanup Docker cache
@@ -115,25 +132,25 @@ jobs:
115132 uses : actions/cache@v4
116133 with :
117134 path : /tmp/image-cache/opensearch.tar
118- key : ${{ runner.os }}-image -opensearch-${{ steps.cache-keys.outputs.opensearch }}
135+ key : ${{ runner.os }}-${{ runner.arch }} -opensearch-${{ steps.cache-keys.outputs.opensearch }}
119136
120137 - name : Cache Backend Image
121138 uses : actions/cache@v4
122139 with :
123140 path : /tmp/image-cache/backend.tar
124- key : ${{ runner.os }}-image -backend-${{ steps.cache-keys.outputs.backend }}
141+ key : ${{ runner.os }}-${{ runner.arch }} -backend-${{ steps.cache-keys.outputs.backend }}
125142
126143 - name : Cache Frontend Image
127144 uses : actions/cache@v4
128145 with :
129146 path : /tmp/image-cache/frontend.tar
130- key : ${{ runner.os }}-image -frontend-${{ steps.cache-keys.outputs.frontend }}
147+ key : ${{ runner.os }}-${{ runner.arch }} -frontend-${{ steps.cache-keys.outputs.frontend }}
131148
132149 - name : Cache Langflow Image
133150 uses : actions/cache@v4
134151 with :
135152 path : /tmp/image-cache/langflow.tar
136- key : ${{ runner.os }}-image -langflow-${{ steps.cache-keys.outputs.langflow }}
153+ key : ${{ runner.os }}-${{ runner.arch }} -langflow-${{ steps.cache-keys.outputs.langflow }}
137154
138155 - name : Build OpenRAG images
139156 run : |
@@ -145,14 +162,40 @@ jobs:
145162 local name=$1
146163 local dockerfile=$2
147164 local tar_path="/tmp/image-cache/${name}.tar"
165+ local use_cache=false
148166
149167 if [ -f "$tar_path" ]; then
150- echo "Cache hit for ${name}. Loading image from ${tar_path} ..."
168+ echo "Found cache file for ${name}. Inspecting architecture ..."
151169 docker load -i "$tar_path"
152- echo "Tagging loaded image as langflowai/openrag-${name}:${CI_IMAGE_TAG}..."
153- docker tag "langflowai/openrag-${name}:cached" "langflowai/openrag-${name}:${CI_IMAGE_TAG}"
154- else
155- echo "Cache miss for ${name}. Building..."
170+
171+ # Get host normalized architecture
172+ local host_arch="$(uname -m)"
173+ local host_arch_norm=""
174+ if [[ "$host_arch" == "x86_64" ]]; then
175+ host_arch_norm="amd64"
176+ elif [[ "$host_arch" == "aarch64" || "$host_arch" == "arm64" ]]; then
177+ host_arch_norm="arm64"
178+ else
179+ host_arch_norm="$host_arch"
180+ fi
181+
182+ local loaded_arch=""
183+ loaded_arch=$(docker inspect --format '{{.Architecture}}' "langflowai/openrag-${name}:cached" 2>/dev/null || echo "unknown")
184+
185+ if [ "$loaded_arch" = "$host_arch_norm" ]; then
186+ echo "Cache hit for ${name}. Loaded image matches host architecture ($host_arch_norm)."
187+ use_cache=true
188+ echo "Tagging loaded image as langflowai/openrag-${name}:${CI_IMAGE_TAG}..."
189+ docker tag "langflowai/openrag-${name}:cached" "langflowai/openrag-${name}:${CI_IMAGE_TAG}"
190+ else
191+ echo "Cache image architecture ($loaded_arch) does not match host architecture ($host_arch_norm). Discarding cache."
192+ docker rmi "langflowai/openrag-${name}:cached" 2>/dev/null || true
193+ rm -f "$tar_path"
194+ fi
195+ fi
196+
197+ if [ "$use_cache" = "false" ]; then
198+ echo "Cache miss/incompatible for ${name}. Building..."
156199 if docker buildx build \
157200 --load \
158201 -t "langflowai/openrag-${name}:cached" \
@@ -226,13 +269,30 @@ jobs:
226269 needs : [changes, build-images]
227270 if : ${{ needs.changes.outputs.integration == 'true' || github.event_name == 'workflow_dispatch' }}
228271 runs-on :
229- labels : ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
272+ labels : " ubuntu-latest "
230273 strategy :
231274 fail-fast : false
232275 matrix :
233276 suite : [core, sdk-python, sdk-typescript]
234277 name : tests (${{ matrix.suite }})
235278 steps :
279+ - name : Maximize build space
280+ uses : easimon/maximize-build-space@v10
281+ continue-on-error : true
282+ with :
283+ root-reserve-mb : 40960
284+ temp-reserve-mb : 30720
285+ remove-dotnet : ' true'
286+ remove-android : ' true'
287+ remove-haskell : ' true'
288+ remove-codeql : ' true'
289+ remove-docker-images : ' true'
290+ build-mount-path : ' /var/lib/docker'
291+
292+ - name : Restart Docker
293+ continue-on-error : true
294+ run : sudo service docker restart || sudo systemctl restart docker || true
295+
236296 - run : df -h
237297
238298 - name : Cleanup Docker cache
@@ -327,14 +387,31 @@ jobs:
327387 needs : [changes, build-images]
328388 if : ${{ needs.changes.outputs.e2e == 'true' || github.event_name == 'workflow_dispatch' }}
329389 runs-on :
330- labels : ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
390+ labels : " ubuntu-latest "
331391 strategy :
332392 fail-fast : false
333393 matrix :
334394 shard : [1, 2, 3, 4, 5, 6, 7, 8]
335395 total_shards : [8]
336396 name : e2e (shard ${{ matrix.shard }}/${{ matrix.total_shards }})
337397 steps :
398+ - name : Maximize build space
399+ uses : easimon/maximize-build-space@v10
400+ continue-on-error : true
401+ with :
402+ root-reserve-mb : 40960
403+ temp-reserve-mb : 30720
404+ remove-dotnet : ' true'
405+ remove-android : ' true'
406+ remove-haskell : ' true'
407+ remove-codeql : ' true'
408+ remove-docker-images : ' true'
409+ build-mount-path : ' /var/lib/docker'
410+
411+ - name : Restart Docker
412+ continue-on-error : true
413+ run : sudo service docker restart || sudo systemctl restart docker || true
414+
338415 - name : Cleanup Docker cache
339416 run : |
340417 docker compose -f docker-compose.yml down -v --remove-orphans || true
@@ -473,7 +550,7 @@ jobs:
473550 if : ${{ !cancelled() && (needs.changes.outputs.e2e == 'true' || github.event_name == 'workflow_dispatch') && needs.e2e-run.result != 'skipped' }}
474551 needs : [changes, e2e-run]
475552 runs-on :
476- labels : ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
553+ labels : " ubuntu-latest "
477554 permissions :
478555 contents : read
479556 steps :
@@ -513,7 +590,7 @@ jobs:
513590 needs : [changes, build-images, test-suite]
514591 if : always()
515592 runs-on :
516- labels : ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
593+ labels : " ubuntu-latest "
517594 steps :
518595 - name : Check split integration result
519596 run : |
@@ -533,7 +610,7 @@ jobs:
533610 needs : [changes, build-images, e2e-run]
534611 if : always()
535612 runs-on :
536- labels : ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
613+ labels : " ubuntu-latest "
537614 steps :
538615 - name : Check E2E result
539616 run : |
0 commit comments