Skip to content

Commit c771582

Browse files
committed
test(hfjobs): send bearer token with hfjobs secrets
1 parent db26e56 commit c771582

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/integration.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ jobs:
165165
--instance-size ${INSTANCE_SIZE})
166166
echo "ENDPOINT_NAME=$(cat ${ENDPOINT_DETAILS} | jq -r '.[].name')" >> "$GITHUB_ENV"
167167
echo "ENDPOINT_URL=$(cat ${ENDPOINT_DETAILS} | jq -r '.[].url')" >> "$GITHUB_ENV"
168+
echo "Successfully started endpoint: ${ENDPOINT_NAME}"
168169
169170
- name: "Build test runner container from the image repo"
170171
id: build_container_test_runner
@@ -186,9 +187,9 @@ jobs:
186187
MODEL=$(cat ${ENDPOINT_REPO_HFJOBS_DEPLOY_CONF_PATH} | jq -r '.model' )
187188
echo "$(cat ${ENDPOINT_REPO_HFJOBS_DEPLOY_CONF_PATH} | jq -r '.description' )" >> "$GITHUB_STEP_SUMMARY"
188189
echo "Running $(cat ${ENDPOINT_REPO_HFJOBS_DEPLOY_CONF_PATH} | jq -r '.id' ) on ${HARDWARE}"
189-
hfjobs run --timeout 10m ${{ format('mfuntowicz/{0}-test:{1}', env.ENDPOINT_REPO, env.COMMIT_ID) }}
190+
hfjobs run --timeout 10m --secrets OPENAI_API_KEY=${{ env.HF_TOKEN }} ${{ format('mfuntowicz/{0}-test:{1}', env.ENDPOINT_REPO, env.COMMIT_ID) }}
190191
191192
- name: "Delete endpoint"
192193
if: ${{ steps.deploy_endpoint.outcome == 'success' }}
193-
run: $(${HF_CLI} endpoints delete ${ENDPOINT_NAME})
194+
run: ${HF_CLI} endpoints delete ${ENDPOINT_NAME}
194195

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM ghcr.io/pyo3/maturin:v1.8.3 AS builder
22

3-
COPY . /opt/endpoints/build
4-
RUN cd /opt/endpoints/build/hfendpoints && \
5-
CARGO_TARGET_DIR=/usr/local/hfendpoints/dist maturin build -f --release --out /usr/local/hfendpoints/dist --features python
3+
RUN --mount=type=bind,source=.,target=/opt/hfendpoints/build \
4+
cd /opt/hfendpoints/build/hfendpoints && \
5+
CARGO_TARGET_DIR=/opt/hfendpoints/dist maturin build -f --release --out /opt/hfendpoints/dist --features python

0 commit comments

Comments
 (0)