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

Charlesthebird/read only filesystem fix #93

Merged
merged 15 commits into from
Aug 23, 2024

Conversation

Charlesthebird
Copy link
Collaborator

@Charlesthebird Charlesthebird commented Aug 20, 2024

Steps to Reproduce this Issue

  1. Set up an example environment by cloning the solo-projects repo, and running sh hack/gateway-portal/portal-server-init.sh
  2. In the portal-frontend deployment, set spec.securityContext.readOnlyRootFilesystem: true to see the yarn issues that arise during the UI build.

Solution

For the dev-portal-starter, we do the UI build when the image is loaded, in order to get the latest environment variables from the deployment. This doesn't work in read-only environments. In our other UI's, like the GME UI, we do the UI build beforehand, and then make a request to the API for environment variables.

This PR adds a solution to this problem by adding a lightweight server to the UI image, which serves the UI and adds the environment variables with the EJS view engine. This makes it so that the portal server doesn't have to change to accommodate UI configuration, and the UI can stay mostly decoupled from it. This is important because:

  • The UI currently supports GG + GMG backends on different URL's, and the portal server endpoint is configurable.
  • This should result in the exact same experience for current users, but they would no longer have to wait for the UI to build, since it could be built when the image is built. Actually the UI image had to already have used a server when it previously did the Vite build and preview steps, so this just makes us have more control over what is being served and how.

Screenshots

Reproducing the Issue

Adding in readOnlyFilesystem: true reproduces the issue.
Screenshot 2024-08-23 at 10 48 02 AM
Screenshot 2024-08-23 at 10 48 15 AM

Adding in the Fix

Keeping readOnlyFilesystem: true and updating the image to the version that is in this PR (gcr.io/solo-public/docs/portal-frontend:read-only-filesystem-test2) fixes the issue.

Screenshot 2024-08-23 at 11 04 53 AM Screenshot 2024-08-23 at 11 04 17 AM

BOT NOTES:
resolves https://github.com/solo-io/gloo-mesh-enterprise/issues/18336

Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
@solo-changelog-bot
Copy link

Issues linked to changelog:
https://github.com/solo-io/gloo-mesh-enterprise/issues/18336

Signed-off-by: Nicholas Bucher <[email protected]>
…h script for testing the build + run process.

Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
@Charlesthebird Charlesthebird marked this pull request as ready for review August 23, 2024 15:05
Signed-off-by: Nicholas Bucher <[email protected]>
@Charlesthebird Charlesthebird merged commit c2b6812 into main Aug 23, 2024
2 checks passed
@Charlesthebird Charlesthebird deleted the charlesthebird/readOnlyFilesystemFix branch September 12, 2024 17:07
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

Successfully merging this pull request may close these issues.

2 participants