You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Darrenzzy (via GitHub)" <gi...@apache.org> on 2024/10/30 08:49:50 UTC

[PR] feat(nginx): add static resource configuration [superset]

Darrenzzy opened a new pull request, #30752:
URL: https://github.com/apache/superset/pull/30752

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   This PR adds static resource configuration to the Nginx setup in the Docker directory. The changes include specifying a static directory in nginx.conf to serve frontend assets with caching enabled. This update helps improve resource loading times and serves assets directly from the designated directory, making the Nginx configuration more aligned with application needs.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   To manually verify these changes:
   
   	1.	Stop the current docker-compose service.
   	2.	Modify the nginx.conf file as specified:
   	•	Add a /static alias pointing to the frontend source directory with caching enabled.
   	3.	Restart docker-compose:
   	•	docker compose up
           4. Check that static resources are served correctly under /static.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue:
   - [x] Required feature flags:
   - [x] Changes UI
   - [x] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
   - [x] Migration is atomic, supports rollback & is backwards-compatible
   - [x] Confirm DB migration upgrade and downgrade tested
   - [x] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
           Yes, configures static resource handling.
   - [x] Removes existing feature or API
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(nginx): add static resource configuration [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #30752:
URL: https://github.com/apache/superset/pull/30752#issuecomment-3180883318

   I don't think this one is mergeable, in terms of approach (potentially), and needs conflict resolution. I'll set it to draft, but ping us if it's ready for review!


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(nginx): add static resource configuration [superset]

Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch commented on PR #30752:
URL: https://github.com/apache/superset/pull/30752#issuecomment-2506541021

   Looking at this a bit more, I don't think the nginx image has the static assets loaded in, they would need to be loaded or mounted


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(nginx): add static resource configuration [superset]

Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch commented on code in PR #30752:
URL: https://github.com/apache/superset/pull/30752#discussion_r1839011580


##########
docker/nginx/nginx.conf:
##########
@@ -112,6 +112,12 @@ http {
             proxy_set_header Host $host;
         }
 
+	location /static {
+            alias /app/superset-frontend/src;

Review Comment:
   Mmmmh, confused to see this as it seems to me the build directory for webpacked assets is `./superset/static/assets`
   https://github.com/apache/superset/blob/master/superset-frontend/webpack.config.js#L43
   
   `superset-frontend/src` contains some of the source code



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(nginx): add static resource configuration [superset]

Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch commented on code in PR #30752:
URL: https://github.com/apache/superset/pull/30752#discussion_r1839011580


##########
docker/nginx/nginx.conf:
##########
@@ -112,6 +112,12 @@ http {
             proxy_set_header Host $host;
         }
 
+	location /static {
+            alias /app/superset-frontend/src;

Review Comment:
   Mmmmh, confused to see this as it seems to me the build directory for webpacked assets is `./superset/static/assets`
   https://github.com/apache/superset/blob/master/superset-frontend/webpack.config.js#L43
   
   `superset-frontend/src` contains some of the raw js/ts source code



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(nginx): add static resource configuration [superset]

Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch commented on PR #30752:
URL: https://github.com/apache/superset/pull/30752#issuecomment-2447744487

   Tagging @dpgaspar as our resident infra/nginx expert


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(nginx): add static resource configuration [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed pull request #30752: feat(nginx): add static resource configuration
URL: https://github.com/apache/superset/pull/30752


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(nginx): add static resource configuration [superset]

Posted by "fuomag9 (via GitHub)" <gi...@apache.org>.
fuomag9 commented on PR #30752:
URL: https://github.com/apache/superset/pull/30752#issuecomment-2466720989

   ```
   superset_app          | 2024-11-10 12:43:08,390:WARNING:superset.views.error_handling:HTTPException
   superset_app          | Traceback (most recent call last):
   superset_app          |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
   superset_app          |     rv = self.dispatch_request()
   superset_app          |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1458, in dispatch_request
   superset_app          |     self.raise_routing_exception(req)
   superset_app          |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1440, in raise_routing_exception
   superset_app          |     raise request.routing_exception  # type: ignore
   superset_app          |   File "/usr/local/lib/python3.10/site-packages/flask/ctx.py", line 353, in match_request
   superset_app          |     result = self.url_adapter.match(return_rule=True)  # type: ignore
   superset_app          |   File "/usr/local/lib/python3.10/site-packages/werkzeug/routing/map.py", line 629, in match
   superset_app          |     raise NotFound() from None
   superset_app          | werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
   superset_app          | 2024-11-10 12:43:08,391:INFO:werkzeug:172.18.0.1 - - [10/Nov/2024 12:43:08] "GET /ws HTTP/1.1" 404 -
   superset_app          | 2024-11-10 12:43:14,907:DEBUG:superset.stats_logger:[stats_logger] (incr) health
   superset_app          | 2024-11-10 12:43:14,907:INFO:werkzeug:127.0.0.1 - - [10/Nov/2024 12:43:14] "GET /health HTTP/1.1" 200 -
   ```
   
   UX works now but this PR needs improvements as it's missing websockets connections configuration


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(nginx): add static resource configuration [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #30752:
URL: https://github.com/apache/superset/pull/30752#issuecomment-3882982329

   Closing due to contributor inactivity for several months. Feel free to reopen if/when warranted, and thank you for the contribution!


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org