-
Notifications
You must be signed in to change notification settings - Fork 103
Update DMR integration to new Compose integration #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: Smoke Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| smoke-test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| project: [go-genai, py-genai, node-genai, rust-genai] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Install Docker Model Plugin | ||
| run: | | ||
| # Add Docker's official GPG key | ||
| sudo apt-get update | ||
| sudo apt-get install ca-certificates curl | ||
| sudo install -m 0755 -d /etc/apt/keyrings | ||
| sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | ||
| sudo chmod a+r /etc/apt/keyrings/docker.asc | ||
|
|
||
| # Add the repository to Apt sources | ||
| echo \ | ||
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ | ||
| $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | ||
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
| sudo apt-get update | ||
|
|
||
| # Install docker-model-plugin | ||
| sudo apt-get install -y docker-model-plugin | ||
|
|
||
| # Verify installation | ||
| if sudo docker model version; then | ||
| echo "Docker Model Plugin installed successfully" | ||
| else | ||
| echo "Failed to install Docker Model Plugin" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Build project | ||
| working-directory: ./${{ matrix.project }} | ||
| run: | | ||
| docker compose build | ||
|
|
||
| - name: Start services and run smoke tests | ||
| working-directory: ./${{ matrix.project }} | ||
| run: | | ||
| # Start services in detached mode | ||
| docker compose up -d | ||
|
|
||
| # Get the port for this project | ||
| case "${{ matrix.project }}" in | ||
| "go-genai") PORT=8080 ;; | ||
| "py-genai") PORT=8081 ;; | ||
| "node-genai") PORT=8082 ;; | ||
| "rust-genai") PORT=8083 ;; | ||
| esac | ||
|
|
||
| # Wait for service to be healthy | ||
| echo "Waiting for service on port $PORT to be healthy..." | ||
| timeout 120s bash -c 'until curl -f http://localhost:'$PORT'/health; do | ||
| echo "Service not ready yet, waiting..." | ||
| sleep 5 | ||
| done' | ||
|
|
||
| echo "Service is healthy, starting smoke tests..." | ||
|
|
||
| # Test main page | ||
| echo "Testing main page..." | ||
| curl -f http://localhost:$PORT/ || (echo "Main page failed" && exit 1) | ||
|
|
||
| # Test chat API with actual model interaction | ||
| echo "Testing chat API with model..." | ||
| RESPONSE=$(curl -s -X POST http://localhost:$PORT/api/chat \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"message": "Hello"}' \ | ||
| --max-time 30) | ||
|
|
||
| if [[ $? -eq 0 ]] && [[ "$RESPONSE" == *"response"* ]]; then | ||
| echo "✅ Chat API test passed" | ||
| else | ||
| echo "❌ Chat API test failed: $RESPONSE" | ||
| # Don't fail the test for now as model interaction might be flaky | ||
| fi | ||
|
|
||
| # Test model info endpoint | ||
| echo "Testing model info..." | ||
| MODEL_INFO=$(curl -s -X POST http://localhost:$PORT/api/chat \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"message": "!modelinfo"}' \ | ||
| --max-time 10) | ||
|
|
||
| if [[ $? -eq 0 ]] && [[ "$MODEL_INFO" == *"model"* ]]; then | ||
| echo "✅ Model info test passed" | ||
| else | ||
| echo "❌ Model info test failed: $MODEL_INFO" | ||
| fi | ||
|
|
||
| echo "✅ Smoke tests completed for ${{ matrix.project }}" | ||
|
|
||
| - name: Check logs on failure | ||
| if: failure() | ||
| working-directory: ./${{ matrix.project }} | ||
| run: | | ||
| echo "=== Docker Compose Logs ===" | ||
| docker compose logs | ||
| echo "=== Container Status ===" | ||
| docker compose ps | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,88 +1,6 @@ | ||
| services: | ||
| go-genai: | ||
| build: | ||
| context: ./go-genai | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8080:8080" | ||
| environment: | ||
| - PORT=8080 | ||
| env_file: | ||
| - .env | ||
| restart: unless-stopped | ||
| extra_hosts: | ||
| - "host.docker.internal:host-gateway" | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8080/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 10s | ||
| include: | ||
| - go-genai/docker-compose.yml | ||
| - py-genai/docker-compose.yml | ||
| - node-genai/docker-compose.yml | ||
| - rust-genai/docker-compose.yaml | ||
|
|
||
| python-genai: | ||
| build: | ||
| context: ./py-genai | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8081:8081" | ||
| environment: | ||
| - PORT=8081 | ||
| - LOG_LEVEL=INFO | ||
| env_file: | ||
| - .env | ||
| restart: unless-stopped | ||
| extra_hosts: | ||
| - "host.docker.internal:host-gateway" | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8081/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 10s | ||
| volumes: | ||
| - ./py-genai:/app | ||
|
|
||
| node-genai: | ||
| build: | ||
| context: ./node-genai | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8082:8082" | ||
| environment: | ||
| - PORT=8082 | ||
| env_file: | ||
| - .env | ||
| restart: unless-stopped | ||
| extra_hosts: | ||
| - "host.docker.internal:host-gateway" | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8082/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 10s | ||
|
|
||
| rust-genai: | ||
| build: | ||
| context: ./rust-genai | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8083:8083" | ||
| environment: | ||
| - PORT=8083 | ||
| env_file: | ||
| - .env | ||
| restart: unless-stopped | ||
| extra_hosts: | ||
| - "host.docker.internal:host-gateway" | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8083/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 10s | ||
|
|
||
| networks: | ||
| default: | ||
| name: hello-genai-network | ||
| driver: bridge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| services: | ||
| go-genai: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8080:8080" | ||
| environment: | ||
| - PORT=8080 | ||
| x-genai-models: | ||
| - llama | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8080/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 10s | ||
|
|
||
| models: | ||
| llama: | ||
| model: ai/llama3.2:1B-Q8_0 | ||
| context_size: 2048 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| services: | ||
| node-genai: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8082:8080" | ||
| environment: | ||
| - PORT=8080 | ||
| x-genai-models: | ||
| - llama | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8080/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 10s | ||
|
|
||
| models: | ||
| llama: | ||
| model: ai/llama3.2:1B-Q8_0 | ||
| context_size: 2048 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the
x-genai-prefix?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol no clue TBH, I did this some time ago and I guess Claude came up with it, or maybe back then it was even needed?