-
Notifications
You must be signed in to change notification settings - Fork 74
feat: serve workspacekind assets (logos + icons) #736
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
base: notebooks-v2
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
37c0693 to
45316eb
Compare
9b203ac to
8e051f4
Compare
|
/ok-to-test |
8e051f4 to
ec35a7c
Compare
thaorell
left a comment
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.
While reviewing the implementation for /api/v1/workspacekinds/{name}/assets/{logo|icon|.svg, I did a quick scan of the existing data flow.
It looks like the frontend/client already receives the full source URL for these icons and logos from ImageRef as part of the parent WorkspaceKind object or a payload from WorkspaceKindInfo in loading workspace(s).
If that's the case, could we simply have the browser render those URLs directly? That would allow us to avoid maintaining a dedicated proxy endpoint and increase maintainability.
Let me know if I’m missing a specific use case where this proxy is required
This commit implements serving of workspacekind assets (logos and icons)
from ConfigMaps through the backend API, with SHA256 hash support for
cache-busting.
Key changes:
- Add endpoint to serve workspacekind assets from ConfigMaps at
`/api/v1/workspacekinds/{name}/assets/{icon|logo}.svg`
- Compute and include SHA256 hashes for ConfigMap-based assets as query
parameters for cache-busting
- Add ConfigMap client support to repositories for accessing asset content
- partial cache for performance/efficiency that keys off label:
- `notebooks.kubeflow.org/image-source: true`
- Add GetConfigMapContent method to WorkspaceKindRepository for
retrieving asset content from ConfigMaps
- Update model functions to support SHA256 hashes in asset URLs:
- NewWorkspaceKindModelFromWorkspaceKindWithAssetHashes
- NewWorkspaceModelFromWorkspaceWithAssetHashes
- Added workspacekind_imagesource_configmap.yaml for reference example
- Refactored `backend` `mgr` setup in `main.go` to leverage `helper/k8s.go`
- easier to keep logic in sync in e2e tests - particularly with new partial cache
Remote URL specification of assets is still supported - but the browser queries
the source URL directly for content.
Signed-off-by: Andy Stoneberg <[email protected]>
ec35a7c to
2157dda
Compare
closes: #692
This commit implements serving of workspacekind assets (logos and icons) from ConfigMaps through the backend API, with SHA256 hash support for cache-busting.
Key changes:
/api/v1/workspacekinds/{name}/assets/{icon|logo}.svgnotebooks.kubeflow.org/image-source: trueWorkspaceKindRepositoryandWorkspaceRepositoryfor retrieving asset content from ConfigMapsbackendmgrsetup inmain.goto leveragehelper/k8s.goRemote URL specification of assets is still supported - but the browser queries
the source URL directly for content.
SCREENSHOTS