Skip to content

Commit

Permalink
Upgrade to v1.2 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
regisss authored Apr 19, 2024
1 parent 54bb856 commit 093ff8b
Show file tree
Hide file tree
Showing 55 changed files with 5,457 additions and 1,156 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/build_75.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
- 'main'
tags:
- 'v*'
pull_request:
paths:
- ".github/workflows/build_75.yaml"
# - "integration-tests/**"
- "backends/**"
- "core/**"
- "router/**"
- "Cargo.lock"
- "rust-toolchain.toml"
- "Dockerfile"
branches:
- 'main'

jobs:
build-and-push-image:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/build_86.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
- 'main'
tags:
- 'v*'
pull_request:
paths:
- ".github/workflows/build.yaml"
# - "integration-tests/**"
- "backends/**"
- "core/**"
- "router/**"
- "Cargo.lock"
- "rust-toolchain.toml"
- "Dockerfile"
branches:
- 'main'

jobs:
build-and-push-image:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/build_89.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
- 'main'
tags:
- 'v*'
pull_request:
paths:
- ".github/workflows/build.yaml"
# - "integration-tests/**"
- "backends/**"
- "core/**"
- "router/**"
- "Cargo.lock"
- "rust-toolchain.toml"
- "Dockerfile"
branches:
- 'main'

jobs:
build-and-push-image:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/build_90.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
- 'main'
tags:
- 'v*'
pull_request:
paths:
- ".github/workflows/build.yaml"
# - "integration-tests/**"
- "backends/**"
- "core/**"
- "router/**"
- "Cargo.lock"
- "rust-toolchain.toml"
- "Dockerfile"
branches:
- 'main'

jobs:
build-and-push-image:
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/build_all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build and push Cuda docker image to registry

on:
workflow_dispatch:
push:
tags:
- 'v*'

jobs:
build-and-push-image:
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-all-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
runs-on: [self-hosted, intel-cpu, 32-cpu, tgi-ci]
permissions:
contents: write
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize Docker Buildx
uses: docker/[email protected]
with:
install: true
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Tailscale
uses: tailscale/github-action@7bd8039bf25c23c4ab1b8d6e2cc2da2280601966
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to internal Container Registry
uses: docker/[email protected]
with:
username: ${{ secrets.TAILSCALE_DOCKER_USERNAME }}
password: ${{ secrets.TAILSCALE_DOCKER_PASSWORD }}
registry: registry.internal.huggingface.tech
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: |
registry.internal.huggingface.tech/api-inference/text-embeddings-inference
ghcr.io/huggingface/text-embeddings-inference
flavor: |
latest=false
tags: |
type=semver,pattern=cuda-{{version}}
type=semver,pattern=cuda-{{major}}.{{minor}}
type=raw,value=cuda-latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=raw,value=cuda-sha-${{ env.GITHUB_SHA_SHORT }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile-cuda-all
push: ${{ github.event_name != 'pull_request' }}
platforms: 'linux/amd64'
build-args: |
GIT_SHA=${{ env.GITHUB_SHA }}
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=registry.internal.huggingface.tech/api-inference/text-embeddings-inference:cache-all,mode=max
cache-to: type=registry,ref=registry.internal.huggingface.tech/api-inference/text-embeddings-inference:cache-all,mode=max
- name: Extract metadata (tags, labels) for Docker
id: meta-sagemaker
uses: docker/[email protected]
with:
images: |
registry.internal.huggingface.tech/api-inference/text-embeddings-inference/sagemaker
flavor: |
latest=false
tags: |
type=semver,pattern=cuda-{{version}}
type=semver,pattern=cuda-{{major}}.{{minor}}
type=raw,value=cuda-latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=raw,value=cuda-sha-${{ env.GITHUB_SHA_SHORT }}
- name: Build and push Docker image
id: build-and-push-sagemaker
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile-cuda-all
push: ${{ github.event_name != 'pull_request' }}
platforms: 'linux/amd64'
target: sagemaker
build-args: |
GIT_SHA=${{ env.GITHUB_SHA }}
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
tags: ${{ steps.meta-sagemaker.outputs.tags }}
labels: ${{ steps.meta-sagemaker.outputs.labels }}
cache-from: type=registry,ref=registry.internal.huggingface.tech/api-inference/text-embeddings-inference:cache-all,mode=max
cache-to: type=registry,ref=registry.internal.huggingface.tech/api-inference/text-embeddings-inference:cache-all,mode=max
Loading

0 comments on commit 093ff8b

Please sign in to comment.