Skip to content

Commit ec321cc

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

1 file changed

Lines changed: 61 additions & 45 deletions

File tree

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

Lines changed: 61 additions & 45 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,16 @@ 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 &
101-
APP_PID=$!
102-
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" &
112+
113+
APP_PID=$!
114+
115+
103116
# Wait for the application to start
104-
echo "Waiting for application to start..."
117+
echo "Starting Quarkus application..."
105118
for i in {1..30}; do
106119
if curl -s http://localhost:8080/q/health > /dev/null 2>&1; then
107120
echo "✅ Application started successfully"
@@ -115,38 +128,41 @@ 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..."
131+
# Test endpoints
123132
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..."
140133
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
148-
149-
echo "✅ GPULlama3 integration test completed"
134+
135+
echo "Blocking endpoint HTTP code: ${BLOCKING_RESPONSE: -3}"
136+
echo "Streaming endpoint HTTP code: ${STREAMING_RESPONSE: -3}"
137+
# # Test the blocking chat endpoint
138+
# echo "Testing blocking chat endpoint..."
139+
# BLOCKING_RESPONSE=$(curl -s -w "%{http_code}" http://localhost:8080/chat/blocking)
140+
# HTTP_CODE="${BLOCKING_RESPONSE: -3}"
141+
#
142+
# if [ "$HTTP_CODE" = "200" ]; then
143+
# RESPONSE_BODY="${BLOCKING_RESPONSE%???}"
144+
# if [ ${#RESPONSE_BODY} -gt 10 ]; then
145+
# echo "✅ Blocking chat endpoint working - received response: ${RESPONSE_BODY:0:50}..."
146+
# else
147+
# echo "⚠️ Blocking chat endpoint returned short response: $RESPONSE_BODY"
148+
# fi
149+
# else
150+
# echo "❌ Blocking chat endpoint failed with HTTP code: $HTTP_CODE"
151+
# echo "Response: ${BLOCKING_RESPONSE%???}"
152+
# fi
153+
#
154+
# # Test the streaming chat endpoint (just check it responds)
155+
# echo "Testing streaming chat endpoint..."
156+
# STREAMING_RESPONSE=$(timeout 10s curl -s -w "%{http_code}" http://localhost:8080/chat/streaming)
157+
# STREAMING_HTTP_CODE="${STREAMING_RESPONSE: -3}"
158+
#
159+
# if [ "$STREAMING_HTTP_CODE" = "200" ]; then
160+
# echo "✅ Streaming chat endpoint responding"
161+
# else
162+
# echo "⚠️ Streaming chat endpoint returned HTTP code: $STREAMING_HTTP_CODE"
163+
# fi
164+
#
165+
# echo "✅ GPULlama3 integration test completed"
150166

151167
# Clean shutdown
152168
kill $APP_PID || true

0 commit comments

Comments
 (0)