Skip to content

dnguyen9/PerfKitExplorer

Repository files navigation

PerfKit Explorer Installation Guide

PerfKit is a service & web front end for composing queries and dashboards, and sharing the results. You can see a [live deployment and demo dashboard here] (https://perfkit-explorer.appspot.com/explore?dashboard=5714163003293696). You can click and interact with widgets (graphs), see the SQL, edit the json, and move things around on the demo dashboard. When you visit the site it will ask you permission to use your account. The full secuity model of the dashboard is active and permission is needed to verify your identity for permission checking. Everyone has read. Writing dashboards and execution of arbitrary queries is restricted.

Note the installation instructions below are based on using a Google Cloud Platform Compute instance, using the Debian Backports image. Instructions for platform installation may vary depending on your operating system and patch levels.

Set up your workstation

  1. Install prerequisite packages:

      sudo apt-get install python2.7 openjdk-7-jdk git nodejs nodejs-legacy npm
    
    • Python 2.7 runtime
    • Java 7 SDK
    • Git
    • NodeJS (nodejs-legacy provides the required /usr/bin/node symlink)
    • Node Package Manager (NPM)
  2. Install the Google Cloud SDK:

      curl https://sdk.cloud.google.com | bash
    
    • note: Restart your shell after installing gcloud to initialize the relevant paths.
  3. Install the Google App Engine SDK for Python.

    • note: You will need to add the App Engine SDK to your PATH so that you can find appcfg.py.
  4. Create a root folder for your source code (i.e.: ~/projects) and navigate to it.

  5. (Optional) If you are planning to participate in the open source project, create a GitHub account at http://www.github.com and make an editable copy of the PerfKitExplorer repository by clicking the "Fork" button at the top right. You can also set this up later, but it's easier to make the fork now before cloning it.

  6. Clone the repository:

      git clone https://github.com/GoogleCloudPlatform/PerfKitExplorer.git
    

    or, if you created your own fork in the step above:

      git clone https://github.com/MY_GITHUB_ID/PerfKitExplorer.git
    

    If you have connected and authenticated correctly, the source code for PerfKit Explorer will download. Your projects folder will contain:

      (projects)
        PerfKitExplorer
          bin
          client
          ...
          compile.sh
          app.yaml
    
  7. Change to the PerfKitExplorer folder and download the Closure Tools, which are included as a submodule in the project:

      git submodule update --init
    
  8. Install the NPM packages for Gulp and dependencies, this will create a node_modules directory in the project.

      npm install
    
  9. Install Bower and the Bower packages for client-side dependencies, this will create a bower_components directory in the project.

      npm install -g bower
      bower install
    

Create the App Engine project

  1. Authorize your workstation to connect to Google Cloud resources:

      gcloud auth login
    
  2. Create a Google Cloud project at https://console.developers.google.com/project.

  3. In "APIs & Auth > APIs", enable the BigQuery service.

    • This is enabled by default for new projects.

Create the BigQuery repository

  1. Create a Google Cloud project, or use the same one you used for the App Engine project.

  2. Enable billing for your Cloud Project (available from links on the left-hand side) https://console.developers.google.com/project/MY_PROJECT_ID/settings

    • MY_PROJECT_ID is the unique "Project ID", not the human-readable project name.
  3. Create a dataset (ex: samples_mart):

      bq mk --project=MY_PROJECT_ID samples_mart
    
  4. Upload sample data to a new table in your dataset (ex: results):

      pushd ~/projects/PerfKitExplorer/data/samples_mart
    
      bq load --project=MY_PROJECT_ID \
        --source_format=NEWLINE_DELIMITED_JSON \
        samples_mart.results \
        ./sample_results.json \
        ./results_table_schema.json
    
      popd
    
  5. If the App Engine and BigQuery projects are separate, add the service account from your App Engine project as an authorized use of your BigQuery project.

Compile and Deploy PerfKit Explorer

  1. Navigate to the PerfKitExplorer directory:

      cd ~/projects/PerfKitExplorer
    
  2. Modify the app.yaml file so that the instance class is appropriate for your needs, and the application name matches the project id you created in the 'Create the App Engine project' step, and the version string is set appropriately. For example:

      application: perfkit-explorer-demo
      version: beta
      instance_class: F2
    
  3. Modify the config/data_source_config.json so that the production tags are appropriate for the repository you created in the previous step. For example:

      project_id: perfkit-explorer-demo
      project_name: perfkit-samples
      samples-mart: perfkit-samples.samples_mart
      analytics-key: UA-12345
    
  4. Compile the application.

      bash compile.sh
    
  5. You will now find a ~/projects/PerfKitExplorer/deploy folder.

  6. Deploy PerfKit Explorer to App Engine.

      appcfg.py --oauth2 update deploy
    
  7. By default the application will be deployed to a build/version specific to your client. For example, with the following values:

      application: MY_PROJECT_ID
      version: 15
    

    will deploy to http://15-dot-MY_PROJECT_ID.appspot.com

Set up a PerfKit dashboard

  1. Open the project URL http://15-dot-MY_PROJECT_ID.appspot.com in your browser.

  2. Click "Edit Config" in the gear icon at the top right and set "default project" to the project id.

  3. In Perfkit Dashboard Administration, click "Upload", and select the sample dashboard file: PerfKitExplorer/data/samples_mart/sample_dashboard.json

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published