playground: Update to current Vanadium version.

Also increased timeout for Go 1.5 compilation.

Change-Id: I95fea9d80aef7ce7e3cbacf9ee337dde1228b876
diff --git a/go/src/v.io/x/playground/.gitignore b/go/src/v.io/x/playground/.gitignore
index 38373aa..f11c1aa 100644
--- a/go/src/v.io/x/playground/.gitignore
+++ b/go/src/v.io/x/playground/.gitignore
@@ -1,4 +1,3 @@
-netrc
 node_modules
 config/*.json
 !config/db-*-example.json
diff --git a/go/src/v.io/x/playground/Dockerfile b/go/src/v.io/x/playground/Dockerfile
index ee3f586..d8de31a 100644
--- a/go/src/v.io/x/playground/Dockerfile
+++ b/go/src/v.io/x/playground/Dockerfile
@@ -2,12 +2,15 @@
 RUN /usr/sbin/useradd -d /home/playground -m playground
 
 # Install various prereqs.
-RUN apt-get update
-RUN apt-get install -y curl git nodejs nodejs-legacy npm
+RUN apt-get update && \
+    apt-get install -y curl git nodejs nodejs-legacy npm && \
+    apt-get clean
 
 # Install Go. Note, the apt-get "golang" target is too old.
-RUN (cd /tmp; curl -O https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz)
-RUN tar -C /usr/local -xzf /tmp/go1.4.2.linux-amd64.tar.gz
+ENV GOLANG_TAR go1.5.3.linux-amd64.tar.gz
+RUN (cd /tmp; curl -O https://storage.googleapis.com/golang/${GOLANG_TAR}) && \
+    tar -C /usr/local -xzf /tmp/${GOLANG_TAR} && \
+    rm /tmp/${GOLANG_TAR}
 ENV PATH /usr/local/go/bin:$PATH
 
 ENV HOME /root
@@ -20,9 +23,10 @@
 # Note: This will be cached! If you want to re-build the docker image using
 # fresh Vanadium code, you must pass "--no-cache" to the docker build command.
 # See README.md.
-ADD netrc /root/.netrc
 RUN curl https://v.io/bootstrap | bash
-RUN rm /root/.netrc
+
+# Setup Vanadium profiles.
+RUN jiri v23-profile install base
 
 # Install the release/javascript/core library.
 # TODO(nlacasse): Switch to "npm install -g vanadium" once release/javascript/core
diff --git a/go/src/v.io/x/playground/README.md b/go/src/v.io/x/playground/README.md
index ad41187..87a0329 100644
--- a/go/src/v.io/x/playground/README.md
+++ b/go/src/v.io/x/playground/README.md
@@ -23,19 +23,11 @@
 
 Build the playground Docker image (this will take a while...):
 
-    $ cp ~/.netrc $JIRI_ROOT/release/projects/playground/go/src/v.io/x/playground/netrc
     $ docker build -t playground $JIRI_ROOT/release/projects/playground/go/src/v.io/x/playground/.
 
 Note: If you want to ensure an up-to-date version of Vanadium is installed in
 the Docker image, run the above command with the "--no-cache" flag.
 
-Note: If you have only a .gitcookies googlesource.com entry and not a .netrc
-one, you can convert it to a .netrc entry using:
-
-    $ cat ~/.gitcookies | grep vanadium.googlesource.com | tail -n 1 | sed -E 's/(\S+)\s+(\S+\s+){5}([^=]+)=(\S+)/machine \1 login \3 password \4/' >> ~/.netrc
-
-(see http://www.chromium.org/chromium-os/developer-guide/gerrit-guide for details)
-
 The 'docker build' command above will compile builder from the main Vanadium
 repository. If you want to use local code instead, open Dockerfile and
 uncomment marked lines before running the command.
diff --git a/go/src/v.io/x/playground/builder/builder_v23_test.go b/go/src/v.io/x/playground/builder/builder_v23_test.go
index 17325b6..633f067 100644
--- a/go/src/v.io/x/playground/builder/builder_v23_test.go
+++ b/go/src/v.io/x/playground/builder/builder_v23_test.go
@@ -115,7 +115,7 @@
 			if len(authfile) > 0 {
 				files = append(files, authfile)
 			}
-			inv := runPGExample(t, sh, builderPath, testdataDir, files, "--verbose=true", "--includeV23Env=true", "--runTimeout=5s")
+			inv := runPGExample(t, sh, builderPath, testdataDir, files, "--verbose=true", "--includeProfileEnv=true", "--runTimeout=5s")
 			t.Logf("test: %s", c.name)
 			inv.S.ExpectSetEventuallyRE(patterns...)
 			inv.Wait()
diff --git a/go/src/v.io/x/playground/builder/main.go b/go/src/v.io/x/playground/builder/main.go
index b0da8e6..375b057 100644
--- a/go/src/v.io/x/playground/builder/main.go
+++ b/go/src/v.io/x/playground/builder/main.go
@@ -44,9 +44,9 @@
 var (
 	verbose              = flag.Bool("verbose", true, "Whether to output debug messages.")
 	includeServiceOutput = flag.Bool("includeServiceOutput", false, "Whether to stream service (mounttable, wspr, proxy) output to clients.")
-	includeV23Env        = flag.Bool("includeV23Env", false, "Whether to log the output of \"jiri env\" before compilation.")
+	includeProfileEnv    = flag.Bool("includeProfileEnv", false, "Whether to log the output of \"jiri v23-profile env\" before compilation.")
 	// TODO(ivanpi): Separate out mounttable, proxy, wspr timeouts. Add compile timeout. Revise default.
-	runTimeout = flag.Duration("runTimeout", 3*time.Second, "Time limit for running user code.")
+	runTimeout = flag.Duration("runTimeout", 5*time.Second, "Time limit for running user code.")
 
 	stopped = false    // Whether we have stopped execution of running files.
 	out     event.Sink // Sink for writing events (debug and run output) to stdout as JSON, one event per line.
@@ -100,9 +100,9 @@
 	}
 }
 
-func logV23Env() error {
-	if *includeV23Env {
-		return makeCmd("<environment>", false, "", "jiri", "env").Run()
+func logProfileEnv() error {
+	if *includeProfileEnv {
+		return makeCmd("<environment>", false, "", "jiri", "v23-profile", "env").Run()
 	}
 	return nil
 }
@@ -447,7 +447,7 @@
 
 	panicOnError(writeFiles(r.Files))
 
-	logV23Env()
+	logProfileEnv()
 
 	badInput, err := compileFiles(r.Files)
 	// Panic on internal error, but not on user error.
diff --git a/go/src/v.io/x/playground/compilerd/compile.go b/go/src/v.io/x/playground/compilerd/compile.go
index d205196..7860826 100644
--- a/go/src/v.io/x/playground/compilerd/compile.go
+++ b/go/src/v.io/x/playground/compilerd/compile.go
@@ -45,7 +45,7 @@
 	// Arbitrary deadline (enough to compile, run, shutdown).
 	// TODO(sadovsky): For now this is set high to avoid spurious timeouts.
 	// Playground execution speed needs to be optimized.
-	maxTime = flag.Duration("max-time", 10*time.Second, "Maximum time for build to run.")
+	maxTime = flag.Duration("max-time", 30*time.Second, "Maximum time for build to run.")
 
 	// TODO(nlacasse): The default value of 100 was chosen arbitrarily and
 	// should be tuned.
diff --git a/go/src/v.io/x/playground/compilerd/jobqueue/jobqueue_test.go b/go/src/v.io/x/playground/compilerd/jobqueue/jobqueue_test.go
index 43b2983..0cb33d0 100644
--- a/go/src/v.io/x/playground/compilerd/jobqueue/jobqueue_test.go
+++ b/go/src/v.io/x/playground/compilerd/jobqueue/jobqueue_test.go
@@ -26,8 +26,9 @@
 )
 
 func init() {
-	// Compile builder binary and put in path.
+	// Compile builder binary and dependencies and put in path.
 	pgDir := os.ExpandEnv("${JIRI_ROOT}/release/projects/playground/go")
+	v23ReleaseDir := os.ExpandEnv("${JIRI_ROOT}/release/go")
 
 	cmd := exec.Command("make", "builder")
 	cmd.Dir = path.Join(pgDir, "src", "v.io", "x", "playground")
@@ -38,7 +39,8 @@
 	}
 
 	pgBinDir := path.Join(pgDir, "bin")
-	if err := os.Setenv("PATH", pgBinDir+":"+os.Getenv("PATH")); err != nil {
+	v23ReleaseBinDir := path.Join(v23ReleaseDir, "bin")
+	if err := os.Setenv("PATH", pgBinDir+":"+v23ReleaseBinDir+":"+os.Getenv("PATH")); err != nil {
 		panic(err)
 	}
 }
@@ -200,7 +202,6 @@
 }
 
 func TestJobQueue(t *testing.T) {
-
 	// Test success cases without docker.
 	runTest(t, testConfig{
 		jobs:      1,
diff --git a/go/src/v.io/x/playground/compilerd/main.go b/go/src/v.io/x/playground/compilerd/main.go
index 9e8ff6b..3aa3682 100644
--- a/go/src/v.io/x/playground/compilerd/main.go
+++ b/go/src/v.io/x/playground/compilerd/main.go
@@ -59,7 +59,7 @@
 
 	// Maximum time to finish serving currently running requests before exiting
 	// cleanly. No new requests are accepted during this time.
-	exitDelay = 30 * time.Second
+	exitDelay = 60 * time.Second
 
 	// Path to SQL configuration file, as described in v.io/x/lib/dbutil/mysql.go.
 	sqlConf = flag.String("sqlconf", "", "Path to SQL configuration file. If empty, load and save requests are disabled. "+dbutil.SqlConfigFileDescription)