Skip to content
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

sagemaker: Support new-style personal CfnSpace #28985

Open
2 tasks
athewsey opened this issue Feb 5, 2024 · 3 comments
Open
2 tasks

sagemaker: Support new-style personal CfnSpace #28985

athewsey opened this issue Feb 5, 2024 · 3 comments
Labels
@aws-cdk/aws-sagemaker Related to AWS SageMaker feature-request A feature should be added or improved. p3

Comments

@athewsey
Copy link

athewsey commented Feb 5, 2024

Describe the feature

CDK should support personal SageMaker Spaces (as introduced for re:Invent 2023) - not just the "classic" shared spaces currently supported by CfnSpace.

The current CfnSpace construct only seems to support some "classic" shared space types, not the full range.

Use Case

As described on the blog, Personal Spaces are now targeted as the default experience of SageMaker Studio, with the old 'Apps' platform still available in "Studio Classic".

We can already create SageMaker Domains and User Profiles within CDK, and would like to be able to create personal (JupyterLab, Code Editor, etc) Spaces for them in line with this change.

Proposed Solution

Update the model behind CfnSpace to align with the new broader capabilities of CloudFormation AWS::SageMaker::Space.

Other Information

If anybody has workarounds for creating a personal JupyterLab space until the L1 CfnSpace construct is updated, I'd appreciate it!

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.126.0

Environment details (OS name and version, etc.)

macOS Sonoma

@athewsey athewsey added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 5, 2024
@github-actions github-actions bot added the @aws-cdk/aws-sagemaker Related to AWS SageMaker label Feb 5, 2024
@pahud
Copy link
Contributor

pahud commented Feb 5, 2024

I believe CfnSpace is actually AWS::SageMaker::Space resource.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-space.html

I am not sure if Personal Spaces are supported in CFN. Did you find any document about that? Is it just to make the SharingType to Private?

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 5, 2024
@athewsey
Copy link
Author

athewsey commented Feb 6, 2024

Yes, can confirm Personal Spaces are supported in CFn because I've since been able to deploy one by making liberal use of CfnSpace.add_override(), something like:

personal_space = sagemaker_cdk.CfnSpace(
    self,
    "PersonalSpace",
    domain_id=studio_domain.domain_id,
    space_name=studio_user.name + "-space",
)
personal_space.add_override("Properties.SpaceSettings.AppType", "JupyterLab")
personal_space.add_override(
    "Properties.SpaceSettings.SpaceStorageSettings.EbsStorageSettings.EbsVolumeSizeInGb", 10
)
personal_space.add_override(
    "Properties.OwnershipSettings.OwnerUserProfileName", studio_user.name
)
personal_space.add_override("Properties.SpaceSharingSettings.SharingType", "Private")

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 6, 2024
@kaizencc
Copy link
Contributor

kaizencc commented Feb 6, 2024

Facts. I see SpaceSettingsProperty typed as such in the latest CDK:

  export interface SpaceSettingsProperty {
    /**
     * The JupyterServer app settings.
     *
     * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-space-spacesettings.html#cfn-sagemaker-space-spacesettings-jupyterserverappsettings
     */
    readonly jupyterServerAppSettings?: cdk.IResolvable | CfnSpace.JupyterServerAppSettingsProperty;

    /**
     * The KernelGateway app settings.
     *
     * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-space-spacesettings.html#cfn-sagemaker-space-spacesettings-kernelgatewayappsettings
     */
    readonly kernelGatewayAppSettings?: cdk.IResolvable | CfnSpace.KernelGatewayAppSettingsProperty;
  }

This looks like it was a recent update to the CloudFormation schema as a snapshot of the schema from ~2 weeks ago did not have these new properties. That means that we will naturally get the updated spec and release soon, either this week or next.

Look out for our next PR that looks like this: #28878. The comment diff should include the new properties you are looking for.

@pahud pahud changed the title aws_sagemaker: Support new-style personal CfnSpace sagemaker: Support new-style personal CfnSpace Jun 3, 2024
@pahud pahud added p3 and removed p2 labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-sagemaker Related to AWS SageMaker feature-request A feature should be added or improved. p3
Projects
None yet
Development

No branches or pull requests

3 participants