Skip to content

Conversation

@kzr-at-amazon
Copy link
Contributor

Problem

Upgrading Space from Toolkit from ml.t3.medium to ml.t3.large does not update the Space properties. It only creates a new app with the updated instance type.

Solution

Make sure to update Space before creating App when it is needed

Testing

Verified that the it does not overwrite the the missing props. Diff link https://diff.corp.amazon.com/compare/54b0ofvc

  • before updating space
sagemaker-user@default:~$ aws sagemaker describe-space --domain-id d-rxs4hhmzrnho  --space-name ce 
{
    "DomainId": "d-rxs4hhmzrnho",
    "SpaceArn": "arn:aws:sagemaker:us-east-2:050752642559:space/d-rxs4hhmzrnho/ce",
    "SpaceName": "ce",
    "Status": "InService",
    "LastModifiedTime": "2025-10-13T21:21:00.933000+00:00",
    "CreationTime": "2025-09-08T20:58:08.976000+00:00",
    "SpaceSettings": {
        "CodeEditorAppSettings": {
            "DefaultResourceSpec": {
                "SageMakerImageArn": "arn:aws:sagemaker:us-east-2:137914896644:image/sagemaker-distribution-cpu",
                "SageMakerImageVersionAlias": "2.8",
                "InstanceType": "ml.t3.medium"
            },
            "AppLifecycleManagement": {
                "IdleSettings": {
                    "IdleTimeoutInMinutes": 60
                }
            }
        },
        "AppType": "CodeEditor",
        "SpaceStorageSettings": {
            "EbsStorageSettings": {
                "EbsVolumeSizeInGb": 16
            }
        },
        "CustomFileSystems": [
            {
                "S3FileSystem": {
                    "S3Uri": "s3://amazon-sagemaker-050752642559-us-east-2-63f9df3f396b/dzd_bh80g0fbj1h7xl/c1wqm5rlzb150p/shared"
                }
            }
        ],
        "RemoteAccess": "DISABLED"
    },
    "OwnershipSettings": {
        "OwnerUserProfileName": "915b9590-a081-704d-8914-0e482edfb1ef"
    },
    "SpaceSharingSettings": {
        "SharingType": "Private"
    },
    "Url": "https://y89msnjovs0fqgr.studio.us-east-2.sagemaker.aws/codeeditor/default"
}

After updating space:

sagemaker-user@default:~$ aws sagemaker describe-space --domain-id d-rxs4hhmzrnho  --space-name ce 
{
    "DomainId": "d-rxs4hhmzrnho",
    "SpaceArn": "arn:aws:sagemaker:us-east-2:050752642559:space/d-rxs4hhmzrnho/ce",
    "SpaceName": "ce",
    "Status": "InService",
    "LastModifiedTime": "2025-10-13T21:28:28.870000+00:00",
    "CreationTime": "2025-09-08T20:58:08.976000+00:00",
    "SpaceSettings": {
        "CodeEditorAppSettings": {
            "DefaultResourceSpec": {
                "SageMakerImageArn": "arn:aws:sagemaker:us-east-2:137914896644:image/sagemaker-distribution-cpu",
                "SageMakerImageVersionAlias": "2.8",
                "InstanceType": "ml.t3.large"
            },
            "AppLifecycleManagement": {
                "IdleSettings": {
                    "IdleTimeoutInMinutes": 60
                }
            }
        },
        "AppType": "CodeEditor",
        "SpaceStorageSettings": {
            "EbsStorageSettings": {
                "EbsVolumeSizeInGb": 16
            }
        },
        "CustomFileSystems": [
            {
                "S3FileSystem": {
                    "S3Uri": "s3://amazon-sagemaker-050752642559-us-east-2-63f9df3f396b/dzd_bh80g0fbj1h7xl/c1wqm5rlzb150p/shared"
                }
            }
        ],
        "RemoteAccess": "ENABLED"
    },
    "OwnershipSettings": {
        "OwnerUserProfileName": "915b9590-a081-704d-8914-0e482edfb1ef"
    },
    "SpaceSharingSettings": {
        "SharingType": "Private"
    },
    "Url": "https://y89msnjovs0fqgr.studio.us-east-2.sagemaker.aws/codeeditor/default"
}

  • 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.

@kzr-at-amazon kzr-at-amazon requested a review from a team as a code owner October 13, 2025 21:49
@amazon-inspector-ohio
Copy link

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

@amazon-inspector-ohio
Copy link

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

@kzr-at-amazon kzr-at-amazon changed the title update space before creating new app if space setting is changed fix(smus): update space before creating new app if space setting is changed Oct 13, 2025
// Get app resource spec
const requestedResourceSpec =
appType === 'JupyterLab'
appType === AppType.JupyterLab
Copy link
Contributor

Choose a reason for hiding this comment

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

This is still prone to errors if someone updates the appTypeSettingsMap but does not update this condition. But fine for now. Ideal change would have been to use a case condition here as well.

@github-actions
Copy link

  • 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.

Copy link
Contributor

@laileni-aws laileni-aws left a comment

Choose a reason for hiding this comment

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

Do you think, this requires a changeLog?

@kzr-at-amazon
Copy link
Contributor Author

Added the changelog.

@laileni-aws laileni-aws merged commit 4f90bc6 into aws:master Oct 15, 2025
30 of 31 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.

4 participants