Skip to content

Commit c5d676f

Browse files
Introduce CI Actions for Quarkus-LangChain4j integration tests with GPULlama3.
1 parent fd74bc4 commit c5d676f

1 file changed

Lines changed: 27 additions & 42 deletions

File tree

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

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,36 @@ jobs:
4949
wget https://github.com/beehive-lab/TornadoVM/releases/download/v2.1.0/tornadovm-2.1.0-${{ matrix.backend.name }}-linux-amd64.zip
5050
unzip tornadovm-2.1.0-${{ matrix.backend.name }}-linux-amd64.zip
5151
52-
TORNADO_SDK="${{ github.workspace }}/tornadovm-2.1.0-${{ matrix.backend.name }}"
53-
PATH=$TORNADO_SDK/bin:$PATH
54-
echo "TORNADO_SDK=$TORNADO_SDK" >> $GITHUB_ENV
55-
echo "PATH=$TORNADO_SDK/bin:$JAVA_HOME/bin:$PATH" >> $GITHUB_ENV
52+
# Export environment for the current shell
53+
export TORNADO_SDK="${{ github.workspace }}/tornadovm-2.1.0-${{ matrix.backend.name }}"
54+
export PATH="$TORNADO_SDK/bin:$JAVA_HOME/bin:$PATH"
5655
57-
tornado --devices
58-
tornado --version
56+
# Save to GitHub Actions environment for future steps
57+
echo "TORNADO_SDK=$TORNADO_SDK" >> $GITHUB_ENV
58+
echo "PATH=$PATH" >> $GITHUB_ENV
5959
60-
if [ $? -eq 0 ]; then
60+
# Check TornadoVM installation
61+
if tornado --devices && tornado --version; then
6162
echo "✅ TornadoVM installed"
6263
else
6364
echo "❌ TornadoVM installation check failed"
6465
exit 1
6566
fi
67+
68+
69+
# # Step 2: Clone Quarkus LangChain4j
70+
# - name: Clone Quarkus LangChain4j
71+
# run: |
72+
# cd ${{ github.workspace }}
73+
# git clone https://github.com/quarkiverse/quarkus-langchain4j.git
74+
# echo "✅ Quarkus LangChain4j cloned"
6675

67-
# Step 2: Clone Quarkus LangChain4j
76+
# Step 2: Clone Quarkus LangChain4j from your fork
6877
- name: Clone Quarkus LangChain4j
6978
run: |
7079
cd ${{ github.workspace }}
71-
git clone https://github.com/quarkiverse/quarkus-langchain4j.git
72-
echo "✅ Quarkus LangChain4j cloned"
80+
git clone --branch gpu-llama3-ci-support https://github.com/orionpapadakis/quarkus-langchain4j.git
81+
echo "✅ Quarkus LangChain4j cloned from fork"
7382
7483
# Step 3: Build Quarkus LangChain4j (optimized)
7584
- name: Build Quarkus LangChain4j
@@ -96,12 +105,14 @@ jobs:
96105
97106
echo "Running Quarkus-Langchain4j integration test with model: $MODEL_PATH"
98107
99-
# Start the application in the background
100-
java "@$TORNADO_SDK/tornado-argfile" -jar target/quarkus-app/quarkus-run.jar &
108+
# Start the app with the test profile
109+
java -jar target/quarkus-app/quarkus-run.jar \
110+
-Dquarkus.profile=test \
111+
@"$TORNADO_SDK/tornado-argfile" &
101112
APP_PID=$!
102113
103114
# Wait for the application to start
104-
echo "Waiting for application to start..."
115+
echo "Starting Quarkus application..."
105116
for i in {1..30}; do
106117
if curl -s http://localhost:8080/q/health > /dev/null 2>&1; then
107118
echo "✅ Application started successfully"
@@ -115,38 +126,12 @@ jobs:
115126
fi
116127
done
117128
118-
# Test that GPULlama3 integration is working
119-
echo "Testing GPULlama3 integration..."
120-
121-
# Test the blocking chat endpoint
122-
echo "Testing blocking chat endpoint..."
129+
# Test endpoints
123130
BLOCKING_RESPONSE=$(curl -s -w "%{http_code}" http://localhost:8080/chat/blocking)
124-
HTTP_CODE="${BLOCKING_RESPONSE: -3}"
125-
126-
if [ "$HTTP_CODE" = "200" ]; then
127-
RESPONSE_BODY="${BLOCKING_RESPONSE%???}"
128-
if [ ${#RESPONSE_BODY} -gt 10 ]; then
129-
echo "✅ Blocking chat endpoint working - received response: ${RESPONSE_BODY:0:50}..."
130-
else
131-
echo "⚠️ Blocking chat endpoint returned short response: $RESPONSE_BODY"
132-
fi
133-
else
134-
echo "❌ Blocking chat endpoint failed with HTTP code: $HTTP_CODE"
135-
echo "Response: ${BLOCKING_RESPONSE%???}"
136-
fi
137-
138-
# Test the streaming chat endpoint (just check it responds)
139-
echo "Testing streaming chat endpoint..."
140131
STREAMING_RESPONSE=$(timeout 10s curl -s -w "%{http_code}" http://localhost:8080/chat/streaming)
141-
STREAMING_HTTP_CODE="${STREAMING_RESPONSE: -3}"
142-
143-
if [ "$STREAMING_HTTP_CODE" = "200" ]; then
144-
echo "✅ Streaming chat endpoint responding"
145-
else
146-
echo "⚠️ Streaming chat endpoint returned HTTP code: $STREAMING_HTTP_CODE"
147-
fi
148132
149-
echo "✅ GPULlama3 integration test completed"
133+
echo "Blocking endpoint HTTP code: ${BLOCKING_RESPONSE: -3}"
134+
echo "Streaming endpoint HTTP code: ${STREAMING_RESPONSE: -3}"
150135
151136
# Clean shutdown
152137
kill $APP_PID || true

0 commit comments

Comments
 (0)