| OLD | NEW |
| 1 WebTry | 1 WebTry Server |
| 2 ====== | 2 ============= |
| 3 | 3 |
| 4 Allows trying out Skia code in the browser. Run a local webserver | 4 Allows trying out Skia code in the browser. Run a local webserver |
| 5 and from the pages it serves try out Skia code and see the results | 5 and from the pages it serves try out Skia code and see the results |
| 6 immediately. To make sandboxing easier this must be built w/GPU off. | 6 immediately. To make sandboxing easier this must be built w/GPU off. |
| 7 | 7 |
| 8 |
| 8 Running Locally | 9 Running Locally |
| 9 =============== | 10 =============== |
| 10 | 11 |
| 11 $ GYP_GENERATORS=ninja ./gyp_skia gyp/webtry.gyp gyp/most.gyp -Dskia_gpu=0 | 12 $ GYP_GENERATORS=ninja ./gyp_skia gyp/webtry.gyp gyp/most.gyp -Dskia_gpu=0 |
| 12 $ ninja -C out/Debug webtry | 13 $ ninja -C out/Debug webtry |
| 13 $ cd experimental/webtry | 14 $ cd experimental/webtry |
| 14 $ go get -d | 15 $ go get -d |
| 15 $ go build webtry.go | 16 $ go build webtry.go |
| 16 $ ./webtry | 17 $ ./webtry |
| 17 | 18 |
| 18 Then visit http://localhost:8000 in your browser. | 19 Then visit http://localhost:8000 in your browser. |
| 19 | 20 |
| 20 Only tested under linux, doubtful it will work on other platforms. | 21 Only tested under linux, doubtful it will work on other platforms. |
| 21 | 22 |
| 22 Full Server Setup | 23 |
| 23 ================= | 24 Server Setup |
| 25 ============ |
| 24 | 26 |
| 25 Create a GCE instance: | 27 Create a GCE instance: |
| 26 | 28 |
| 27 gcutil --project=google.com:skia-buildbots addinstance skia-webtry-b \ | 29 gcutil --project=google.com:skia-buildbots addinstance skia-webtry-b \ |
| 28 --zone=us-central2-b --external_ip_address=108.170.220.126 \ | 30 --zone=us-central2-b --external_ip_address=108.170.220.126 \ |
| 29 --service_account=default \ | 31 --service_account=default \ |
| 30 --service_account_scopes="https://www.googleapis.com/auth/devstorage.full_
control" \ | 32 --service_account_scopes="https://www.googleapis.com/auth/devstorage.full_
control" \ |
| 31 --network=default --machine_type=n1-standard-1 --image=backports-debian-7-
wheezy-v20140331 \ | 33 --network=default --machine_type=n1-standard-1 --image=backports-debian-7-
wheezy-v20140331 \ |
| 32 --persistent_boot_disk | 34 --persistent_boot_disk |
| 33 | 35 |
| 34 Make sure port 80 is accessible externally for the above instance. | 36 Make sure port 80 is accessible externally for the above instance. |
| 35 | 37 |
| 36 SSH into the instance: | 38 SSH into the instance: |
| 37 | 39 |
| 38 gcutil --project=google.com:skia-buildbots ssh --ssh_user=default skia-webtr
y-b | 40 gcutil --project=google.com:skia-buildbots ssh --ssh_user=default skia-webtr
y-b |
| 39 | 41 |
| 40 | 42 |
| 41 Do once | 43 Do the first time |
| 42 ------- | 44 ================= |
| 43 | 45 |
| 44 The following things only need to be done once | 46 The following things only need to be done once. |
| 45 | 47 |
| 46 1. sudo apt-get install git schroot debootstrap | 48 1. SSH into the server as default. |
| 47 2. git clone https://skia.googlesource.com/skia | 49 2. sudo apt-get install git schroot debootstrap |
| 48 3. Add the following to /etc/fstab and reboot: | 50 3. git clone https://skia.googlesource.com/skia |
| 51 4. cd ~/skia/experimental/webtry/setup |
| 52 5. ./webtry_setup.sh |
| 53 |
| 54 6. Add the following to /etc/fstab and reboot: |
| 49 | 55 |
| 50 none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0 | 56 none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0 |
| 51 | 57 |
| 52 The above will allow ninja to run. See http://stackoverflow.com/questions/200927
8/python-multiprocessing-permission-denied | 58 The above will allow ninja to run. See http://stackoverflow.com/questions/200927
8/python-multiprocessing-permission-denied |
| 53 | 59 |
| 54 4. Add the following to the /etc/schroot/minimal/fstab: | 60 7. Add the following to the /etc/schroot/minimal/fstab: |
| 55 | 61 |
| 56 /home/webtry/inout /inout none rw,bind 0 0 | 62 /home/webtry/inout /inout none rw,bind 0 0 |
| 57 | 63 |
| 58 5. Change /etc/monit/monitrc to: | 64 8. Change /etc/monit/monitrc to: |
| 59 | 65 |
| 60 set daemon 2 | 66 set daemon 2 |
| 61 | 67 |
| 62 then run the following so it applies: | 68 then run the following so it applies: |
| 63 | 69 |
| 64 sudo /etc/init.d/monit restart | 70 sudo /etc/init.d/monit restart |
| 65 | 71 |
| 66 This means that monit will poll every two seconds that our application is up and
running. | 72 This means that monit will poll every two seconds that our application is up and
running. |
| 67 | 73 |
| 68 6. Set the TCP keepalive. For more info see: | 74 9. Set the TCP keepalive. For more info see: |
| 69 https://developers.google.com/cloud-sql/docs/gce-access | 75 https://developers.google.com/cloud-sql/docs/gce-access |
| 70 | 76 |
| 71 sudo bash -c 'echo 60 > /proc/sys/net/ipv4/tcp_keepalive_time' | 77 sudo bash -c 'echo 60 > /proc/sys/net/ipv4/tcp_keepalive_time' |
| 72 | 78 |
| 73 Do the first time | 79 Once, after setup |
| 74 ----------------- | 80 ================= |
| 75 | 81 |
| 76 Do the following the first time you setup a machine, and each time you want to u
pdate the code running on the server | 82 Do this step only once, but only after running webtry_setup.sh the first time. |
| 77 | |
| 78 cd ~/skia/experimental/webtry/setup | |
| 79 ./webtry_setup.sh | |
| 80 | |
| 81 | |
| 82 Once, after setup | |
| 83 ----------------- | |
| 84 | |
| 85 Do this step only once, but only after running webtry_setup.sh the first time | |
| 86 | 83 |
| 87 sudo debootstrap --variant=minbase wheezy /srv/chroot/webtry | 84 sudo debootstrap --variant=minbase wheezy /srv/chroot/webtry |
| 88 | 85 |
| 89 | 86 |
| 87 To update the code |
| 88 ================== |
| 89 |
| 90 1. SSH into the server as default. |
| 91 2. cd ~/skia/experimental/webtry/setup |
| 92 3. git pull |
| 93 4. ./webtry_setup.sh |
| 94 |
| 95 |
| 90 Third Party Code | 96 Third Party Code |
| 91 ---------------- | 97 ================ |
| 92 | 98 |
| 93 * res/js/polyfill.js - Various JS polyfill libraries. To rebuild or update | 99 * res/js/polyfill.js - Various JS polyfill libraries. To rebuild or update |
| 94 see poly/README.md. | 100 see poly/README.md. |
| OLD | NEW |