Skip to content

Commit 774d757

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

1 file changed

Lines changed: 33 additions & 46 deletions

File tree

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

Lines changed: 33 additions & 46 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
@@ -92,18 +101,22 @@ jobs:
92101
93102
# Set model path
94103
MODEL_PATH="${MODELS_DIR}/Llama-3.2-1B-Instruct-F16.gguf"
104+
QUARKUS_PORT=8081
95105
export MODEL_PATH
96106
97-
echo "Running Quarkus-Langchain4j integration test with model: $MODEL_PATH"
107+
echo "Running Quarkus-Langchain4j integration test with model: $MODEL_PATH on port $QUARKUS_PORT"
98108
99-
# Start the application in the background
100-
java "@$TORNADO_SDK/tornado-argfile" -jar target/quarkus-app/quarkus-run.jar &
109+
# Start the app with the test profile
110+
java @"$TORNADO_SDK/tornado-argfile" \
111+
-Dquarkus.profile=test \
112+
-Dquarkus.http.port=$QUARKUS_PORT \
113+
-jar target/quarkus-app/quarkus-run.jar &
101114
APP_PID=$!
102115
103116
# Wait for the application to start
104-
echo "Waiting for application to start..."
117+
echo "Starting Quarkus application on port $QUARKUS_PORT..."
105118
for i in {1..30}; do
106-
if curl -s http://localhost:8080/q/health > /dev/null 2>&1; then
119+
if curl -s http://localhost:$QUARKUS_PORT/q/health > /dev/null 2>&1; then
107120
echo "✅ Application started successfully"
108121
break
109122
elif [ $i -eq 30 ]; then
@@ -115,38 +128,12 @@ jobs:
115128
fi
116129
done
117130
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..."
123-
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..."
140-
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
131+
# Trigger endpoints
132+
BLOCKING_RESPONSE=$(curl -s -w "%{http_code}" http://localhost:$QUARKUS_PORT/chat/blocking)
133+
STREAMING_RESPONSE=$(timeout 10s curl -s -w "%{http_code}" http://localhost:$QUARKUS_PORT/chat/streaming)
148134
149-
echo "✅ GPULlama3 integration test completed"
135+
echo "Blocking endpoint HTTP code: ${BLOCKING_RESPONSE: -3}"
136+
echo "Streaming endpoint HTTP code: ${STREAMING_RESPONSE: -3}"
150137
151138
# Clean shutdown
152139
kill $APP_PID || true

0 commit comments

Comments
 (0)