| OLD | NEW |
| 1 WebTry | 1 WebTry |
| 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 Running Locally | 8 Running Locally |
| 9 =============== | 9 =============== |
| 10 | 10 |
| 11 $ GYP_GENERATORS=ninja ./gyp_skia gyp/webtry.gyp gyp/most.gyp -Dskia_gpu=0 | 11 $ GYP_GENERATORS=ninja ./gyp_skia gyp/webtry.gyp gyp/most.gyp -Dskia_gpu=0 |
| 12 $ ninja -C out/Debug webtry | 12 $ ninja -C out/Debug webtry |
| 13 $ cd experimental/webtry | 13 $ cd experimental/webtry |
| 14 $ go build webtry.go | 14 $ go build webtry.go |
| 15 $ ./webtry | 15 $ ./webtry |
| 16 | 16 |
| 17 Then visit http://localhost:8000 in your browser. | 17 Then visit http://localhost:8000 in your browser. |
| 18 | 18 |
| 19 Only tested under linux, doubtful it will work on other platforms. | 19 Only tested under linux, doubtful it will work on other platforms. |
| 20 | 20 |
| 21 Full Server Setup | 21 Full Server Setup |
| 22 ================= | 22 ================= |
| 23 | 23 |
| 24 Create a GCE instance: | 24 Create a GCE instance: |
| 25 | 25 |
| 26 gcutil --project=google.com:skia-buildbots addinstance skia-webtry-b \ | 26 gcutil --project=google.com:skia-buildbots addinstance skia-webtry-b \ |
| 27 --zone=us-central2-b --external_ip_address=108.170.220.126 \ | 27 --zone=us-central2-b --external_ip_address=108.170.220.126 \ |
| 28 --service_account=default \ | 28 --service_account=default \ |
| 29 --service_account_scopes="https://www.googleapis.com/auth/devstorage.full_cont
rol" \ | 29 --service_account_scopes="https://www.googleapis.com/auth/devstorage.full_
control" \ |
| 30 --network=default --machine_type=n1-standard-1 --image=backports-debian-7-whee
zy-v20140331 \ | 30 --network=default --machine_type=n1-standard-1 --image=backports-debian-7-
wheezy-v20140331 \ |
| 31 --persistent_boot_disk | 31 --persistent_boot_disk |
| 32 | 32 |
| 33 SSH into the instance: | 33 SSH into the instance: |
| 34 | 34 |
| 35 gcutil --project=google.com:skia-buildbots ssh --ssh_user=default skia-webtry-
b | 35 gcutil --project=google.com:skia-buildbots ssh --ssh_user=default skia-webtr
y-b |
| 36 | 36 |
| 37 | 37 |
| 38 Do once |
| 39 ------- |
| 40 |
| 38 The following things only need to be done once | 41 The following things only need to be done once |
| 39 ---------------------------------------------- | |
| 40 | 42 |
| 41 1. sudo apt-get install git schroot debootstrap | 43 1. sudo apt-get install git schroot debootstrap |
| 42 2. git clone https://skia.googlesource.com/skia | 44 2. git clone https://skia.googlesource.com/skia |
| 43 3. Add the following to /etc/fstab and reboot: | 45 3. Add the following to /etc/fstab and reboot: |
| 44 | 46 |
| 45 none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0 | 47 none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0 |
| 46 | 48 |
| 47 The above will allow ninja to run. See http://stackoverflow.com/questions/200927
8/python-multiprocessing-permission-denied | 49 The above will allow ninja to run. See http://stackoverflow.com/questions/200927
8/python-multiprocessing-permission-denied |
| 48 | 50 |
| 49 4. Add the following to the /etc/schroot/minimal/fstab: | 51 4. Add the following to the /etc/schroot/minimal/fstab: |
| 50 | 52 |
| 51 /home/webtry/inout /inout none rw,bind 0 0 | 53 /home/webtry/inout /inout none rw,bind 0 0 |
| 52 | 54 |
| 53 5. Change /etc/monit/monitrc to: | 55 5. Change /etc/monit/monitrc to: |
| 54 | 56 |
| 55 set daemon 2 | 57 set daemon 2 |
| 56 | 58 |
| 57 then run the following so it applies: | 59 then run the following so it applies: |
| 58 | 60 |
| 59 sudo /etc/init.d/monit restart | 61 sudo /etc/init.d/monit restart |
| 60 | 62 |
| 61 This means that monit will poll every two seconds that our application is up and
running. | 63 This means that monit will poll every two seconds that our application is up and
running. |
| 62 | 64 |
| 65 Do the first time |
| 66 ----------------- |
| 67 |
| 63 Do the following the first time you setup a machine, and each time you want to u
pdate the code running on the server | 68 Do the following the first time you setup a machine, and each time you want to u
pdate the code running on the server |
| 64 --------------------------------------------------------------------------------
------------------------------------ | |
| 65 | 69 |
| 66 cd ~/skia/experimental/webtry/setup | 70 cd ~/skia/experimental/webtry/setup |
| 67 ./webtry_setup.sh | 71 ./webtry_setup.sh |
| 68 | 72 |
| 69 | 73 |
| 70 Do these steps only once, but only after running webtry_setup.sh the first time | 74 Once, after setup |
| 71 ------------------------------------------------------------------------------- | 75 ----------------- |
| 72 | 76 |
| 73 1. sudo debootstrap --variant=minbase wheezy /srv/chroot/webtry | 77 Do this step only once, but only after running webtry_setup.sh the first time |
| 74 | 78 |
| 79 sudo debootstrap --variant=minbase wheezy /srv/chroot/webtry |
| 80 |
| OLD | NEW |