pingcap / go-tpc

A toolbox to benchmark TPC workloads in Go
Apache License 2.0
177 stars 94 forks source link

*: Support building multi-arch image #175

Closed pingyu closed 6 months ago

pingyu commented 6 months ago

Manual Test

> make docker-buildx IMG=hub.pingcap.net/go-tpc/go-tpc:latest
...
...
 => [linux/arm64 builder 7/7] RUN GOOS=linux GOARCH=arm64 make build                                                                                                                                                                                                                             114.1s
 => [linux/amd64 builder 6/7] COPY . .                                                                                                                                                                                                                                                             0.1s
 => [linux/amd64 builder 7/7] RUN GOOS=linux GOARCH=amd64 make build                                                                                                                                                                                                                              10.5s
 => [linux/amd64 stage-1 3/3] COPY --from=builder /workspace/bin/go-tpc /go-tpc                                                                                                                                                                                                                    0.0s
 => [linux/arm64 stage-1 3/3] COPY --from=builder /workspace/bin/go-tpc /go-tpc                                                                                                                                                                                                                    0.1s
 => exporting to image                                                                                                                                                                                                                                                                            11.4s
...
...
image

Regression Test:

> make docker-build
...
...
 => [stage-1 2/3] RUN apk add --no-cache   dumb-init   tzdata   mariadb-client                                                                                                                                                                                                   37.0s
 => [builder 2/7] WORKDIR /workspace                                                                                                                                                                                                                                              0.6s 
 => [builder 3/7] COPY go.mod go.mod                                                                                                                                                                                                                                              0.0s
 => [builder 4/7] COPY go.sum go.sum                                                                                                                                                                                                                                              0.0s
 => [builder 5/7] RUN go mod download                                                                                                                                                                                                                                             4.4s
 => [builder 6/7] COPY . .                                                                                                                                                                                                                                                        0.1s
 => [builder 7/7] RUN GOOS=linux GOARCH=amd64 make build                                                                                                                                                                                                                         11.0s
 => [stage-1 3/3] COPY --from=builder /workspace/bin/go-tpc /go-tpc                                                                                                                                                                                                               0.0s
 => exporting to image                                                                                                                                                                                                                                                            0.5s
 => => exporting layers                                                                                                                                                                                                                                                           0.5s
 => => writing image sha256:8e411f671534ce7c987794abdedc8b5b882563ed3fb7c8f15302732c94ec460e                                                                                                                                                                                      0.0s
 => => naming to docker.io/library/go-tpc:latest                                                                                                                                                                                                                                  0.0s
...
...
CLAassistant commented 6 months ago

CLA assistant check
All committers have signed the CLA.