|
18 | 18 | nightly_date:
|
19 | 19 | description: "PyTorch nightly version"
|
20 | 20 | required: false
|
| 21 | + tags: |
| 22 | + description: "Tags to attach to the docker image, split by comma" |
| 23 | + required: false |
21 | 24 | env:
|
22 | 25 | CONDA_ENV: "tritonbench"
|
23 | 26 | DOCKER_IMAGE: "ghcr.io/meta-pytorch/tritonbench:latest"
|
@@ -49,19 +52,24 @@ jobs:
|
49 | 52 | # and it is github.ref_name when triggered by workflow_dispatch
|
50 | 53 | branch_name=${{ github.head_ref || github.ref_name }}
|
51 | 54 | docker build . --build-arg TRITONBENCH_BRANCH="${branch_name}" --build-arg FORCE_DATE="${NIGHTLY_DATE}" \
|
52 |
| - -f tritonbench-nightly.dockerfile -t ghcr.io/meta-pytorch/tritonbench:latest |
53 |
| - # Extract pytorch version from the docker |
54 |
| - PYTORCH_VERSION=$(docker run -e SETUP_SCRIPT="${SETUP_SCRIPT}" ghcr.io/meta-pytorch/tritonbench:latest bash -c '. "${SETUP_SCRIPT}"; python -c "import torch; print(torch.__version__)"') |
55 |
| - export DOCKER_TAG=$(awk '{match($0, /dev[0-9]+/, arr); print arr[0]}' <<< "${PYTORCH_VERSION}") |
56 |
| - docker tag ghcr.io/meta-pytorch/tritonbench:latest ghcr.io/meta-pytorch/tritonbench:${DOCKER_TAG} |
| 55 | + -f tritonbench-nightly.dockerfile -t ghcr.io/meta-pytorch/tritonbench:latest |
57 | 56 | - name: Push docker to remote
|
58 | 57 | if: github.event_name != 'pull_request'
|
59 | 58 | run: |
|
60 | 59 | # Extract pytorch version from the docker
|
61 | 60 | PYTORCH_VERSION=$(docker run -e SETUP_SCRIPT="${SETUP_SCRIPT}" ghcr.io/meta-pytorch/tritonbench:latest bash -c '. "${SETUP_SCRIPT}"; python -c "import torch; print(torch.__version__)"')
|
62 | 61 | export DOCKER_TAG=$(awk '{match($0, /dev[0-9]+/, arr); print arr[0]}' <<< "${PYTORCH_VERSION}")
|
| 62 | + docker tag ghcr.io/meta-pytorch/tritonbench:latest ghcr.io/meta-pytorch/tritonbench:${DOCKER_TAG} |
63 | 63 | docker push ghcr.io/meta-pytorch/tritonbench:${DOCKER_TAG}
|
64 | 64 | docker push ghcr.io/meta-pytorch/tritonbench:latest
|
| 65 | + set -x |
| 66 | + if [[ -n "${{ github.event.inputs.tags }}" ]]; then |
| 67 | + IFS=',' read -ra tags <<< "${{ github.event.inputs.tags }}" |
| 68 | + for tag in "${tags[@]}"; do |
| 69 | + docker tag ghcr.io/meta-pytorch/tritonbench:latest ghcr.io/meta-pytorch/tritonbench:${tag} |
| 70 | + docker push ghcr.io/meta-pytorch/tritonbench:${tag} |
| 71 | + done |
| 72 | + fi |
65 | 73 | concurrency:
|
66 | 74 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
|
67 | 75 | cancel-in-progress: true
|
0 commit comments