Skip to content

mgr/dashboard/frontend:Ceph dashboard supports multiple languages - #52617

Merged
nizamial09 merged 3 commits into
ceph:mainfrom
TomNewChao:main
Mar 20, 2024
Merged

nizamial09 merged 3 commits into
ceph:mainfrom
TomNewChao:main

Conversation

@TomNewChao

Copy link
Copy Markdown
Contributor

The Ceph Dashboard provides monitoring and management functions of the Ceph cluster through the WebUI, including but not limited to cluster health, device management, storage pool management, OSD monitoring, RBD management, CEPHFS management, object gateway management and other functions. It has been accepted and liked by ceph lovers. However, with the rapid development of Ceph, the Dashboard of Ceph native community only provides English environment and does not support other environments, such as Chinese, Japanese, etc., resulting in high requirements on operation and maintenance language. It is hoped that ceph native community can support multiple languages on ceph mgr dashboard.

Fixes: https://tracker.ceph.com/issues/58653#change-232261
Signed-off-by: TomNewChao [email protected]

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

mgr/dashboard/frontend:Ceph dashboard supports multiple languages

Signed-off-by: TomNewChao <[email protected]>
@TomNewChao

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@TomNewChao TomNewChao closed this Aug 22, 2023
@TomNewChao TomNewChao reopened this Jan 1, 2024
@Svelar

Svelar commented Jan 3, 2024

Copy link
Copy Markdown
Member

jenkins test windows

@Svelar
Svelar requested review from a team, aaSharma14 and ivoalmeida and removed request for a team January 3, 2024 06:44
@Svelar

Svelar commented Jan 5, 2024

Copy link
Copy Markdown
Member

@aaSharma14 Hi Aashish, could you help review this PR?

@aaSharma14

Copy link
Copy Markdown
Contributor

Hi @Svelar , Thanks for the contribution. I will try out the PR and leave a review.

@aaSharma14
aaSharma14 requested a review from nizamial09 January 16, 2024 13:51
@Svelar

Svelar commented Jan 23, 2024

Copy link
Copy Markdown
Member

Hi @Svelar , Thanks for the contribution. I will try out the PR and leave a review.

@aaSharma14 @nizamial09 Hi guys, any update?

@cloudbehl

Copy link
Copy Markdown
Contributor

Hey @TomNewChao, Thanks for the PR

can you attach screenshot/recording on how it works or a way to test the PR?

@TomNewChao

TomNewChao commented Jan 25, 2024 •

Copy link
Copy Markdown
Contributor Author

Hey @TomNewChao, Thanks for the PR

can you attach screenshot/recording on how it works or a way to test the PR?

Very happy to receive your reply. Below is a screenshot of our test environment.
image

@cloudbehl

Copy link
Copy Markdown
Contributor

Hey @TomNewChao, Thanks for the PR
can you attach screenshot/recording on how it works or a way to test the PR?

Very happy to receive your reply. Below is a screenshot of our test environment. image

Perfect, will go ahead and test the PR.

@epuertat epuertat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great contribution, @TomNewChao ! I was completely unaware of the fact that i18n builds were disabled. We should definitely fix that. Thank you!

Comment thread ceph.spec.in Resolved
Comment thread ceph.spec.in Resolved
Comment thread ceph.spec.in Resolved
@TomNewChao

Copy link
Copy Markdown
Contributor Author

@epuertat The PR has been updated, Can you help me to review it again?

@epuertat epuertat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the changes @TomNewChao! You're almost there. I left you a couple of comments.

Comment thread src/pybind/mgr/dashboard/frontend/cd.js Resolved
Comment thread ceph.spec.in Resolved

@epuertat epuertat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Once my two previous suggestions are addressed, I'm happy with this to be merged. Thank you @TomNewChao for your effort here!

@TomNewChao

Copy link
Copy Markdown
Contributor Author

Once my two previous suggestions are addressed, I'm happy with this to be merged. Thank you @TomNewChao for your effort here!

You are welcome,Contributing my PR to the ceph community is a pleasant process,And thanks for your review and approval.

@Svelar

Svelar commented Feb 1, 2024

Copy link
Copy Markdown
Member

jenkins test windows

@TomNewChao

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@TomNewChao

