Repository navigation
mgr/dashboard/frontend:Ceph dashboard supports multiple languages - #52617
Conversation
mgr/dashboard/frontend:Ceph dashboard supports multiple languages Signed-off-by: TomNewChao <[email protected]>
|
jenkins test make check |
|
jenkins test windows |
|
@aaSharma14 Hi Aashish, could you help review this PR? |
|
Hi @Svelar , Thanks for the contribution. I will try out the PR and leave a review. |
@aaSharma14 @nizamial09 Hi guys, any update? |
|
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. |
Perfect, will go ahead and test the PR. |
epuertat
left a comment
There was a problem hiding this comment.
Great contribution, @TomNewChao ! I was completely unaware of the fact that i18n builds were disabled. We should definitely fix that. Thank you!
|
@epuertat The PR has been updated, Can you help me to review it again? |
epuertat
left a comment
There was a problem hiding this comment.
Thanks for the changes @TomNewChao! You're almost there. I left you a couple of comments.
epuertat
left a comment
There was a problem hiding this comment.
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. |
|
jenkins test windows |
|
jenkins test windows |
|
jenkins test windows |
|
@epuertat The PR has been updated, Can you help me to review it again? |
epuertat
left a comment
There was a problem hiding this comment.
LGTM, except for the version-matching part. @nizamial09 @tchaikov, what do you think about that?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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.10debian/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: npmThat 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
There was a problem hiding this comment.
Just like the PR I submitted, two methods are used to support ceph dashboard multi-language:
- 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.
- 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_NPMis 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 setsWITH_SYSTEM_NPMto True, and then it needs to ensure the nodejs version by themself.
So, I agree with you to cancel the nodejs version checking.
@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]>
@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 ! |
|
jenkins test make check |
|
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. |
|
@nizamial09 Please help me to run shaman builds, Thanks. |
shaman ongoing |
|
jenkins test make check |
Hi, I find the error about shaman ongoing about centos8 by using crimson version, And the error screenshot is as follows: |
Known issue: https://tracker.ceph.com/issues/64696 Looks like nothing to block merging. |
Yeah, let's merge it. |
|
@nizamial09 It looks like nothing to block merging.Please help me to merge it. |
|
merge it, thank you @TomNewChao |
You're welcome! |




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
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows