Sagemaker Studio - Code Editor Lifecycle config

0

I'm attempting to set up a Lifecycle config for the Code Editor app on the new Sagemaker Studio service. At the moment I just want to install some extensions, and have been following this guide. This states

You can retrieve the extension name from the URL of the extension in the Open VSX Registry. The extension name to use in the sagemaker-code-editor command should contain all text that follows https://open-vsx.org/extension/ in the URL. Replace all instances of a slash (/) with a period (.). For example, AmazonEMR/emr-tools should be AmazonEMR.emr-tools.

The following simple config script works no problem

#!/bin/bash
set -eux
sagemaker-code-editor --install-extension ms-python.pylint --extensions-dir /opt/amazon/sagemaker/sagemaker-code-editor-server-data/extensions

But the following returns an error stdbuf: failed to run command ‘/opt/ml/lifecycleconfig/lifecycle_script.sh’: No such file or directory when I start the space.

#!/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

Can anyone explain or help shed some light on what's going on? I've tried various iterations - even trying to install the Dracula extension alone causes the same issue. Running this through the Sagemaker UI.

ah123
asked 15 days ago62 views
1 Answer
1

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:

  1. Open the Amazon SageMaker console and navigate to “Lifecycle Configurations.“.

  2. 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
  1. Now navigate to Sagemaker Domain and go to Environment Variables to attach this script and make it the default.

  2. Now launch Sagemaker Studio.

  3. Then create a new code editor and try running the instance (please make sure the lifecycle script is shown under the lifecycle configuration dropdown).

Enter image description here

  1. Now I was successfully able to launch the code editor and see the extension from the left sidebar.

Enter image description here

Enter image description here

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

AWS
answered 14 days ago
profile picture
EXPERT
reviewed 14 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions