-
Notifications
You must be signed in to change notification settings - Fork 21
Add 3.x docker images #572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
PR Review ChecklistDo not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed. Trivial Change
Code
Architecture
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor suggestions to only duplicate the Dockerfile
s and keep the infra unified.
@@ -12,3 +12,6 @@ DOCKER_ORG=$3 | |||
DOCKER_REPO=$4 | |||
|
|||
docker build -f $1 -t $DOCKER_ORG/$DOCKER_REPO:$DOCKER_VERSION . | |||
|
|||
|
|||
docker buildx build --platform linux/amd64 --load -f Dockerfile.amd64 -t typedb/ubuntu:3.1.0b-amd64 . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.x tag in 2.x folder, no Dockerfile.amd64 in the picture.
Could you actually add one for each arch here?
In fact, the only differences between the two should be in the Dockerfile
s ? Do we need to duplicate the rest of the files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, I forgot to remove this line after putting it there temporarily, thanks for the flag
The difference is in buildx
(extended support for arch-specific images, but maybe it can work without -- I decided to prioritize moving forward), and other versioning. My priority was to make sure that the chosen platform was correct, while I still don't fully understand the usage of the 2.x images since it cannot be run on my machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're both basically doing the same thing.
FROM base-image
RUN apt update && ...
So they would both need buildx
. Docker 2.x here is amd64 only at the moment, since we've never updated it to have both versions.
I don't see a reason to keep them separate. I can create the 2.x dockerfiles & test the images if you'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't run Bazel rules locally. It was partially a reason why I thought I'm not able to push both archs from my local machine:
bazel run //images/docker/ubuntu-2x:assemble-docker
ERROR: /private/var/tmp/_bazel_spare/a5af50c3bc2e234514ed639efd623f2f/external/local_config_cc/BUILD:48:19: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'darwin_arm64'
ERROR: /private/var/tmp/_bazel_spare/a5af50c3bc2e234514ed639efd623f2f/external/local_config_cc/BUILD:48:19: Analysis of target '@local_config_cc//:toolchain' failed
ERROR: Analysis of target '//images/docker/ubuntu-2x:assemble-docker' failed; build aborted:
INFO: Elapsed time: 0.098s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 4 targets configured)
ERROR: Build failed. Not running target
But I can make two files for 2.x and reuse the new scripts from 3.x. I didn't know we really wanted it.
Usage and product changes
Add a base Ubuntu image with CA certificates preinstalled for TypeDB 3.x.
Motivation
TypeDB Docker image required a stable base image with CA certificates.
Implementation
Split Ubuntu images into
2.x
(the old image with JVM) and3.x
. Prepare scripts similar to2.x
for3.x
, but avoid using Bazel: it feels unnecessarily complicated, especially in the case of a multi-arch build.Introduce a
VERSION
file for3.x
images to easily match multiple arch-specific images and the TypeDB Server requiring it.Other reasoning for decisions is described in
README
s.Now, to update all 3.x images, except for environment setup, you can just update the
VERSION
file locally and run a single script, which will do the whole work.