Add vitess/lite ubi8 images for mysql80, including for arm64#9830
Add vitess/lite ubi8 images for mysql80, including for arm64#9830deepthi merged 7 commits intovitessio:mainfrom
Conversation
Signed-off-by: Jacques Grove <aquarapid@gmail.com>
containers, to match our other containers Signed-off-by: Jacques Grove <aquarapid@gmail.com>
vmg
left a comment
There was a problem hiding this comment.
This looks good! How many Vitess contributors have M1 macs that could test this? It would be nice to have some confidence in the implementation besides the cross-compilation way.
On a M1 Mac running zsh |
|
I don't have a Mac, so I cannot test any of this there. |
|
I cannot reproduce, even using zsh on Linux. |
Signed-off-by: Jacques Grove <aquarapid@gmail.com>
blocks... Signed-off-by: Jacques Grove <aquarapid@gmail.com>
Signed-off-by: Jacques Grove <aquarapid@gmail.com>
Signed-off-by: Jacques Grove <aquarapid@gmail.com>
Signed-off-by: Jacques Grove <aquarapid@gmail.com>
mattlord
left a comment
There was a problem hiding this comment.
Thanks! I had a few questions but nothing that should block us. We can iterate from here.
| if [ -d /go/bin ]; then | ||
| # Probably in the bootstrap container | ||
| (cd go/cmd/vttablet && go run github.com/GeertJohan/go.rice/rice --verbose append --exec=/go/bin/${GOOS}_${GOARCH}/vttablet) | ||
| else | ||
| (cd go/cmd/vttablet && unset GOOS && unset GOARCH && go run github.com/GeertJohan/go.rice/rice --verbose append --exec=$${HOME}/go/bin/${GOOS}_${GOARCH}/vttablet) | ||
| fi |
There was a problem hiding this comment.
Curious why we don't rely on ${GOPATH}/bin here? It is set inside the container, and should be set on any other system:
$ echo "GOBIN: ${GOPATH}/bin"
GOBIN: /Users/matt/go/bin
$ docker run -it vitess/bootstrap:mysql80 /bin/bash -c 'echo "GOBIN: ${GOPATH}/bin"'
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
GOBIN: /go/bin
Would there be any other reason to use a different command?
| mkdir -p "$${PREFIX}/bin" | ||
| cp "$${VTROOT}/bin/"{mysqlctl,mysqlctld,vtorc,vtadmin,vtctld,vtctlclient,vtctldclient,vtgate,vttablet,vtworker,vtbackup} "$${PREFIX}/bin/" | ||
|
|
||
| # Will only work inside the docker bootstrap for now |
There was a problem hiding this comment.
Worth printing this out to the console then too, IMO.
| io.k8s.display-name="Vitess Lite image - MySQL Community Server 8.0" \ | ||
| maintainer="cncf-vitess-maintainers@lists.cncf.io" \ | ||
| vendor="CNCF" \ | ||
| version="13.0.0" \ |
There was a problem hiding this comment.
This is the wrong version for main. I'd just remove it as I don't see where we have that in the other images. Or if we really need it, something like:
$ grep versionName go/vt/servenv/version.go | awk '{print $4}' | tr -d '"'
14.0.0-SNAPSHOT
|
For anyone that's interested ... Here's the details from my local tests on my m1 Mac laptop: |
Today, Vitess has no facility for building non-x86_64 vitess/lite images. This PR fixes that. To simplify matters, I used the Red Hat ubi8 images, which has good aarch64 support. I then added a vitess/lite image for both the ubi8/amd64(x86_64) and ubi8/arm64(aarch64) combos.
To build this on an Intel machine, you will need your local docker installation to support cross compiling for linux/arm64. The easiest way to achieve this is to use https://github.com/tonistiigi/binfmt , specifically by running something like:
before doing your build.
You can confirm that your installation is capable of cross-compilation by doing something like:
Note the
linux/arm64option.If you just want to build the 2 new images, you can do that:
for amd64:
for arm64:
Future cross-build docker containers just need to include the
arm64string in the build target name (i.e. ubi8.arm64.mysql80 in this case) to trigger the cross-compilation.Finally, the lite container for arm64/aarch64 excludes a few things that are not available on aarch64:
xtrabackup is the big one here; so if you use these images to run your Vitess MySQL instances, you will have to either rely on the "builtin" (offline) backup; or you will have to supply your own xtrabackup binaries (in theory it is possible to build it on aarch64, but Percona does not test this or provide binaries, yet).