dcoric opened a new pull request, #198:
URL: https://github.com/apache/yunikorn-web/pull/198

   Implemented Module Federation for the Applications Drawer component 
Implemented and fixed all tests.
   Added copyright info
   
   ### What is this PR for?
   This PR introduces [Module 
Federation](https://www.npmjs.com/package/@angular-architects/module-federation)
 for loading components remotely.
   This was intended to easily connect [Yunikorn History 
Server](https://github.com/G-Research/yunikorn-history-server) with YuniKorn. 
Components that should consume data from the Yunikorn History Server will be 
served from the YHS itself and loaded in the YuniKorn with configuring env 
parameters on build time.
   
   This PR includes adjustments to the Applications page (apps-view component). 
The allocations drawer is extracted to a separate component (allocations-drawer 
component). The apps-view component is loaded dynamically on init in the 
initializeSidebarComponent method. Depending on the env configuration, that 
component is loaded locally, or remotely from the YHS server.
   
   With component separation and page updates, the design is slightly tweaked 
to match more closely to match the design linked in the 
[YUNIKORN-2603](https://issues.apache.org/jira/browse/YUNIKORN-2603) 
   
   ### What type of PR is it?
   * [ ] - Bug Fix
   * [x] - Improvement
   * [x] - Feature
   * [ ] - Documentation
   * [ ] - Hot Fix
   * [ ] - Refactoring
   
   ### Todos
   * [ ] - Add info to the documentation on how to configure the remote module
   
   ### What is the Jira issue?
   [YUNIKORN-2606](https://issues.apache.org/jira/browse/YUNIKORN-2606)
   
   ### How should this be tested?
   Steps for testing this feature:
   1. Check out the (YuniKorn History 
Server)[https://github.com/G-Research/yunikorn-history-server]
   2. Go to the `web` folder and run `npm install` and `npm start`. This will 
start the application with module federation in `remote` mode that will 
generate a `remoteEntry.js` file.
   3. In YuniKorn `envconfig.json` file set these values:
       ```
         "moduleFederationRemoteEntry": "http://localhost:3100/remoteEntry.js";,
         "allocationsDrawerRemoteComponent": "./AllocationsDrawerComponent"
       ```
   4. Start YuniKorn as usual. You will notice that the Allocations Sidebar is 
a different component that is loaded over the network (`remoteEntry.js` will be 
visible in the network). The rest of the application will not be affected in 
any way.
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * [ ] - The licenses files need update.
   * [ ] - There is breaking changes for older versions.
   * [x] - It needs documentation.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to