aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/webtry/README.md
blob: 059b66e45eb8f4666f30fbb6bf7d710ce8d7bb25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
WebTry Server
=============

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
immediately. To make sandboxing easier this must be built w/GPU off.


Running Locally
===============

    $ GYP_GENERATORS=ninja ./gyp_skia gyp/webtry.gyp gyp/most.gyp -Dskia_gpu=0
    $ ninja -C out/Debug webtry
    $ cd experimental/webtry
    $ go get -d
    $ go build webtry.go
    $ ./webtry

Then visit http://localhost:8000 in your browser.

Only tested under linux, doubtful it will work on other platforms.


Server Setup
============

Create a GCE instance:

    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

Make sure port 80 is accessible externally for the above instance.

SSH into the instance:

    gcutil --project=google.com:skia-buildbots ssh --ssh_user=default skia-webtry-b


Do the first time
=================

The following things only need to be done once.

1. SSH into the server as default.

2. sudo apt-get install git schroot debootstrap

3. Add the following to the /etc/schroot/minimal/fstab:

  none /run/shm tmpfs rw,nosuid,nodev,noexec 0 0
  /home/webtry/inout             /skia_build/inout  none    rw,bind         0       0
  /home/webtry/cache             /skia_build/cache  none    rw,bind         0       0


4. git clone https://skia.googlesource.com/skia

5. cd ~/skia/experimental/webtry/setup

6. ./webtry_setup.sh

7. Change /etc/monit/monitrc to:

    set daemon 2

then run the following so it applies:

    sudo /etc/init.d/monit restart

This means that monit will poll every two seconds that our application is up and running.

8. 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'

To update the code
==================

1. SSH into the server as default.
2. cd ~/skia/experimental/webtry/setup
3. git pull
4. ./webtry_setup.sh

Third Party Code
================

  * res/js/polyfill.js - Various JS polyfill libraries. To rebuild or update
    see poly/README.md.