Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Make admin ui work when volumes are mounted #1266

Merged
merged 5 commits into from
Sep 7, 2022
Merged

Conversation

sanders41
Copy link
Contributor

@sanders41 sanders41 commented Sep 7, 2022

Purpose

Mounting a volume overrides the files built in the container, the result of this is the admin ui files are deleted and can't load. This is to fix that issue.

Changes

  • Instead of copying the front end build files into the /fidesops directory copy them to /admin_ui so they will not be overwritten on volume mounts
  • Modify generate_route_file_map in main.py to work with the new directory structure.

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section 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.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #1235

src/fidesops/main.py Outdated Show resolved Hide resolved
@TheAndrewJackson
Copy link
Contributor

@sanders41 This command will need to be updated so it copies the files to the correct directory.

"copy-export": "rsync -a --delete out/ ../../../src/fidesops/ops/build/static/",

@sanders41
Copy link
Contributor Author

@sanders41 This command will need to be updated so it copies the files to the correct directory.

You run this outside docker right? So the correct path would be: "copy-export": "rsync -a --delete out/ ../../../admin_ui/"?

@TheAndrewJackson
Copy link
Contributor

@sanders41 This command will need to be updated so it copies the files to the correct directory.

You run this outside docker right? So the correct path would be: "copy-export": "rsync -a --delete out/ ../../../admin_ui/"?

Yes, this command is run from outside docker. I think it assumes that the directory it's copying to is mounted inside the docker container. I think this command won't work until we add another volume that mounts to the new /admin-ui directory. Maybe we should remove it for now. It's relatively uncommon to update the hosted UI while developing.

What do you think of circling back and adding an equivalent command back if there is a need for it again?

@sanders41
Copy link
Contributor Author

Sounds reasonable to me. I think it will be less needed after the update.

@TheAndrewJackson TheAndrewJackson self-assigned this Sep 7, 2022
@TheAndrewJackson TheAndrewJackson self-requested a review September 7, 2022 20:40
@TheAndrewJackson TheAndrewJackson merged commit 16fba9b into main Sep 7, 2022
@TheAndrewJackson TheAndrewJackson deleted the ps-admin-ui branch September 7, 2022 20:40
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* Make admin ui work when volumes are mounted

* Update changelog

* Fix path issue with hard refresh

* Update from code review

Co-authored-by: Paul Sanders <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No src/fidesops/ops/build/static/index.html found error showing
2 participants