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

HDDS-9568. Add docusaurus build check in github actions #71

Merged
merged 2 commits into from
Feb 3, 2024

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Add smoketest that builds the website in CI.

https://issues.apache.org/jira/browse/HDDS-9568

How was this patch tested?

Introduced broken link, verified the same steps fail with:

Error: Unable to build website for locale en.
...
  [cause]: Error: Docusaurus found broken links!
...
  - On source page path = /docs/system-internals/features/ratis-streaming:
     -> linking to ./no-such-page (resolved as: /docs/system-internals/features/no-such-page)
...

CI:
https://github.com/adoroszlai/ozone-site/actions/runs/7740784527/job/21106463270

@adoroszlai adoroszlai added the CI label Feb 1, 2024
@adoroszlai adoroszlai self-assigned this Feb 1, 2024
@github-actions github-actions bot added the website-v2 Tasks for the new ozone website targeting the HDDS-9225-website-v2 branch label Feb 1, 2024
Copy link
Contributor

@errose28 errose28 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @adoroszlai

This implementation uses a mix of dependencies installed in the docker image and in the runner, which I think is a bit confusing (correct me if I'm reading this wrong):

docker build -t ozone-site:ci .

This installs all javascript dependencies into the image when building it.

docker run --rm -v $PWD:/ozone-site ozone-site:ci pnpm install

This mounts the current directory over the ozone-site directory in the image, covering the previously installed dependencies in /ozone-site/node_modules but using pnpm from the image. The dependencies here are installed into the runner directly so now we have two copies.

docker run --rm -v $PWD:/ozone-site ozone-site:ci pnpm build

This executes the build using pnpm from the image and dependencies from the runner. Dependencies installed into the image are not used.

I think we should use pnpm and the dependencies from the image to do the build, but leave the build output in the runner with the volume mount. We can do this with the existing compose file:

  1. docker commpose build: Optional, since run will build the image anyways. Making this its own step might make for clearer CI messages though.
  2. docker compose run site pnpm build: Builds the site using all dependencies in the image, but leaves the final build artifacts in the runner.
  3. (Future PR) If this is a push to the HDDS-9225-website-v2 branch, re-use the pre-built artifacts in the commit step to the publishing branch.
  4. (Future PR) Liveness check for the build: docker compose run --service-ports site pnpm serve followed by curl to check that the homepage is returned. Yunikorn has a similar check

@adoroszlai
Copy link
Contributor Author

Thanks @errose28 for the explanation on how to use compose to build/run. I had a feeling that my steps are too complex.

Copy link
Contributor

@errose28 errose28 left a comment

Choose a reason for hiding this comment

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

Thanks for the updates @adoroszlai LGTM

@errose28 errose28 merged commit eb8375f into apache:HDDS-9225-website-v2 Feb 3, 2024
3 checks passed
@adoroszlai adoroszlai deleted the HDDS-9568 branch February 3, 2024 12:12
errose28 added a commit to errose28/ozone-site that referenced this pull request Feb 6, 2024
* HDDS-9225-website-v2:
  HDDS-10255. Update Release Manager Guide after importing it to the new website. (apache#67)
  HDDS-9568. Add docusaurus build check in github actions (apache#71)
  HDDS-10266. Auto label PRs for the new website. (apache#68)
  HDDS-10267. Add PR template for the new website. (apache#70)
  HDDS-9603. Add PR title check (apache#69)
  HDDS-9564. Create Ozone Social Card. (apache#62)
  HDDS-10233. Apache Release Manager Guide (apache#66)
  HDDS-10203. Update Github actions to v4 since Node.js 16 actions are deprecated. (apache#60)
  HDDS-9612. Add CONTRIBUTING.md for the new Ozone website (apache#54)
  HDDS-9865. Add outline of docs sections and pages. (apache#53)
  HDDS-9926. Publish WIP website to staging branch (2/2) (apache#56)

Conflicts:
docs/01-overview.md
docs/03-core-concepts/04-security/01-authentication/01-kerberos.md
docs/05-administrator-guide/02-configuration/03-security/01-kerberos.md
progress.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI website-v2 Tasks for the new ozone website targeting the HDDS-9225-website-v2 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants