83
83
labels : ${{ steps.meta.outputs.labels }}
84
84
cache-from : type=registry,ref=registry.internal.huggingface.tech/api-inference/text-embeddings-inference:cache-all,mode=max
85
85
cache-to : type=registry,ref=registry.internal.huggingface.tech/api-inference/text-embeddings-inference:cache-all,mode=max
86
+
87
+ build-and-push-sagemaker-image :
88
+ needs :
89
+ - build-and-push-image
90
+ concurrency :
91
+ group : ${{ github.workflow }}-${{ github.job }}-all-${{ github.head_ref || github.run_id }}
92
+ cancel-in-progress : true
93
+ runs-on : [self-hosted, intel-cpu, 32-cpu, tgi-ci]
94
+ permissions :
95
+ contents : write
96
+ packages : write
97
+ # This is used to complete the identity challenge
98
+ # with sigstore/fulcio when running outside of PRs.
99
+ id-token : write
100
+ security-events : write
101
+ steps :
102
+ - name : Checkout repository
103
+ uses : actions/checkout@v3
104
+ - name : Initialize Docker Buildx
105
+ uses : docker/setup-buildx-action@v2.0.0
106
+ with :
107
+ install : true
108
+ - name : Configure sccache
109
+ uses : actions/github-script@v6
110
+ with :
111
+ script : |
112
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
113
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
114
+ - name : Inject slug/short variables
115
+ uses : rlespinasse/github-slug-action@v4.4.1
116
+ - name : Login to internal Container Registry
117
+ uses : docker/login-action@v2.1.0
118
+ with :
119
+ username : ${{ secrets.TAILSCALE_DOCKER_USERNAME }}
120
+ password : ${{ secrets.TAILSCALE_DOCKER_PASSWORD }}
121
+ registry : registry.internal.huggingface.tech
122
+ - name : Extract metadata (tags, labels) for Docker
123
+ id : meta
124
+ uses : docker/metadata-action@v4.3.0
125
+ with :
126
+ images : |
127
+ registry.internal.huggingface.tech/api-inference/text-embeddings-inference/sagemaker
128
+ flavor : |
129
+ latest=false
130
+ tags : |
131
+ type=semver,pattern=cuda-{{version}}
132
+ type=semver,pattern=cuda-{{major}}.{{minor}}
133
+ type=raw,value=cuda-latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
134
+ type=raw,value=cuda-sha-${{ env.GITHUB_SHA_SHORT }}
135
+ - name : Build and push Docker image
136
+ id : build-and-push-sagemaker
137
+ uses : docker/build-push-action@v4
138
+ with :
139
+ context : .
140
+ file : Dockerfile-cuda-all
141
+ push : ${{ github.event_name != 'pull_request' }}
142
+ platforms : ' linux/amd64'
143
+ target : sagemaker
144
+ build-args : |
145
+ SCCACHE_GHA_ENABLED=on
146
+ ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }}
147
+ ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }}
148
+ GIT_SHA=${{ env.GITHUB_SHA }}
149
+ DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
150
+ tags : ${{ steps.meta.outputs.tags }}
151
+ labels : ${{ steps.meta.outputs.labels }}
152
+ cache-from : type=registry,ref=registry.internal.huggingface.tech/api-inference/text-embeddings-inference:cache-all,mode=max
153
+ cache-to : type=registry,ref=registry.internal.huggingface.tech/api-inference/text-embeddings-inference:cache-all,mode=max
0 commit comments