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

How to build cockpit plugin locally? #53

Open
HuangShumin opened this issue Dec 28, 2023 · 7 comments
Open

How to build cockpit plugin locally? #53

HuangShumin opened this issue Dec 28, 2023 · 7 comments

Comments

@HuangShumin
Copy link

I found this project requires to Nexus repo for packaging.

@idevat
Copy link
Collaborator

idevat commented Dec 28, 2023

Hi @HuangShumin,

you can run

BUILD_FOR_COCKPIT=true make build

to build pcs-web-ui for cockpit.
It creates build/ directory and you need to copy it to cockpit plugin directory by e.g.:

cp -r build/. /usr/share/cockpit/ha-cluster

Keep in mind that pcs-web-ui in cockpit requires pcsd running locally.

Nexus is not required.

@HuangShumin
Copy link
Author

No luck. After I built for cockpit in RHEL8.8 and copied to /usr/share/cockpit/ha-cluster, I saw nothing in the ha-cluster menu of cockpit page.

@idevat
Copy link
Collaborator

idevat commented Jan 12, 2024

Hi @HuangShumin,

unix socket communication support in pcsd is required to be possible to run pcs-web-ui from cockpit. This feature appeared first time in pcs version 0.11.4. In RHEL8, there is pcs based on pcs-0.10 branch, see https://github.com/ClusterLabs/pcs/blob/main/README.md#pcs-versions

@HuangShumin
Copy link
Author

Clear. Thank you for this information

@HuangShumin
Copy link
Author

I tried on Alma Linux 9.3 this time with these outpt

[root@node1 pcs-web-ui-0.1.18]# BUILD_FOR_COCKPIT=true make build
./packages/app/.bin/check-assumptions.sh
Starting build

Node modules prepared: /root/pcs-web-ui-0.1.18/packages/app/node_modules.
Build dir prepared: /root/pcs-web-ui-0.1.18/build.
Going to build assets.
node:internal/modules/cjs/loader:1031
  throw err;
  ^

Error: Cannot find module 'webpack'
Require stack:
- /root/pcs-web-ui-0.1.18/packages/app/.bin/build.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
    at Function.Module._load (node:internal/modules/cjs/loader:873:27)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/root/pcs-web-ui-0.1.18/packages/app/.bin/build.js:18:17)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/root/pcs-web-ui-0.1.18/packages/app/.bin/build.js' ]
}
Assets compiled.
ls: cannot access '/root/pcs-web-ui-0.1.18/build/static/css/main.*.css': No such file or directory
ls: cannot access '/root/pcs-web-ui-0.1.18/build/static/js/main.*.js': No such file or directory
Compiled assets injected to html page.
Adapting for usage inside cockpit.
Adapted for environment
Prefixed asset paths: '.'.

Environment adapter minimized
Marks prepared
rm: cannot remove '/root/pcs-web-ui-0.1.18/packages/app/node_modules': No such file or directory

/root/pcs-web-ui-0.1.18/build/static/js/adapter.js: 1200

[root@node1 pcs-web-ui-0.1.18]# ls -R build/
build/:
index.html  manifest.json  manifest_test_marks.json  static

build/static:
js  media

build/static/js:
adapter.js

build/static/media:
favicon.png

@idevat
Copy link
Collaborator

idevat commented Feb 2, 2024

Hi @HuangShumin,

sorry for the delay, I was sick.

Unfortunately, a nexus proxy has indeed slipped into package-lock.json. This is now fixed in the branch main with a commit b3203ed.

@HuangShumin
Copy link
Author

thanks for update. sincerely I wish you good health. I will try this commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants