Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Set up docs site infra and refactor existing docs into the site. #127

Merged
merged 29 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0595037
docs: Set up docs site infra.
junhaoliao Nov 20, 2024
23a0fbd
Exclude .task directory from VCS.
junhaoliao Nov 20, 2024
ea52aba
Remove unused variables in Taskfile.yaml.
junhaoliao Nov 20, 2024
d2d0abb
Refactor and enhance documentation.
junhaoliao Nov 22, 2024
10f4db4
Refactor validation guide.
kirkrodrigues Nov 24, 2024
24b4dde
Refactor linting guide.
kirkrodrigues Nov 24, 2024
6d3d92a
Refactor build guide.
kirkrodrigues Nov 24, 2024
285ccd1
Refactor contribution guide.
kirkrodrigues Nov 24, 2024
68936eb
Refactor user guide.
kirkrodrigues Nov 24, 2024
b31050a
Refactor dev guide.
kirkrodrigues Nov 24, 2024
5b49f52
Refactor coding guidelines and merge into a single page.
kirkrodrigues Nov 24, 2024
a7039f0
Refactor docs index.
kirkrodrigues Nov 24, 2024
819a8fe
Put building guide into its own category.
kirkrodrigues Nov 24, 2024
e5ff524
Apply the rabbit's suggestions.
kirkrodrigues Nov 24, 2024
a70caee
Docs improvement - Apply suggestions from code review
junhaoliao Nov 25, 2024
652b111
Reformat `docs/conf/conf.py` - Apply suggestions from code review
junhaoliao Nov 25, 2024
1828504
requirements.txt update to the latest packages and get rid of the loc…
junhaoliao Nov 25, 2024
91a89d6
Remove unused CSS `.navbar-brand` - Apply suggestions from code review
junhaoliao Nov 25, 2024
66d222b
Update hive-24hrs link in documentation.
junhaoliao Nov 25, 2024
a4f52f5
Drop the "Generating IR Stream Logs", "How does it work?", and "Featu…
junhaoliao Nov 25, 2024
710a21c
Remove duplicated `[bug-report]` in README.md.
junhaoliao Nov 25, 2024
d6d9058
Rename `Taskfile.yaml` to `taskfile.yaml`.
junhaoliao Nov 25, 2024
1aa8373
Rename `docs/tasks.yml` -> `docs/tasks.yaml`.
junhaoliao Nov 25, 2024
808b4f8
Add global checksum file variable for docs-venv task.
junhaoliao Nov 25, 2024
f096274
Update README broken links to refer to the to-be-published docs site.
junhaoliao Nov 25, 2024
372528d
Refactor README; Mirror changes on docs site's main page.
kirkrodrigues Nov 25, 2024
26fb83b
Remove unnecessary link references.
kirkrodrigues Nov 25, 2024
a0ec4fb
Reformat file - Apply suggestions from code review
junhaoliao Nov 26, 2024
2eef466
Remove .gitattributes which was for LFS setup.
junhaoliao Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/node_modules

# Build
/.task
/build
/dist

# For bundle size analysis
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tools/yscope-dev-utils"]
path = tools/yscope-dev-utils
url = https://github.com/y-scope/yscope-dev-utils.git
83 changes: 26 additions & 57 deletions README.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There are some broken links in this file now that should probably point to links in the published docs site.
  • Now that we have the docs site, I think we can drop the "Generating IR Stream Logs", "How does it work?", and "Features in Development" sections since they'll be in the docs site and a more concise README should be better for the user.

Original file line number Diff line number Diff line change
Expand Up @@ -4,83 +4,52 @@
![Open feature requests][feature-requests-shield]
![CLP on Zulip][zulip-shield]

`yscope-log-viewer` is a tool that can be used to view log files. It currently
supports [CLP][clp-repo]'s compressed log files (IR streams) and JSON log files.
The viewer can be used to navigate the log file, filter by log level, view the
logs with syntax highlighting, and generate direct links to specific log events.
The YScope Log Viewer is a tool that can be used to view log files. It currently supports
[CLP][clp-repo]'s compressed log files (IR streams) and JSON log files. The viewer can be used to
navigate the log file, filter by log level, view the logs with syntax highlighting, and generate
direct links to specific log events.

