Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e47255f
feat: enhance CI pipeline with improved caching and multi-arch support
Aias00 Oct 8, 2025
8a3c551
Merge branch 'main' into feat/ci_time
Aias00 Oct 8, 2025
0dd98df
feat: refactor Dockerfile to use Makefile for Rust library build
Aias00 Oct 8, 2025
c3ceee1
Merge branch 'main' into feat/ci_time
Aias00 Oct 8, 2025
f1a7601
feat: simplify Dockerfile by removing unnecessary directory creation
Aias00 Oct 8, 2025
06e5784
Merge branch 'feat/ci_time' of https://github.com/Aias00/semantic-rou…
Aias00 Oct 8, 2025
5aa2708
Merge branch 'main' into feat/ci_time
Aias00 Oct 9, 2025
d8ef7d5
feat: enhance Dockerfiles for cross-compilation and optimize CI pipeline
Aias00 Oct 9, 2025
2bd7a67
feat: enhance cross-compilation support in Dockerfile for ARM64 and A…
Aias00 Oct 9, 2025
5e03de2
feat: improve ARM64 cross-compilation process in Dockerfile
Aias00 Oct 9, 2025
a5c53d7
feat: enhance Dockerfile to include detailed build output for Rust li…
Aias00 Oct 9, 2025
76e71d9
feat: enhance Dockerfile to include detailed build output for Rust li…
Aias00 Oct 9, 2025
e0acd87
feat: optimize CI pipeline with disk cleanup steps and improved build…
Aias00 Oct 9, 2025
790bd2d
feat: update CI configuration for ARM64 builds and improve Dockerfile…
Aias00 Oct 9, 2025
ebdc8a3
feat: simplify CI configuration by standardizing runner for ARM64 builds
Aias00 Oct 9, 2025
621b07c
feat: enhance Dockerfile for ARM64 cross-compilation with OpenSSL con…
Aias00 Oct 9, 2025
75e158c
feat: enhance Dockerfile for ARM64 cross-compilation with OpenSSL con…
Aias00 Oct 9, 2025
a1b17cf
feat: enhance Dockerfile for ARM64 cross-compilation with OpenSSL con…
Aias00 Oct 9, 2025
2fc08e4
feat: enhance Dockerfile for ARM64 cross-compilation with OpenSSL con…
Aias00 Oct 9, 2025
3c0ee66
feat: update CI configuration for multi-architecture Docker image builds
Aias00 Oct 9, 2025
a7cb96c
feat: update CI manifest tagging for pull requests with architecture …
Aias00 Oct 9, 2025
5bdbb16
feat: remove architecture suffix from pull request tags in CI manifest
Aias00 Oct 9, 2025
291fbae
feat: update CI manifest tagging for pull requests with architecture …
Aias00 Oct 9, 2025
0a509b7
feat: update CI manifest tagging for pull requests with architecture …
Aias00 Oct 9, 2025
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
49 changes: 31 additions & 18 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ on:
default: false
push:
branches: [ "main" ]
pull_request:
paths:
- ".github/workflows/docker-publish.yml"
- "Dockerfile*"
- "candle-binding/**"
- "src/**"
- "e2e-tests/llm-katan/**"

jobs:
# Parallel job for building both images
Expand All @@ -42,7 +49,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Set up QEMU (only for multi-arch builds)
if: inputs.skip_multiarch != true
if: inputs.skip_multiarch != true && github.event_name != 'pull_request'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
Expand All @@ -62,33 +69,24 @@ jobs:
- name: Set lowercase repository owner
run: echo "REPOSITORY_OWNER_LOWER=$(echo $GITHUB_REPOSITORY_OWNER | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

# Rust build cache for extproc - only use GitHub Actions cache for non-PR builds
- name: Cache Rust dependencies (extproc only)
if: matrix.image == 'extproc' && github.event_name != 'pull_request'
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
candle-binding/target/
key: ${{ runner.os }}-cargo-extproc-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-extproc-

