Skip to content
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

Remove vitess/base and vitess/k8s Docker images #15620

Merged
merged 10 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Build Base
name: Docker Build Images
on:
push:
branches:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: .
Expand Down Expand Up @@ -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
73 changes: 0 additions & 73 deletions .github/workflows/docker_build_lite.yml

This file was deleted.

26 changes: 1 addition & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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,vtctl,vtctld,vtctlclient,vtctldclient,vtgate,vttablet,vtbackup,vtexplain} "$${PREFIX}/bin/"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image vitess/k8s now relies on vitess/lite, which runs make install. In vitess/k8s we copy these binaries so they are available for the binary-specific images. I had to add the missing binaries that we use in vitess/k8s.


# Will only work inside the docker bootstrap for now
cross-install: cross-build
Expand Down Expand Up @@ -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}

Expand Down Expand Up @@ -365,20 +355,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
Comment on lines -368 to -370
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed docker/release and the corresponding make command as it seems to not be used and very ancient.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. It was being used by the pre-GH release process.

@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

Expand Down
16 changes: 1 addition & 15 deletions doc/DockerBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -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[:<flavor>]` 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[:<flavor>]` 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
Expand Down
25 changes: 0 additions & 25 deletions docker/Dockerfile.release

This file was deleted.

41 changes: 0 additions & 41 deletions docker/base/Dockerfile

This file was deleted.

41 changes: 0 additions & 41 deletions docker/base/Dockerfile.mysql57

This file was deleted.

41 changes: 0 additions & 41 deletions docker/base/Dockerfile.percona57

This file was deleted.

Loading
Loading