-
Notifications
You must be signed in to change notification settings - Fork 16
Deploy UI within fidesops #625
Conversation
| | Admin UI Variables|---|---|---|---|---| | ||
| |`ENABLED` | `FIDESOPS__ADMIN_UI__ENABLED` | bool | False | True | Toggle whether the `/static` file directory is mounted to serve the Admin UI |
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.
Thank you for this! 👍
|
@TheAndrewJackson I'm getting this build err locally when trying to |
|
Aside from my comment above ^ the code itself looks good. Not blocking, but would like to add documentation for how to nav to the admin ui when the |
I ran into that issue this morning and resolved it by restarting my computer. I'm not completely sure what was wrong 🤷♂️ |
Good idea. Can we get that in a follow up docs ticket? @eastandwestwind |
|
I was able to resolve the Main question is, when I nav to |
|
I've added a separate issue for docs here- #644 |
Ahh, it's sort of expected. I ran into this a few times while developing this feature. What you're most likely seeing is the volumes:
- type: bind
source: ./
target: /fidesops
read_only: False
- /fidesops/src/fidesops.egg-infoWhat's happening is the UI is built when the docker image is created initially. Then when |
|
Thanks for the clarification @TheAndrewJackson ! |
| if not WEBAPP_INDEX.is_file(): | ||
| WEBAPP_DIRECTORY.mkdir(parents=True, exist_ok=True) | ||
| with open(WEBAPP_DIRECTORY / "index.html", "w") as index_file: | ||
| index_file.write("<h1>Privacy is a Human Right!</h1>") |
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.
I'm curious why is this needed? Is this just to handle a case where the docker build hasn't successfully built the admin UI and exported it, or is it more common than that?
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.
I followed the same pattern that the fides used did for this update: https://github.com/ethyca/fides/blob/main/src/fidesapi/main.py#L59-L68. I believe that it is so there is always something to display in the event that the admin UI is toggled on.
It should probably be updated to display something for helpful to help the user know why the full admin ui isn't being displayed.
One common issue that Catherine, Sean, and I ran into while this was developed the the default config in the docker-compose.yml mounts a volume of the local fidesops files with this snippet
volumes:
- type: bind
source: ./
target: /fidesops
read_only: False
- /fidesops/src/fidesops.egg-infoSince the admin ui is only built while the docker image is created the ui files are missing from the local fidesops code causing the ui files to be missing once docker-compose up is ran.
This is okay because frontend development still uses npm run dev from clients/admin-ui and backend development won't typically need to use the admin ui from within the fidesops webserver. In the event that backend development needs the full admin within the webserver they can run the npm run prod-export command from within clients/admin-ui and that will build and move the full ui into the correct place within the backend code.
| security: FidesopsSecuritySettings | ||
| execution: ExecutionSettings | ||
| root_user: RootUserSettings | ||
| admin_ui: AdminUiSettings |
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.
Can you add this to the log_all_config_values helper too? Sorry I didn't know a clean way to introspect the settings object to do this automatically
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.
Yes, I'll make an issue for it now and update the code.
* Switch to Chakra image instead of nextjs * checking in progress towards static build * Mount static file directory * Update Dockerfile * Add dockerignore file * Fix file path * Update Dockerfile * Add admin ui config model * Conditionally build the UI * Fix env_prefix * Remove hello_world placeholder * Remove if logic from Dockerfile * Fix issues with BASE_URL * Refactor Head into component & update URNs * Fix import order * Update test URL path * Fix isort lint issue * Fix unit test failure * Update docs and changelog
Purpose
Build and serve the Admin UI within fidesops as a static website.
Changes
startupevent to serve the website if it's toggled onHeadportion of pages into singleFidesHeadcomponent to remove duplicationChecklist
CHANGELOG.mdfileCHANGELOG.mdfile is being appended toUnreleasedsection in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.Run Unsafe PR Checkslabel has been applied, and checks have passed, if this PR touches any external servicesTicket
Fixes #528 #529