Skip to content

Commit

Permalink
test sync registry feature
Browse files Browse the repository at this point in the history
  • Loading branch information
glegendre01 committed Jul 11, 2024
1 parent 8a472df commit fa6b1bf
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,35 @@ jobs:
labels: ${{ steps.meta.outputs.labels || steps.meta-pr.outputs.labels }}
cache-from: type=s3,region=us-east-1,bucket=ci-docker-buildx-cache,name=text-generation-inference-cache${{ env.LABEL }},mode=min,access_key_id=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_ACCESS_KEY_ID }},secret_access_key=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_SECRET_ACCESS_KEY }},mode=min
cache-to: type=s3,region=us-east-1,bucket=ci-docker-buildx-cache,name=text-generation-inference-cache${{ env.LABEL }},mode=min,access_key_id=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_ACCESS_KEY_ID }},secret_access_key=${{ secrets.S3_CI_DOCKER_BUILDX_CACHE_SECRET_ACCESS_KEY }},mode=min
# If main, trigger sync registry
- name: Extract metadata (tags, labels) for Internal Registry
if: ${{ github.event_name != 'pull_request' }}
id: meta-internal-registry
uses: docker/[email protected]
with:
flavor: |
latest=auto
images: |
registry.internal.huggingface.tech/api-inference/community/text-generation-inference
tags: |
type=semver,pattern={{version}}${{ env.LABEL }}
type=semver,pattern={{major}}.{{minor}}${{ env.LABEL }}
type=raw,value=latest${{ env.LABEL }},enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}${{ env.LABEL }}
- name: Sync to internal registry
if: ${{ github.event_name != 'pull_request' }}
id: sync-internal-registry
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: Copy to internal registry
repo: ${{ secrets.SYNC_REGISTRY_REPO }}
wait-for-completion: true
wait-for-completion-interval: 10s
display-workflow-run-url-interval: 10s
ref: refs/heads/main
token: ${{ secrets.SYNC_REGISTRY_TOKEN }}
inputs: '{"source_image": "registry-us-east-1.prod.aws.ci.huggingface.tech/api-inference/community/text-generation-inference:sha-${{ env.GITHUB_SHA_SHORT }}${{ env.LABEL }}", "destination_image": ${{ join(steps.meta-internal-registry.outputs.tags,',') }} }'

- name: Final
id: final
run: |
Expand Down

0 comments on commit fa6b1bf

Please sign in to comment.