Added prerequisites to docker-install#1777
Added prerequisites to docker-install#1777kirtanchandak wants to merge 3 commits intovitessio:prodfrom kirtanchandak:local-docker-install/kirtan
Conversation
kirtanchandak
commented
Jun 28, 2024
- added prerequisite to install go

Signed-off-by: kirtanchandak <themarketingkirtan@gmail.com>
Signed-off-by: kirtanchandak <themarketingkirtan@gmail.com>
✅ Deploy Preview for vitess ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
deepthi
left a comment
There was a problem hiding this comment.
The same changes should be made in all active versions. v18 -> v21.
| ## Prerequisite | ||
|
|
||
| Before we get started, let’s get a few pre-requisites out of the way: | ||
| 1. Install [Golang](https://go.dev/doc/install) locally. |
There was a problem hiding this comment.
Use bullet instead of numbering.
|
|
||
| ## Prerequisite | ||
|
|
||
| Before we get started, let’s get a few pre-requisites out of the way: |
There was a problem hiding this comment.
We don't really need this line at all.
There was a problem hiding this comment.
made the required changes
Signed-off-by: kirtanchandak <themarketingkirtan@gmail.com>
| ## Prerequisite | ||
|
|
||
| - Install [Golang](https://go.dev/doc/install) locally. | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 \
$actionIn that case, I am still unsure why we require Golang to be installed for the Docker guide.
There was a problem hiding this comment.
make docker_local itself requires golang
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Removing it has been my long running preference FWIW.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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} .; \
There was a problem hiding this comment.
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"; \
fiWhich 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=/
|
@kirtanchandak after discussion with @frouioui this is what we concluded
|
|
Correct, @kirtanchandak I can give you some pointers on how to fix the error. In the Makefile we have a function called |
|
@kirtanchandak please wait a day or two until the team makes a decision on whether to delete this guide. If that's what we decide your PR can delete the guide instead of modifying it. |
|
@kirtanchandak please go ahead and do 2 PRs
|