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

Auto-detect VT_MYSQL_ROOT, remove cruft #5488

Merged
merged 5 commits into from
Dec 2, 2019
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/cluster_endtoend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Build
run: |
GOBIN=$PWD/bin make build
VTROOT=$PWD VTTOP=$PWD make build

- name: cluster_endtoend
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_race.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Build
run: |
GOBIN=$PWD/bin make build
VTROOT=$PWD VTTOP=$PWD make build

- name: e2e_race
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/endtoend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Build
run: |
GOBIN=$PWD/bin make build
VTROOT=$PWD VTTOP=$PWD make build

- name: endtoend
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/local_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Build
run: |
GOBIN=$PWD/bin make build
VTROOT=$PWD VTTOP=$PWD make build

- name: local_example
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Build
run: |
GOBIN=$PWD/bin make build
VTROOT=$PWD VTTOP=$PWD make build

- name: unit
run: |
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/unit_race.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.12

- name: Check out code
uses: actions/checkout@v1
Expand All @@ -26,13 +26,11 @@ jobs:

- name: Run bootstrap.sh
run: |
echo "Copying new bootstrap over location of legacy one."
cp .github/bootstrap.sh .
./bootstrap.sh
VTTOP=$PWD VTROOT=$PWD BUILD_PYTHON=0 ./bootstrap.sh

- name: Build
run: |
GOBIN=$PWD/bin make build
VTROOT=$PWD VTTOP=$PWD make build

- name: unit_race
run: |
Expand Down
17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

MAKEFLAGS = -s

# Soon this can be $PWD/bin, with no dependencies
# Waiting on https://github.com/vitessio/vitess/issues/5378

export GOBIN=$(VTROOT)/bin
export GO111MODULE=on

# Disabled parallel processing of target prerequisites to avoid that integration tests are racing each other (e.g. for ports) and may fail.
# Since we are not using this Makefile for compilation, limiting parallelism will not increase build time.
.NOTPARALLEL:
Expand All @@ -33,14 +39,6 @@ ifdef VT_EXTRA_BUILD_FLAGS
export EXTRA_BUILD_FLAGS := $(VT_EXTRA_BUILD_FLAGS)
endif

# Link against the MySQL library in $VT_MYSQL_ROOT if it's specified.
ifdef VT_MYSQL_ROOT
# Clutter the env var only if it's a non-standard path.
ifneq ($(VT_MYSQL_ROOT),/usr)
CGO_LDFLAGS += -L$(VT_MYSQL_ROOT)/lib
endif
endif

build_web:
echo $$(date): Building web artifacts
cd web/vtctld2 && ng build -prod
Expand Down Expand Up @@ -249,9 +247,6 @@ docker_lite_alpine:
docker_guestbook:
cd examples/kubernetes/guestbook && ./build.sh

docker_publish_site:
docker build -f docker/publish-site/Dockerfile -t vitess/publish-site .

# This rule loads the working copy of the code into a bootstrap image,
# and then runs the tests inside Docker.
# Example: $ make docker_test flavor=mariadb
Expand Down
21 changes: 0 additions & 21 deletions azure-pipelines.yml

This file was deleted.

13 changes: 2 additions & 11 deletions build.env
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,5 @@ if ! source "${dir}/tools/shell_functions.inc"; then
return 1
fi

VTTOP=$(pwd)
export VTTOP
VTROOT="${VTROOT:-${VTTOP/\/src\/vitess.io\/vitess/}}"
export VTROOT
# VTTOP sanity check
if [[ "$VTTOP" == "${VTTOP/\/src\/vitess.io\/vitess/}" ]]; then
echo "WARNING: VTTOP($VTTOP) does not contain src/vitess.io/vitess"
fi

export GOBIN="$VTROOT/bin"
export GO111MODULE=on
export VTTOP=$(pwd)
export VTROOT="${VTROOT:-${VTTOP/\/src\/vitess.io\/vitess/}}"
23 changes: 0 additions & 23 deletions dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

source ./build.env

export GOTOP=$VTTOP/go
export PYTOP=$VTTOP/py

export VTDATAROOT="${VTDATAROOT:-${VTROOT}/vtdataroot}"
mkdir -p "$VTDATAROOT"

Expand Down Expand Up @@ -62,28 +59,8 @@ PATH=$(prepend_path "$PATH" "$VTROOT/dist/chromedriver")
PATH=$(prepend_path "$PATH" "$VTROOT/dist/node/bin")
export PATH

# mysql install location. Please set based on your environment.
# Build will not work if this is incorrect.

if [[ "$VT_MYSQL_ROOT" == "" ]]; then
if [[ "$(which mysql)" == "" ]]; then
echo "WARNING: VT_MYSQL_ROOT unset because mysql not found. Did you install a client package?"
else
VT_MYSQL_ROOT=$(dirname "$(dirname "$(which mysql)")")
export VT_MYSQL_ROOT
fi
fi

PKG_CONFIG_PATH=$(prepend_path "$PKG_CONFIG_PATH" "$VTROOT/lib")
export PKG_CONFIG_PATH

# According to https://github.com/etcd-io/etcd/blob/a621d807f061e1dd635033a8d6bc261461429e27/Documentation/op-guide/supported-platform.md,
# currently, etcd is unstable on arm64, so ETCD_UNSUPPORTED_ARCH should be set.
if [ "$(uname -m)" == aarch64 ]; then
export ETCD_UNSUPPORTED_ARCH=arm64
fi