Copy link
Copy Markdown
Contributor Author

@epuertat @Svelar Hi, ceph windows tests failed because of the test environment, But I comment by jenkins test windows, Nothing works here. What should i do?

@Svelar

Svelar commented Feb 18, 2024

Copy link
Copy Markdown
Member

jenkins test windows

@TomNewChao

Copy link
Copy Markdown
Contributor Author

@epuertat The PR has been updated, Can you help me to review it again?

@epuertat epuertat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, except for the version-matching part. @nizamial09 @tchaikov, what do you think about that?

Comment on lines 59 to 67

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is going to be really hard to maintain. I'd just leave npm install or ng build to scream if the dependencies are not met.

@TomNewChao TomNewChao Feb 20, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Angular has developed to version v17.0.x. And the version v15 is the past version and will basically not change; if there is a chance in the future, it will adapt to node.js versions 14.[15-19].x or 16.[ 10-12].x, I will submit a PR to change this version at that time. This is a process of continuous contribution.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@TomNewChao in my experience, and specially when dealing with external dependendencies and no security risks involved, it's better to let the external deps complain than trying to be overzealous (this is aligned to the Pythonic EAFP approach).

BTW, if this is all because my comment here, I'll gladly take it back :P as this change is valuable enough without the version checking, and SYSTEM_NPM is not the default approach.


That said, if we definitely want to enforce a specific version range from the Ceph side, I checked Ceph's CMake files and we're using strict version checking only for:

  • Python
  • C compiler
  • Boost

