<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[190645] trunk/Websites/perf.webkit.org</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/190645">190645</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-06 14:04:03 -0700 (Tue, 06 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Perf dashboard should have the capability to test local UI with production data
https://bugs.webkit.org/show_bug.cgi?id=149834
Reviewed by Chris Dumez.
Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server.
* Install.md: Added the instruction on how to use the script. Also updated the remaining instructions
for El Capitan.
* config.json: Added remote server configurations.
* public/admin/fetch-from-remote.php: Added. This script fetches JSON from the remote server specified in
config.json and caches the results in the location specified as "cacheDirectory" in config.json.
(main):
(fetch_remote):
* public/include/db.php:
(config_path): Extracted from generate_data_file.
(generate_data_file):
* tools/remote-server-relay.conf: Added. Apache 2.4 configuration file for a local http server launched by
run-with-remote-server.py.
* tools/run-with-remote-server.py: Added. Launches Apache with the right set of directives.
(main):
(abspath_from_root):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgChangeLog">trunk/Websites/perf.webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsitesperfwebkitorgInstallmd">trunk/Websites/perf.webkit.org/Install.md</a></li>
<li><a href="#trunkWebsitesperfwebkitorgconfigjson">trunk/Websites/perf.webkit.org/config.json</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicincludedbphp">trunk/Websites/perf.webkit.org/public/include/db.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgpublicadminfetchfromremotephp">trunk/Websites/perf.webkit.org/public/admin/fetch-from-remote.php</a></li>
<li><a href="#trunkWebsitesperfwebkitorgtoolsremoteserverrelayconf">trunk/Websites/perf.webkit.org/tools/remote-server-relay.conf</a></li>
<li><a href="#trunkWebsitesperfwebkitorgtoolsrunwithremoteserverpy">trunk/Websites/perf.webkit.org/tools/run-with-remote-server.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebsitesperfwebkitorgChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/ChangeLog (190644 => 190645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/ChangeLog        2015-10-06 20:57:22 UTC (rev 190644)
+++ trunk/Websites/perf.webkit.org/ChangeLog        2015-10-06 21:04:03 UTC (rev 190645)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
+
+ Perf dashboard should have the capability to test local UI with production data
+ https://bugs.webkit.org/show_bug.cgi?id=149834
+
+ Reviewed by Chris Dumez.
+
+ Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server.
+
+ * Install.md: Added the instruction on how to use the script. Also updated the remaining instructions
+ for El Capitan.
+ * config.json: Added remote server configurations.
+ * public/admin/fetch-from-remote.php: Added. This script fetches JSON from the remote server specified in
+ config.json and caches the results in the location specified as "cacheDirectory" in config.json.
+ (main):
+ (fetch_remote):
+ * public/include/db.php:
+ (config_path): Extracted from generate_data_file.
+ (generate_data_file):
+ * tools/remote-server-relay.conf: Added. Apache 2.4 configuration file for a local http server launched by
+ run-with-remote-server.py.
+ * tools/run-with-remote-server.py: Added. Launches Apache with the right set of directives.
+ (main):
+ (abspath_from_root):
+
</ins><span class="cx"> 2015-07-13 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> Fix a typo.
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgInstallmd"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/Install.md (190644 => 190645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/Install.md        2015-10-06 20:57:22 UTC (rev 190644)
+++ trunk/Websites/perf.webkit.org/Install.md        2015-10-06 21:04:03 UTC (rev 190645)
</span><span class="lines">@@ -1,7 +1,6 @@
</span><span class="cx"> # Checking Out the Code and Installing Required Applications
</span><span class="cx">
</span><del>-The instructions assume you're using Mac OS X (Mavericks for Server.app case and Mountain Lion without Server.app) as the
-host server, and assume that we're installing this application at `/Volumes/Data/perf.webkit.org`.
</del><ins>+The instructions assume you're using Mac OS X as the host server and installing this application at `/Volumes/Data/perf.webkit.org`.
</ins><span class="cx">
</span><span class="cx"> You can choose between using Server.app or install the required tools separately
</span><span class="cx">
</span><span class="lines">@@ -9,9 +8,35 @@
</span><span class="cx"> 2. Install node.
</span><span class="cx"> 3. Install Xcode with command line tools (only needed for svn)
</span><span class="cx"> 4. `svn co https://svn.webkit.org/repository/webkit/trunk/Websites/perf.webkit.org /Volumes/Data/perf.webkit.org`
</span><del>-5. Inside `/Volumes/Data/perf.webkit.org`, run `npm install pg`.
</del><ins>+5. Inside `/Volumes/Data/perf.webkit.org`, run `npm install pg` and `mkdir -m 755 public/data/`
</ins><span class="cx">
</span><ins>+# Testing Local UI Changes with Production Data
</ins><span class="cx">
</span><ins>+The front end has the capability to pull data from a production server without replicating the database locally on OS X (Yosemite and later).
+To use this feature, modify `config.json`'s `remoteServer` entry so that "remoteServer.url" points to your production server,
+and "remoteServer.basicAuth" specifies the username and the password that is used by the production sever.
+
+Remove "basicAuth" entry for production servers that doesn't require a basic authentication (e.g. perf.webkit.org).
+
+```json
+{
+ "url": "http://perf.webkit.org",
+ "basicAuth": {
+ "username": "webkitten",
+ "password": "webkitten's secret password"
+ }
+}
+```
+
+Then run `tools/run-with-remote-server.py`. This launches a httpd server on port 8080.
+
+The initial few page loads after starting the script could take as much as a few minutes depending on your production sever's configurations
+since Apache needs to start a pool of processes. Reloading the dashboards few times should bring the load time under control.
+
+The script caches remote server's responses under `public/data/remote-cache` and never revalidates them (to allow offline work).
+If you needed the latest content, delete caches stored in this directory by running `rm -rf public/data/remote-cache`.
+
+
</ins><span class="cx"> # Configuring Apache
</span><span class="cx">
</span><span class="cx"> You can use apachectl to start/stop/restart apache server from the command line:
</span><span class="lines">@@ -20,30 +45,31 @@
</span><span class="cx"> - Stopping httpd: `sudo apachectl stop`
</span><span class="cx"> - Restarting httpd: `sudo apachectl restart`
</span><span class="cx">
</span><ins>+The apache logs are located at `/private/var/log/apache2`.
+
</ins><span class="cx"> ## Instructions if you're using Server.app
</span><span class="cx">
</span><span class="cx"> - Enable PHP web applications
</span><del>- - Go to Server Website / Store Site Files In, change it to /Volumes/Data/perf.webkit.org/public/`
</del><ins>+ - Go to Server Website / Store Site Files In, change it to `/Volumes/Data/perf.webkit.org/public/`
</ins><span class="cx"> - Go to Server Website / Edit advanced settings, enable Allow overrides using .htaccess files
</span><ins>+ - httpd config file is located at `/Library/Server/Web/Config/apache2/sites/0000_any_80.conf` (and/or 0000_any_`PORT#`.conf)
</ins><span class="cx">
</span><span class="cx"> ## Instructions if you're not using Server.app
</span><span class="cx">
</span><span class="cx"> - Edit /private/etc/apache2/httpd.conf
</span><span class="cx">
</span><span class="cx"> 1. Change DocumentRoot to `/Volumes/Data/perf.webkit.org/public/`
</span><del>- 2. Uncomment `"LoadModule php5_module libexec/apache2/libphp5.so"`
</del><ins>+ 2. Uncomment `LoadModule php5_module libexec/apache2/libphp5.so`
+ 3. Uncomment `LoadModule rewrite_module libexec/apache2/mod_rewrite.so`
+ 4. Uncomment `LoadModule deflate_module libexec/apache2/mod_deflate.so`
</ins><span class="cx">
</span><span class="cx"> - In Mavericks and later, copy php.ini to load pdo_pgsql.so pgsql.so.
</span><span class="cx"> `sudo cp /Applications/Server.app/Contents/ServerRoot/etc/php.ini /etc/`
</span><ins>+ - In El Capitan and later, comment out the `LockFile` directive in `/private/etc/apache2/extra/httpd-mpm.conf`
+ since the directive has been superseded by `Mutex` directive.
</ins><span class="cx">
</span><ins>+## Production Configurations
</ins><span class="cx">
</span><del>-## Common directives for the related apache config file
-
- httpd config file is located at:
-
- - With Server.app: /Library/Server/Web/Config/apache2/sites/0000_any_80.conf (and/or 0000_any_`PORT#`.conf)
- - Without: /private/etc/apache2/httpd.conf
-
</del><span class="cx"> 1. Update ServerAdmin to your email address
</span><span class="cx"> 2. Add the following directives to enable gzip:
</span><span class="cx">
</span><span class="lines">@@ -56,13 +82,10 @@
</span><span class="cx"> Options Indexes MultiViews
</span><span class="cx"> php_flag zlib.output_compression on
</span><span class="cx">
</span><del>-The apache logs are located at `/private/var/log/apache2`.
</del><ins>+### Protecting the Administrative Pages to Prevent Execution of Arbitrary Code
</ins><span class="cx">
</span><del>-
-# Protecting the Administrative Pages to Prevent Execution of Arbitrary Code
-
</del><span class="cx"> By default, the application gives the administrative privilege to everyone. Anyone can add, remove, or edit tests,
</span><del>-builders, and other entities in the database and may even execute arbitrary JavaScript on the server via aggregators.
</del><ins>+builders, and other entities in the database.
</ins><span class="cx">
</span><span class="cx"> We recommend protection via Digest Auth on https connection.
</span><span class="cx">
</span><span class="lines">@@ -97,8 +120,9 @@
</span><span class="cx"> Run `database/init-database.sql` in psql as `webkit-perf-db-user`:
</span><span class="cx"> `/Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost --username webkit-perf-db-user -f init-database.sql`
</span><span class="cx">
</span><del>-## Making a Backup of the Database
</del><ins>+## Making a Backup and Restoring
</ins><span class="cx">
</span><span class="cx"> Run `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dump -h localhost --no-owner -f <filepath> webkit-perf-db | gzip > backup.gz`
</span><span class="cx">
</span><del>-To restore, setup a new database and run `gunzip backup.gz | /Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost --username webkit-perf-db-user`
</del><ins>+To restore, setup a new database and run
+`gunzip backup.gz | /Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost --username webkit-perf-db-user`
</ins></span></pre></div>
<a id="trunkWebsitesperfwebkitorgconfigjson"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/config.json (190644 => 190645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/config.json        2015-10-06 20:57:22 UTC (rev 190644)
+++ trunk/Websites/perf.webkit.org/config.json        2015-10-06 21:04:03 UTC (rev 190645)
</span><span class="lines">@@ -13,6 +13,17 @@
</span><span class="cx"> "hostname": "localhost",
</span><span class="cx"> "port": 80
</span><span class="cx"> },
</span><ins>+ "cacheDirectory": "public/data/remote-cache/",
+ "remoteServer": {
+ "httpdConfig": "tools/remote-server-relay.conf",
+ "httpdPID": "tools/remote-server-relay.pid",
+ "httpdErroLog": "tools/remote-server-relay.log",
+ "url": "http://perf.webkit.org",
+ "basicAuth": {
+ "username": "username",
+ "password": "password"
+ }
+ },
</ins><span class="cx"> "defaultDashboard": [[]],
</span><span class="cx"> "dashboards": {}
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicadminfetchfromremotephp"></a>
<div class="addfile"><h4>Added: trunk/Websites/perf.webkit.org/public/admin/fetch-from-remote.php (0 => 190645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/admin/fetch-from-remote.php         (rev 0)
+++ trunk/Websites/perf.webkit.org/public/admin/fetch-from-remote.php        2015-10-06 21:04:03 UTC (rev 190645)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<?php
+
+require('../include/db.php');
+
+function main($path)
+{
+ $remote_server = config('remoteServer');
+
+ $remote_url = $remote_server['url'] . $path;
+ $cache_path = config_path('cacheDirectory', hash("sha256", $remote_url));
+
+ $content = @file_get_contents($cache_path);
+ if ($content === FALSE) {
+ $content = fetch_remote($remote_server, $remote_url);
+ if ($content === FALSE) {
+ header('HTTP/1.0 404 Not Found');
+ echo 'NotFound';
+ exit(1);
+ }
+ file_put_contents($cache_path, $content);
+ }
+
+ header('Content-Type: application/json');
+ header('Content-Length: ' . strlen($content));
+ echo $content;
+}
+
+function fetch_remote($remote_server, $remote_url)
+{
+ $auth = array_get($remote_server, 'basicAuth');
+
+ $header = '';
+ if ($auth)
+ $header = 'Authorization: Basic ' . base64_encode($auth['username'] . ':' . $auth['password']);
+
+ $context = stream_context_create(array('http' => array('method' => 'GET', 'header' => $header)));
+
+ return @file_get_contents($remote_url, false, $context);
+}
+
+main(array_get($_SERVER, 'PATH_INFO', ''));
+
+?>
</ins></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicincludedbphp"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/include/db.php (190644 => 190645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/include/db.php        2015-10-06 20:57:22 UTC (rev 190644)
+++ trunk/Websites/perf.webkit.org/public/include/db.php        2015-10-06 21:04:03 UTC (rev 190645)
</span><span class="lines">@@ -36,10 +36,14 @@
</span><span class="cx"> return $_config[$key];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function config_path($key, $path) {
+ return CONFIG_DIR . config($key) . '/' . $path;
+}
+
</ins><span class="cx"> function generate_data_file($filename, $content) {
</span><span class="cx"> if (!assert(ctype_alnum(str_replace(array('-', '_', '.'), '', $filename))))
</span><span class="cx"> return FALSE;
</span><del>- return file_put_contents(CONFIG_DIR . config('dataDirectory') . '/' . $filename, $content);
</del><ins>+ return file_put_contents(config_path('dataDirectory'. $filename), $content);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (config('debug')) {
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgtoolsremoteserverrelayconf"></a>
<div class="addfile"><h4>Added: trunk/Websites/perf.webkit.org/tools/remote-server-relay.conf (0 => 190645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/tools/remote-server-relay.conf         (rev 0)
+++ trunk/Websites/perf.webkit.org/tools/remote-server-relay.conf        2015-10-06 21:04:03 UTC (rev 190645)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+ServerRoot "/usr"
+Listen 8080
+
+LoadModule authn_core_module libexec/apache2/mod_authn_core.so
+LoadModule authz_core_module libexec/apache2/mod_authz_core.so
+LoadModule deflate_module libexec/apache2/mod_deflate.so
+LoadModule log_config_module libexec/apache2/mod_log_config.so
+LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so
+LoadModule env_module libexec/apache2/mod_env.so
+LoadModule headers_module libexec/apache2/mod_headers.so
+LoadModule setenvif_module libexec/apache2/mod_setenvif.so
+LoadModule mime_module libexec/apache2/mod_mime.so
+LoadModule unixd_module libexec/apache2/mod_unixd.so
+LoadModule status_module libexec/apache2/mod_status.so
+LoadModule negotiation_module libexec/apache2/mod_negotiation.so
+LoadModule dir_module libexec/apache2/mod_dir.so
+LoadModule alias_module libexec/apache2/mod_alias.so
+LoadModule rewrite_module libexec/apache2/mod_rewrite.so
+LoadModule mime_module libexec/apache2/mod_mime.so
+LoadModule php5_module libexec/apache2/libphp5.so
+LoadModule negotiation_module libexec/apache2/mod_negotiation.so
+
+<Directory />
+ Options Indexes FollowSymLinks MultiViews
+ AllowOverride None
+ Require all granted
+</Directory>
+
+<IfModule dir_module>
+ DirectoryIndex index.html index.php
+</IfModule>
+
+LogLevel warn
+
+RewriteEngine On
+RewriteRule "/data/(.*)$" "/admin/fetch-from-remote.php/data/$1"
+RewriteRule "/api/(.*)$" "/admin/fetch-from-remote.php/api/$1"
+
+<IfModule log_config_module>
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+ LogFormat "%h %l %u %t \"%r\" %>s %b" common
+
+ <IfModule logio_module>
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
+ </IfModule>
+
+ CustomLog |/usr/bin/tee common
+ ErrorLog |/usr/bin/tee
+</IfModule>
+
+<IfModule mime_module>
+ AddType text/html .html
+ AddType text/html .htm
+ AddType text/css .css
+ AddType text/javascript .js
+</IfModule>
+
+<IfModule php5_module>
+        AddType application/x-httpd-php .php
+        AddType application/x-httpd-php-source .phps
+</IfModule>
+
+Include /private/etc/apache2/extra/httpd-mpm.conf
</ins></span></pre></div>
<a id="trunkWebsitesperfwebkitorgtoolsrunwithremoteserverpy"></a>
<div class="addfile"><h4>Added: trunk/Websites/perf.webkit.org/tools/run-with-remote-server.py (0 => 190645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/tools/run-with-remote-server.py         (rev 0)
+++ trunk/Websites/perf.webkit.org/tools/run-with-remote-server.py        2015-10-06 21:04:03 UTC (rev 190645)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+#!/usr/bin/python
+
+import json
+import os
+import subprocess
+import tempfile
+
+
+def main():
+ with open(abspath_from_root('config.json')) as config_file:
+ config = json.load(config_file)
+ cache_dir = abspath_from_root(config['cacheDirectory'])
+ httpd_config_file = abspath_from_root(config['remoteServer']['httpdConfig'])
+ httpd_pid_file = abspath_from_root(config['remoteServer']['httpdPID'])
+ httpd_error_log_file = abspath_from_root(config['remoteServer']['httpdErroLog'])
+ doc_root = abspath_from_root('public')
+
+ if not os.path.isdir(cache_dir):
+ os.makedirs(cache_dir)
+ os.chmod(cache_dir, 0755)
+
+ httpd_mutax_dir = tempfile.mkdtemp()
+ try:
+ subprocess.call(['httpd',
+ '-f', httpd_config_file,
+ '-c', 'PidFile ' + httpd_pid_file,
+ '-c', 'Mutex file:' + httpd_mutax_dir,
+ '-c', 'DocumentRoot ' + doc_root,
+ '-c', 'ErrorLog ' + httpd_error_log_file,
+ '-X'])
+ finally:
+ os.rmdir(httpd_mutax_dir)
+
+
+def abspath_from_root(relpath):
+ return os.path.abspath(os.path.join(os.path.dirname(__file__), '../', relpath))
+
+
+if __name__ == "__main__":
+ main()
</ins><span class="cx">Property changes on: trunk/Websites/perf.webkit.org/tools/run-with-remote-server.py
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
</div>
</body>
</html>