- Newest
- Most votes
- Most comments
Hello,
I understand that you are trying to set up a lifecycle configuration for the Code Editor app on the new Sagemaker Studio and would like to gather more information on the same.
Here, I would like to mention that I tried to replicate the scenario at my end; however, I was successfully able to install the extensions in my test environment, Sagemaker Studio Code Editor. I would request that you please go through the below steps that I followed on my end:
-
Open the Amazon SageMaker console and navigate to “Lifecycle Configurations.“.
-
On the Lifecycle Configuration page, navigate to Code Editor and try creating a new configuration with the below script.
#!/bin/bash
set -eux
sagemaker-code-editor —install-extension ms-python.pylint —extensions-dir /opt/amazon/sagemaker/sagemaker-code-editor-server-data/extensions
sagemaker-code-editor --install-extension dracula-theme.theme-dracula --extensions-dir /opt/amazon/sagemaker/sagemaker-code-editor-server-data/extensions
-
Now navigate to Sagemaker Domain and go to Environment Variables to attach this script and make it the default.
-
Now launch Sagemaker Studio.
-
Then create a new code editor and try running the instance (please make sure the lifecycle script is shown under the lifecycle configuration dropdown).
- Now I was successfully able to launch the code editor and see the extension from the left sidebar.
I would request that you please try this on your end and let us know how it goes for you.
If you have any difficulty or if you still run into issues, please reach out to AWS Support [1] (Sagemaker) along with your issue or use case in detail, and we would be happy to assist you further.
References:
=========
[1] Creating support cases and case management: https://docs.aws.amazon.com/awssupport/latest/user/case-management.html#creating-a-support-casehttps://docs.aws.amazon.com/awssupport/latest/user/case-management.html#creating-a-support-case
Just a possible alternative in case it's relevant, since the other answer isn't accepted yet... (but looks like a nice walkthrough!)
I am aware that customers running Windows computers have previously observed issues creating LCCs for (Linux-based) SageMaker Studio environments both through the AWS Console and their local text editors, due to CRLF vs LF line endings.
I notice the first line of your script is a shebang, so if you created it on Windows it's possible SageMaker is trying to run your script with the #!/bin/bash[CR] interpreter. Since that doesn't exist, I'd usually expect to result in an error along the lines of "bad interpreter: No such file or directory": Pretty close to what you've seen.
Not sure whether this past issue has been fixed already, or applies to your case, but if you're using Windows and still having issues with LCCs mysteriously breaking when they should work, I'd suggest maybe creating/uploading your LCCs from a Linux box via the CLI: Perhaps a SageMaker Notebook Instance outside your SM Domain?
Relevant content
- AWS OFFICIALUpdated a year ago
