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

Update static UI assets path in contrib doc #2548

Conversation

albertteoh
Copy link
Contributor

Signed-off-by: albertteoh albert.teoh@logz.io

Which problem is this PR solving?

Following the instruction from the CONTRIBUTING.md file results in a "no such file or directory" error when trying to fetch static UI assets:

$ go run ./cmd/all-in-one/main.go --query.static-files jaeger-ui/packages

"Could not create static assets handler","error":"cannot load index.html: cannot open index.html: open jaeger-ui/build/index.html: no such file or directory"

Short description of the changes

The Makefile appears to copy the static UI assets into jaeger-ui/packages/jaeger-ui/build instead. See: https://github.com/jaegertracing/jaeger/blob/master/Makefile#L234

Changing the command to the correct path as specified in the build-ui Makefile target results in the all-in-one running successfully:

$ go run ./cmd/all-in-one/main.go --query.static-files jaeger-ui/packages/jaeger-ui/build 

Signed-off-by: albertteoh <albert.teoh@logz.io>
@albertteoh albertteoh requested a review from a team as a code owner October 9, 2020 05:49
CONTRIBUTING.md Outdated
@@ -45,7 +45,7 @@ $ go run -tags ui ./cmd/all-in-one/main.go
Alternatively, the path to the built UI assets can be provided via `--query.static-files` flag:

```
$ go run ./cmd/all-in-one/main.go --query.static-files jaeger-ui/build
$ go run ./cmd/all-in-one/main.go --query.static-files jaeger-ui/packages/jaeger-ui/build
Copy link
Contributor

Choose a reason for hiding this comment

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

We actually have a make target now that can be used instead: make run-all-in-one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah okay, glad you pointed this out. Do you think we should delete this section of the contrib file then (i.e. "Alternatively, ..." + code block)?

Moreover, given we already have the make build-ui instruction in the previous section, could we just have a one-liner for this "Running local build with the UI" section of:

make run-all-in-one

Unless if we feel the first two sentences (i.e. "The jaeger-ui... .gitignored-ed.") are useful information.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think so, the whole section here could be replaced with this one make target.

Signed-off-by: albertteoh <albert.teoh@logz.io>
@codecov
Copy link

codecov bot commented Oct 9, 2020

Codecov Report

Merging #2548 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2548      +/-   ##
==========================================
+ Coverage   95.32%   95.36%   +0.03%     
==========================================
  Files         208      208              
  Lines        9248     9248              
==========================================
+ Hits         8816     8819       +3     
+ Misses        355      352       -3     
  Partials       77       77              
Impacted Files Coverage Δ
plugin/storage/integration/integration.go 77.90% <0.00%> (+0.55%) ⬆️
...lugin/sampling/strategystore/adaptive/processor.go 100.00% <0.00%> (+0.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 600d023...c1281ca. Read the comment docs.

@jpkrohling jpkrohling merged commit e3a73e1 into jaegertracing:master Oct 9, 2020
make build-ui
```

### Running local build with the UI

The `jaeger-ui` submodule contains the source code for the UI assets (requires Node.js 6+). The assets must be compiled first with `make build-ui`, which runs Node.js build and then packages the assets into a Go file that is `.gitignore`-ed. The packaged assets can be enabled by providing a build tag `ui`, e.g.:
Copy link
Member

Choose a reason for hiding this comment

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

The make target is great, but why remove the explanation? It's valuable information that now someone needs to dig out by reading source code.

Copy link
Member

Choose a reason for hiding this comment

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

Not to mention that this section is about the UI, not all-in-one, i.e the same approach is used with query-service.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a valid point, @yurishkuro; how the UI assets are created and used deserves a more detailed explanation as it's not straightforward (at least to me) to understand from just looking at code and Makefiles.

I think though, that this instruction should belong in the Pre-requisites section as an explanation to what make build-ui does. So my proposal is (what do you think?):

Pre-requisites

Then install dependencies and run the tests:

git submodule update --init --recursive
make install-tools
make test

The jaeger-ui submodule contains the source code for the UI assets (requires Node.js 6+). The assets must be compiled first with make build-ui, which runs Node.js build and then packages the assets into a Go file that is .gitignore-ed:

# if you wish to build platform binaries locally - the step below is needed.
make build-ui

Running local build with the UI

The packaged assets (created by the make build-ui step above) can be enabled by providing a build tag ui. The following command will start Jaeger all-in-one with this ui tag.

make run-all-in-one

Copy link
Member

Choose a reason for hiding this comment

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

I prefer UI-related explanations to be together under one section.

@albertteoh albertteoh deleted the update-static-file-path-in-contrib-doc branch October 9, 2020 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants