Skip to content

Commit c151c80

Browse files
committed
wip
1 parent 10da62f commit c151c80

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

.github/workflows/providers-build.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -231,19 +231,14 @@ jobs:
231231
232232
- name: Test the export
233233
run: |
234-
USE_COPY_NOT_MOUNT=true LLAMA_STACK_DIR=. uv run llama stack build --config llama_stack/templates/starter/build.yaml --export-dir export
234+
# Support for USE_COPY_NOT_MOUNT=true LLAMA_STACK_DIR=. will be added in the future
235+
uv run llama stack build --config llama_stack/templates/starter/build.yaml --export-dir export
235236
for file in export/*; do
236237
echo "File: $file"
237238
if [[ "$file" == *.tar.gz ]]; then
238239
echo "Tarball found"
239240
tarball_found=1
240-
tar -xzvf "$file"
241-
if [ -f "Containerfile" ]; then
242-
echo "Containerfile found"
243-
else
244-
echo "Containerfile not found"
245-
exit 1
246-
fi
241+
tar -xzvf "$file" -C export
247242
else
248243
continue
249244
fi
@@ -254,4 +249,8 @@ jobs:
254249
exit 1
255250
fi
256251
cd export
257-
docker build -t test .
252+
docker build -t export-test -f ./Containerfile .
253+
254+
- name: Setup tmate session
255+
if: ${{ failure() }}
256+
uses: mxschmitt/action-tmate@v3

llama_stack/distribution/build_container.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,20 @@ if [ -n "$export_dir" ]; then
289289
echo "Creating tarball with the following files:"
290290
echo "- Containerfile"
291291
[ -n "$run_config" ] && echo "- run.yaml"
292-
[ -n "$external_providers_dir" ] && echo "- providers.d directory"
292+
[ -n "$external_providers_dir" ] && [ -d "$external_providers_dir" ] && echo "- providers.d directory"
293293

294294
# Capture both stdout and stderr from tar command
295-
tar_output=$(tar -czf "$export_dir/$tar_name" \
296-
-C "$TEMP_DIR" Containerfile \
297-
${run_config:+-C "$BUILD_CONTEXT_DIR" "$(basename run.yaml)"} \
298-
${external_providers_dir:+-C "$BUILD_CONTEXT_DIR" providers.d} 2>&1)
295+
tar_cmd="tar -czf \"$export_dir/$tar_name\" -C \"$TEMP_DIR\" Containerfile"
296+
297+
if [ -n "$run_config" ]; then
298+
tar_cmd="$tar_cmd -C \"$BUILD_CONTEXT_DIR\" \"$(basename run.yaml)\""
299+
fi
300+
301+
if [ -n "$external_providers_dir" ] && [ -d "$external_providers_dir" ]; then
302+
tar_cmd="$tar_cmd -C \"$BUILD_CONTEXT_DIR\" providers.d"
303+
fi
304+
305+
tar_output=$(eval "$tar_cmd" 2>&1)
299306
tar_status=$?
300307

301308
if [ $tar_status -ne 0 ]; then

0 commit comments

Comments
 (0)