forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
155 lines (136 loc) · 4 KB
/
Copy pathdocker-bake.hcl
File metadata and controls
155 lines (136 loc) · 4 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
variable "tag" {
default = "ghcr.io/facebookincubator/velox-dev"
}
# Variable to control cache pushing
variable "DOCKER_UPLOAD_CACHE" {
default = false
}
function "cache-to-arch" {
params = [name, arch]
# We don't want to push local build to the cache by accident
# so we remove cache-to unless we are running in CI
result = DOCKER_UPLOAD_CACHE ? [{
type = "registry"
ref = "${tag}:build-cache-${name}-${arch}"
mode = "max"
compression = "zstd"
}] : []
}
function "cache-from-arch" {
params = [name, arch]
result = [{
type = "registry"
ref = "${tag}:build-cache-${name}-${arch}"
}]
}
function "ci_images_by_arch" {
params = [arch]
result = ["centos9-${arch}", "adapters-${arch}"]
}
group "ci-amd64" {
targets = ci_images_by_arch("amd64")
}
group "ci-arm64" {
targets = ci_images_by_arch("arm64")
}
group "default" {
targets = []
}
target "base" {
output = [
DOCKER_UPLOAD_CACHE ? {
type = "registry"
compression = "zstd"
oci-mediatypes = true
} : {
# For local builds with the docker driver the image will be loaded
# even without explicitly adding the `docker` exporter
type = "cacheonly"
}
]
}
target "pyvelox" {
inherits = ["base"]
context = "."
name = "pyvelox-${arch}"
dockerfile = "scripts/docker/centos-multi.dockerfile"
target = "pyvelox"
args = {
image = "quay.io/pypa/manylinux_2_28:latest"
VELOX_BUILD_SHARED = "OFF"
# pyvelox uses a manylinux base which is el8, not el9. The
# dockerfile's CENTOS_TZDATA_VERSION default is el9 (correct for
# the centos9/adapters targets); override here to the el8 build of
# the same upstream tzdata release. Keep the upstream version
# (2026a) in sync with CENTOS_TZDATA_VERSION at the top of
# scripts/docker/centos-multi.dockerfile.
CENTOS_TZDATA_VERSION = "2026a-1.el8"
}
matrix = {
arch = ["amd64", "arm64"]
}
platforms = ["linux/${arch}"]
tags = ["${tag}:pyvelox-${arch}"]
cache-to = cache-to-arch("pyvelox", "${arch}")
cache-from = cache-from-arch("pyvelox", "${arch}")
}
target "adapters" {
inherits = ["base","adapters-cpp"]
name = "adapters-${arch}"
matrix = {
arch = ["amd64", "arm64"]
}
platforms = ["linux/${arch}"]
tags = ["${tag}:adapters-${arch}"]
cache-to = cache-to-arch("adapters", "${arch}")
cache-from = cache-from-arch("adapters", "${arch}")
}
target "centos9" {
inherits = ["base","centos-cpp"]
name = "centos9-${arch}"
matrix = {
arch = ["amd64", "arm64"]
}
platforms = ["linux/${arch}"]
tags = ["${tag}:centos9-${arch}"]
cache-to = cache-to-arch("centos9", "${arch}")
cache-from = cache-from-arch("centos9", "${arch}")
}
target "ubuntu-amd64" {
inherits = ["base","ubuntu-cpp"]
cache-to = cache-to-arch("ubuntu", "amd64")
cache-from = cache-from-arch("ubuntu", "amd64")
}
group "ubuntu-arm64" {
# We don't actually want to build the ubuntu arm image, this is a trick to simplify CI
# Empty targets don't fail the build.
targets = []
}
group "fedora-arm64" {
# We don't actually want to build the fedora arm image, this is a trick to simplify CI
# Empty targets don't fail the build.
targets = []
}
target "fedora-amd64" {
inherits = ["base", "fedora"]
dockerfile = "scripts/docker/fedora.dockerfile"
cache-to = cache-to-arch("fedora", "amd64")
cache-from = cache-from-arch("fedora", "amd64")
}
group "java" {
# The main work is in the well cached download steps and the shared base stage,
# so these can easily be run on the same node in ci
targets = ["spark-server", "presto-java"]
}
target "spark-server" {
inherits = ["base"]
target = "spark-server"
cache-to = cache-to-arch("spark-server", "amd64")
cache-from = cache-from-arch("spark-server", "amd64")
}
target "presto-java" {
inherits = ["base"]
target = "presto-java"
cache-to = cache-to-arch("presto-java", "amd64")
cache-from = cache-from-arch("presto-java", "amd64")
}