Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: experimental/webtry/DESIGN.md

Issue 240773003: First pass at workspaces. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | experimental/webtry/css/webtry.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/webtry/DESIGN.md
diff --git a/experimental/webtry/DESIGN.md b/experimental/webtry/DESIGN.md
index 0c4f3a1b87ef4270a617f603779099b5d7c780af..3aaf2e707c81ed3230ddae3d359e22877227aeea 100644
--- a/experimental/webtry/DESIGN.md
+++ b/experimental/webtry/DESIGN.md
@@ -36,35 +36,33 @@ Architecture
The server runs on GCE, and consists of a Go Web Server that calls out to the
c++ compiler and executes code in a chroot jail. See the diagram below:
-                            
-    +–––––––––––––+         
-    |             |         
-    |  Browser    |         
-    |             |         
-    +––––––+––––––+         
-           |                
-    +––––––+––––––+         
-    |             |         
-    |             |         
-    | Web Server  |         
-    |             |         
-    |   (Go)      |         
-    |             |         
-    |             |         
-    +–––––––+–––––+         
-            |               
-    +–––––––+––––––––––+    
-    | chroot jail      |    
-    |  +––––––––––––––+|    
-    |  | seccomp      ||    
-    |  |  +––––––––––+||    
-    |  |  |User code |||    
-    |  |  |          |||    
-    |  |  +––––––––––+||    
-    |  +––––––––––––––+|    
-    |                  |    
-    +––––––––––––––––––+    
-                            
+    +–––––––––––––+
+    |             |
+    |  Browser    |
+    |             |
+    +––––––+––––––+
+           |
+    +––––––+––––––+
+    |             |
+    |             |
+    | Web Server  |
+    |             |
+    |   (Go)      |
+    |             |
+    |             |
+    +–––––––+–––––+
+            |
+    +–––––––+––––––––––+
+    | chroot jail      |
+    |  +––––––––––––––+|
+    |  | seccomp      ||
+    |  |  +––––––––––+||
+    |  |  |User code |||
+    |  |  |          |||
+    |  |  +––––––––––+||
+    |  +––––––––––––––+|
+    |                  |
+    +––––––––––––––––––+
The user code is expanded into a simple template and linked against libskia
and a couple other .o files that contain main() and the code that sets up the
@@ -147,6 +145,21 @@ Initial setup of the database, the user, and the only table:
PRIMARY KEY(hash)
);
+ CREATE TABLE workspace (
+ name CHAR(64) DEFAULT '' NOT NULL,
+ create_ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ PRIMARY KEY(name)
+ );
+
+ CREATE TABLE workspacetry (
+ name CHAR(64) DEFAULT '' NOT NULL,
+ create_ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
+ hash CHAR(64) DEFAULT '' NOT NULL,
+ hidden INTEGER DEFAULT 0 NOT NULL,
+
+ FOREIGN KEY (name) REFERENCES workspace(name)
+ );
+
Common queries webtry.go will use:
INSERT INTO webtry (code, hash) VALUES('int i = 0;...', 'abcdef...');
@@ -161,9 +174,18 @@ Common queries webtry.go will use:
// Run before and after to confirm the password changed:
SELECT Host, User, Password FROM mysql.user;
+Common queries for workspaces:
+
+ SELECT hash, create_ts FROM workspace ORDER BY create_ts DESC;
+
+ INSERT INTO workspace (name, hash) VALUES('autumn-river-12354', 'abcdef...');
+
+ SELECT name FROM workspace GROUP BY name;
+
Password for the database will be stored in the metadata instance, if the
-metadata server can't be found, i.e. running locally, then data will not be
-stored. To see the current password stored in metadata and the fingerprint:
+metadata server can't be found, i.e. running locally, then a local sqlite
+database will be used. To see the current password stored in metadata and the
+fingerprint:
gcutil --project=google.com:skia-buildbots getinstance skia-webtry-b
@@ -179,6 +201,14 @@ the metadata server:
N.B. If you need to change the MySQL password that webtry uses, you must change
it both in MySQL and the value stored in the metadata server.
+Workspaces
+----------
+
+Workspaces are implemented by the workspace and workspacetry tables. The
+workspace table keeps the unique list of all workspaces. The workspacetry table
+keeps track of all the tries that have occured in a workspace. Right now the
+hidden column of workspacetry is not used, it's for future functionality.
+
Installation
------------
See the README file.
« no previous file with comments | « no previous file | experimental/webtry/css/webtry.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698