repair the webtry setup process

The previous version of the script didn't properly update the code for the webtry
user, so only changes to skia would really be pulled, not changes to the actual
webtry server itself.

This version of the setup script is 100% automated and brings everything up to date.

It's also a little more verbose about what it's doing, so it's easier to debug.

BUG=skia:
R=tfarina@chromium.org
TBR=jcgregorio, mtklein, tfarina

Review URL: https://codereview.chromium.org/636173003
This commit is contained in:
Greg Humphreys 2014-10-08 12:33:31 -04:00
parent 25ec1b3c8c
commit 117ff1c1d1
3 changed files with 58 additions and 14 deletions

View File

@ -1,19 +1,16 @@
#!/bin/bash
#
# The continue_install script updates the jail's copy of depot tools and the latest
# verion of skia. It then builds the skia libraries inside the jail, and builds the webtry
# server outside the jail.
# The continue_install script updates the webtry user's copy of skia and depot_tools.
# It then builds the webtry server outside the jail.
#
# The setup scripts should run this script as the 'webtry' user.
#
# See the README file for detailed installation instructions.
CHROOT_JAIL=/srv/chroot/webtry_gyp
sudo cp continue_install_jail.sh ${CHROOT_JAIL}/bin/continue_install_jail.sh
sudo chmod 755 ${CHROOT_JAIL}/bin/continue_install_jail.sh
sudo chroot ${CHROOT_JAIL} /bin/continue_install_jail.sh
sudo chown -R webtry:webtry ${CHROOT_JAIL}/skia_build/skia
# Install Go
cd
# Install Go
if [ -d go ]; then
echo Go already installed.
else
@ -26,7 +23,22 @@ export GOROOT=${HOME}/go
export GOPATH=${HOME}/golib
export PATH=$PATH:$GOROOT/bin
cd skia/experimental/webtry
# Install depot_tools.
if [ -d depot_tools ]; then
(cd depot_tools && git pull);
else
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git;
fi
export PATH=$PATH:~/depot_tools
# Checkout the skia code and dependencies (again)
mkdir skia
cd skia
gclient config --name . https://skia.googlesource.com/skia.git
gclient sync
git checkout master
cd experimental/webtry
go get -d
./build

View File

@ -38,5 +38,4 @@ git checkout master
SKIA_GYP_OUTPUT_DIR=${SKIA_BUILD}/skia/out GYP_GENERATORS=ninja ./gyp_skia -Dskia_gpu=0
ninja -C ${SKIA_BUILD}/skia/out/Release skia_lib libjpeg libSkKTX libetc1 flags
ninja -C ${SKIA_BUILD}/skia/out/Release skia_lib libjpeg libSkKTX libetc1 flags sk_tool_utils

View File

@ -2,13 +2,26 @@
#
# Script to setup a GCE instance to run the webtry server.
# For full instructions see the README file.
function banner {
echo ""
echo "******************************************"
echo "*"
echo "* $1"
echo "*"
echo "******************************************"
echo ""
}
banner "Installing debian packages needed for the server"
sudo apt-get install schroot debootstrap monit squid3
# although aufs is being replaced by overlayfs, it's not clear
# to me if overlayfs is completely supported by schroot yet.
sudo apt-get install aufs-tools
echo "Adding the webtry user account"
banner "Setting up the webtry user account"
sudo adduser webtry
sudo mkdir /home/webtry/cache
@ -23,6 +36,7 @@ sudo cp ../sys/webtry_schroot /etc/schroot/chroot.d/webtry
CHROOT_JAIL=/srv/chroot/webtry_gyp
# Build the chroot environment.
if [ ! -d ${CHROOT_JAIL} ]; then
banner "Building the chroot jail"
sudo mkdir -p ${CHROOT_JAIL}
sudo debootstrap --variant=minbase wheezy ${CHROOT_JAIL}
@ -32,12 +46,27 @@ if [ ! -d ${CHROOT_JAIL} ]; then
sudo sh -c "echo 'none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0' >> ${CHROOT_JAIL}/etc/fstab"
fi
# The continue_install_jail script will update and build up the skia library
# inside the jail.
banner "Installing and updating software on the chroot jail"
sudo cp continue_install_jail.sh ${CHROOT_JAIL}/bin/continue_install_jail.sh
sudo chmod 755 ${CHROOT_JAIL}/bin/continue_install_jail.sh
sudo chroot ${CHROOT_JAIL} /bin/continue_install_jail.sh
sudo chown -R webtry:webtry ${CHROOT_JAIL}/skia_build/skia
# The continue_install script will fetch the latest versions of
# skia and depot_tools. We split up the installation process into
# two pieces like this so that the continue_install script can
# be run independently of this one to fetch and build the latest skia.
./continue_install.sh
banner "Building the webtry server outside the jail"
sudo cp continue_install.sh /home/webtry
sudo chown webtry:webtry /home/webtry/continue_install.sh
sudo su - webtry -c /home/webtry/continue_install.sh
banner "Setting up system initialization scripts"
sudo cp ../sys/webtry_init /etc/init.d/webtry
sudo cp ../sys/webtry_monit /etc/monit/conf.d/webtry
@ -48,4 +77,8 @@ sudo chmod 744 /etc/init.d/webtry
sudo monit -t
sudo monit reload
banner "Restarting webtry server"
sudo /etc/init.d/webtry restart
banner "All done!"