Skip to content

Commit

Permalink
do not use private registry in cleanup cache step
Browse files Browse the repository at this point in the history
  • Loading branch information
fxmarty committed Jun 26, 2024
1 parent 4067fc8 commit 60a96a9
Showing 1 changed file with 22 additions and 36 deletions.
58 changes: 22 additions & 36 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
build-and-push:
outputs:
docker_image: ${{ steps.final.outputs.docker_image }}
base_docker_image: ${{ steps.final.outputs.base_docker_image }}
docker_devices: ${{ steps.final.outputs.docker_devices }}
docker_volume: ${{ steps.final.outputs.docker_volume}}
runs_on: ${{ steps.final.outputs.runs_on }}
Expand Down Expand Up @@ -160,48 +161,37 @@ jobs:
echo "runs_on=${{ env.RUNS_ON }}" >> "$GITHUB_OUTPUT"
echo "label=${{ env.LABEL }}" >> "$GITHUB_OUTPUT"
if [[ ${{ inputs.hardware }} == "rocm" ]]
then
echo "base_docker_image=rocm/dev-ubuntu-22.04:6.1.1_hip_update" >> "$GITHUB_OUTPUT"
elif [[ ${{ inputs.hardware }} == "cuda" ]]
then
echo "base_docker_image=nvidia/cuda:12.1.0-base-ubuntu22.04" >> "$GITHUB_OUTPUT"
elif [[ ${{ inputs.hardware }} == "cuda" ]]
then
echo "base_docker_image=intel/intel-extension-for-pytorch:2.1.30-xpu" >> "$GITHUB_OUTPUT"
else
exit 1
fi
if [[ ${{ inputs.hardware }} == "rocm" ]]
then
echo "docker_volume=/data/cache/.cache/huggingface/hub" >> "$GITHUB_OUTPUT"
else
echo "docker_volume=/mnt/cache" >> "$GITHUB_OUTPUT"
fi
login_tailscale_and_registry:
runs-on: ["self-hosted", "${{ needs.build-and-push.outputs.runs_on }}", "multi-gpu"]
needs: build-and-push
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ needs.build-and-push.outputs.label }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
if: needs.build-and-push.outputs.runs_on != 'ubuntu-latest'
steps:
- name: Tailscale
uses: huggingface/tailscale-action@main
if: needs.build-and-push.outputs.runs_on != 'amd-gpu-tgi'
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}

- name: Login to internal Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.TAILSCALE_DOCKER_USERNAME }}
password: ${{ secrets.TAILSCALE_DOCKER_PASSWORD }}
registry: registry.internal.huggingface.tech


prepare_integration_tests:
runs-on: ["self-hosted", "${{ needs.build-and-push.outputs.runs_on }}", "multi-gpu"]
needs: [build-and-push, login_tailscale_and_registry]
needs: [build-and-push]
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ needs.build-and-push.outputs.label }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
if: needs.build-and-push.outputs.runs_on != 'ubuntu-latest'
# Ideally, we would use the image from registry.internal.huggingface.tech but we can not login to the private registry outside of tailscale,
# and even adding a previous job with tailscale login still results in `Docker login for 'registry.internal.huggingface.tech' failed with exit code 1`.
container:
image: ${{ needs.build-and-push.outputs.docker_image }}
credentials:
username: ${{ secrets.TAILSCALE_DOCKER_USERNAME }}
password: ${{ secrets.TAILSCALE_DOCKER_PASSWORD }}
image: ${{ needs.build-and-push.outputs.base_docker_image }}
options: --shm-size "16gb" --ipc host -v ${{ needs.build-and-push.outputs.docker_volume }}:/data
steps:
- name: Checkout repository
Expand All @@ -216,7 +206,10 @@ jobs:
pwd
echo "ls:"
ls
python integration-tests/clean_cache_and_download.py --token ${{ secrets.HF_TOKEN }} --cache-dir /data
pip3 install -U huggingface_hub
python3 integration-tests/clean_cache_and_download.py --token ${{ secrets.HF_TOKEN }} --cache-dir /data
fi
integration_tests:
Expand All @@ -235,13 +228,6 @@ jobs:
- name: Inject slug/short variables
uses: rlespinasse/[email protected]

# - name: Login to internal Container Registry
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.TAILSCALE_DOCKER_USERNAME }}
# password: ${{ secrets.TAILSCALE_DOCKER_PASSWORD }}
# registry: registry.internal.huggingface.tech

- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down

0 comments on commit 60a96a9

Please sign in to comment.