Skip to content

Commit 5505bac

Browse files
committed
Add build-and-push-image for Intel GPUs
1 parent 5888034 commit 5505bac

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

.github/workflows/build.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,105 @@ jobs:
274274
cache-from: type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache-rocm,mode=min
275275
cache-to: type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache-rocm,mode=min
276276

277+
build-and-push-image-intel:
278+
concurrency:
279+
group: ${{ github.workflow }}-build-and-push-image-intel-${{ github.head_ref || github.run_id }}
280+
cancel-in-progress: true
281+
needs:
282+
- start-runner
283+
- build-and-push-image # Wait for the main docker image to be built
284+
- integration-tests # Wait for the main integration-tests
285+
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
286+
permissions:
287+
contents: write
288+
packages: write
289+
# This is used to complete the identity challenge
290+
# with sigstore/fulcio when running outside of PRs.
291+
id-token: write
292+
security-events: write
293+
steps:
294+
- name: Checkout repository
295+
uses: actions/checkout@v3
296+
- name: Initialize Docker Buildx
297+
uses: docker/[email protected]
298+
with:
299+
install: true
300+
- name: Inject slug/short variables
301+
uses: rlespinasse/[email protected]
302+
- name: Tailscale
303+
uses: tailscale/github-action@7bd8039bf25c23c4ab1b8d6e2cc2da2280601966
304+
with:
305+
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
306+
- name: Login to GitHub Container Registry
307+
if: github.event_name != 'pull_request'
308+
uses: docker/login-action@v2
309+
with:
310+
registry: ghcr.io
311+
username: ${{ github.actor }}
312+
password: ${{ secrets.GITHUB_TOKEN }}
313+
- name: Login to internal Container Registry
314+
uses: docker/[email protected]
315+
with:
316+
username: ${{ secrets.TAILSCALE_DOCKER_USERNAME }}
317+
password: ${{ secrets.TAILSCALE_DOCKER_PASSWORD }}
318+
registry: registry.internal.huggingface.tech
319+
- name: Login to Azure Container Registry
320+
if: github.event_name != 'pull_request'
321+
uses: docker/[email protected]
322+
with:
323+
username: ${{ secrets.AZURE_DOCKER_USERNAME }}
324+
password: ${{ secrets.AZURE_DOCKER_PASSWORD }}
325+
registry: db4c2190dd824d1f950f5d1555fbadf0.azurecr.io
326+
# If pull request
327+
- name: Extract metadata (tags, labels) for Docker
328+
if: ${{ github.event_name == 'pull_request' }}
329+
id: meta-pr
330+
uses: docker/[email protected]
331+
with:
332+
images: |
333+
registry.internal.huggingface.tech/api-inference/community/text-generation-inference
334+
tags: |
335+
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}-intel
336+
# If main, release or tag
337+
- name: Extract metadata (tags, labels) for Docker
338+
if: ${{ github.event_name != 'pull_request' }}
339+
id: meta
340+
uses: docker/[email protected]
341+
with:
342+
flavor: |
343+
latest=false
344+
images: |
345+
registry.internal.huggingface.tech/api-inference/community/text-generation-inference
346+
ghcr.io/huggingface/text-generation-inference
347+
db4c2190dd824d1f950f5d1555fbadf0.azurecr.io/text-generation-inference
348+
tags: |
349+
type=semver,pattern={{version}}-intel
350+
type=semver,pattern={{major}}.{{minor}}-intel
351+
type=raw,value=latest-intel,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
352+
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}-intel
353+
- name: Build and push Docker image
354+
id: build-and-push
355+
uses: docker/build-push-action@v4
356+
with:
357+
context: .
358+
file: Dockerfile_intel
359+
push: true
360+
platforms: 'linux/amd64'
361+
build-args: |
362+
GIT_SHA=${{ env.GITHUB_SHA }}
363+
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}-intel
364+
tags: ${{ steps.meta.outputs.tags || steps.meta-pr.outputs.tags }}
365+
labels: ${{ steps.meta.outputs.labels || steps.meta-pr.outputs.labels }}
366+
cache-from: type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache-intel,mode=min
367+
cache-to: type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache-intel,mode=min
368+
277369
stop-runner:
278370
name: Stop self-hosted EC2 runner
279371
needs:
280372
- start-runner
281373
- build-and-push-image
282374
- build-and-push-image-rocm
375+
- build-and-push-image-intel
283376
- integration-tests
284377
runs-on: ubuntu-latest
285378
env:

0 commit comments

Comments
 (0)