This repository has been archived by the owner on Sep 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 127
117 lines (102 loc) · 4 KB
/
docker-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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Docker Image CI
on:
push:
branches: [ '**' ]
tags: ['*']
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
config:
- {tag: "", dockerfile: "./Dockerfile.default", platforms: "linux/amd64,linux/arm64", build_args: "" }
- {
tag: "-openblas",
dockerfile: "./Dockerfile.default",
platforms: "linux/amd64,linux/arm64",
build_args: "EXTRA_DEPS=\"libopenblas-dev\" CMAKE_ARGS=\"-DGGML_OPENBLAS=On\""
}
- {
tag: "-cuda11-7",
dockerfile: "./Dockerfile.default",
platforms: "linux/amd64",
build_args: "\
BUILD_BASE=\"nvidia/cuda:11.7.1-devel-ubuntu22.04\" \
RUNTIME_BASE=\"nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04\" \
CMAKE_ARGS=\"-DGGML_CUBLAS=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc\""
}
- {
tag: "-cuda12-0",
dockerfile: "./Dockerfile.default",
platforms: "linux/amd64",
build_args: "\
BUILD_BASE=\"nvidia/cuda:12.0.0-devel-ubuntu20.04\" \
RUNTIME_BASE=\"nvidia/cuda:12.0.0-runtime-ubuntu20.04\" \
CMAKE_ARGS=\"-DGGML_CUBLAS=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc\""
}
- {
tag: "-cuda12-2",
dockerfile: "./Dockerfile.default",
platforms: "linux/amd64",
build_args: "\
BUILD_BASE=\"nvidia/cuda:12.2.0-devel-ubuntu20.04\" \
RUNTIME_BASE=\"nvidia/cuda:12.2.0-runtime-ubuntu20.04\" \
CMAKE_ARGS=\"-DGGML_CUBLAS=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc\""
}
- {
tag: "-clblast",
dockerfile: "./Dockerfile.default",
platforms: "linux/amd64",
build_args: "EXTRA_DEPS=\"libclblast-dev\" CMAKE_ARGS=\"-DGGML_CLBLAST=On\""
}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64,linux/arm68/v8
- name: Login to GH ContainerHub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ravenscroftj
password: ${{ secrets.GH_TOKEN }}
- name: Build and push incremental
uses: docker/build-push-action@v4.1.1
if: (!startsWith(github.ref, 'refs/tags/'))
with:
file: ${{matrix.config.dockerfile}}
push: true
tags: ghcr.io/ravenscroftj/turbopilot:nightly${{matrix.config.tag}}-${{ github.sha }}
context: ${{github.workspace}}
platforms: ${{matrix.config.platforms}}
build-args: ${{matrix.config.build_args}}
- name: Build and push release (Main Latest Build)
uses: docker/build-push-action@v4
if: startsWith(github.ref, 'refs/tags/') && matrix.config.tag == ''
with:
file: ${{matrix.config.dockerfile}}
push: true
tags: ghcr.io/ravenscroftj/turbopilot:${{ github.ref_name }}, ghcr.io/ravenscroftj/turbopilot:latest
context: ${{github.workspace}}
platforms: ${{matrix.config.platforms}}
build-args: ${{matrix.config.build_args}}
- name: Build and push release (Accelerated Builds)
uses: docker/build-push-action@v4
if: startsWith(github.ref, 'refs/tags/') && matrix.config.tag != ''
with:
file: ${{matrix.config.dockerfile}}
push: true
tags: ghcr.io/ravenscroftj/turbopilot:${{ github.ref_name }}${{matrix.config.tag}}
context: ${{github.workspace}}
platforms: ${{matrix.config.platforms}}
build-args: ${{matrix.config.build_args}}