From a82a594def1425b5255b39900f72986a6486f069 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 2 Apr 2024 16:08:51 -0600 Subject: [PATCH 01/10] Remove unused Dockerfile.release Signed-off-by: Florent Poinsard --- Makefile | 14 -------------- docker/Dockerfile.release | 25 ------------------------- 2 files changed, 39 deletions(-) delete mode 100644 docker/Dockerfile.release diff --git a/Makefile b/Makefile index 5f5d7094270..604c1694457 100644 --- a/Makefile +++ b/Makefile @@ -365,20 +365,6 @@ docker_test: docker_unit_test: go run test.go -flavor $(flavor) unit -# Release a version. -# This will generate a tar.gz file into the releases folder with the current source -release: docker_base - @if [ -z "$VERSION" ]; then \ - echo "Set the env var VERSION with the release version"; exit 1;\ - fi - mkdir -p releases - docker build -f docker/Dockerfile.release -t vitess/release . - docker run -v ${PWD}/releases:/vt/releases --env VERSION=$(VERSION) vitess/release - git tag -m Version\ $(VERSION) v$(VERSION) - echo "A git tag was created, you can push it with:" - echo "git push origin v$(VERSION)" - echo "Also, don't forget the upload releases/v$(VERSION).tar.gz file to GitHub releases" - create_release: ./tools/create_release.sh diff --git a/docker/Dockerfile.release b/docker/Dockerfile.release deleted file mode 100644 index 1c36b503acc..00000000000 --- a/docker/Dockerfile.release +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2019 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# We rely on the base image, as that will re-copy the local -# working tree and build it. Because of so, we trust the local -# vendor folder is up to data. -FROM vitess/base - -# Clean local files, and keep vendorer libs -RUN git clean -xdf --exclude="vendor" - -RUN mkdir /vt/releases - -CMD tar -czf /vt/releases/v$VERSION.tar.gz --exclude .git . \ No newline at end of file From 53cd5fb46bb6f839ce8c09b185c653c430b70cdf Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 2 Apr 2024 16:51:00 -0600 Subject: [PATCH 02/10] Remove base from docker/mini Signed-off-by: Florent Poinsard --- docker/mini/Dockerfile | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/docker/mini/Dockerfile b/docker/mini/Dockerfile index 469fbef8d9e..0bb3aac7561 100644 --- a/docker/mini/Dockerfile +++ b/docker/mini/Dockerfile @@ -12,17 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -# NOTE: We have to build the Vitess binaries from scratch instead of sharing -# a base image because Docker Hub dropped the feature we relied upon to -# ensure images contain the right binaries. - -# Use a temporary layer for the build stage. -FROM vitess/base AS base - FROM vitess/lite USER root +# Install dependencies +COPY docker/utils/install_dependencies.sh /vt/dist/install_dependencies.sh +RUN /vt/dist/install_dependencies.sh mysql80 + RUN apt-get update RUN apt-get install -y sudo curl vim python3 jq sqlite3 RUN ln -s /usr/bin/python3 /usr/bin/python @@ -40,9 +37,6 @@ COPY docker/mini/vttablet-mini-up.sh /vt/dist/scripts/vttablet-mini-up.sh RUN echo "hostname=127.0.0.1" >> /vt/dist/scripts/env.sh RUN cat /vt/dist/scripts/env.sh | egrep "^alias" >> /etc/bash.bashrc -COPY --from=base /vt/bin/vtctl /vt/bin/ -COPY --from=base /vt/bin/mysqlctl /vt/bin/ - # Set up Vitess environment (just enough to run pre-built Go binaries) ENV VTROOT /vt/src/vitess.io/vitess ENV VTDATAROOT /vt/vtdataroot From 6ccdf9bfaa8e6c7e5329512164825f60310e2b14 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 2 Apr 2024 17:01:28 -0600 Subject: [PATCH 03/10] Remove base from k8s and vtexplain Signed-off-by: Florent Poinsard --- docker/k8s/Dockerfile | 30 +++++++++++++++--------------- docker/k8s/vtexplain/Dockerfile | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docker/k8s/Dockerfile b/docker/k8s/Dockerfile index 3ba46595a83..6528585aae7 100644 --- a/docker/k8s/Dockerfile +++ b/docker/k8s/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/base:${VT_BASE_VER} AS base +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -31,28 +31,28 @@ RUN mkdir -p /vt && \ mkdir -p /vtdataroot/tabletdata # Copy CA certs for https calls -COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # Copy binaries -COPY --from=base /vt/bin/mysqlctld /vt/bin/ -COPY --from=base /vt/bin/mysqlctl /vt/bin/ -COPY --from=base /vt/bin/vtctld /vt/bin/ -COPY --from=base /vt/bin/vtctl /vt/bin/ -COPY --from=base /vt/bin/vtctlclient /vt/bin/ -COPY --from=base /vt/bin/vtgate /vt/bin/ -COPY --from=base /vt/bin/vttablet /vt/bin/ -COPY --from=base /vt/bin/vtbackup /vt/bin/ -COPY --from=base /vt/bin/vtadmin /vt/bin/ -COPY --from=base /vt/bin/vtorc /vt/bin/ +COPY --from=lite /vt/bin/mysqlctld /vt/bin/ +COPY --from=lite /vt/bin/mysqlctl /vt/bin/ +COPY --from=lite /vt/bin/vtctld /vt/bin/ +COPY --from=lite /vt/bin/vtctl /vt/bin/ +COPY --from=lite /vt/bin/vtctlclient /vt/bin/ +COPY --from=lite /vt/bin/vtgate /vt/bin/ +COPY --from=lite /vt/bin/vttablet /vt/bin/ +COPY --from=lite /vt/bin/vtbackup /vt/bin/ +COPY --from=lite /vt/bin/vtadmin /vt/bin/ +COPY --from=lite /vt/bin/vtorc /vt/bin/ # copy web admin files -COPY --from=base $VTROOT/web /vt/web/ +COPY --from=lite $VTROOT/web /vt/web/ # copy vitess config -COPY --from=base $VTROOT/config/init_db.sql /vt/config/ +COPY --from=lite $VTROOT/config/init_db.sql /vt/config/ # my.cnf include files -COPY --from=base $VTROOT/config/mycnf /vt/config/mycnf +COPY --from=lite $VTROOT/config/mycnf /vt/config/mycnf # add vitess user and add permissions RUN groupadd -r --gid 2000 vitess && useradd -r -g vitess --uid 1000 vitess && \ diff --git a/docker/k8s/vtexplain/Dockerfile b/docker/k8s/vtexplain/Dockerfile index fb2f375d41c..58e2bd040db 100644 --- a/docker/k8s/vtexplain/Dockerfile +++ b/docker/k8s/vtexplain/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/base:${VT_BASE_VER} AS base +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -26,7 +26,7 @@ ENV VTROOT /vt RUN mkdir -p /vt/bin && mkdir -p /vtdataroot # Copy binaries -COPY --from=base /vt/bin/vtexplain /vt/bin/ +COPY --from=lite /vt/bin/vtexplain /vt/bin/ # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ From ad325951eab7a503d1ea10a5fe6b6447875fdf30 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 2 Apr 2024 17:06:04 -0600 Subject: [PATCH 04/10] Use from k8s in the vtexplain image and fix Makefile Signed-off-by: Florent Poinsard --- Makefile | 2 +- docker/k8s/Dockerfile | 1 + docker/k8s/vtexplain/Dockerfile | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 604c1694457..6a00f5da414 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ endif install: build # binaries mkdir -p "$${PREFIX}/bin" - cp "$${VTROOTBIN}/"{mysqlctl,mysqlctld,vtorc,vtadmin,vtctld,vtctlclient,vtctldclient,vtgate,vttablet,vtbackup} "$${PREFIX}/bin/" + cp "$${VTROOTBIN}/"{mysqlctl,mysqlctld,vtorc,vtadmin,vtctld,vtctlclient,vtctldclient,vtgate,vttablet,vtbackup,vtexplain} "$${PREFIX}/bin/" # Will only work inside the docker bootstrap for now cross-install: cross-build diff --git a/docker/k8s/Dockerfile b/docker/k8s/Dockerfile index 6528585aae7..8fa30041877 100644 --- a/docker/k8s/Dockerfile +++ b/docker/k8s/Dockerfile @@ -44,6 +44,7 @@ COPY --from=lite /vt/bin/vttablet /vt/bin/ COPY --from=lite /vt/bin/vtbackup /vt/bin/ COPY --from=lite /vt/bin/vtadmin /vt/bin/ COPY --from=lite /vt/bin/vtorc /vt/bin/ +COPY --from=lite /vt/bin/vtexplain /vt/bin/ # copy web admin files COPY --from=lite $VTROOT/web /vt/web/ diff --git a/docker/k8s/vtexplain/Dockerfile b/docker/k8s/vtexplain/Dockerfile index 58e2bd040db..53ce13b9e9e 100644 --- a/docker/k8s/vtexplain/Dockerfile +++ b/docker/k8s/vtexplain/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/lite:${VT_BASE_VER} AS lite +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} @@ -26,7 +26,7 @@ ENV VTROOT /vt RUN mkdir -p /vt/bin && mkdir -p /vtdataroot # Copy binaries -COPY --from=lite /vt/bin/vtexplain /vt/bin/ +COPY --from=k8s /vt/bin/vtexplain /vt/bin/ # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ From 83cfabbdad3ef9e115043e981fc6382e68f92648 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 2 Apr 2024 17:10:42 -0600 Subject: [PATCH 05/10] Remove docker/base and usages Signed-off-by: Florent Poinsard --- Makefile | 10 ----- doc/DockerBuild.md | 16 +------- docker/base/Dockerfile | 41 ------------------- docker/base/Dockerfile.mysql57 | 41 ------------------- docker/base/Dockerfile.percona57 | 41 ------------------- docker/base/Dockerfile.percona80 | 41 ------------------- test/vtop_example.sh | 1 - .../e2e/vtcompose/docker-compose.test.yml | 18 ++++---- 8 files changed, 10 insertions(+), 199 deletions(-) delete mode 100644 docker/base/Dockerfile delete mode 100644 docker/base/Dockerfile.mysql57 delete mode 100644 docker/base/Dockerfile.percona57 delete mode 100644 docker/base/Dockerfile.percona80 diff --git a/Makefile b/Makefile index 6a00f5da414..fc92a712d94 100644 --- a/Makefile +++ b/Makefile @@ -318,16 +318,6 @@ define build_docker_image fi endef -docker_base: - ${call build_docker_image,docker/base/Dockerfile,vitess/base} - -DOCKER_BASE_SUFFIX = mysql80 percona57 percona80 -DOCKER_BASE_TARGETS = $(addprefix docker_base_, $(DOCKER_BASE_SUFFIX)) -$(DOCKER_BASE_TARGETS): docker_base_%: - ${call build_docker_image,docker/base/Dockerfile.$*,vitess/base:$*} - -docker_base_all: docker_base $(DOCKER_BASE_TARGETS) - docker_lite: ${call build_docker_image,docker/lite/Dockerfile,vitess/lite} diff --git a/doc/DockerBuild.md b/doc/DockerBuild.md index c4134556cc2..7ffecafce34 100644 --- a/doc/DockerBuild.md +++ b/doc/DockerBuild.md @@ -37,22 +37,8 @@ Then you can run our build script for the `lite` image which extracts the Vitess image on your machine before then it could be old, which may cause build failures. So it would be a good idea to always execute this step. -1. Build the `vitess/base[:]` image. - It will include the compiled the Vitess binaries. - (`vitess/base` also contains the source code and tests i.e. everything needed for development work.) - - Choose one of the following commands (the command without suffix builds - the default image containing MySQL 5.7): - - ```sh - vitess$ make docker_base - vitess$ make docker_base_mysql56 - vitess$ make docker_base_percona57 - vitess$ make docker_base_percona - ``` - 1. Build the `vitess/lite[:]` image. - This will run a script that extracts from `vitess/base` only the files + This will run a script that extracts from `vitess/bootstrap` only the files needed to run Vitess. Choose one of the following commands (the command without suffix builds diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile deleted file mode 100644 index dd3a36955c7..00000000000 --- a/docker/base/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2019 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ARG bootstrap_version=30 -ARG image="vitess/bootstrap:${bootstrap_version}-mysql80" - -FROM "${image}" - -# Allows some docker builds to disable CGO -ARG CGO_ENABLED=0 - -# Allows docker builds to set the BUILD_NUMBER -ARG BUILD_NUMBER - -# Allows docker builds to set the BUILD_GIT_BRANCH -ARG BUILD_GIT_BRANCH - -# Allows docker builds to set the BUILD_GIT_REV -ARG BUILD_GIT_REV - -# Allows docker builds to set the BUILD_TIME -ARG BUILD_TIME - -# Re-copy sources from working tree -COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess - -USER vitess - -# Build Vitess -RUN make build diff --git a/docker/base/Dockerfile.mysql57 b/docker/base/Dockerfile.mysql57 deleted file mode 100644 index bea82db9bdd..00000000000 --- a/docker/base/Dockerfile.mysql57 +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2023 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ARG bootstrap_version=30 -ARG image="vitess/bootstrap:${bootstrap_version}-mysql57" - -FROM "${image}" - -# Allows some docker builds to disable CGO -ARG CGO_ENABLED=0 - -# Allows docker builds to set the BUILD_NUMBER -ARG BUILD_NUMBER - -# Allows docker builds to set the BUILD_GIT_BRANCH -ARG BUILD_GIT_BRANCH - -# Allows docker builds to set the BUILD_GIT_REV -ARG BUILD_GIT_REV - -# Allows docker builds to set the BUILD_TIME -ARG BUILD_TIME - -# Re-copy sources from working tree -COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess - -USER vitess - -# Build Vitess -RUN make build diff --git a/docker/base/Dockerfile.percona57 b/docker/base/Dockerfile.percona57 deleted file mode 100644 index 6768f11a291..00000000000 --- a/docker/base/Dockerfile.percona57 +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2023 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ARG bootstrap_version=30 -ARG image="vitess/bootstrap:${bootstrap_version}-percona57" - -FROM "${image}" - -# Allows some docker builds to disable CGO -ARG CGO_ENABLED=0 - -# Allows docker builds to set the BUILD_NUMBER -ARG BUILD_NUMBER - -# Allows docker builds to set the BUILD_GIT_BRANCH -ARG BUILD_GIT_BRANCH - -# Allows docker builds to set the BUILD_GIT_REV -ARG BUILD_GIT_REV - -# Allows docker builds to set the BUILD_TIME -ARG BUILD_TIME - -# Re-copy sources from working tree -COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess - -USER vitess - -# Build Vitess -RUN make build diff --git a/docker/base/Dockerfile.percona80 b/docker/base/Dockerfile.percona80 deleted file mode 100644 index 04cec8ae483..00000000000 --- a/docker/base/Dockerfile.percona80 +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2023 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ARG bootstrap_version=30 -ARG image="vitess/bootstrap:${bootstrap_version}-percona80" - -FROM "${image}" - -# Allows some docker builds to disable CGO -ARG CGO_ENABLED=0 - -# Allows docker builds to set the BUILD_NUMBER -ARG BUILD_NUMBER - -# Allows docker builds to set the BUILD_GIT_BRANCH -ARG BUILD_GIT_BRANCH - -# Allows docker builds to set the BUILD_GIT_REV -ARG BUILD_GIT_REV - -# Allows docker builds to set the BUILD_TIME -ARG BUILD_TIME - -# Re-copy sources from working tree -COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess - -USER vitess - -# Build Vitess -RUN make build diff --git a/test/vtop_example.sh b/test/vtop_example.sh index 421e1c230df..3862936a370 100755 --- a/test/vtop_example.sh +++ b/test/vtop_example.sh @@ -486,7 +486,6 @@ EOF # Build the docker image for vitess/lite using the local code docker build -f docker/lite/Dockerfile -t vitess/lite:pr . # Build the docker image for vitess/vtadmin using the local code -docker build -f docker/base/Dockerfile -t vitess/base:pr . docker build -f docker/k8s/Dockerfile --build-arg VT_BASE_VER=pr -t vitess/k8s:pr . docker build -f docker/k8s/vtadmin/Dockerfile --build-arg VT_BASE_VER=pr -t vitess/vtadmin:pr . diff --git a/vitess-mixin/e2e/vtcompose/docker-compose.test.yml b/vitess-mixin/e2e/vtcompose/docker-compose.test.yml index a96ef3b1ca9..e6928d73acc 100644 --- a/vitess-mixin/e2e/vtcompose/docker-compose.test.yml +++ b/vitess-mixin/e2e/vtcompose/docker-compose.test.yml @@ -52,7 +52,7 @@ services: - SCHEMA_FILES=test_keyspace_schema_file.sql - POST_LOAD_FILE= - EXTERNAL_DB=0 - image: vitess/base + image: vitess/lite volumes: - .:/script schemaload_unsharded_keyspace: @@ -76,7 +76,7 @@ services: - SCHEMA_FILES=unsharded_keyspace_schema_file.sql - POST_LOAD_FILE= - EXTERNAL_DB=0 - image: vitess/base + image: vitess/lite volumes: - .:/script vtctld: @@ -91,7 +91,7 @@ services: - consul1 - consul2 - consul3 - image: vitess/base + image: vitess/lite ports: - 15000:8080 - "15999" @@ -108,7 +108,7 @@ services: --pid_file $$VTDATAROOT/tmp/vtgate.pid --normalize_queries=true ' depends_on: - vtctld - image: vitess/base + image: vitess/lite ports: - 15099:8080 - "15999" @@ -145,7 +145,7 @@ services: - CMD-SHELL - curl localhost:8080/debug/health timeout: 10s - image: vitess/base + image: vitess/lite ports: - 15101:8080 - "15999" @@ -182,7 +182,7 @@ services: - CMD-SHELL - curl localhost:8080/debug/health timeout: 10s - image: vitess/base + image: vitess/lite ports: - 15102:8080 - "15999" @@ -219,7 +219,7 @@ services: - CMD-SHELL - curl localhost:8080/debug/health timeout: 10s - image: vitess/base + image: vitess/lite ports: - 15201:8080 - "15999" @@ -256,7 +256,7 @@ services: - CMD-SHELL - curl localhost:8080/debug/health timeout: 10s - image: vitess/base + image: vitess/lite ports: - 15202:8080 - "15999" @@ -293,7 +293,7 @@ services: - CMD-SHELL - curl localhost:8080/debug/health timeout: 10s - image: vitess/base + image: vitess/lite ports: - 15301:8080 - "15999" From b24daf80b967a168f0a73fd1819ea0df0ce4bb58 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 2 Apr 2024 17:17:15 -0600 Subject: [PATCH 06/10] Use only one workflow to build and push all docker images Signed-off-by: Florent Poinsard --- ...build_base.yml => docker_build_images.yml} | 27 +++---- .github/workflows/docker_build_lite.yml | 73 ------------------- 2 files changed, 14 insertions(+), 86 deletions(-) rename .github/workflows/{docker_build_base.yml => docker_build_images.yml} (92%) delete mode 100644 .github/workflows/docker_build_lite.yml diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_images.yml similarity index 92% rename from .github/workflows/docker_build_base.yml rename to .github/workflows/docker_build_images.yml index e40a029125a..e9f5b5d6174 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_images.yml @@ -1,4 +1,4 @@ -name: Docker Build Base +name: Docker Build Images on: push: branches: @@ -7,21 +7,21 @@ on: - '*' concurrency: - group: format('{0}-{1}', ${{ github.ref }}, 'Docker Build Base') + group: format('{0}-{1}', ${{ github.ref }}, 'Docker Build Images') cancel-in-progress: true permissions: read-all jobs: - build_and_push_base: - name: Build and push vitess/base Docker images + build_and_push_lite: + name: Build and push vitess/lite Docker images runs-on: gh-hosted-runners-16cores-1 if: github.repository == 'vitessio/vitess' strategy: fail-fast: true matrix: - branch: [ latest, mysql57, percona57, percona80 ] + branch: [ latest ] steps: - name: Check out code @@ -36,9 +36,9 @@ jobs: - name: Set Dockerfile path run: | if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKERFILE=./docker/base/Dockerfile" >> $GITHUB_ENV + echo "DOCKERFILE=./docker/lite/Dockerfile" >> $GITHUB_ENV else - echo "DOCKERFILE=./docker/base/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV + echo "DOCKERFILE=./docker/lite/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV fi - name: Build and push on main @@ -48,25 +48,26 @@ jobs: context: . file: ${{ env.DOCKERFILE }} push: true - tags: vitess/base:${{ matrix.branch }} + tags: vitess/lite:${{ matrix.branch }} ###### # All code below only applies to new tags ###### - - name: Get the Git tag if: startsWith(github.ref, 'refs/tags/') run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: Set Docker tag name - if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' + if: startsWith(github.ref, 'refs/tags/') run: | if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKER_TAG=vitess/base:${TAG_NAME}" >> $GITHUB_ENV + echo "DOCKER_TAG=vitess/lite:${TAG_NAME}" >> $GITHUB_ENV + else + echo "DOCKER_TAG=vitess/lite:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV fi - name: Build and push on tags - if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' + if: startsWith(github.ref, 'refs/tags/') uses: docker/build-push-action@v5 with: context: . @@ -258,4 +259,4 @@ jobs: tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} build-args: | VT_BASE_VER=${{ env.TAG_NAME }} - DEBIAN_VER=${{ matrix.debian }}-slim + DEBIAN_VER=${{ matrix.debian }}-slim \ No newline at end of file diff --git a/.github/workflows/docker_build_lite.yml b/.github/workflows/docker_build_lite.yml deleted file mode 100644 index 96db1bf1a41..00000000000 --- a/.github/workflows/docker_build_lite.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Docker Build Lite -on: - push: - branches: - - main - tags: - - '*' - -concurrency: - group: format('{0}-{1}', ${{ github.ref }}, 'Docker Build Lite') - cancel-in-progress: true - -permissions: read-all - -jobs: - build_and_push: - name: Build and push vitess/lite Docker images - runs-on: gh-hosted-runners-16cores-1 - if: github.repository == 'vitessio/vitess' - - strategy: - fail-fast: true - matrix: - branch: [ latest ] - - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set Dockerfile path - run: | - if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKERFILE=./docker/lite/Dockerfile" >> $GITHUB_ENV - else - echo "DOCKERFILE=./docker/lite/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV - fi - - - name: Build and push on main - if: github.ref == 'refs/heads/main' - uses: docker/build-push-action@v5 - with: - context: . - file: ${{ env.DOCKERFILE }} - push: true - tags: vitess/lite:${{ matrix.branch }} - - - name: Get the Git tag - if: startsWith(github.ref, 'refs/tags/') - run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - - name: Set Docker tag name - if: startsWith(github.ref, 'refs/tags/') - run: | - if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKER_TAG=vitess/lite:${TAG_NAME}" >> $GITHUB_ENV - else - echo "DOCKER_TAG=vitess/lite:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV - fi - - - name: Build and push on tags - if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v5 - with: - context: . - file: ${{ env.DOCKERFILE }} - push: true - tags: ${{ env.DOCKER_TAG }} \ No newline at end of file From 59e8385de45c6b93fed7f1fa7030732d0c2e6ba8 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Wed, 3 Apr 2024 12:07:57 -0600 Subject: [PATCH 07/10] Add missing vtctl binary Signed-off-by: Florent Poinsard --- Makefile | 2 +- docker/k8s/Dockerfile | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index fc92a712d94..a4ec599064e 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ endif install: build # binaries mkdir -p "$${PREFIX}/bin" - cp "$${VTROOTBIN}/"{mysqlctl,mysqlctld,vtorc,vtadmin,vtctld,vtctlclient,vtctldclient,vtgate,vttablet,vtbackup,vtexplain} "$${PREFIX}/bin/" + cp "$${VTROOTBIN}/"{mysqlctl,mysqlctld,vtorc,vtadmin,vtctl,vtctld,vtctlclient,vtctldclient,vtgate,vttablet,vtbackup,vtexplain} "$${PREFIX}/bin/" # Will only work inside the docker bootstrap for now cross-install: cross-build diff --git a/docker/k8s/Dockerfile b/docker/k8s/Dockerfile index 8fa30041877..de1543383b9 100644 --- a/docker/k8s/Dockerfile +++ b/docker/k8s/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/lite:${VT_BASE_VER} AS lite +FROM frouioui/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -56,5 +56,4 @@ COPY --from=lite $VTROOT/config/init_db.sql /vt/config/ COPY --from=lite $VTROOT/config/mycnf /vt/config/mycnf # add vitess user and add permissions -RUN groupadd -r --gid 2000 vitess && useradd -r -g vitess --uid 1000 vitess && \ - chown -R vitess:vitess /vt; +RUN groupadd -r --gid 2000 vitess && useradd -r -g vitess --uid 1000 vitess && chown -R vitess:vitess /vt; From 9bc5f2387aa82f175fcb30b9de37bc106c95bbda Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Wed, 3 Apr 2024 12:17:24 -0600 Subject: [PATCH 08/10] Remove debug code Signed-off-by: Florent Poinsard --- docker/k8s/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/k8s/Dockerfile b/docker/k8s/Dockerfile index de1543383b9..986a6274ff9 100644 --- a/docker/k8s/Dockerfile +++ b/docker/k8s/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/lite:${VT_BASE_VER} AS lite +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} From 0fa9fdbc11c6a6ffa654a14e3e58602c4484a609 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Wed, 3 Apr 2024 15:10:32 -0600 Subject: [PATCH 09/10] Remove k8s image Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_images.yml | 95 +------------------ docker/{k8s => binaries}/logrotate/Dockerfile | 0 .../logrotate/logrotate.conf | 0 docker/{k8s => binaries}/logrotate/rotate.sh | 0 docker/{k8s => binaries}/logtail/Dockerfile | 0 docker/{k8s => binaries}/logtail/tail.sh | 0 docker/{k8s => binaries}/mysqlctl/Dockerfile | 8 +- docker/{k8s => binaries}/mysqlctld/Dockerfile | 8 +- docker/{k8s => binaries}/vtadmin/Dockerfile | 8 +- docker/{k8s => binaries}/vtadmin/default.conf | 0 docker/{k8s => binaries}/vtbackup/Dockerfile | 8 +- docker/{k8s => binaries}/vtctl/Dockerfile | 6 +- .../{k8s => binaries}/vtctlclient/Dockerfile | 4 +- docker/{k8s => binaries}/vtctld/Dockerfile | 8 +- docker/{k8s => binaries}/vtexplain/Dockerfile | 4 +- .../{k8s/vtorc => binaries/vtgate}/Dockerfile | 6 +- .../{k8s/vtgate => binaries/vtorc}/Dockerfile | 6 +- docker/{k8s => binaries}/vttablet/Dockerfile | 8 +- docker/k8s/Dockerfile | 59 ------------ test/vtop_example.sh | 3 +- 20 files changed, 39 insertions(+), 192 deletions(-) rename docker/{k8s => binaries}/logrotate/Dockerfile (100%) rename docker/{k8s => binaries}/logrotate/logrotate.conf (100%) rename docker/{k8s => binaries}/logrotate/rotate.sh (100%) rename docker/{k8s => binaries}/logtail/Dockerfile (100%) rename docker/{k8s => binaries}/logtail/tail.sh (100%) rename docker/{k8s => binaries}/mysqlctl/Dockerfile (84%) rename docker/{k8s => binaries}/mysqlctld/Dockerfile (86%) rename docker/{k8s => binaries}/vtadmin/Dockerfile (86%) rename docker/{k8s => binaries}/vtadmin/default.conf (100%) rename docker/{k8s => binaries}/vtbackup/Dockerfile (84%) rename docker/{k8s => binaries}/vtctl/Dockerfile (86%) rename docker/{k8s => binaries}/vtctlclient/Dockerfile (92%) rename docker/{k8s => binaries}/vtctld/Dockerfile (84%) rename docker/{k8s => binaries}/vtexplain/Dockerfile (92%) rename docker/{k8s/vtorc => binaries/vtgate}/Dockerfile (86%) rename docker/{k8s/vtgate => binaries/vtorc}/Dockerfile (86%) rename docker/{k8s => binaries}/vttablet/Dockerfile (83%) delete mode 100644 docker/k8s/Dockerfile diff --git a/.github/workflows/docker_build_images.yml b/.github/workflows/docker_build_images.yml index e9f5b5d6174..c5b86d20877 100644 --- a/.github/workflows/docker_build_images.yml +++ b/.github/workflows/docker_build_images.yml @@ -75,99 +75,6 @@ jobs: push: true tags: ${{ env.DOCKER_TAG }} - build_and_push_k8s: - needs: build_and_push_base - name: Build and push vitess/k8s image - runs-on: gh-hosted-runners-16cores-1 - if: github.repository == 'vitessio/vitess' - - strategy: - fail-fast: true - matrix: - debian: [ bullseye, bookworm ] - - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set Docker context path - run: | - echo "DOCKER_CTX=./docker/k8s" >> $GITHUB_ENV - - - name: Build and push on main latest tag - if: github.ref == 'refs/heads/main' && matrix.debian == 'bookworm' - uses: docker/build-push-action@v5 - with: - context: ${{ env.DOCKER_CTX }} - push: true - tags: vitess/k8s:latest - build-args: | - VT_BASE_VER=latest - DEBIAN_VER=${{ matrix.debian }}-slim - - - name: Build and push on main debian specific tag - if: github.ref == 'refs/heads/main' - uses: docker/build-push-action@v5 - with: - context: ${{ env.DOCKER_CTX }} - push: true - tags: vitess/k8s:latest-${{ matrix.debian }} - build-args: | - VT_BASE_VER=latest - DEBIAN_VER=${{ matrix.debian }}-slim - - ###### - # All code below only applies to new tags - ###### - - - name: Get the Git tag - if: startsWith(github.ref, 'refs/tags/') - run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - # We push git-tag-based k8s image to three tags, i.e. for 'v19.0.0' we push to: - # - # vitess/k8s:v19.0.0 (DOCKER_TAG_DEFAULT_DEBIAN) - # vitess/k8s:v19.0.0-bookworm (DOCKER_TAG) - # vitess/k8s:v19.0.0-bullseye (DOCKER_TAG) - # - - name: Set Docker tag name - if: startsWith(github.ref, 'refs/tags/') - run: | - echo "DOCKER_TAG_DEFAULT_DEBIAN=vitess/k8s:${TAG_NAME}" >> $GITHUB_ENV - echo "DOCKER_TAG=vitess/k8s:${TAG_NAME}-${{ matrix.debian }}" >> $GITHUB_ENV - - # Build and Push component image to DOCKER_TAG, applies to both debian version - - name: Build and push on tags using Debian extension - if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v5 - with: - context: ${{ env.DOCKER_CTX }} - push: true - tags: ${{ env.DOCKER_TAG }} - build-args: | - VT_BASE_VER=${{ env.TAG_NAME }} - DEBIAN_VER=${{ matrix.debian }}-slim - - # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) - # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already - - name: Build and push on tags without Debian extension - if: startsWith(github.ref, 'refs/tags/') && matrix.debian == 'bookworm' - uses: docker/build-push-action@v5 - with: - context: ${{ env.DOCKER_CTX }} - push: true - tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} - build-args: | - VT_BASE_VER=${{ env.TAG_NAME }} - DEBIAN_VER=${{ matrix.debian }}-slim - - build_and_push_components: needs: build_and_push_k8s name: Build and push vitess components Docker images @@ -192,7 +99,7 @@ jobs: - name: Set Docker context path run: | - echo "DOCKER_CTX=./docker/k8s/${{ matrix.component }}" >> $GITHUB_ENV + echo "DOCKER_CTX=./docker/binaries/${{ matrix.component }}" >> $GITHUB_ENV - name: Build and push on main latest tag if: github.ref == 'refs/heads/main' && matrix.debian == 'bookworm' diff --git a/docker/k8s/logrotate/Dockerfile b/docker/binaries/logrotate/Dockerfile similarity index 100% rename from docker/k8s/logrotate/Dockerfile rename to docker/binaries/logrotate/Dockerfile diff --git a/docker/k8s/logrotate/logrotate.conf b/docker/binaries/logrotate/logrotate.conf similarity index 100% rename from docker/k8s/logrotate/logrotate.conf rename to docker/binaries/logrotate/logrotate.conf diff --git a/docker/k8s/logrotate/rotate.sh b/docker/binaries/logrotate/rotate.sh similarity index 100% rename from docker/k8s/logrotate/rotate.sh rename to docker/binaries/logrotate/rotate.sh diff --git a/docker/k8s/logtail/Dockerfile b/docker/binaries/logtail/Dockerfile similarity index 100% rename from docker/k8s/logtail/Dockerfile rename to docker/binaries/logtail/Dockerfile diff --git a/docker/k8s/logtail/tail.sh b/docker/binaries/logtail/tail.sh similarity index 100% rename from docker/k8s/logtail/tail.sh rename to docker/binaries/logtail/tail.sh diff --git a/docker/k8s/mysqlctl/Dockerfile b/docker/binaries/mysqlctl/Dockerfile similarity index 84% rename from docker/k8s/mysqlctl/Dockerfile rename to docker/binaries/mysqlctl/Dockerfile index 6c449552354..72c80c6363b 100644 --- a/docker/k8s/mysqlctl/Dockerfile +++ b/docker/binaries/mysqlctl/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -28,13 +28,13 @@ RUN mkdir -p /vt/bin && \ mkdir -p /vt/config && mkdir -p /vtdataroot # Copy binaries -COPY --from=k8s /vt/bin/mysqlctl /vt/bin/ +COPY --from=lite /vt/bin/mysqlctl /vt/bin/ # Copy certs to allow https calls -COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # copy vitess config -COPY --from=k8s /vt/config /vt/config +COPY --from=lite /vt/config /vt/config # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/mysqlctld/Dockerfile b/docker/binaries/mysqlctld/Dockerfile similarity index 86% rename from docker/k8s/mysqlctld/Dockerfile rename to docker/binaries/mysqlctld/Dockerfile index 6fdb30f012a..81909b9f092 100644 --- a/docker/k8s/mysqlctld/Dockerfile +++ b/docker/binaries/mysqlctld/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -35,13 +35,13 @@ RUN mkdir -p /vt/bin && \ mkdir -p /vt/config && mkdir -p /vtdataroot # Copy binaries -COPY --from=k8s /vt/bin/mysqlctld /vt/bin/ +COPY --from=lite /vt/bin/mysqlctld /vt/bin/ # Copy certs to allow https calls -COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # copy vitess config -COPY --from=k8s /vt/config /vt/config +COPY --from=lite /vt/config /vt/config # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/vtadmin/Dockerfile b/docker/binaries/vtadmin/Dockerfile similarity index 86% rename from docker/k8s/vtadmin/Dockerfile rename to docker/binaries/vtadmin/Dockerfile index f952681d3c9..9d30ba565e0 100644 --- a/docker/k8s/vtadmin/Dockerfile +++ b/docker/binaries/vtadmin/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=bullseye-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM node:18-${DEBIAN_VER} as node @@ -23,7 +23,7 @@ FROM node:18-${DEBIAN_VER} as node RUN mkdir -p /vt/web # copy web admin files -COPY --from=k8s /vt/web/vtadmin /vt/web/vtadmin +COPY --from=lite /vt/web/vtadmin /vt/web/vtadmin # install/build/clean web dependencies RUN npm --prefix /vt/web/vtadmin ci && \ @@ -37,10 +37,10 @@ ENV VTADMIN_WEB_PORT=14201 ENV VTROOT /vt # Copy binaries -COPY --from=k8s /vt/bin/vtadmin /vt/bin/ +COPY --from=lite /vt/bin/vtadmin /vt/bin/ # Copy certs to allow https calls -COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --chown=nginx --from=node /vt/web/vtadmin/build /var/www/ COPY --chown=nginx default.conf /etc/nginx/templates/default.conf.template diff --git a/docker/k8s/vtadmin/default.conf b/docker/binaries/vtadmin/default.conf similarity index 100% rename from docker/k8s/vtadmin/default.conf rename to docker/binaries/vtadmin/default.conf diff --git a/docker/k8s/vtbackup/Dockerfile b/docker/binaries/vtbackup/Dockerfile similarity index 84% rename from docker/k8s/vtbackup/Dockerfile rename to docker/binaries/vtbackup/Dockerfile index 4a8b3be9d52..3b429928cb4 100644 --- a/docker/k8s/vtbackup/Dockerfile +++ b/docker/binaries/vtbackup/Dockerfile @@ -16,7 +16,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -28,13 +28,13 @@ ENV VTDATAROOT /vtdataroot RUN mkdir -p /vt/bin && mkdir -p /vtdataroot # Copy binaries -COPY --from=k8s /vt/bin/vtbackup /vt/bin/ +COPY --from=lite /vt/bin/vtbackup /vt/bin/ # Copy certs to allow https calls -COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # Copy vitess config -COPY --from=k8s /vt/config /vt/config +COPY --from=lite /vt/config /vt/config # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/vtctl/Dockerfile b/docker/binaries/vtctl/Dockerfile similarity index 86% rename from docker/k8s/vtctl/Dockerfile rename to docker/binaries/vtctl/Dockerfile index cce3b6dc63c..21ca6aaf77c 100644 --- a/docker/k8s/vtctl/Dockerfile +++ b/docker/binaries/vtctl/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -26,10 +26,10 @@ ENV VTROOT /vt RUN mkdir -p /vt/bin && mkdir -p /vtdataroot # Copy certs to allow https calls -COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # Copy binaries -COPY --from=k8s /vt/bin/vtctl /vt/bin/ +COPY --from=lite /vt/bin/vtctl /vt/bin/ # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/vtctlclient/Dockerfile b/docker/binaries/vtctlclient/Dockerfile similarity index 92% rename from docker/k8s/vtctlclient/Dockerfile rename to docker/binaries/vtctlclient/Dockerfile index 17eab700eb4..c3d67cb8e4b 100644 --- a/docker/k8s/vtctlclient/Dockerfile +++ b/docker/binaries/vtctlclient/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -26,7 +26,7 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -COPY --from=k8s /vt/bin/vtctlclient /usr/bin/ +COPY --from=lite /vt/bin/vtctlclient /usr/bin/ # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/vtctld/Dockerfile b/docker/binaries/vtctld/Dockerfile similarity index 84% rename from docker/k8s/vtctld/Dockerfile rename to docker/binaries/vtctld/Dockerfile index 5daaf929486..a33297fe0ff 100644 --- a/docker/k8s/vtctld/Dockerfile +++ b/docker/binaries/vtctld/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -27,13 +27,13 @@ RUN mkdir -p /vt/bin && \ mkdir -p /vt/web && mkdir -p /vtdataroot # Copy binaries -COPY --from=k8s /vt/bin/vtctld /vt/bin/ +COPY --from=lite /vt/bin/vtctld /vt/bin/ # Copy certs to allow https calls -COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # copy web admin files -COPY --from=k8s /vt/web /vt/web +COPY --from=lite /vt/web /vt/web # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/vtexplain/Dockerfile b/docker/binaries/vtexplain/Dockerfile similarity index 92% rename from docker/k8s/vtexplain/Dockerfile rename to docker/binaries/vtexplain/Dockerfile index 53ce13b9e9e..58e2bd040db 100644 --- a/docker/k8s/vtexplain/Dockerfile +++ b/docker/binaries/vtexplain/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -26,7 +26,7 @@ ENV VTROOT /vt RUN mkdir -p /vt/bin && mkdir -p /vtdataroot # Copy binaries -COPY --from=k8s /vt/bin/vtexplain /vt/bin/ +COPY --from=lite /vt/bin/vtexplain /vt/bin/ # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/vtorc/Dockerfile b/docker/binaries/vtgate/Dockerfile similarity index 86% rename from docker/k8s/vtorc/Dockerfile rename to docker/binaries/vtgate/Dockerfile index b62b30ee676..761700c1673 100644 --- a/docker/k8s/vtorc/Dockerfile +++ b/docker/binaries/vtgate/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -26,10 +26,10 @@ ENV VTROOT /vt RUN mkdir -p /vt/bin && mkdir -p /vtdataroot # Copy certs to allow https calls -COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # Copy binaries -COPY --from=k8s /vt/bin/vtorc /vt/bin/ +COPY --from=lite /vt/bin/vtgate /vt/bin/ # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/vtgate/Dockerfile b/docker/binaries/vtorc/Dockerfile similarity index 86% rename from docker/k8s/vtgate/Dockerfile rename to docker/binaries/vtorc/Dockerfile index 3829227e2fa..b24588f8ee4 100644 --- a/docker/k8s/vtgate/Dockerfile +++ b/docker/binaries/vtorc/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -26,10 +26,10 @@ ENV VTROOT /vt RUN mkdir -p /vt/bin && mkdir -p /vtdataroot # Copy certs to allow https calls -COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # Copy binaries -COPY --from=k8s /vt/bin/vtgate /vt/bin/ +COPY --from=lite /vt/bin/vtorc /vt/bin/ # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/vttablet/Dockerfile b/docker/binaries/vttablet/Dockerfile similarity index 83% rename from docker/k8s/vttablet/Dockerfile rename to docker/binaries/vttablet/Dockerfile index dd504d7860d..1c6ff92a588 100644 --- a/docker/k8s/vttablet/Dockerfile +++ b/docker/binaries/vttablet/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM vitess/lite:${VT_BASE_VER} AS lite FROM debian:${DEBIAN_VER} @@ -27,11 +27,11 @@ ENV VTDATAROOT /vtdataroot RUN mkdir -p /vt/bin && mkdir -p /vtdataroot # Copy binaries -COPY --from=k8s /vt/bin/vttablet /vt/bin/ -COPY --from=k8s /vt/bin/vtctlclient /vt/bin/ +COPY --from=lite /vt/bin/vttablet /vt/bin/ +COPY --from=lite /vt/bin/vtctlclient /vt/bin/ # Copy certs to allow https calls -COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt # add vitess user/group and add permissions RUN groupadd -r --gid 2000 vitess && \ diff --git a/docker/k8s/Dockerfile b/docker/k8s/Dockerfile deleted file mode 100644 index 986a6274ff9..00000000000 --- a/docker/k8s/Dockerfile +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2019 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ARG VT_BASE_VER=latest -ARG DEBIAN_VER=stable-slim - -FROM vitess/lite:${VT_BASE_VER} AS lite - -FROM debian:${DEBIAN_VER} - -# Set up Vitess environment (just enough to run pre-built Go binaries) -ENV VTROOT /vt/src/vitess.io/vitess -ENV VTDATAROOT /vtdataroot - -# Prepare directory structure. -RUN mkdir -p /vt && \ - mkdir -p /vt/bin && \ - mkdir -p /vt/config && \ - mkdir -p /vt/web && \ - mkdir -p /vtdataroot/tabletdata - -# Copy CA certs for https calls -COPY --from=lite /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt - -# Copy binaries -COPY --from=lite /vt/bin/mysqlctld /vt/bin/ -COPY --from=lite /vt/bin/mysqlctl /vt/bin/ -COPY --from=lite /vt/bin/vtctld /vt/bin/ -COPY --from=lite /vt/bin/vtctl /vt/bin/ -COPY --from=lite /vt/bin/vtctlclient /vt/bin/ -COPY --from=lite /vt/bin/vtgate /vt/bin/ -COPY --from=lite /vt/bin/vttablet /vt/bin/ -COPY --from=lite /vt/bin/vtbackup /vt/bin/ -COPY --from=lite /vt/bin/vtadmin /vt/bin/ -COPY --from=lite /vt/bin/vtorc /vt/bin/ -COPY --from=lite /vt/bin/vtexplain /vt/bin/ - -# copy web admin files -COPY --from=lite $VTROOT/web /vt/web/ - -# copy vitess config -COPY --from=lite $VTROOT/config/init_db.sql /vt/config/ - -# my.cnf include files -COPY --from=lite $VTROOT/config/mycnf /vt/config/mycnf - -# add vitess user and add permissions -RUN groupadd -r --gid 2000 vitess && useradd -r -g vitess --uid 1000 vitess && chown -R vitess:vitess /vt; diff --git a/test/vtop_example.sh b/test/vtop_example.sh index 3862936a370..dfd3719e4da 100755 --- a/test/vtop_example.sh +++ b/test/vtop_example.sh @@ -486,8 +486,7 @@ EOF # Build the docker image for vitess/lite using the local code docker build -f docker/lite/Dockerfile -t vitess/lite:pr . # Build the docker image for vitess/vtadmin using the local code -docker build -f docker/k8s/Dockerfile --build-arg VT_BASE_VER=pr -t vitess/k8s:pr . -docker build -f docker/k8s/vtadmin/Dockerfile --build-arg VT_BASE_VER=pr -t vitess/vtadmin:pr . +docker build -f docker/binaries/vtadmin/Dockerfile --build-arg VT_BASE_VER=pr -t vitess/vtadmin:pr . # Print the docker images available docker image ls From a7d69dfba30ed24929a06bc945c60ac38f1c3d37 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Wed, 3 Apr 2024 15:19:16 -0600 Subject: [PATCH 10/10] Modify release notes Signed-off-by: Florent Poinsard --- changelog/20.0/20.0.0/summary.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changelog/20.0/20.0.0/summary.md b/changelog/20.0/20.0.0/summary.md index d0021555c0b..2e9304c4fcf 100644 --- a/changelog/20.0/20.0.0/summary.md +++ b/changelog/20.0/20.0.0/summary.md @@ -5,6 +5,7 @@ - **[Major Changes](#major-changes)** - **[Deletions](#deletions)** - [MySQL binaries in the vitess/lite Docker images](#vitess-lite) + - [vitess/base and vitess/k8s Docker images](#base-k8s-images) - **[Breaking changes](#breaking-changes)** - [`shutdown_grace_period` Default Change](#shutdown-grace-period-default) - [New `unmanaged` Flag and `disable_active_reparents` deprecation](#unmanaged-flag) @@ -71,6 +72,12 @@ Below is an example of a kubernetes yaml file before and after upgrading to an o mysql80Compatible: mysql:8.0.30 # or even mysql:8.0.34 for instance ``` +#### `vitess/base` and `vitess/k8s` Docker images + +Since we have deleted MySQL from our `vitess/lite` image, we are removing the `vitess/base` and `vitess/k8s` images. + +These images are no longer useful since we can use `vitess/lite` as the base of many other Docker images (`vitess/vtgate`, `vitess/vtgate`, ...). + ### Breaking Changes #### `shutdown_grace_period` Default Change