webui/README.md
Maven builds this project automatically, however, if a manual rebuild of the UI, you may do so in the ways below.
Execute mvn clean install from the webui directory
We use NVM to have multiple versions on node on one machine, and Lerna to handle our UI package dependencies.
brew install nvmwebui directory:
nvm installnpm run bootstrapNOTE: Please ensure you are running the correct version of Node before building packages. The expected version can be found both in the package.json file and in the .nvmrc file.
This can be done in two ways:
npm run buildcd webui/common-ui && npm run buildcd webui/master-ui && npm run buildcd webui/worker-ui && npm run buildThis can be done in two ways:
npm run test-cicd webui/common-ui && npm run testcd webui/master-ui && npm run testcd webui/worker-ui && npm run testNOTE: test-ci is meant to run tests once and quit (for continuous integration); test is meant to run tests for one package and will continuously watch for changes (for active development).
This can be done in two ways:
npm run coverage-cicd webui/common-ui && npm run coveragecd webui/master-ui && npm run coveragecd webui/worker-ui && npm run coverageNOTE: coverage-ci is meant to run tests once and quit (for continuous integration); "coverage" is meant to run tests for one package and will continuously watch for changes (for active development).
Follow the prerequisite instructions above.
Enable CORS for the alluxio RESTful api endpoints by setting alluxio.web.cors.enabled=true in conf/alluxio-site.properties
Start a development server in one of the following ways:
npm run startcd webui/common-ui && npm run startcd webui/master-ui && npm run startcd webui/worker-ui && npm run startThis will open two browser windows with the common-ui at http://localhost:3000, the master-ui at http://localhost:3001, and the worker-ui at http://localhost:3002. Your work will be recompiled and updated as you make changes to each package. You will see compile-time errors in the terminal windows and runtime errors in the browser console.
(Optionally) Start a test watcher for each package independently (using lerna for this is possible, but you will not be able to interact with the console):
1. common-ui: cd webui/common-ui && npm run test
1. master-ui: cd webui/master-ui && npm run test
1. worker-ui: cd webui/worker-ui && npm run test
This will continuously run your tests and will show you when tests pass or fail as you work.
(Optionally) Run a test coverage report in one of the following ways:
npm run coverage-cicd webui/common-ui && npm run coveragecd webui/master-ui && npm run coveragecd webui/worker-ui && npm run coverageThis will also generate a coverage report within each package: common/coverage/lcov-report/index.html, master/coverage/lcov-report/index.html, worker/coverage/lcov-report/index.html. You may also run coverage-ci instead of coverage in this step if you would like this to execute only once.
This will format .tsx files based on .prettierrc.js and return errors based on rules defined in .eslintrc.js.
This can be done in two ways:
npm run formatcd webui/common-ui && npm run formatcd webui/master-ui && npm run formatcd webui/worker-ui && npm run formatIt is sometimes necessary to bump package dependency versions for various reasons:
NOTE: Any dependencies that are shared across packages should use identical versions, otherwise lerna will complain about a dependency hoisting error. Please keep shared imported dependency versions synchronized.
Once a dependency changes, it is important to verify any functionality that could be affected by the change. This can be done via unit testing, system testing, and/or old fashioned QA testing.
In order to keep the UI consistent for production builds we shrinkwrap our dependecies using npm-shrinkwrap so that our package versions stay consistent across builds. Shrinkwrapping locks dependency versions so that updates to underlying UI libraries don't affect our build.
Once changes are tested and things work as planned, please run npm shrinkwrap && lerna exec npm shrinkwrap to lock package dependency versions.