feat(sagemaker): Reconnection toolkit #8485
Conversation
|
|
lint update |
packages/core/src/awsService/sagemaker/detached-server/routes/getHyperpodSession.ts
Show resolved
Hide resolved
packages/core/src/awsService/sagemaker/detached-server/routes/getHyperpodSession.ts
Outdated
Show resolved
Hide resolved
packages/core/src/awsService/sagemaker/detached-server/kubectlClientStub.ts
Show resolved
Hide resolved
|
has this been tested locally? if so, can you update the description |
cb4fa4d to
d0a38c3
Compare
packages/core/src/awsService/sagemaker/detached-server/routes/getHyperpodSession.ts
Show resolved
Hide resolved
packages/core/src/awsService/sagemaker/detached-server/routes/getHyperpodSession.ts
Show resolved
Hide resolved
packages/core/src/awsService/sagemaker/detached-server/kubectlClientStub.ts
Show resolved
Hide resolved
| appType | ||
| appType, | ||
| workspaceName, | ||
| undefined, |
There was a problem hiding this comment.
Please reconsider refactoring prepareDevEnvConnection to accept an options object instead of many ordered arguments. Especially since it seems like some of them can be optional/undefined. When the list of arguments eventually grows, it can be hard for others to use it because they have to maintain the same order of arguments, a lot of which may not be relevant to them.
packages/core/src/awsService/sagemaker/hyperpodConnectionMonitor.ts
Outdated
Show resolved
Hide resolved
|
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
|
✅ I finished the code review, and didn't find any security or code quality issues. |
- Parse API response JSON once instead of 3 times for better efficiency - Add error handling for JSON parsing failures - Extract complex connection key fallback logic to separate function - Add URL encoding for query parameters to handle special characters - Replace ChildProcess with native execFile in detached server to avoid vscode dependency - Add SAGEMAKER_LOCAL_SERVER_FILE_PATH environment variable to hyperpod connection - Store wsUrl and token in hyperpod mapping for reconnection support
| return JSON.parse(content) | ||
| } catch (err: any) { | ||
| if (err.code === 'ENOENT') { | ||
| return {} |
There was a problem hiding this comment.
why do we return empty here?
| export class KubectlClient { | ||
| private kubeConfig: k8s.KubeConfig | ||
| private k8sApi: k8s.CustomObjectsApi | ||
| private eksCluster: any |
There was a problem hiding this comment.
Assign datatype instead of any?
laileni-aws
left a comment
There was a problem hiding this comment.
- Need internal team approval
- Need to add a changeLog
|
/retryBuilds |
|
Approved |
| try { | ||
| // Attempt to fetch EKS cluster details using AWS CLI | ||
| const region = connectionInfo.region || parse(connectionInfo.clusterArn).region | ||
| const { stdout } = await execFileAsync('aws', [ |
There was a problem hiding this comment.
Why are we using the CLI instead of a typescript SDK? This will fail if the user does not have cli installed.
There was a problem hiding this comment.
Ah, is this the "Deeplink" use case? If so can you clarify the UX we decided on.
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "type": "Feature", | |||
| "description": "We can connect to hyperpod spaces through toolkit but now user will be able to save their work in case of connection disruption as we now support reconnection." | |||
There was a problem hiding this comment.
Is the right wording here?
Kinda sounds like we are releasing connect to hyperpod spaces and that the user can manually save their work.
Using kiro:
"This update enhances HyperPod Space connectivity in the Toolkit by adding reconnection support. In the event of a connection disruption, users can now seamlessly reconnect to their existing session and resume work without losing in-progress changes."
|
/retryBuilds |
|
/retryBuilds |
Adding connect script to support connection and reconnection in windows
|
/retryBuilds |
|
/retryBuilds |
##Problem
Right now, we don't support reconnection from toolkit for hyperpod spaces.
##Solution
This PR will add the reconnection functionality which leads to seamless user experience.
The duplicate check is failing but we need that code at 2 places, one for initial connection and in detached-server so that when the user closes the main window, detached server is able to provide the seamless user experience.
##Notes
Tested the unit test cases and reconnection use cases end to end locally.
feature/xbranches will not be squash-merged at release time.