Changeset 196190 in webkit


Ignore:
Timestamp:
Feb 5, 2016 2:28:20 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

Perf dashboard should have a script to setup database
https://bugs.webkit.org/show_bug.cgi?id=153906

Reviewed by Chris Dumez.

Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
and initializes a database at the specified location.

  • Install.md: Updated instruction to setup postgres to use setup-database.py.
  • tools/setup-database.py: Added.

(main):
(load_database_config):
(determine_psql_dir):
(start_or_stop_database):
(execute_psql_command):

Location:
trunk/Websites/perf.webkit.org
Files:
1 added
2 edited

Legend:

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

    r194935 r196190  
     12016-02-04  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Perf dashboard should have a script to setup database
     4        https://bugs.webkit.org/show_bug.cgi?id=153906
     5
     6        Reviewed by Chris Dumez.
     7
     8        Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
     9        and initializes a database at the specified location.
     10
     11        * Install.md: Updated instruction to setup postgres to use setup-database.py.
     12        * tools/setup-database.py: Added.
     13        (main):
     14        (load_database_config):
     15        (determine_psql_dir):
     16        (start_or_stop_database):
     17        (execute_psql_command):
     18
    1192016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/Websites/perf.webkit.org/Install.md

    r190645 r196190  
    4040# Configuring Apache
    4141
    42 You can use apachectl to start/stop/restart apache server from the command line:
    43 
    44  - Starting httpd: `sudo apachectl start`
    45  - Stopping httpd: `sudo apachectl stop`
    46  - Restarting httpd: `sudo apachectl restart`
    47 
    48 The apache logs are located at `/private/var/log/apache2`.
    49 
    5042## Instructions if you're using Server.app
    5143
     
    6860 - In El Capitan and later, comment out the `LockFile` directive in `/private/etc/apache2/extra/httpd-mpm.conf`
    6961   since the directive has been superseded by `Mutex` directive.
     62
     63## Starting Apache
     64
     65You can use apachectl to start/stop/restart apache server from the command line:
     66
     67- Starting httpd: `sudo apachectl start`
     68- Stopping httpd: `sudo apachectl stop`
     69- Restarting httpd: `sudo apachectl restart`
     70
     71The apache logs are located at `/private/var/log/apache2`.
    7072
    7173## Production Configurations
     
    103105# Configuring PostgreSQL
    104106
    105 1. Create database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/initdb /Volumes/Data/perf.webkit.org/PostgresSQL`
    106 2. Start database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_ctl -D /Volumes/Data/perf.webkit.org/PostgresSQL -l logfile -o "-k /Volumes/Data/perf.webkit.org/PostgresSQL" start`
     107Run the following command to setup a Postgres server at `/Volumes/Data/perf.webkit.org/PostgresSQL` (or wherever you'd prefer):
     108`python ./setup-database.py /Volumes/Data/perf.webkit.org/PostgresSQL`
    107109
    108 ## Creating a Database and a User
     110It automatically retrieves the database name, the username, and the password from `config.json`.
    109111
    110 The binaries located in PostgreSQL's directory, or if you're using Server.app in /Applications/Server.app/Contents/ServerRoot/usr/bin/
     112## Starting PostgreSQL
    111113
    112 1. Create a database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/createdb webkit-perf-db -h localhost`
    113 2. Create a user: `/Applications/Server.app/Contents/ServerRoot/usr/bin/createuser -P -S -e webkit-perf-db-user -h localhost`
    114 3. Connect to database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost`
    115 4. Grant all permissions to the new user: `grant all privileges on database "webkit-perf-db" to "webkit-perf-db-user";`
    116 5. Update database/config.json.
     114The setup script automatically starts the database but you may need to run the following command to manually start the database after reboot.
     115
     116- Starting the database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_ctl -D /Volumes/Data/perf.webkit.org/PostgresSQL -l /Volumes/Data/perf.webkit.org/PostgresSQL/logfile -o "-k /Volumes/Data/perf.webkit.org/PostgresSQL" start`
     117- Stopping the database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_ctl -D /Volumes/Data/perf.webkit.org/PostgresSQL -l /Volumes/Data/perf.webkit.org/PostgresSQL/logfile -o "-k /Volumes/Data/perf.webkit.org/PostgresSQL" start`
    117118
    118119## Initializing the Database
     
    123124## Making a Backup and Restoring
    124125
    125 Run `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dump -h localhost --no-owner -f <filepath> webkit-perf-db | gzip > backup.gz`
    126 
    127 To 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`
     126- Backing up the database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dump -h localhost --no-owner -f <filepath> webkit-perf-db | gzip > backup.gz`
     127- Restoring the database: `gunzip -c backup.gz | /Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost --username webkit-perf-db-user`
Note: See TracChangeset for help on using the changeset viewer.