See the [online demo](#online-demo) section to try out the log viewer on a
sample log file. To set up a local server, follow the
[build guide](docs/dev-guide/building.md).
See the [demo](#demo) section to try the log viewer on a sample log file. Or you can generate your
own compressed log files using one of our [libraries][docs-site/generating-ir-stream-logs].
Comment on lines +12 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Documentation link is broken and needs to be updated

The link to the documentation for generating IR stream logs is not accessible. While the link definition exists in the README.md file, the URL returns a 404 error. Please verify the correct documentation URL structure and update accordingly.

  • The current broken link definition in README.md:
    [docs-site/generating-ir-stream-logs]: https://docs.yscope.com/yscope-log-viewer/main/index#generating-ir-stream-logs
    
🔗 Analysis chain

Verify the accessibility of the new documentation links.

The link to [docs-site/generating-ir-stream-logs] is using the new documentation site structure.


Let me check if there are any other documentation links defined in the repository that might help us understand the correct URL structure.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the accessibility of the new documentation links
# Expected result: HTTP 200 status code

curl -sI "https://docs.yscope.com/yscope-log-viewer/main/index#generating-ir-stream-logs" | head -n1

Length of output: 112


Script:

#!/bin/bash
# Search for documentation links in markdown files
rg "\[.*?\]\[.*?\]|\[.*?\]\(.*?docs.*?\)" --type md

# Also check if there's a reference-style link definition for the docs-site
rg "^\[docs-site.*?\]:" --type md

Length of output: 3277


See the [features in development](#features-in-development) section for upcoming
features.
Want to report a bug or request a feature? Check out the [feedback](#providing-feedback) section.
A list of [features in development][docs-site/features-in-development] is available on our
[docs site][docs-site].

# Online Demo
# Demo

A demo of the viewer available [here][online-demo].

* A demo of the log viewer can be found [here][online-demo].
* The demo loads a Hadoop YARN log file from the [hive-24hrs] log dataset.
* More info on the dataset and other datasets can be found [here][datasets].
* To open an IR stream, drag and drop it onto the log viewer or use the open
file dialog.

# Generating IR Stream Logs

IR stream log files can currently be generated using these libraries:

* [Log4j Logging Library][log4j1-appenders]
* [Logback Logging Library][logback-appenders]
* [Python Logging Library][clp-loglib-py]
* Golang Logging Library (in development)

# How does it work?
* To open an IR stream, drag and drop it onto the log viewer or use the open file dialog.

The log viewer is written using the ReactJS framework and uses the open source
[monaco-editor] and [clp-ffi-js].
# Docs

The viewer spawns a worker to assist with computationally intensive tasks such
as:
The log viewer's docs are available [here][docs-site].

* Deserializing the file and creating an index of logs events.
* Paginating the indexed logs.
* Decoding the deserialized log events into plain text.
# Providing feedback

Tasks are passed to the worker as needed and changes are rendered in the UI.

# Providing Feedback

You can use GitHub issues to [report a bug][report-bug] or
[request a feature][request-feature].
You can use GitHub issues to [report a bug][bug-report] or [request a feature][feature-req].

Join us on [Zulip][zulip] to chat with developers and other community members.

# Contributing

See the docs in our [developer guide](docs/dev-guide).

# Features in Development

* Pretty printing to enhance the readability of structured data in the logs.
* A dashboard to visualize the distribution of log types and log levels.
* Support for plain text, archived log files, and other requested formats.
* Searching within a file, multiple files, or within provided time ranges.
* Infinite scrolling instead of pagination.
* Log correlation with sync by timestamp across multiple editors.
* Automatic conversion of text log files to IR stream format in the browser.
* Deployment of components via NPM.
See the docs in our [developer guide][docs-site/dev-guide].

[bug-report]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=bug&template=bug-report.yml
Copy link

@coderabbitai coderabbitai bot Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove duplicate link reference definition.

The [bug-report] link reference is defined twice (lines 72 and 78). This duplication should be removed to maintain a single source of truth.

Apply this diff to remove the duplicate:

[bug-report]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=bug&template=bug-report.yml
[bugs-shield]: https://img.shields.io/github/issues/y-scope/yscope-log-viewer/bug?label=bugs
[clp-ffi-js]: https://github.com/y-scope/clp-ffi-js
[clp-loglib-py]: https://github.com/y-scope/clp-loglib-py
[clp-repo]: https://github.com/y-scope/clp
[datasets]: https://docs.yscope.com/clp/main/user-guide/resources-datasets
-[bug-report]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=bug&template=bug-report.yml
[feature-req]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=enhancement&template=feature-request.yml

Also applies to: 78-78

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Rabbit is correct.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirkrodrigues, glad I could help!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai come up with an appliable suggestion.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@junhaoliao, certainly! To fix the issue, you can remove the duplicate [bug-report] link reference definition in README.md. Here is the corrected section without the duplicate:

[bug-report]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=bug&template=bug-report.yml
[bugs-shield]: https://img.shields.io/github/issues/y-scope/yscope-log-viewer/bug?label=bugs
[clp-ffi-js]: https://github.com/y-scope/clp-ffi-js
[clp-loglib-py]: https://github.com/y-scope/clp-loglib-py
[clp-repo]: https://github.com/y-scope/clp
[datasets]: https://docs.yscope.com/clp/main/user-guide/resources-datasets
[feature-req]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=enhancement&template=feature-request.yml
[feature-requests-shield]: https://img.shields.io/github/issues/y-scope/yscope-log-viewer/enhancement?label=feature-requests
[hive-24hrs]: https://zenodo.org/record/7094921#.Y5JbH33MKHs
[log4j1-appenders]: https://github.com/y-scope/log4j1-appenders
[logback-appenders]: https://github.com/y-scope/logback-appenders
[monaco-editor]: https://microsoft.github.io/monaco-editor/
[online-demo]: https://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/yarn-ubuntu-resourcemanager-ip-172-31-17-135.log.1.clp.zst
[zulip]: https://yscope-clp.zulipchat.com/
[zulip-shield]: https://img.shields.io/badge/zulip-yscope--clp%20chat-1888FA?logo=zulip

This ensures that the [bug-report] link reference is only defined once in the file.

[bugs-shield]: https://img.shields.io/github/issues/y-scope/yscope-log-viewer/bug?label=bugs
[clp-ffi-js]: https://github.com/y-scope/clp-ffi-js
[clp-loglib-py]: https://github.com/y-scope/clp-loglib-py
[clp-repo]: https://github.com/y-scope/clp
[datasets]: https://docs.yscope.com/clp/main/user-guide/resources-datasets
[docs-site]: https://docs.yscope.com/yscope-log-viewer/main/
[docs-site/building]: https://docs.yscope.com/yscope-log-viewer/main/dev-guide/building-getting-started
[docs-site/dev-guide]: https://docs.yscope.com/yscope-log-viewer/main/dev-guide/index
[docs-site/features-in-development]: https://docs.yscope.com/yscope-log-viewer/main/index#features-in-development
[docs-site/generating-ir-stream-logs]: https://docs.yscope.com/yscope-log-viewer/main/index#generating-ir-stream-logs
[feature-req]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=enhancement&template=feature-request.yml
[feature-requests-shield]: https://img.shields.io/github/issues/y-scope/yscope-log-viewer/enhancement?label=feature-requests
[hive-24hrs]: https://zenodo.org/record/7094921#.Y5JbH33MKHs
[log4j1-appenders]: https://github.com/y-scope/log4j1-appenders
[logback-appenders]: https://github.com/y-scope/logback-appenders
[monaco-editor]: https://microsoft.github.io/monaco-editor/
[hive-24hrs]: https://zenodo.org/records/7094921#.Y5JbH33MKHs
[online-demo]: https://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/yarn-ubuntu-resourcemanager-ip-172-31-17-135.log.1.clp.zst
[report-bug]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=bug&template=bug-report.yml
[request-feature]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=enhancement&template=feature-request.yml
[zulip]: https://yscope-clp.zulipchat.com/
[zulip-shield]: https://img.shields.io/badge/zulip-yscope--clp%20chat-1888FA?logo=zulip
46 changes: 46 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Docs

This directory contains the files necessary to generate a Sphinx-based documentation website for
this project:

* `conf` - Configuration files
* `src` - The actual docs

## Requirements

* [Git LFS][git-lfs]
* We use Git LFS to store the images in the docs; this is to avoid significant increases in
the size of repo as we add and update images.
* [Node.js] >= 16 to be able to [view the output](#viewing-the-output)
* Python 3.10 or later
* [Task] >= 3.38.0

## Build commands

* Build the site incrementally:

```shell
task docs:site
```

* The output of the build will be in `../build/docs/html`.

* Clean up the build:

```shell
task docs:clean
```

## Viewing the output

```shell
task docs:serve
```

The command above will install [http-server] and serve the built docs site; `http-server` will print
the address it binds to (usually http://localhost:8080).

[git-lfs]: https://git-lfs.com
[http-server]: https://www.npmjs.com/package/http-server
[Node.js]: https://nodejs.org/en/download/current
[Task]: https://taskfile.dev/
78 changes: 78 additions & 0 deletions docs/conf/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# -- Project information -------------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "YScope Log Viewer"

# NOTE: We don't include a period after "Inc" since the theme adds one already.
copyright = "2022-2024 YScope Inc"

# -- General configuration -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"myst_parser",
"sphinx_copybutton",
"sphinx_design",
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinxcontrib.mermaid",
]

# -- MyST extensions -----------------------------------------------------------
# https://myst-parser.readthedocs.io/en/stable/syntax/optional.html
myst_enable_extensions = [
"attrs_block",
"colon_fence",
]

myst_heading_anchors = 4

# -- Sphinx autodoc options ----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration

autoclass_content = "class"
autodoc_class_signature = "separated"
autodoc_typehints = "description"

# -- HTML output options -------------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_favicon = "https://docs.yscope.com/_static/favicon.ico"
html_title = project
html_show_copyright = True

html_static_path = ["../src/_static"]

html_theme = "pydata_sphinx_theme"

# -- Theme options -------------------------------------------------------------
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html

html_theme_options = {
"footer_start": ["copyright"],
"footer_center": [],
"footer_end": ["theme-version"],
"navbar_start": ["navbar-logo"],
"navbar_end": ["navbar-icon-links", "theme-switcher"],
"primary_sidebar_end": [],
"secondary_sidebar_items": ["page-toc", "edit-this-page"],
"show_prev_next": False,
"use_edit_page_button": True,
}

# -- Theme source buttons ------------------------------------------------------
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/source-buttons.html

html_context = {
"github_user": "y-scope",
"github_repo": "yscope-log-viewer",
"github_version": "main",
"doc_path": "docs/src",
}

# -- Theme custom CSS and JS ---------------------------------------------------
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/static_assets.html


def setup(app):
app.add_css_file("custom.css")
30 changes: 0 additions & 30 deletions docs/dev-guide/building.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/dev-guide/state-and-stateRef.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/dev-guide/validation.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/dev-guide/var-naming.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
myst-parser>=4.0.0
pydata-sphinx-theme>=0.16.0
sphinx_design>=0.6.1
sphinx-copybutton>=0.5.2
sphinx>=8.1.3
sphinxcontrib-mermaid>=1.0.0
32 changes: 32 additions & 0 deletions docs/src/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
html[data-theme="dark"], html[data-theme="light"] {
--pst-color-primary: #3399ff;
--pst-color-secondary: #9580ff;
}

a {
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

/*
Use the bottom border that's used for indicating the current page as the hover style (for a more
cohesive look).
NOTE: This selector matches the one in pydata-sphinx-theme
pydata/[email protected]/src/pydata_sphinx_theme/assets/styles/sections/_header.scss#L86
*/
.bd-header .navbar-nav li a.nav-link:hover {
border-bottom: max(3px,.1875rem,.12em) solid var(--pst-color-secondary);
text-decoration: none;
}

/*
Remove margin from sidebar-primary-items__end so that we don't have an unnecessary scrollbar. We're
not using the end items currently.
*/
.bd-sidebar-primary .sidebar-primary-items__end {
margin-top: 0;
margin-bottom: 0;
}
Loading