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

Pack dashboard resources in release package #15280

Closed
fuyufjh opened this issue Feb 27, 2024 · 2 comments · Fixed by #15836
Closed

Pack dashboard resources in release package #15280

fuyufjh opened this issue Feb 27, 2024 · 2 comments · Fixed by #15836
Assignees
Labels
type/enhancement Improvements to existing implementation.
Milestone

Comments

@fuyufjh
Copy link
Member

fuyufjh commented Feb 27, 2024

This will actually break the old-version RW, but it's acceptable to me.

This is because RisingWave's Web resources are served from GitHub repo dashboard-artifact branch, and it's not versioned, i.e. only the latest main build will be kept.

RUN curl -LO https://github.com/risingwavelabs/risingwave/archive/refs/heads/dashboard-artifact.zip
RUN unzip dashboard-artifact.zip && mv risingwave-dashboard-artifact /risingwave/ui && rm dashboard-artifact.zip

Hope someday we can ship the frontend resource into / along with the binary.

Originally posted by @fuyufjh in #15277 (comment)

I think we can take the same approach as the java code, that is, ship the .jars with RisingWave binary together in the tar.gz file

@github-actions github-actions bot added this to the release-1.7 milestone Feb 27, 2024
@fuyufjh fuyufjh changed the title Pack website resources in release package Pack dashboard resources in release package Feb 27, 2024
@fuyufjh fuyufjh added the type/enhancement Improvements to existing implementation. label Feb 27, 2024
@BugenZhao BugenZhao self-assigned this Mar 1, 2024
@BugenZhao
Copy link
Member

It appears that Dockerfile.hdfs is quite outdated. 😄 We've already switched to build the dashboard artifact in place since #12421.

FROM base AS dashboard-builder
RUN apt-get update && apt-get install -y curl gnupg protobuf-compiler && mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update && apt-get install -y nodejs
COPY ./dashboard/ /risingwave/dashboard
COPY ./proto /risingwave/proto
RUN cd /risingwave/dashboard && npm i && npm run build-static && rm -rf node_modules

Specifically for this case, I would strongly suggest maintaining Dockerfile.hdfs as an extra step in Dockerfile to avoid such inconsistencies.


However, the issue still exist if there's no --dashboard-ui-path specified. We'll proxy to githubusercontent.com then at runtime and it's not versioned. This affect the users who directly download the binary directly or through Homebrew.

let url_str = format!(
"https://raw.githubusercontent.com/risingwavelabs/risingwave/dashboard-artifact{}",
path
);

@BugenZhao BugenZhao modified the milestones: release-1.7, release-1.8 Mar 6, 2024
@BugenZhao
Copy link
Member

Plan:

  • Introduce a new crate dashboard to build the dashboard assets in the build script (build.rs) conditionally based on the configuration, providing a unified entry for serving dashboard assets.

    • Always build and embed in the binary for releases, requiring nodejs toolchain.
    • Do not build but proxy to GitHub for debug/CI builds, unless asked to build.
  • The meta crate will depends on dashboard and be no more aware of the source of the dashboard assets. ui-path is deprecated as there's no need of external assets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Improvements to existing implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants