visualzhou / parsley

Feature rich log viewer for evergreen logs

Home Page:https://parsley.mongodb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsley 🌿

Parsley is the UI for Evergreen's log viewer. It will eventually replace Lobster.

Table of Contents

Getting Started

Running Locally

  1. Clone this GitHub repository.
  2. Ensure you have Node.js 16.13+ and Yarn installed.
  3. Ask a colleague for their .cmdrc.json file and follow the instructions here
  4. Run yarn.
  5. Run yarn run dev. This will launch the app.

Starting supporting services

Parsley is capable of fetching logs from both evergreen and logkeeper. If you would like to develop against them you will need to run both of the servers locally.

Evergreen

  1. Clone the Evergreen Repository
  2. Follow the setup instructions in the README to set up your environment.
  3. Run make local-evergreen to start the local evergreen server

Logkeeper

  1. Clone the Logkeeper Repository

  2. Run yarn bootstrap-logkeeper to download some sample resmoke logs from s3.

  3. Run the command outputted by the previous step to seed the env variables and start the local logkeeper server

    LK_CORS_ORIGINS=http:\/\/localhost:\\d+ LK_EVERGREEN_ORIGIN=http://localhost:8080 LK_PARSLEY_ORIGIN=http://localhost:5173 go run main/logkeeper.go --localPath {abs_path_to_parsley}/bin/_bucketdata

    Note that all log output is piped to a file named logkeeperapp.log. You can use tail -f logkeeperapp.log to view the log output

GraphQL Type Generation

To be able to use code generation, you'll need to create a symlink to the schema folder in Evergreen. This folder contains the definitions for our GraphQL queries, mutations, and types.

To create a symlink, run the following command:

ln -s <path_to_evergreen_repo>/graphql/schema sdlschema

Environment Variables

env-cmd is used to configure build environments for production, staging and development. We use two files to represent these various environments: .cmdrc-local.json for local builds with non-sensitive information, and .cmdrc.json for builds deployed to S3. This file is git ignored because it contains API keys that we do not want to publish. It should be named .env-cmdrc.json and placed at the root of the project. This file is required to deploy Parsley to production and to staging. Ask a team member to send you their copy of the file, which should look like the following:

{
    "devLocal": {
        "REACT_APP_LOGKEEPER_URL": "devLocal",
        "REACT_APP_EVERGREEN_URL": "http://localhost:9090"
    },
    "local": {
        "REACT_APP_LOGKEEPER_URL": "devLocal",
        "REACT_APP_EVERGREEN_URL": "http://localhost:9090",
        "REACT_APP_RELEASE_STAGE": "local"
    }
}

Deployment

Requirements

You must be on the main Branch if deploying to prod.

A .env-cmdrc.json file is required to deploy because it sets the environment variables that the application needs for a given deployment environments. See Environment Variables section for more info about this file.

How to Deploy:

Run the deploy:<env> yarn command

About

Feature rich log viewer for evergreen logs

https://parsley.mongodb.com

License:Other


Languages

Language:TypeScript 91.1%Language:HTML 5.6%Language:JavaScript 2.1%Language:Shell 1.2%