skia2/experimental/webtry
commit-bot@chromium.org e2b193ca5c Revert of remove unused (by clients) SkUnitMapper (https://codereview.chromium.org/283273002/)
Reason for revert:
does not address all legacy callsites in chrome.

e.g.

[13:45:32.091872] ../../ui/native_theme/native_theme_base.cc:608:76: error: no matching function for call to ‘SkGradientShader::CreateLinear(SkPoint [3], SkColor [3], NULL, int, SkShader::TileMode, NULL)’
[13:45:32.091919]            gradient_bounds, colors, NULL, 3, SkShader::kClamp_TileMode, NULL));


Original issue's description:
> remove unused (by clients) SkUnitMapper
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=14761

R=robertphillips@google.com, scroggo@google.com, george@mozilla.com
TBR=george@mozilla.com, robertphillips@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: reed@google.com

Review URL: https://codereview.chromium.org/287063009

git-svn-id: http://skia.googlecode.com/svn/trunk@14763 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-16 13:49:08 +00:00
..
res Add polyfill for pointer events, change code to handle both mouse and pointer events equalls. 2014-05-15 21:14:34 +00:00
setup Run Squid as a reverse caching proxy on port 80 and proxy the requests 2014-05-01 20:10:03 +00:00
sys Run Squid as a reverse caching proxy on port 80 and proxy the requests 2014-05-01 20:10:03 +00:00
templates Revert of remove unused (by clients) SkUnitMapper (https://codereview.chromium.org/283273002/) 2014-05-16 13:49:08 +00:00
DESIGN.md Run Squid as a reverse caching proxy on port 80 and proxy the requests 2014-05-01 20:10:03 +00:00
main.cpp First pass at workspaces. 2014-04-19 13:55:50 +00:00
README.md Add polyfill for pointer events, change code to handle both mouse and pointer events equalls. 2014-05-15 21:14:34 +00:00
result.cpp Initial code for webtry, a web application for allowing users to try out Skia. 2014-04-09 18:59:44 +00:00
safec++ Set ulimits for the compile stage. 2014-04-30 19:38:51 +00:00
seccomp_bpf.h Sanitizing source files in Housekeeper-Nightly 2014-04-10 03:05:44 +00:00
TODO.md Factor out common template code. Send stdout back to web page. 2014-04-22 21:13:45 +00:00
webtry.go Ping MySQL every minute in an attempt to keep the connection alive. 2014-05-14 12:55:34 +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 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 build webtry.go
$ ./webtry

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

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

Full 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 once

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:

    none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0

The above will allow ninja to run. See http://stackoverflow.com/questions/2009278/python-multiprocessing-permission-denied

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

    /home/webtry/inout /inout none rw,bind 0 0

  2. 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.

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

Do the first time

Do the following the first time you setup a machine, and each time you want to update the code running on the server

cd ~/skia/experimental/webtry/setup
./webtry_setup.sh

Once, after setup

Do this step only once, but only after running webtry_setup.sh the first time

sudo debootstrap --variant=minbase wheezy /srv/chroot/webtry

Third Party Code