# Set build context and dockerfile based on matrix
- name: Set build parameters
id: build-params
run: |
# Skip multi-arch for PRs to speed up CI, unless explicitly disabled
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is misleading. The logic actually skips multi-arch for PRs unless explicitly enabled (when skip_multiarch is false), not 'unless explicitly disabled'.

Suggested change
# Skip multi-arch for PRs to speed up CI, unless explicitly disabled
# Skip multi-arch for PRs to speed up CI, unless explicitly enabled

Copilot uses AI. Check for mistakes.

PLATFORMS="linux/amd64"
if [ "${{ inputs.skip_multiarch }}" != "true" ] && [ "${{ github.event_name }}" != "pull_request" ]; then
PLATFORMS="linux/amd64,linux/arm64"
fi

if [ "${{ matrix.image }}" = "extproc" ]; then
echo "context=." >> $GITHUB_OUTPUT
echo "dockerfile=./Dockerfile.extproc" >> $GITHUB_OUTPUT
echo "platforms=${{ inputs.skip_multiarch == true && 'linux/amd64' || 'linux/amd64,linux/arm64' }}" >> $GITHUB_OUTPUT
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
elif [ "${{ matrix.image }}" = "llm-katan" ]; then
echo "context=./e2e-tests/llm-katan" >> $GITHUB_OUTPUT
echo "dockerfile=./e2e-tests/llm-katan/Dockerfile" >> $GITHUB_OUTPUT
echo "platforms=${{ inputs.skip_multiarch == true && 'linux/amd64' || 'linux/amd64,linux/arm64' }}" >> $GITHUB_OUTPUT
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
fi

# Extract version for llm-katan
Expand Down Expand Up @@ -132,6 +130,7 @@ jobs:
fi

- name: Build and push ${{ matrix.image }} Docker image
id: build
uses: docker/build-push-action@v5
with:
context: ${{ steps.build-params.outputs.context }}
Expand All @@ -140,5 +139,19 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
load: ${{ github.event_name == 'pull_request' }}
tags: ${{ matrix.image == 'extproc' && steps.extproc-tags.outputs.tags || steps.llm-katan-tags.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILDKIT_INLINE_CACHE=1
CARGO_BUILD_JOBS=4
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coding CARGO_BUILD_JOBS to 4 may not be optimal for all runner types. Consider using a dynamic value based on available CPU cores, such as CARGO_BUILD_JOBS=${{ github.event_name == 'pull_request' && '2' || '4' }}.

Suggested change
CARGO_BUILD_JOBS=4
CARGO_BUILD_JOBS=${{ github.event_name == 'pull_request' && '2' || '4' }}

Copilot uses AI. Check for mistakes.

BUILDKIT_PROGRESS=plain

- name: Build summary
if: always()
run: |
if [ "${{ steps.build.conclusion }}" = "success" ]; then
echo "::notice title=Build Success::${{ matrix.image }} build completed successfully"
echo "Image digest: ${{ steps.build.outputs.digest }}"
else
echo "::error title=Build Failed::${{ matrix.image }} build failed"
fi
9 changes: 7 additions & 2 deletions Dockerfile.extproc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ RUN mkdir -p src/semantic-router
COPY src/semantic-router/go.mod src/semantic-router/go.sum src/semantic-router/
COPY candle-binding/go.mod candle-binding/semantic-router.go candle-binding/

# Download Go dependencies (cached layer)
RUN cd src/semantic-router && go mod download

# Copy semantic-router source code
COPY src/semantic-router/ src/semantic-router/

Expand All @@ -38,9 +41,11 @@ COPY --from=rust-builder /app/candle-binding/target/release/libcandle_semantic_r
# Set environment variables for CGO to find the library
ENV CGO_ENABLED=1
ENV LD_LIBRARY_PATH=/app/candle-binding/target/release
ENV GOOS=linux

# Build the router binary
RUN mkdir -p bin && cd src/semantic-router && go build -o ../../bin/router cmd/main.go
# Build the router binary with optimizations
RUN mkdir -p bin && cd src/semantic-router && \
go build -ldflags="-w -s" -o ../../bin/router cmd/main.go

# Final stage: copy the binary and the shared library
FROM quay.io/centos/centos:stream9
Expand Down
Loading