Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions content/en/docs/18.0/get-started/local-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ This guide will only work on x86_64/amd64 based machines.

This guide illustrates how to run a local testing Vitess setup via Docker. The Vitess environment is identical to the [local setup](../local/), but without having to install software on one's host other than Docker.

## Prerequisite

- Install [Golang](https://go.dev/doc/install) locally.

## Check out the vitessio/vitess repository

Clone the GitHub repository via:
Expand Down
4 changes: 4 additions & 0 deletions content/en/docs/19.0/get-started/local-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ This guide will only work on x86_64/amd64 based machines.

This guide illustrates how to run a local testing Vitess setup via Docker. The Vitess environment is identical to the [local setup](../local/), but without having to install software on one's host other than Docker.

## Prerequisite

- Install [Golang](https://go.dev/doc/install) locally.

## Check out the vitessio/vitess repository

Clone the GitHub repository via:
Expand Down
4 changes: 4 additions & 0 deletions content/en/docs/20.0/get-started/local-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ This guide will only work on x86_64/amd64 based machines.

This guide illustrates how to run a local testing Vitess setup via Docker. The Vitess environment is identical to the [local setup](../local/), but without having to install software on one's host other than Docker.

## Prerequisite

- Install [Golang](https://go.dev/doc/install) locally.

## Check out the vitessio/vitess repository

Clone the GitHub repository via:
Expand Down
4 changes: 4 additions & 0 deletions content/en/docs/21.0/get-started/local-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ This guide will only work on x86_64/amd64 based machines.

This guide illustrates how to run a local testing Vitess setup via Docker. The Vitess environment is identical to the [local setup](../local/), but without having to install software on one's host other than Docker.

## Prerequisite

- Install [Golang](https://go.dev/doc/install) locally.

Comment on lines +15 to +18
Copy link
Member

@frouioui frouioui Jul 2, 2024

Choose a reason for hiding this comment

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

Applies to all versions: I am unsure why we require Golang since we do everything on Docker.

Is it because eventually the guide links to the Move Tables step and in that step we need to run some vtctldclient commands? If so, we should add a step that builds that binary along with a prerequisite to have mysql installed since we use it in the next step too.

Copy link
Member

@frouioui frouioui Jul 2, 2024

Choose a reason for hiding this comment

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

Actually I think it is a mistake to link the Docker install guide to the current Move Tables guide. In the Move Tables guide we only support K8S and local installs. The local install steps won't work on Docker as we start/execute the binaries directly on the user's machine, not in Docker. For instance mysqlctl-up.sh which is called by ./201_customer_tablets.sh does the following:

mysqlctl \
 --log_dir $VTDATAROOT/tmp \
 --tablet_uid $uid \
 --mysql_port $mysql_port \
 $action

In that case, I am still unsure why we require Golang to be installed for the Docker guide.

Copy link
Collaborator

Choose a reason for hiding this comment

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

make docker_local itself requires golang

Copy link
Collaborator

@deepthi deepthi Jul 2, 2024

Choose a reason for hiding this comment

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

Actually I think it is a mistake to link the Docker install guide to the current Move Tables guide.

I suppose we could remove this link. Or remove docker_local completely. Who is using it?

Copy link
Member

Choose a reason for hiding this comment

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

Removing it has been my long running preference FWIW.

Copy link
Collaborator

Choose a reason for hiding this comment

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

make docker_local itself requires golang

hmm, actually not. So we need the PR author to tell us what the specific error was that required golang installation.

But the bigger point is what Matt said. Should we delete this guide completely? We've debated this in the past without coming to a good conclusion.
Maybe what we should do is conduct a survey in slack and if no one is using it, we delete the code and docs.

Copy link
Member

Choose a reason for hiding this comment

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

It is debatable but I don't think we should require people to install Golang if they use the Docker install guide, it defeats the purpose of using Docker and contradicts the first sentence of the guide:

but without having to install software on one's host other than Docker

If we decide to keep this guide and these commands on the Makefile, I think we should tweak build_docker_image to first check if Go is installed before calling it, and if it is not installed: build the docker images as usual (without the arch/proc information). The guide also says This guide will only work on x86_64/amd64 based machines. which, if I understand correctly, is not fully true if you have Golang installed since we use the --platform flag to build the Docker images.

I think we should put more emphasis on inviting users to use K8S instead of Docker, the install steps of the operator are easier to follow than they were a few years ago. But I also understand that some people want to have a small vitess setup to test things around in which case this guide is useful, but should not necessarily be linked to Move Tables.

Copy link
Member

@frouioui frouioui Jul 2, 2024

Choose a reason for hiding this comment

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

I am guessing the error the author saw is that the following if statement from build_docker_image is broken:

elif [ $$(go env GOOS) != $$(go env GOHOSTOS) ] || [ $$(go env GOARCH) != $$(go env GOHOSTARCH) ]; then \`

If go is not installed, the condition will always be true, leading to wrong arguments when calling docker buildx build --platform "$$(go env GOOS)/$$(go env GOARCH)" -f ${1} -t ${2} --build-arg bootstrap_version=${BOOTSTRAP_VERSION} .; \

Copy link
Member

Choose a reason for hiding this comment

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

Easily testable with this make command that runs gox (does not exist) instead of go:

toto:
	if [ $$(gox env GOOS) != $$(gox env GOHOSTOS) ] || [ $$(gox env GOARCH) != $$(gox env GOHOSTARCH) ]; then \
		echo "Building docker using buildx --platform=$$(gox env GOOS)/$$(gox env GOARCH)"; \
	else \
		echo "Building docker using straight docker build"; \
	fi

Which returns:

/bin/bash: gox: command not found
/bin/bash: gox: command not found
/bin/bash: gox: command not found
/bin/bash: gox: command not found
Building docker using buildx --platform=/

## Check out the vitessio/vitess repository

Clone the GitHub repository via:
Expand Down