2014-03-11 22:57:50 +00:00
|
|
|
WebTry
|
|
|
|
======
|
|
|
|
|
|
|
|
Allows trying out Skia code in the browser. Run a local webserver
|
|
|
|
and from the pages it serves try out Skia code and see the results
|
2014-04-09 18:59:44 +00:00
|
|
|
immediately. To make sandboxing easier this must be built w/GPU off.
|
2014-03-11 22:57:50 +00:00
|
|
|
|
2014-04-09 18:59:44 +00:00
|
|
|
Running Locally
|
|
|
|
===============
|
2014-03-11 22:57:50 +00:00
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
$ GYP_GENERATORS=ninja ./gyp_skia gyp/webtry.gyp gyp/most.gyp -Dskia_gpu=0
|
|
|
|
$ ninja -C out/Debug webtry
|
|
|
|
$ cd experimental/webtry
|
|
|
|
$ go build webtry.go
|
|
|
|
$ ./webtry
|
2014-03-11 22:57:50 +00:00
|
|
|
|
2014-04-09 18:59:44 +00:00
|
|
|
Then visit http://localhost:8000 in your browser.
|
2014-03-11 22:57:50 +00:00
|
|
|
|
2014-04-09 18:59:44 +00:00
|
|
|
Only tested under linux, doubtful it will work on other platforms.
|
|
|
|
|
|
|
|
Full Server Setup
|
|
|
|
=================
|
|
|
|
|
|
|
|
Create a GCE instance:
|
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
gcutil --project=google.com:skia-buildbots addinstance skia-webtry-b \
|
|
|
|
--zone=us-central2-b --external_ip_address=108.170.220.126 \
|
|
|
|
--service_account=default \
|
|
|
|
--service_account_scopes="https://www.googleapis.com/auth/devstorage.full_control" \
|
|
|
|
--network=default --machine_type=n1-standard-1 --image=backports-debian-7-wheezy-v20140331 \
|
|
|
|
--persistent_boot_disk
|
2014-04-09 18:59:44 +00:00
|
|
|
|
2014-05-01 20:10:03 +00:00
|
|
|
Make sure port 80 is accessible externally for the above instance.
|
|
|
|
|
2014-04-09 18:59:44 +00:00
|
|
|
SSH into the instance:
|
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
gcutil --project=google.com:skia-buildbots ssh --ssh_user=default skia-webtry-b
|
2014-04-09 18:59:44 +00:00
|
|
|
|
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
Do once
|
|
|
|
-------
|
|
|
|
|
2014-04-09 18:59:44 +00:00
|
|
|
The following things only need to be done once
|
|
|
|
|
|
|
|
1. sudo apt-get install git schroot debootstrap
|
|
|
|
2. git clone https://skia.googlesource.com/skia
|
|
|
|
3. Add the following to /etc/fstab and reboot:
|
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0
|
2014-04-09 18:59:44 +00:00
|
|
|
|
|
|
|
The above will allow ninja to run. See http://stackoverflow.com/questions/2009278/python-multiprocessing-permission-denied
|
|
|
|
|
|
|
|
4. Add the following to the /etc/schroot/minimal/fstab:
|
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
/home/webtry/inout /inout none rw,bind 0 0
|
2014-04-09 18:59:44 +00:00
|
|
|
|
|
|
|
5. Change /etc/monit/monitrc to:
|
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
set daemon 2
|
2014-04-09 18:59:44 +00:00
|
|
|
|
|
|
|
then run the following so it applies:
|
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
sudo /etc/init.d/monit restart
|
2014-04-09 18:59:44 +00:00
|
|
|
|
|
|
|
This means that monit will poll every two seconds that our application is up and running.
|
|
|
|
|
2014-04-30 16:14:10 +00:00
|
|
|
6. Set the TCP keepalive. For more info see:
|
|
|
|
https://developers.google.com/cloud-sql/docs/gce-access
|
|
|
|
|
|
|
|
sudo bash -c 'echo 60 > /proc/sys/net/ipv4/tcp_keepalive_time'
|
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
Do the first time
|
|
|
|
-----------------
|
|
|
|
|
2014-04-09 18:59:44 +00:00
|
|
|
Do the following the first time you setup a machine, and each time you want to update the code running on the server
|
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
cd ~/skia/experimental/webtry/setup
|
|
|
|
./webtry_setup.sh
|
|
|
|
|
2014-04-09 18:59:44 +00:00
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
Once, after setup
|
|
|
|
-----------------
|
2014-04-09 18:59:44 +00:00
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
Do this step only once, but only after running webtry_setup.sh the first time
|
2014-04-09 18:59:44 +00:00
|
|
|
|
2014-04-14 14:54:07 +00:00
|
|
|
sudo debootstrap --variant=minbase wheezy /srv/chroot/webtry
|
2014-03-11 22:57:50 +00:00
|
|
|
|