forked from pytorch/benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (41 loc) · 1.46 KB
/
build-nightly-docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: TorchBench nightly docker build
on:
schedule:
# Push the nightly docker daily at 3 PM UTC
- cron: '0 15 * * *'
workflow_dispatch:
env:
WITH_PUSH: "true"
jobs:
build-push-docker:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: [self-hosted, linux.4xlarge]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: benchmark
- name: Login to GitHub Container Registry
if: ${{ env.WITH_PUSH == 'true' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: pytorch
password: ${{ secrets.TORCHBENCH_ACCESS_TOKEN }}
- name: Build TorchBench nightly docker
run: |
export TODAY=$(date +'%Y%m%d')
export DOCKER_TAG=dev${TODAY}
cd benchmark/docker
docker build . -f torchbench-nightly.dockerfile -t ghcr.io/pytorch/torchbench:${DOCKER_TAG}
docker tag ghcr.io/pytorch/torchbench:${DOCKER_TAG} ghcr.io/pytorch/torchbench:latest
- name: Push docker to remote
if: ${{ env.WITH_PUSH == 'true' }}
run: |
export TODAY=$(date +'%Y%m%d')
export DOCKER_TAG=dev${TODAY}
docker push ghcr.io/pytorch/torchbench:${DOCKER_TAG}
docker push ghcr.io/pytorch/torchbench:latest
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true