# Useful aliases. Remove if inconvenient.
alias gt='cd $GOTOP'
alias pt='cd $PYTOP'
alias vt='cd $VTTOP'
7 changes: 0 additions & 7 deletions docker/bootstrap/Dockerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
libtool \
make \
openjdk-8-jdk \
pkg-config \
python-crypto \
python-dev \
python-mysqldb \
Expand All @@ -40,17 +39,11 @@ RUN mkdir -p /vt/dist && \
# Set up Vitess environment (equivalent to '. dev.env')
ENV VTTOP /vt/src/vitess.io/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV PYTOP $VTTOP/py
ENV VTDATAROOT $VTROOT/vtdataroot
ENV VTPORTSTART 15000
ENV PYTHONPATH $VTROOT/dist/grpc/usr/local/lib/python2.7/site-packages:$VTROOT/dist/py-mock-1.0.1/lib/python2.7/site-packages:$VTROOT/py-vtdb:$VTROOT/dist/selenium/lib/python2.7/site-packages
ENV GOBIN $VTROOT/bin
ENV PATH $VTROOT/bin:$VTROOT/dist/maven/bin:$VTROOT/dist/chromedriver:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV USER vitess
ENV GO111MODULE on

# Copy files needed for bootstrap
COPY bootstrap.sh dev.env build.env go.mod go.sum /vt/src/vitess.io/vitess/
Expand Down
1 change: 0 additions & 1 deletion docker/bootstrap/Dockerfile.mariadb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ RUN for i in $(seq 1 10); do apt-key adv --no-tty --keyserver keys.gnupg.net --r
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess

ENV MYSQL_FLAVOR MariaDB
USER vitess
RUN ./bootstrap.sh
1 change: 0 additions & 1 deletion docker/bootstrap/Dockerfile.mariadb103
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ RUN apt-key adv --no-tty --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess

ENV MYSQL_FLAVOR MariaDB103
USER vitess
RUN ./bootstrap.sh
1 change: 0 additions & 1 deletion docker/bootstrap/Dockerfile.mysql56
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ RUN for i in $(seq 1 10); do apt-key adv --no-tty --recv-keys --keyserver pool.s
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess

ENV MYSQL_FLAVOR MySQL56
USER vitess
RUN ./bootstrap.sh
2 changes: 0 additions & 2 deletions docker/bootstrap/Dockerfile.mysql57
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,5 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess


ENV MYSQL_FLAVOR MySQL56
USER vitess
RUN ./bootstrap.sh
2 changes: 0 additions & 2 deletions docker/bootstrap/Dockerfile.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ RUN for i in $(seq 1 10); do apt-key adv --no-tty --recv-keys --keyserver ha.poo
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess


ENV MYSQL_FLAVOR MySQL80
USER vitess
RUN ./bootstrap.sh
1 change: 0 additions & 1 deletion docker/bootstrap/Dockerfile.percona
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ RUN for i in $(seq 1 10); do apt-key adv --no-tty --keyserver keys.gnupg.net --r
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess

ENV MYSQL_FLAVOR MySQL56
USER vitess
RUN ./bootstrap.sh
1 change: 0 additions & 1 deletion docker/bootstrap/Dockerfile.percona57
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ RUN for i in $(seq 1 10); do apt-key adv --no-tty --keyserver keys.gnupg.net --r
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess

ENV MYSQL_FLAVOR MySQL56
USER vitess
RUN ./bootstrap.sh
1 change: 0 additions & 1 deletion docker/bootstrap/Dockerfile.percona80
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ RUN for i in $(seq 1 10); do apt-key adv --no-tty --keyserver keys.gnupg.net --r
# Bootstrap Vitess
WORKDIR /vt/src/vitess.io/vitess

ENV MYSQL_FLAVOR MySQL80
USER vitess
RUN ./bootstrap.sh
6 changes: 0 additions & 6 deletions docker/lite/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/vitess.io/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV MYSQL_FLAVOR MySQL56

# Copy binaries (placed by build.sh)
COPY --from=staging /vt/ /vt/
Expand Down
6 changes: 0 additions & 6 deletions docker/lite/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,8 @@ RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/reposito
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/vitess.io/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV MYSQL_FLAVOR MariaDB103

# Create vitess user
RUN addgroup -S vitess && adduser -S -G vitess vitess && mkdir -p /vt
Expand Down
6 changes: 0 additions & 6 deletions docker/lite/Dockerfile.mariadb
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/vitess.io/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV MYSQL_FLAVOR MariaDB

# Copy binaries (placed by build.sh)
COPY --from=staging /vt/ /vt/
Expand Down
6 changes: 0 additions & 6 deletions docker/lite/Dockerfile.mariadb103
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/vitess.io/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV MYSQL_FLAVOR MariaDB103

# Copy binaries (placed by build.sh)
COPY --from=staging /vt/ /vt/
Expand Down
6 changes: 0 additions & 6 deletions docker/lite/Dockerfile.mysql56
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/vitess.io/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV MYSQL_FLAVOR MySQL56

# Copy binaries (placed by build.sh)
COPY --from=staging /vt/ /vt/
Expand Down
6 changes: 0 additions & 6 deletions docker/lite/Dockerfile.mysql57
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/vitess.io/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV MYSQL_FLAVOR MySQL56

# Copy binaries (placed by build.sh)
COPY --from=staging /vt/ /vt/
Expand Down
6 changes: 0 additions & 6 deletions docker/lite/Dockerfile.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/vitess.io/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV MYSQL_FLAVOR MySQL56

# Copy binaries (placed by build.sh)
COPY --from=staging /vt/ /vt/
Expand Down
6 changes: 0 additions & 6 deletions docker/lite/Dockerfile.percona
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/vitess.io/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV MYSQL_FLAVOR MySQL56

# Copy binaries (placed by build.sh)
COPY --from=staging /vt/ /vt/
Expand Down
Loading