These are core deps and the checks are mostly done to cope with side effects of specific versions (e.g.: https://tracker.ceph.com/issues/45147).

So IMHO rather than "simply" failing at build stage if those deps are missing/incorrect, we should enforce the desired versions by declaring those in the appropriate places, like:

  • ceph.spec.in (RHEL/SUSE): BuildRequires: python3-jinja2 >= 2.10
  • debian/control (Debian/Ubuntu): Build-Depends: ... libthrift-dev (>= 0.13.0),

That would similar to what I suggested here, and for Angular 15:

BuildRequires:  node<20.0 and (node >= 14.20 or node>=16.13 or node >= 18.10)
BuildRequires:  npm

That said, I checked in major distros and:

Distro Default nodejs version Ok Comment
CentOS 9 16.20.2 ✅
CentOS 8 10.23 ❌ Requires enabling modules
Ubuntu 22.04 12.22 ❌ Requires NodeSource PPA
Ubuntu 20.04 10.19 ❌ Requires NodeSource PPA

So this basically means that for CentOS8 and Ubuntu, we need to enable those extra sources at install-deps.sh script (and that doesn't work with rpmbuild or dpkg-buildpackage, right @tchaikov ?)


Summarizing

This is too complicate given that WITH_SYSTEM_NPM is disabled by default (instead, Python nodeenv package is used to specify nodejs versions). So, I'd probably remove any version checking

@TomNewChao TomNewChao Feb 21, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just like the PR I submitted, two methods are used to support ceph dashboard multi-language:

  1. Build the dashboard ui while compiling ceph, but it will strongly depend on the versions of Npm and nodejs to support building the dashboard, so we need to determine the version of nodejs. There is no doubt that this is the right approach. but this is going to be tough to maintain in the long run.
  2. Follow the existing implementation logic, support dashboard multi-language when executing make-dist, compress it into the release package, and avoid compiling dashboard ui when building ceph, because the default value of WITH_SYSTEM_NPM is false, which is the meaning of nodejs version judgment at this time It's not particularly big, because it is turned off by default during build, unless someone sets WITH_SYSTEM_NPM to True, and then it needs to ensure the nodejs version by themself.

So, I agree with you to cancel the nodejs version checking.

@tchaikov

Copy link
Copy Markdown
Contributor

LGTM, except for the version-matching part. @nizamial09 @tchaikov, what do you think about that?

@epuertat hi Ernesto, i will take a look this weekend. i share the same concern with you. let me see if we have at least a better approach to check the Node.js version which works with Angular we are using. the current approach should work, but it hurts the readability/maintainability.

@tchaikov tchaikov self-assigned this Feb 20, 2024
@epuertat

Copy link
Copy Markdown
Member

LGTM, except for the version-matching part. @nizamial09 @tchaikov, what do you think about that?

@epuertat hi Ernesto, i will take a look this weekend. i share the same concern with you. let me see if we have at least a better approach to check the Node.js version which works with Angular we are using. the current approach should work, but it hurts the readability/maintainability.

@tchaikov please check my reply here, and let me know what you think.

…ple languages

1.Set the default value of DASHBOARD_FRONTEND_LANGS to 'ALL'.
2.Fix bug about receive the `"ALL"` or `'ALL'`from process.env.DASHBOARD_FRONTEND_LANGS that is not equal 'ALL' in cd.js.
3.When we use the make-dist script to build the front-end UI to release the ceph, we should add DASHBOARD_FRONTEND_LANGS="ALL" to support multiple languages.

Signed-off-by: TomNewChao <[email protected]>
@TomNewChao

Copy link
Copy Markdown
Contributor Author

LGTM, except for the version-matching part. @nizamial09 @tchaikov, what do you think about that?

@epuertat hi Ernesto, i will take a look this weekend. i share the same concern with you. let me see if we have at least a better approach to check the Node.js version which works with Angular we are using. the current approach should work, but it hurts the readability/maintainability.

@tchaikov please check my reply here, and let me know what you think.

@epuertat There is no feedback to us from @tchaikov, So I will modify this PR according to the consensus reached through our discussion.

@epuertat

epuertat commented Mar 6, 2024

Copy link
Copy Markdown
Member

@epuertat There is no feedback to us from @tchaikov, So I will modify this PR according to the consensus reached through our discussion.

Perfect! Thank you, @TomNewChao !

@TomNewChao

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@tchaikov

Copy link
Copy Markdown
Contributor

sorry for the latency. the PR fell through the crack in my table. looks much better now.

@TomNewChao

Copy link
Copy Markdown
Contributor Author

sorry for the latency. the PR fell through the crack in my table. looks much better now.

Thanks for yours reply, Let us merge it.

@TomNewChao

Copy link
Copy Markdown
Contributor Author

@nizamial09 Please help me to run shaman builds, Thanks.

@nizamial09

Copy link
Copy Markdown
Member

@nizamial09 Please help me to run shaman builds, Thanks.

shaman ongoing

@Svelar

Svelar commented Mar 12, 2024

Copy link
Copy Markdown
Member

jenkins test make check

@TomNewChao

Copy link
Copy Markdown
Contributor Author

@nizamial09 Please help me to run shaman builds, Thanks.

shaman ongoing

Hi, I find the error about shaman ongoing about centos8 by using crimson version, And the error screenshot is as follows:
image
My changes will not involve ceph-osd or ceph-volume. Can you help me take a look?

@Svelar

Svelar commented Mar 14, 2024

Copy link
Copy Markdown
Member

@nizamial09 Please help me to run shaman builds, Thanks.

shaman ongoing

Hi, I find the error about shaman ongoing about centos8 by using crimson version, And the error screenshot is as follows: image My changes will not involve ceph-osd or ceph-volume. Can you help me take a look?

Known issue: https://tracker.ceph.com/issues/64696

Looks like nothing to block merging.

@TomNewChao

TomNewChao commented Mar 14, 2024 •

Copy link
Copy Markdown
Contributor Author

@nizamial09 Please help me to run shaman builds, Thanks.

shaman ongoing

Hi, I find the error about shaman ongoing about centos8 by using crimson version, And the error screenshot is as follows: image My changes will not involve ceph-osd or ceph-volume. Can you help me take a look?

Known issue: https://tracker.ceph.com/issues/64696

Looks like nothing to block merging.

Yeah, let's merge it.

@tchaikov tchaikov removed their assignment Mar 14, 2024
@TomNewChao

Copy link
Copy Markdown
Contributor Author

@nizamial09 It looks like nothing to block merging.Please help me to merge it.

@nizamial09
nizamial09 merged commit 09e55fb into ceph:main Mar 20, 2024
@nizamial09

Copy link
Copy Markdown
Member

merge it, thank you @TomNewChao

@TomNewChao

Copy link
Copy Markdown
Contributor Author

merge it, thank you @TomNewChao

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants