Changeset 190645 in webkit


Ignore:
Timestamp:
Oct 6, 2015 2:04:03 PM (9 years ago)
Author:
rniwa@webkit.org
Message:

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):

Location:
trunk/Websites/perf.webkit.org
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r186797 r190645  
     12015-10-06  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Perf dashboard should have the capability to test local UI with production data
     4        https://bugs.webkit.org/show_bug.cgi?id=149834
     5
     6        Reviewed by Chris Dumez.
     7
     8        Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server.
     9
     10        * Install.md: Added the instruction on how to use the script. Also updated the remaining instructions
     11        for El Capitan.
     12        * config.json: Added remote server configurations.
     13        * public/admin/fetch-from-remote.php: Added. This script fetches JSON from the remote server specified in
     14        config.json and caches the results in the location specified as "cacheDirectory" in config.json.
     15        (main):
     16        (fetch_remote):
     17        * public/include/db.php:
     18        (config_path): Extracted from generate_data_file.
     19        (generate_data_file):
     20        * tools/remote-server-relay.conf: Added. Apache 2.4 configuration file for a local http server launched by
     21        run-with-remote-server.py.
     22        * tools/run-with-remote-server.py: Added. Launches Apache with the right set of directives.
     23        (main):
     24        (abspath_from_root):
     25
    1262015-07-13  Ryosuke Niwa  <rniwa@webkit.org>
    227
  • trunk/Websites/perf.webkit.org/Install.md

    r185676 r190645  
    11# Checking Out the Code and Installing Required Applications
    22
    3 The instructions assume you're using Mac OS X (Mavericks for Server.app case and Mountain Lion without Server.app) as the
    4 host server, and assume that we're installing this application at `/Volumes/Data/perf.webkit.org`.
     3The instructions assume you're using Mac OS X as the host server and installing this application at `/Volumes/Data/perf.webkit.org`.
    54
    65You can choose between using Server.app or install the required tools separately
     
    1093. Install Xcode with command line tools (only needed for svn)
    11104. `svn co https://svn.webkit.org/repository/webkit/trunk/Websites/perf.webkit.org /Volumes/Data/perf.webkit.org`
    12 5. Inside `/Volumes/Data/perf.webkit.org`, run `npm install pg`.
     115. Inside `/Volumes/Data/perf.webkit.org`, run `npm install pg` and `mkdir -m 755 public/data/`
     12
     13# Testing Local UI Changes with Production Data
     14
     15The front end has the capability to pull data from a production server without replicating the database locally on OS X (Yosemite and later).
     16To use this feature, modify `config.json`'s `remoteServer` entry so that "remoteServer.url" points to your production server,
     17and "remoteServer.basicAuth" specifies the username and the password that is used by the production sever.
     18
     19Remove "basicAuth" entry for production servers that doesn't require a basic authentication (e.g. perf.webkit.org).
     20
     21```json
     22{
     23    "url": "http://perf.webkit.org",
     24    "basicAuth": {
     25        "username": "webkitten",
     26        "password": "webkitten's secret password"           
     27    }
     28}
     29```
     30
     31Then run `tools/run-with-remote-server.py`. This launches a httpd server on port 8080.
     32
     33The initial few page loads after starting the script could take as much as a few minutes depending on your production sever's configurations
     34since Apache needs to start a pool of processes. Reloading the dashboards few times should bring the load time under control.
     35
     36The script caches remote server's responses under `public/data/remote-cache` and never revalidates them (to allow offline work).
     37If you needed the latest content, delete caches stored in this directory by running `rm -rf public/data/remote-cache`.
    1338
    1439
     
    2146 - Restarting httpd: `sudo apachectl restart`
    2247
     48The apache logs are located at `/private/var/log/apache2`.
     49
    2350## Instructions if you're using Server.app
    2451
    2552 - Enable PHP web applications
    26  - Go to Server Website / Store Site Files In, change it to /Volumes/Data/perf.webkit.org/public/`
     53 - Go to Server Website / Store Site Files In, change it to `/Volumes/Data/perf.webkit.org/public/`
    2754 - Go to Server Website / Edit advanced settings, enable Allow overrides using .htaccess files
     55 - httpd config file is located at `/Library/Server/Web/Config/apache2/sites/0000_any_80.conf` (and/or 0000_any_`PORT#`.conf)
    2856
    2957## Instructions if you're not using Server.app
     
    3260
    3361     1. Change DocumentRoot to `/Volumes/Data/perf.webkit.org/public/`
    34      2. Uncomment `"LoadModule php5_module libexec/apache2/libphp5.so"`
     62     2. Uncomment `LoadModule php5_module libexec/apache2/libphp5.so`
     63     3. Uncomment `LoadModule rewrite_module libexec/apache2/mod_rewrite.so`
     64     4. Uncomment `LoadModule deflate_module libexec/apache2/mod_deflate.so`
    3565
    3666 - In Mavericks and later, copy php.ini to load pdo_pgsql.so pgsql.so.
    3767    `sudo cp /Applications/Server.app/Contents/ServerRoot/etc/php.ini /etc/`
     68 - In El Capitan and later, comment out the `LockFile` directive in `/private/etc/apache2/extra/httpd-mpm.conf`
     69   since the directive has been superseded by `Mutex` directive.
    3870
    39 
    40 ## Common directives for the related apache config file
    41 
    42   httpd config file is located at:
    43 
    44     - With Server.app: /Library/Server/Web/Config/apache2/sites/0000_any_80.conf (and/or 0000_any_`PORT#`.conf)
    45     - Without: /private/etc/apache2/httpd.conf
     71## Production Configurations
    4672
    4773 1. Update ServerAdmin to your email address
     
    5783        php_flag zlib.output_compression on
    5884
    59 The apache logs are located at `/private/var/log/apache2`.
    60 
    61 
    62 # Protecting the Administrative Pages to Prevent Execution of Arbitrary Code
     85### Protecting the Administrative Pages to Prevent Execution of Arbitrary Code
    6386
    6487By default, the application gives the administrative privilege to everyone. Anyone can add, remove, or edit tests,
    65 builders, and other entities in the database and may even execute arbitrary JavaScript on the server via aggregators.
     88builders, and other entities in the database.
    6689
    6790We recommend protection via Digest Auth on https connection.
     
    98121`/Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost --username webkit-perf-db-user -f init-database.sql`
    99122
    100 ## Making a Backup of the Database
     123## Making a Backup and Restoring
    101124
    102125Run `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dump -h localhost --no-owner -f <filepath> webkit-perf-db | gzip > backup.gz`
    103126
    104 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`
     127To restore, setup a new database and run
     128`gunzip backup.gz | /Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost --username webkit-perf-db-user`
  • trunk/Websites/perf.webkit.org/config.json

    r182651 r190645  
    1414        "port": 80
    1515    },
     16    "cacheDirectory": "public/data/remote-cache/",
     17    "remoteServer": {
     18        "httpdConfig": "tools/remote-server-relay.conf",
     19        "httpdPID": "tools/remote-server-relay.pid",
     20        "httpdErroLog": "tools/remote-server-relay.log",
     21        "url": "http://perf.webkit.org",
     22        "basicAuth": {
     23            "username": "username",
     24            "password": "password"
     25        }
     26    },
    1627    "defaultDashboard": [[]],
    1728    "dashboards": {}
  • trunk/Websites/perf.webkit.org/public/include/db.php

    r183041 r190645  
    3737}
    3838
     39function config_path($key, $path) {
     40    return CONFIG_DIR . config($key) . '/' . $path;
     41}
     42
    3943function generate_data_file($filename, $content) {
    4044    if (!assert(ctype_alnum(str_replace(array('-', '_', '.'), '', $filename))))
    4145        return FALSE;
    42     return file_put_contents(CONFIG_DIR . config('dataDirectory') . '/' . $filename, $content);
     46    return file_put_contents(config_path('dataDirectory'. $filename), $content);
    4347}
    4448
Note: See TracChangeset for help on using the changeset viewer.