-
Notifications
You must be signed in to change notification settings - Fork 194
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
winglibs/sagemaker doesn't work with aws sso login
#5684
Comments
so to understand what's the goal here: You wanna run this locally in the simulator (or as a test) with an active AWS SSO session. And the compiled wing handlers are not picking up the credentials from the SSO session, right? Don't know of the top of my head, but happy to look into this. Skimming through the linked issues, these suggest that it might be due to some incompatible fields in the aws config file. Another thought I just had was, that maybe esbuild bundling might be interfering here. Can look deeper into this later today / tomorrow. Is there a full code example somewhere? |
Yes the goal is to run this in the simulator (not test, test should use a mock) on interactive development with an active SSO session.
It is basically https://github.com/winglang/winglibs/tree/main/sagemaker
It might be the @tsuf239 will work on it, I am not sure. Lets see what @ainvoner / @staycoolcall911 have to say about this. |
Just looked into this a bit. The bundled code contains the relevant credential providers. To confirm, I changed the function in this example to https://github.com/winglang/winglibs/blob/main/sagemaker/sagemaker.test.w
where the
after doing a sign in via My guess would be, that the SSO setup is either outdated (try upgrading the AWS CLI and see if a login works) or perhaps the SSO session is broken for some reason. A quick check could be if If that's all not helping, we'd need more information about the environment. Also, I'd probably try to write a minimal nodejs script which does the similar thing without wing to see if that's working. |
Besides from the things mentioned above: Perhaps it would be worthwhile if the simulator would pass through relevant wing/libs/wingsdk/src/shared/sandbox.ts Line 39 in c4e9312
|
aws sso login
aws sso login
I have the aws sso config setup in the same way as @skorfmann. The profile works correctly when I call It works when I run it as a test, but not when I invoke in the simulator. To elaborate: Works fine: Doesn't work: The code for main.w is below.
aws --version output: Installed wing modules: |
hm, interesting.
Perhaps an OS issue, since I'm on macOS. What's your exact setup, we could try to reproduce it then more easily. |
Below are some details. Let me know if you need anything else? $wsl --version $node --version $npm list |
Thanks, I think this should be enough to reproduce. |
I'm getting the same error on my windows machine after configuring the sso:
Error:
|
@polamoros @marciocadev thanks for taking the time to reproduce this issue. Looks like this is particularily related to the standard AWS SSO setup on windows. @marciocadev was able to get a valid session (see here via https://www.leapp.cloud/ A workaround could be, to export the temporary SSO credentials in the environment before starting the wing console, e.g with this command
and then explicitly pass along the following variables in the function definition.
Implementing this issue #5738 would streamline this even further. For an actual fix, we'll need to dive deeper into the mechanics of how wing and the js aws sdk plays together on Windows in the context of SSO. |
@bencaldwell , can you check the following workaround: % $(aws configure export-credentials --format env) && wing run And making sure we pass:
to the Here is the complete code:
@skorfmann, FYI |
|
Thanks @ekeren and @skorfmann that works! |
@tsuf239 FYI |
I tried this:
As reported by @bencaldwell.
When trying to use winglibs/sagemaker with sso based login
Notice that we also used
AWS_PROFILE
andAWS_REGION
This happened:
could not load credentials from any providers
I expected this:
To invoke the model
Is there a workaround?
No response
Anything else?
It seems that the auth in
winglibs/sagemaker
andwinglibs/bedrock
, doesn't work with short lived TOKENThere are some reference to this in the following tickets (although I am not sure if this is related)
aws configure sso
aws/aws-cdk#27265 (comment)Wing Version
0.57.22
Node.js Version
No response
Platform(s)
No response
Community Notes
The text was updated successfully, but these errors were encountered: