Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/dev-jan-api-gateway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI - jan-api-gateway
on:
push:
branches:
- dev
paths:
- "apps/jan-api-gateway/**"
- .github/workflows/dev-jan-api-gateway
- .github/workflows/template-docker.yml
pull_request:
branches:
- dev
paths:
- "apps/jan-api-gateway/**"
- .github/workflows/dev-jan-api-gateway
- .github/workflows/template-docker.yml

jobs:
build-docker-x64:
uses: ./.github/workflows/template-docker.yml
secrets: inherit
with:
runs-on: ubuntu-24-04-docker
docker-file: apps/jan-api-gateway/Dockerfile
context: apps/jan-api-gateway
registry-url: registry.menlo.ai
tags: registry.menlo.ai/jan-server/jan-api-gateway:dev-${{ github.sha }}
is_push: ${{ github.event_name == 'push' }}
29 changes: 29 additions & 0 deletions .github/workflows/dev-jan-inference-model.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI - jan-inference-model

on:
push:
branches:
- dev
paths:
- "apps/jan-inference-model/**"
- .github/workflows/dev-jan-inference-model
- .github/workflows/template-docker.yml
pull_request:
branches:
- dev
paths:
- "apps/jan-inference-model/**"
- .github/workflows/dev-jan-inference-model
- .github/workflows/template-docker.yml

jobs:
build-docker-x64:
uses: ./.github/workflows/template-docker.yml
secrets: inherit
with:
runs-on: ubuntu-24-04-docker
docker-file: apps/jan-inference-model/Dockerfile
context: apps/jan-inference-model
registry-url: registry.menlo.ai
tags: registry.menlo.ai/jan-server/jan-inference-model:dev-${{ github.sha }}
is_push: ${{ github.event_name == 'push' }}
94 changes: 94 additions & 0 deletions .github/workflows/template-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: build-docker-x64
on:
workflow_call:
inputs:
runs-on:
required: false
type: string
default: "ubuntu-latest"
description: "The runner to use for this job"
docker-file:
required: true
type: string
default: "./Dockerfile"
description: "The docker file to use for this job"
context:
required: true
type: string
default: "."
description: "The context to use for this job"
registry-url:
required: false
type: string
default: "docker.io"
description: "The URL of the docker registry to use"
is_push:
required: false
type: boolean
default: true
description: "Whether to push the docker image"
build-args:
required: false
type: string
default: ""
description: "The build args to use for docker build"
tags:
required: false
type: string
default: "menloltd/cortex:latest"
description: "The tags to use for docker build and push"
need_build_time_env_file:
required: false
type: boolean
default: false
description: "Whether to use the build-time environment file"
dot_env_source_file:
required: false
type: string
default: ".env"
description: "The .env file to use for this job"
dot_env_destination_file:
required: false
type: string
default: ".env"
description: "The .env file to use for this job"

jobs:
build-docker-x64:
runs-on: ${{ inputs.runs-on }}
permissions:
contents: write
steps:
- name: Getting the repo
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ inputs.registry-url }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Set .env file for build-time environment
if: ${{ inputs.need_build_time_env_file }}
continue-on-error: true
run: |
mv ${{ inputs.dot_env_source_file }} ${{ inputs.dot_env_destination_file }}
cat ${{ inputs.dot_env_destination_file }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ${{ inputs.context }}
file: ${{ inputs.docker-file }}
push: ${{ inputs.is_push }}
tags: ${{ inputs.tags }}
build-args: ${{ inputs.build-args }}
3 changes: 2 additions & 1 deletion apps/jan-api-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM golang:1.24.6-alpine AS builder
WORKDIR /app

COPY application/go.mod application/go.sum ./
COPY application/go.mod ./
RUN go mod download

COPY application/. .
RUN go mod tidy
RUN go build -o /jan-api-gateway -ldflags="-s -w" ./cmd/server

FROM alpine:latest
Expand Down
2 changes: 1 addition & 1 deletion apps/jan-inference-model/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RUN pip install --no-cache-dir huggingface_hub \

EXPOSE 8101

CMD ["--model", "Qwen/Qwen3-4B", "--host", "0.0.0.0", "--port", "8101"]
CMD ["--model", "Qwen/Qwen3-4B", "--host", "0.0.0.0", "--port", "8101", "--gpu-memory-utilization", "0.65", "--enforce-eager", "--max_model_len", "32768"]
Loading