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
mgr/dashboard: remove node/npm system installation #20898
Conversation
1d12aee
to
b1dbe9f
Compare
message(FATAL_ERROR "WITH_MGR_DASHBOARD_V2_FRONTEND set, but npm not found") | ||
endif() | ||
|
||
set(mgr-dashboard_v2-nodeenv ${CMAKE_SOURCE_DIR}/build/dashboard_nodeenv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use CMAKE_BINARY_DIR
instead of hardwiring it to ${CMAKE_SOURCE_DIR}/build
. also i'd suggest remove the prefix of mgr-dashboard_v2-
, and install the nodeenv in current binary, i.e.
set(mgr-dashboard_v2-nodeenv ${CMAKE_CURRENT_BINARY_DIR}/node-env)
COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh ${mgr-dashboard_v2-nodeenv} | ||
COMMAND ${mgr-dashboard_v2-nodeenv}/bin/pip install nodeenv | ||
COMMAND ${mgr-dashboard_v2-nodeenv}/bin/nodeenv -p -n 8.10.0 | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
b1dbe9f
to
5fdd741
Compare
Implemented @tchaikov's suggestions and updated |
|
||
.. note:: | ||
After you are finished with it, you can simply run ``deactivate`` and exit the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this scares me =)
might want to put something like
Once you finish it
5faf2b2
to
e6743f6
Compare
updated |
It would be nice to skip using nodeenv if running on a distro that has recent enough node/npm (Fedora 27 has it, probably also latest opensuse has it?). I get that it is more complicated to have both the native path and the nodeenv path though. |
@tspmelo I tested the frontend build plus frontend unit tests in tumbleweed, ubuntu 16.04, 18.04, and CentOS 7 docker containers and everything worked good! But before merging this code as it is, we could take this opportunity to move the frontend build artifacts from the source tree into the build directory, what do you think? |
Node and npm are now being installed in a virtualenv, removing the need of having it installed in the system or as a node dependency. Now, if you want to use npm, you just need to activate the virtualenv created on 'build/src/pybind/mgr/dashboard/node-env', and then you can execute the same commands as you did before. Signed-off-by: Tiago Melo <tmelo@suse.com>
e6743f6
to
d5f8713
Compare
Rebased the branch. @jcsp are you talking about implementing this on |
@tspmelo second thought, moving the location of the frontend files requires changes to the backend code. That should be done in a different PR. Therefore, this PR LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@tspmelo Thanks, this makes the whole make-dist experience much smoother. |
@tspmelo builds in shaman were successful |
Node and npm are now being installed in a virtualenv, removing the need of
having it installed in the system or as a node dependency.
Now, if you want to use npm, you just need to activate the virtualenv created
on 'build/src/pybind/mgr/dashboard/node-env', and then you can execute
the same commands as you did before.
Signed-off-by: Tiago Melo <tmelo@suse.com>