-
Notifications
You must be signed in to change notification settings - Fork 33
feat(session): add SageMaker Unified Studio portal redirect #106
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
feat(session): add SageMaker Unified Studio portal redirect #106
Conversation
| ResourceArn?: string | ||
| ResourceName?: string | ||
| AppImageVersion?: string | ||
| AdditionalMetadata?: { |
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.
nit: Uneven spacings
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.
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.
Nit: Was using more than tab (4 space). Hence called it.
| const sagemakerCookie: SagemakerCookie = r as SagemakerCookie | ||
|
|
||
| initialize(sagemakerCookie); | ||
| updateStatusItemWithMetadata(context); |
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.
Any issues with SM AI if we move this out of this code block scope?
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.
this should be okay, but I would rather set the smusRedirectUrl seperately from updateStatusItemWithMetadata, I feel like we're overloading this func. Refactor fecthing jsonData into a helper function
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.
Thanks for the suggestion, I am adding helper function in next revision.
| sagemaker-idle-extension.patch | ||
| terminal-crash-mitigation.patch | ||
| sagemaker-open-notebook-extension.patch | ||
| sagemaker-extension-smus-support.patch |
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.
Any strong reason why not have it in sagemaker-extension.diff itself and have it in separate patch?
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.
patches are feature based
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.
Please do test this in both SMUS and SM AI world and add unit tests accordingly.
| DataZoneDomainRegion: !!DataZoneDomainRegion, | ||
| DataZoneProjectId: !!DataZoneProjectId | ||
| }); | ||
| return null; |
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.
What's the SMUS session renewal UX if we're unable to generate the url?
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.
| * Constructs the SMUS portal URL using domain, region, and project information | ||
| * Returns null if not in SMUS environment or if required fields are missing | ||
| */ | ||
| export const getSmusVscodePortalUrl = (metadata: SagemakerMetadata): string | null => { |
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.
why can't we follow existing pattern of setting redirect url in cookies?
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.
Redirect url is set by LooseLeaf, do you mean LL return Redirect URL of SMUS for SMUS use cases?
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.
yeah
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 for setting "Redirect URL" suggestion from LooseLeaf side. This looks like a better long term solution. It will need to good amount of research to make sure it doesn't impact any other functionality and also "Redirect URL" is generic solution for all IDEs so updating it could have impact on other IDEs in unexpected way. I'll suggest we do it in incremental way. First we use current short term way (this PR) and then we see if we can get "Redirect URL" updated from LL side as long term way.
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.
sounds good, please create a tracking issue for this.
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.
| sagemaker-idle-extension.patch | ||
| terminal-crash-mitigation.patch | ||
| sagemaker-open-notebook-extension.patch | ||
| sagemaker-extension-smus-support.patch |
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.
patches are feature based
097a7ba to
965cfe3
Compare
** Description ** • Add support for redirecting to SMUS portal during VSCode session renewal • Detect SMUS environment using SERVICE_NAME variable • Update metadata handling to support SMUS portal URL construction ** Motivation ** • Enable users to renew VSCode sessions through SMUS portal • Improve session renewal experience for SMUS users ** Testing ** • Verified with local VSCode server • Tested for both SMUS and SageMaker AI with manually cookie population and metadata file creation ** Backward compatibility ** • Maintains existing behavior for non-SMUS environments • Silent failure handling prevents disruption of current flows
965cfe3 to
3983b4d
Compare
| return JSON.parse(data) as SagemakerResourceMetadata; | ||
| } catch (error) { | ||
| // fail silently not to block users | ||
| console.error('Error reading metadata file:', error); |
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.
Non-blocking: we should move all these logs to output channel. like #110 (comment)
| ResourceArn?: string | ||
| ResourceName?: string | ||
| AppImageVersion?: string | ||
| AdditionalMetadata?: { |
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.
Nit: Was using more than tab (4 space). Hence called it.
…s-sagemaker-extension
…s-sagemaker-extension
…nsion feat(session): add SageMaker Unified Studio portal redirect


DESCRIPTION
• Add support for redirecting to SMUS portal during VSCode session renewal • Detect SMUS environment using SERVICE_NAME variable • Update metadata handling to support SMUS portal URL construction
MOTIVATION
• Enable users to renew VSCode sessions through SMUS portal • Improve session renewal experience for SMUS users
TESTING
• Verified with local VSCode server
• Tested for both SMUS and SageMaker AI with manually cookie population and metadata file creation
BACKWARD COMPATIBILITY
• Maintains existing behavior for non-SMUS environments • Silent failure handling prevents disruption of current flows
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.