Skip to content

Commit 3e5e90c

Browse files
[ci] Fix github syntax issues
1 parent e2a1efd commit 3e5e90c

4 files changed

Lines changed: 52 additions & 28 deletions

File tree

.github/actions/run-inference/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ runs:
4040
-Dllama.metrics.format=json
4141
-Dllama.metrics.output=file
4242
-Dllama.metrics.file=${{ inputs.metrics_file }}
43+
METRICS_FILE: ${{ inputs.metrics_file }}
4344
run: |
4445
# Run inference and emit raw metrics JSON via JAVA_TOOL_OPTIONS
4546
./llama-tornado --gpu --${{ inputs.backend }} \
@@ -48,7 +49,7 @@ runs:
4849
${{ inputs.flags }}
4950
5051
# Write metadata sidecar so process_metrics.py can identify each metrics file
51-
SIDECAR="${{ inputs.metrics_file }%.json}.meta.json"
52+
SIDECAR="${METRICS_FILE%.json}.meta.json"
5253
python3 scripts/write_metrics_sidecar.py \
5354
--out "$SIDECAR" \
5455
backend="${{ inputs.backend }}" \

.github/actions/setup-tornadovm/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,10 @@ runs:
9191
echo "=== Checking tornado CLI ==="
9292
which tornado || { echo "::error::tornado not in PATH"; exit 1; }
9393
tornado --devices
94+
95+
- name: Save TornadoVM cache
96+
if: steps.cache.outputs.cache-hit != 'true'
97+
uses: actions/cache/save@v4
98+
with:
99+
path: ${{ steps.paths.outputs.tornado_root }}
100+
key: tornadovm-${{ inputs.backend }}-${{ steps.tornado_sha.outputs.sha }}

.github/workflows/build-and-run.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ jobs:
4949
shell: bash
5050
run: |
5151
source "$HOME/.sdkman/bin/sdkman-init.sh"
52-
53-
if ! sdk list java | grep -q "installed.*$JAVA_VERSION"; then
52+
53+
# install Java with sdkman, if not already installed
54+
if ! sdk list java | grep -q "$JAVA_VERSION"; then
5455
sdk install java "$JAVA_VERSION"
5556
fi
57+
5658
sdk use java "$JAVA_VERSION"
5759
5860
echo "JAVA_HOME=$HOME/.sdkman/candidates/java/current" >> $GITHUB_ENV
@@ -283,6 +285,7 @@ jobs:
283285
github.repository == 'beehive-lab/GPULlama3.java' &&
284286
github.event_name == 'push' &&
285287
github.ref == 'refs/heads/main'
288+
286289
runs-on: [self-hosted]
287290
needs: build-and-run
288291
timeout-minutes: 15
@@ -302,24 +305,36 @@ jobs:
302305
run: |
303306
python3 scripts/process_metrics.py \
304307
--metrics-dir "${{ runner.temp }}/metrics-artifacts" \
305-
--commit "${{ github.sha }}" \
306-
--branch "${{ github.ref_name }}" \
307-
--run-id "${{ github.run_id }}" \
308-
--run-number "${{ github.run_number }}" \
309-
--run-attempt "${{ github.run_attempt }}" \
310-
--workflow "${{ github.workflow }}" \
311-
--history "$PERF_HISTORY_FILE"
308+
--commit "${{ github.sha }}" \
309+
--branch "${{ github.ref_name }}" \
310+
--run-id "${{ github.run_id }}" \
311+
--run-number "${{ github.run_number }}" \
312+
--run-attempt "${{ github.run_attempt }}" \
313+
--workflow "${{ github.workflow }}" \
314+
--history "$PERF_HISTORY_FILE"
312315
313316
- name: Commit performance history
314317
run: |
315-
git config user.name "github-actions[bot]"
318+
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-8)
319+
320+
git config user.name "github-actions[bot]"
316321
git config user.email "github-actions[bot]@users.noreply.github.com"
322+
317323
git add "$PERF_HISTORY_FILE"
318-
git diff --cached --quiet && echo "No history changes to commit" && exit 0
319-
git commit -m "perf: record run #${{ github.run_number }} @ ${GITHUB_SHA::8}"
324+
325+
git diff --cached --quiet && \
326+
echo "No history changes to commit" && exit 0
327+
328+
git commit -m "perf: record run #${{ github.run_number }} @ ${SHORT_SHA}"
329+
320330
for attempt in 1 2 3; do
321331
git pull --rebase origin main && git push && break || {
322-
[ $attempt -lt 3 ] && { echo "Attempt $attempt failed, retrying in $((attempt * 5))s..."; sleep $((attempt * 5)); } \
323-
|| { echo "::error::Failed to push after 3 attempts"; exit 1; }
332+
if [ $attempt -lt 3 ]; then
333+
echo "Attempt $attempt failed, retrying in $((attempt * 5))s..."
334+
sleep $((attempt * 5))
335+
else
336+
echo "::error::Failed to push after 3 attempts"
337+
exit 1
338+
fi
324339
}
325-
done
340+
done

