Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request vitessio#5999 from planetscale/morgo-fix-docker-bo…
Browse files Browse the repository at this point in the history
…otstrap

Fix Docker bootstrap
  • Loading branch information
morgo authored Apr 1, 2020
2 parents 9271419 + f4a28ab commit fa7bdf0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ tools:

minimaltools:
echo $$(date): Installing minimal dependencies
BUILD_JAVA=0 BUILD_CONSUL=0 ./bootstrap.sh
BUILD_CHROME=0 BUILD_JAVA=0 BUILD_CONSUL=0 ./bootstrap.sh

dependency_check:
./tools/dependency_check.sh
Expand Down
36 changes: 36 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ source ./dev.env

BUILD_JAVA=${BUILD_JAVA:-1}
BUILD_CONSUL=${BUILD_CONSUL:-1}
BUILD_CHROME=${BUILD_CHROME:-1}

#
# 0. Initialization and helper methods.
Expand Down Expand Up @@ -217,5 +218,40 @@ if [ "$BUILD_CONSUL" == 1 ] ; then
install_dep "Consul" "1.4.0" "$VTROOT/dist/consul" install_consul
fi

# Download chromedriver
function install_chromedriver() {
local version="$1"
local dist="$2"

case $(uname) in
Linux) local platform=linux;;
*) echo "Platform not supported for vtctl-web tests. Skipping chromedriver install."; return;;
esac

if [ "$(arch)" == "aarch64" ] ; then
os=$(cat /etc/*release | grep "^ID=" | cut -d '=' -f 2)
case $os in
ubuntu|debian)
sudo apt-get update -y && sudo apt install -y --no-install-recommends unzip libglib2.0-0 libnss3 libx11-6
;;
centos|fedora)
sudo yum update -y && yum install -y libX11 unzip wget
;;
esac
echo "For Arm64, using prebuilt binary from electron (https://github.com/electron/electron/) of version 76.0.3809.126"
wget https://github.com/electron/electron/releases/download/v6.0.3/chromedriver-v6.0.3-linux-arm64.zip
unzip -o -q chromedriver-v6.0.3-linux-arm64.zip -d "$dist"
rm chromedriver-v6.0.3-linux-arm64.zip
else
curl -sL "https://chromedriver.storage.googleapis.com/$version/chromedriver_linux64.zip" > chromedriver_linux64.zip
unzip -o -q chromedriver_linux64.zip -d "$dist"
rm chromedriver_linux64.zip
fi
}

if [ "$BUILD_CHROME" == 1 ] ; then
install_dep "chromedriver" "73.0.3683.20" "$VTROOT/dist/chromedriver" install_chromedriver
fi

echo
echo "bootstrap finished - run 'make build' to compile"
8 changes: 0 additions & 8 deletions docker/bootstrap/Dockerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
libtool \
make \
openjdk-8-jdk \
python-crypto \
python-dev \
python-mysqldb \
python-pip \
ruby \
ruby-dev \
software-properties-common \
virtualenv \
unzip \
Expand All @@ -46,9 +40,7 @@ ENV USER vitess
# Copy files needed for bootstrap
COPY bootstrap.sh dev.env build.env go.mod go.sum /vt/src/vitess.io/vitess/
COPY config /vt/src/vitess.io/vitess/config
COPY third_party /vt/src/vitess.io/vitess/third_party
COPY tools /vt/src/vitess.io/vitess/tools
COPY travis /vt/src/vitess.io/vitess/travis

# Create vitess user
RUN groupadd -r vitess && useradd -r -g vitess vitess && \
Expand Down

0 comments on commit fa7bdf0

Please sign in to comment.