-
Notifications
You must be signed in to change notification settings - Fork 279
83 lines (74 loc) · 2.73 KB
/
push-image.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This is an example workflow file.
#
# When you add a new image, copy this file and then change all mentions of "hello-world" with
# the name of your new image.
#
# Read through the rest of the comments in this file to figure out how it works, and what else
# you need to change.
name: build_open_instruct
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
# Run this workflow anytime a push updates one of the files in the image's directory
# (other than the README), and anytime there's a new release tag for this image.
paths:
- 'open_instruct/**'
- '!open_instruct/README.md'
- 'requirements.txt'
- 'Dockerfile'
- '.github/workflows/push-image.yml'
# Note, add .olmo dockerfile + requirements if adding auto build to those
branches: [main]
pull_request: # note, comment this out for running on every push
# Also run on PRs that update the files in the image's directory (other than README).
branches: [main]
paths:
- 'open_instruct/**'
- '!open_instruct/README.md'
- 'requirements.txt'
- 'Dockerfile'
workflow_dispatch: # This allows us to manually trigger a build through the GitHub UI.
env:
DOCKER_BUILDKIT: "1"
jobs:
build:
name: open_instruct
runs-on: ubuntu-latest
timeout-minutes: 60
if: (github.event_name != 'workflow_run') || (github.event.workflow_run.conclusion == 'success')
steps:
- uses: actions/checkout@v3
- name: Setup environment
uses: ./.github/actions/setup
with:
beaker_token: ${{ secrets.BEAKER_TOKEN }}
# ghcr_token: ${{ secrets.GHCR_TOKEN }}
# ghcr_user: ${{ secrets.GHCR_USER }}
# big images fail, trying this
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache /usr/share/dotnet "$AGENT_TOOLSDIRECTORY"
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILDKIT_INLINE_CACHE=1
CUDA=12.1.0
TARGET=cudnn8-devel
DIST=ubuntu20.04
REQUIRE=requirements.txt
tags: open_instruct
- name: Check image
run: |
docker run --rm open_instruct
# - name: Push image
# # if: github.event_name != 'pull_request'
# uses: ./.github/actions/push
# with:
# image: open_instruct # this is the tag of the image we just built in the previous step
# beaker: open_instruct_auto # this is the name of the image on Beaker
# latest: true # this flag says we should also push this as the 'latest' version to GHCR