.github/workflows/integration-quarkus-langchain4j.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
8-
types: [opened, synchronize, reopened]
7+
branches: [ main ]
8+
types: [opened, synchronize, reopened]
99
schedule:
10-
# Run every Saturday at 02:30 UTC to catch dependency breakages
11-
- cron: '30 2 * * 6'
10+
# Run every Saturday at 02:30 UTC to catch dependency breakages
11+
- cron: '30 2 * * 6'
1212
workflow_dispatch:
1313
inputs:
1414
quarkus_langchain4j_version:
@@ -77,14 +77,15 @@ jobs:
7777
7878
# Build
7979
./mvnw clean install -DskipTests
80-
80+
8181
# Save GPULlama3.java version for subsequent steps
8282
echo "GPULLAMA3_VERSION=$GPULLAMA3_VERSION" >> $GITHUB_ENV
8383
8484
# Step 3: Clone Quarkus LangChain4j
8585
- name: Clone Quarkus LangChain4j
8686
run: |
8787
cd ${{ github.workspace }}
88+
rm -rf quarkus-langchain4j
8889
git clone --depth 1 https://github.com/quarkiverse/quarkus-langchain4j.git
8990
9091
# Step 4: Build Quarkus LangChain4j with current GPULlama3.java
@@ -156,15 +157,15 @@ jobs:
156157
MAX_ATTEMPTS=3
157158
ATTEMPT=1
158159
SUCCESS=false
159-
160+
160161
while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do
161162
echo "Attempt $ATTEMPT of $MAX_ATTEMPTS for blocking endpoint..."
162-
163+
163164
# Trigger endpoint
164165
HTTP_RESPONSE=$(curl -s -w "%{http_code}" http://localhost:$QUARKUS_PORT/chat/blocking)
165166
HTTP_RESPONSE_CODE="${HTTP_RESPONSE: -3}"
166167
HTTP_RESPONSE_BODY="${HTTP_RESPONSE%???}"
167-
168+
168169
# Check response code
169170
if [ "$HTTP_RESPONSE_CODE" = "200" ]; then
170171
echo "SUCCESS: Blocking endpoint returned HTTP code: $HTTP_RESPONSE_CODE"
@@ -174,16 +175,16 @@ jobs:
174175
else
175176
echo "Attempt $ATTEMPT failed: Blocking endpoint returned HTTP code $HTTP_RESPONSE_CODE"
176177
echo "Response body: $HTTP_RESPONSE_BODY"
177-
178+
178179
if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then
179180
echo "Retrying in 2 seconds..."
180181
sleep 2
181182
fi
182183
fi
183-
184+
184185
ATTEMPT=$((ATTEMPT + 1))
185186
done
186-
187+
187188
if [ "$SUCCESS" = false ]; then
188189
echo "ERROR: Blocking endpoint failed after $MAX_ATTEMPTS attempts"
189190
exit 1
@@ -233,4 +234,4 @@ jobs:
233234
run: |
234235
# Clean shutdown
235236
kill $APP_PID || true
236-
wait $APP_PID 2>/dev/null || true
237+
wait $APP_PID 2>/dev/null || true

0 commit comments

Comments
 (0)