Skip to content

fix(sagemaker): Removed the dependency on AWS CLI#8703

Merged
branrin merged 8 commits intoaws:masterfrom
msgupta-amazon:parker-listing-windows
Apr 8, 2026
Merged

fix(sagemaker): Removed the dependency on AWS CLI#8703
branrin merged 8 commits intoaws:masterfrom
msgupta-amazon:parker-listing-windows

Conversation

@msgupta-amazon
Copy link
Copy Markdown
Contributor

@msgupta-amazon msgupta-amazon commented Mar 31, 2026

Problem

The listing functionality for parker does not work on windows. The root cause for the same was the dependency we had on AWS CLI which was our initial assumption while implementing Parker but after some discussions, we are aligned on that this won't be the case all the time and therefore we are removing the dependency of AWS CLI from our code base.

Solution

We have removed the dependency on AWS CLI while listing the dev spaces and establishing connections.
Please review this PR as well which covers unit test cases for the same.
https://github.com/msgupta-amazon/aws-toolkit-vscode/pull/2/changes

As per the current architecture for supporting connections in sagemaker the duplicate code check is failing. The code duplicated is less than 15 code lines and are required.


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@msgupta-amazon msgupta-amazon requested a review from a team as a code owner March 31, 2026 23:02
@amazon-inspector-ohio
Copy link
Copy Markdown

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@github-actions
Copy link
Copy Markdown

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@amazon-inspector-ohio
Copy link
Copy Markdown

✅ I finished the code review, and didn't find any security or code quality issues.

const status = body.status
const presignedUrl = status?.workspaceConnectionUrl
const connectionType = status?.workspaceConnectionType
const token = status?.tokenValue ?? ''
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if token and session are empty, how does this affect connection?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the response in the comment in the code.

@aws-ajangg
Copy link
Copy Markdown
Contributor

what kind of testing have we completed?

@msgupta-amazon
Copy link
Copy Markdown
Contributor Author

We have completed the basic testing of the feature

@msgupta-amazon msgupta-amazon force-pushed the parker-listing-windows branch from 4d2b5a0 to 76f7cef Compare April 1, 2026 19:28
@msgupta-amazon msgupta-amazon changed the title feat(sagemaker): Removed the dependency on AWS CLI fix(sagemaker): Removed the dependency on AWS CLI Apr 1, 2026
@msgupta-amazon msgupta-amazon force-pushed the parker-listing-windows branch from cce572d to 07b9942 Compare April 1, 2026 20:44
@msgupta-amazon msgupta-amazon requested a review from a team as a code owner April 2, 2026 18:47
Copy link
Copy Markdown

@sgganjo sgganjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Do we also need a changelog entry since this is a fix

@msgupta-amazon
Copy link
Copy Markdown
Contributor Author

Added the changelog entry

@aws-ajangg
Copy link
Copy Markdown
Contributor

can we fix ci for lint dup code

@msgupta-amazon
Copy link
Copy Markdown
Contributor Author

It will be there as we have some test cases for the functionality in detached-server and then in normal directory as well.

@aws-ajangg
Copy link
Copy Markdown
Contributor

aws-ajangg commented Apr 6, 2026

can we move to shared or utils in detached-server and import to kubectlClient test? same thing we do for any shared code btwn detached-server and the rest of the directory

@msgupta-amazon
Copy link
Copy Markdown
Contributor Author

We have already removed the duplicate code during implementation by using the above approach.
Right now, only the code in test cases which is responsible for generating tokens is getting duplicated which is necessary before the tests execution and should not be a blocker here.

@aws-ajangg
Copy link
Copy Markdown
Contributor

aws-ajangg commented Apr 7, 2026

What does basic testing entail? Has anyone tested your vsix for confirmation or have we conducted a bug bash? This implementation changes how the listing feature obtains credentials so I think we should have extensive testing coverage. This change is intended for Windows but will also apply for macOS so have we tested that edge case? Have we tried testing on fresh slate to replicate assuming the role of a new customer?

@msgupta-amazon msgupta-amazon force-pushed the parker-listing-windows branch from 5e99897 to 93d4ce9 Compare April 7, 2026 20:43
@msgupta-amazon
Copy link
Copy Markdown
Contributor Author

@aws-ajangg I have shared with the team earlier. I think you missed it. Extensive testing is been done to verify the feature in both the environments and sanity testing is also completed.

Comment on lines +90 to +93
$jsonObj = @{ streamUrl = $streamUrl; tokenValue = $token; sessionId = $sessionId }
$jsonStr = $jsonObj | ConvertTo-Json -Compress
$envVarName = "AWS_SSM_START_SESSION_RESPONSE"
$env:AWS_SSM_START_SESSION_RESPONSE = $jsonStr
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: why do we need to make this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After removing the AWS CLI dependency, connection started failing due to quoting/escaping rules of powershell and hence we made the change to resolve the issue.

Comment on lines +37 to +40
headers: {
host: `sts.${region}.amazonaws.com`,
'x-k8s-aws-id': clusterName,
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have the typescript AWS SDK, why we do this http based access?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This underlying uses @smithy/signature-v4 and @smithy/protocol-http which are part of the AWS SDK v3. EKS token generation requires presigning an STS GetCallerIdentity request, and the JS SDK v3 doesn't have a higher-level API for this — it's the same approach aws eks get-token uses under the hood.

@branrin branrin merged commit c5d2d61 into aws:master Apr 8, 2026
25 of 29 checks passed
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.

6 participants