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
46 changes: 46 additions & 0 deletions .github/workflows/publish-docker-full-amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docker Full AMD64
on:
release:
types: [created]

jobs:
build:
name: Build full Docker image for AMD64
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and push full AMD64 image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64
tags: |
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.VERSION }}-amd64
ghcr.io/${{ github.repository }}:latest-amd64
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.description=OptiLLM full image with model serving and API routing capabilities (AMD64)
org.opencontainers.image.licenses=Apache-2.0
org.opencontainers.image.version=${{ steps.version.outputs.VERSION }}
cache-from: type=gha,scope=full-amd64
cache-to: type=gha,scope=full-amd64,mode=max
49 changes: 49 additions & 0 deletions .github/workflows/publish-docker-full-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker Full ARM64
on:
release:
types: [created]

jobs:
build:
name: Build full Docker image for ARM64
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

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

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and push full ARM64 image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
platforms: linux/arm64
tags: |
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.VERSION }}-arm64
ghcr.io/${{ github.repository }}:latest-arm64
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.description=OptiLLM full image with model serving and API routing capabilities (ARM64)
org.opencontainers.image.licenses=Apache-2.0
org.opencontainers.image.version=${{ steps.version.outputs.VERSION }}
cache-from: type=gha,scope=full-arm64
cache-to: type=gha,scope=full-arm64,mode=max
123 changes: 123 additions & 0 deletions .github/workflows/publish-docker-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Docker Multi-arch Manifests
on:
workflow_run:
workflows:
- "Docker Proxy AMD64"
- "Docker Proxy ARM64"
- "Docker Full AMD64"
- "Docker Full ARM64"
types: [completed]

jobs:
check-builds:
name: Check if all builds succeeded
runs-on: ubuntu-latest
outputs:
all-success: ${{ steps.check.outputs.result }}
version: ${{ steps.version.outputs.VERSION }}
steps:
- name: Check workflow results
id: check
uses: actions/github-script@v7
with:
script: |
const workflows = [
"Docker Proxy AMD64",
"Docker Proxy ARM64",
"Docker Full AMD64",
"Docker Full ARM64"
];

const runId = context.payload.workflow_run.id;
const ref = context.payload.workflow_run.head_sha;

console.log(`Checking workflows for ref: ${ref}`);

// Get all workflow runs for this ref
const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
head_sha: ref,
status: 'completed'
});

const workflowResults = {};

for (const run of runs.workflow_runs) {
if (workflows.includes(run.name)) {
workflowResults[run.name] = run.conclusion;
console.log(`${run.name}: ${run.conclusion}`);
}
}

// Check if all workflows succeeded
const allSuccess = workflows.every(name =>
workflowResults[name] === 'success'
);

console.log(`All workflows successful: ${allSuccess}`);

return allSuccess;

- name: Extract version from workflow
id: version
run: |
VERSION=$(echo "${{ github.event.workflow_run.head_branch }}" | sed 's/refs\/tags\///')
if [[ $VERSION != v* ]]; then
# If not a version tag, use the tag from the triggering release
VERSION="${{ github.event.workflow_run.head_branch }}"
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"

create-manifests:
name: Create multi-arch manifests
runs-on: ubuntu-latest
needs: check-builds
if: needs.check-builds.outputs.all-success == 'true'
permissions:
contents: read
packages: write
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create proxy multi-arch manifest
run: |
VERSION="${{ needs.check-builds.outputs.version }}"

# Create versioned proxy manifest
docker manifest create ghcr.io/${{ github.repository }}:${VERSION}-proxy \
ghcr.io/${{ github.repository }}:${VERSION}-proxy-amd64 \
ghcr.io/${{ github.repository }}:${VERSION}-proxy-arm64

docker manifest push ghcr.io/${{ github.repository }}:${VERSION}-proxy

# Create latest proxy manifest
docker manifest create ghcr.io/${{ github.repository }}:latest-proxy \
ghcr.io/${{ github.repository }}:latest-proxy-amd64 \
ghcr.io/${{ github.repository }}:latest-proxy-arm64

docker manifest push ghcr.io/${{ github.repository }}:latest-proxy

- name: Create full multi-arch manifest
run: |
VERSION="${{ needs.check-builds.outputs.version }}"

# Create versioned full manifest
docker manifest create ghcr.io/${{ github.repository }}:${VERSION} \
ghcr.io/${{ github.repository }}:${VERSION}-amd64 \
ghcr.io/${{ github.repository }}:${VERSION}-arm64

docker manifest push ghcr.io/${{ github.repository }}:${VERSION}

# Create latest full manifest
docker manifest create ghcr.io/${{ github.repository }}:latest \
ghcr.io/${{ github.repository }}:latest-amd64 \
ghcr.io/${{ github.repository }}:latest-arm64

docker manifest push ghcr.io/${{ github.repository }}:latest
46 changes: 46 additions & 0 deletions .github/workflows/publish-docker-proxy-amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docker Proxy AMD64
on:
release:
types: [created]

jobs:
build:
name: Build proxy Docker image for AMD64
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and push proxy AMD64 image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.proxy_only
push: true
platforms: linux/amd64
tags: |
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.VERSION }}-proxy-amd64
ghcr.io/${{ github.repository }}:latest-proxy-amd64
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.description=OptiLLM proxy-only image for API routing without model serving capabilities (AMD64)
org.opencontainers.image.licenses=Apache-2.0
org.opencontainers.image.version=${{ steps.version.outputs.VERSION }}
cache-from: type=gha,scope=proxy-amd64
cache-to: type=gha,scope=proxy-amd64,mode=max
49 changes: 49 additions & 0 deletions .github/workflows/publish-docker-proxy-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker Proxy ARM64
on:
release:
types: [created]

jobs:
build:
name: Build proxy Docker image for ARM64
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

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

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and push proxy ARM64 image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.proxy_only
push: true
platforms: linux/arm64
tags: |
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.VERSION }}-proxy-arm64
ghcr.io/${{ github.repository }}:latest-proxy-arm64
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.description=OptiLLM proxy-only image for API routing without model serving capabilities (ARM64)
org.opencontainers.image.licenses=Apache-2.0
org.opencontainers.image.version=${{ steps.version.outputs.VERSION }}
cache-from: type=gha,scope=proxy-arm64
cache-to: type=gha,scope=proxy-arm64,mode=max
29 changes: 29 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upload Python Package to PyPI on Release
on:
release:
types: [created]

jobs:
pypi-publish:
name: Publish release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/optillm
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading