Upgrade the RStudio Version - Amazon SageMaker
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Upgrade the RStudio Version

Important

Custom IAM policies that allow Amazon SageMaker Studio or Amazon SageMaker Studio Classic to create Amazon SageMaker resources must also grant permissions to add tags to those resources. The permission to add tags to resources is required because Studio and Studio Classic automatically tag any resources they create. If an IAM policy allows Studio and Studio Classic to create resources but does not allow tagging, "AccessDenied" errors can occur when trying to create resources. For more information, see Provide Permissions for Tagging SageMaker Resources.

Amazon Managed Policies for Amazon SageMaker that give permissions to create SageMaker resources already include permissions to add tags while creating those resources.

This guide provides information about the 2023.03.2-547.pro5 version update for RStudio on SageMaker. Starting February 27, 2024, new domains with RStudio support are created with Posit Workbench version 2023.03.2-547.pro5. This applies to the RStudioServerPro applications and default RSessionGateway applications.

The following sections give information about the 2023.03.2-547.pro5 release.

Latest version updates

The patch version 2023.03.2-547.pro5 release includes the following change:

  • Fixed intermittent RServer crash when joining an RSession that was started with the job launcher and is not immediately available.

The latest RStudio version is 2023.03.2-454.pro2. This version includes the following changes:

  • Added RTools 4.3 support

  • Added support for R 4.3

  • Upgraded Quarto to 1.2.335

  • Improved session management

For more information about the changes in this release, see https://docs.posit.co/ide/news/.

Note

If you see the following warning, there is a version mismatch between the RSession and the Posit Workbench version used in RStudio on SageMaker. To resolve this issue, update the RStudio version for the domain. For information about updating the RStudio version, see Upgrade to the new version. Despite this warning, versions 2023.03.2-547.pro5 and 2023.03.2-454.pro2 are compatible images.

Session version 2023.03.2+454.pro2 does not match server version 2023.03.3-547.pro5 - this is an unsupported configuration, and you may experience unexpected issues as a result.

Versioning

There are currently two versions of Posit Workbench supported by SageMaker.

  • Latest version supported: 2023.03.2-547.pro5

  • Previous version supported: 2022.02.2-485.pro2

The default Posit Workbench version that's selected by SageMaker depends on the creation date of the domain.

  • For domains created after February 27, 2024, version 2023.03.2-547.pro5 is the default selected version.

  • For domains created after June 27, 2023 and before February 27, 2024, version 2023.03.2-454.pro2 is the default selected version. You can update your domains to the latest version (2023.03.2-547.pro5) by setting it as the default version for the domain. For more information, see Upgrade to the new version.

  • For domains created before June 27, 2023, version 2022.02.2-485.pro2 is the default selected version. You can update your domains to the latest version (2023.03.2-547.pro5) by setting it as the default version for the domain. For more information, see Upgrade to the new version.

Note

The default RSessionGateway application version matches the current version of the RStudioServerPro application.

The following table lists the image ARNs for both versions for each Amazon Web Services Region. These ARNs are passed as part of an update-domain command to set the desired version.

Region 2022.02.2-485.pro2 Image ARN 2023.03.2-547.pro5 Image ARN
us-east-1 arn:aws:sagemaker:us-east-1:081325390199:image/rstudio-workbench-2021.08 arn:aws:sagemaker:us-east-1:081325390199:image/rstudio-workbench-2023.03
us-east-2 arn:aws:sagemaker:us-east-2:429704687514:image/rstudio-workbench-2021.08 arn:aws:sagemaker:us-east-2:429704687514:image/rstudio-workbench-2023.03
us-west-1 arn:aws:sagemaker:us-west-1:742091327244:image/rstudio-workbench-2021.08 arn:aws:sagemaker:us-west-1:742091327244:image/rstudio-workbench-2023.03
us-west-2 arn:aws:sagemaker:us-west-2:236514542706:image/rstudio-workbench-2021.08 arn:aws:sagemaker:us-west-2:236514542706:image/rstudio-workbench-2023.03
af-south-1 arn:aws:sagemaker:af-south-1:559312083959:image/rstudio-workbench-2021.08 arn:aws:sagemaker:af-south-1:559312083959:image/rstudio-workbench-2023.03
ap-east-1 arn:aws:sagemaker:ap-east-1:493642496378:image/rstudio-workbench-2021.08 arn:aws:sagemaker:ap-east-1:493642496378:image/rstudio-workbench-2023.03
ap-south-1 arn:aws:sagemaker:ap-south-1:394103062818:image/rstudio-workbench-2021.08 arn:aws:sagemaker:ap-south-1:394103062818:image/rstudio-workbench-2023.03
ap-northeast-2 arn:aws:sagemaker:ap-northeast-2:806072073708:image/rstudio-workbench-2021.08 arn:aws:sagemaker:ap-northeast-2:806072073708:image/rstudio-workbench-2023.03
ap-southeast-1 arn:aws:sagemaker:ap-southeast-1:492261229750:image/rstudio-workbench-2021.08 arn:aws:sagemaker:ap-southeast-1:492261229750:image/rstudio-workbench-2023.03
ap-southeast-2 arn:aws:sagemaker:ap-southeast-2:452832661640:image/rstudio-workbench-2021.08 arn:aws:sagemaker:ap-southeast-2:452832661640:image/rstudio-workbench-2023.03
ap-northeast-1 arn:aws:sagemaker:ap-northeast-1:102112518831:image/rstudio-workbench-2021.08 arn:aws:sagemaker:ap-northeast-1:102112518831:image/rstudio-workbench-2023.03
ca-central-1 arn:aws:sagemaker:ca-central-1:310906938811:image/rstudio-workbench-2021.08 arn:aws:sagemaker:ca-central-1:310906938811:image/rstudio-workbench-2023.03
eu-central-1 arn:aws:sagemaker:eu-central-1:936697816551:image/rstudio-workbench-2021.08 arn:aws:sagemaker:eu-central-1:936697816551:image/rstudio-workbench-2023.03
eu-west-1 arn:aws:sagemaker:eu-west-1:470317259841:image/rstudio-workbench-2021.08 arn:aws:sagemaker:eu-west-1:470317259841:image/rstudio-workbench-2023.03
eu-west-2 arn:aws:sagemaker:eu-west-2:712779665605:image/rstudio-workbench-2021.08 arn:aws:sagemaker:eu-west-2:712779665605:image/rstudio-workbench-2023.03
eu-west-3 arn:aws:sagemaker:eu-west-3:615547856133:image/rstudio-workbench-2021.08 arn:aws:sagemaker:eu-west-3:615547856133:image/rstudio-workbench-2023.03
eu-north-1 arn:aws:sagemaker:eu-north-1:243637512696:image/rstudio-workbench-2021.08 arn:aws:sagemaker:eu-north-1:243637512696:image/rstudio-workbench-2023.03
eu-south-1 arn:aws:sagemaker:eu-south-1:592751261982:image/rstudio-workbench-2021.08 arn:aws:sagemaker:eu-south-1:592751261982:image/rstudio-workbench-2023.03
sa-east-1 arn:aws:sagemaker:sa-east-1:782484402741:image/rstudio-workbench-2021.08 arn:aws:sagemaker:sa-east-1:782484402741:image/rstudio-workbench-2023.03

Upgrade to the new version

Existing domains using version 2022.02.2-485.pro2 or 2023.03.2-454.pro2 can upgrade to 2023.03.2-547.pro5 version in one of two ways:

  • Create a new domain from the Amazon CLI with RStudio enabled.

  • Update an existing domain to use the 2023.03.2-547.pro5 version.

The following procedure shows how to delete the RStudio application for an existing domain, set the default version to 2023.03.2-547.pro5, and then create an RStudio application.

  1. Delete the RStudioServerPro application and all RSessionGateway applications associated with your existing domain. For information about how to find your domain ID, see View domains. For more information about deleting applications, see Shut down and restart RStudio.

    aws sagemaker delete-app \ --region region \     --domain-id domainId \     --user-profile-name domain-shared \     --app-type RStudioServerPro \     --app-name default
  2. If your domain is using RStudio version 2022.02.2-485.pro2, update the domain to set 2023.03.2-547.pro5 as the default Posit Workbench version. The SageMakerImageArn value in the following update-domain command specifies the RStudio 2023.03.2-547.pro5 version as the default. This ARN must match the Region that your domain is in. For a list of all available ARNs, see Versioning.

    Pass an execution role ARN for the domain that provides permissions to update the domain.

    aws sagemaker update-domain \ --region region \ --domain-id domainId \ --domain-settings-for-update "{\"RStudioServerProDomainSettingsForUpdate\":{\"DefaultResourceSpec\": {\"SageMakerImageArn\": \"arn-for-2023.03.2-547.pro5-version\", \"InstanceType\": \"system\"}, \"DomainExecutionRoleArn\": \"execution-role-arn\"}}"
  3. Create a new RStudioServerPro application in the existing domain.

    aws sagemaker create-app \ --region region     --domain-id domainId \     --user-profile-name domain-shared \     --app-type RStudioServerPro \     --app-name default

Your RStudioServerPro application is now updated to version 2023.03.2-547.pro5. You can now relaunch your RSessionGateway applications.

Downgrade to the existing version

You can manually downgrade the version of your existing RStudio application to the 2022.02.2-485.pro2 version.

To downgrade to the existing version
  1. Delete the RStudioServerPro application that's associated with your existing domain. For information about how to find your domain ID, see View domains.

    aws sagemaker delete-app \     --domain-id domainId \     --user-profile-name domain-shared \     --app-type RStudioServerPro \     --app-name default
  2. Pass the corresponding 2022.02.2-485.pro2 ARN for your Region as part of the update-domain command. For a list of all available ARNs, see Versioning. You must also pass an execution role ARN for the domain that provides permissions to update the domain.

    aws sagemaker update-domain \ --region region \ --domain-id domainId \ --domain-settings-for-update "{\"RStudioServerProDomainSettingsForUpdate\":{\"DefaultResourceSpec\": {\"SageMakerImageArn\": \"arn-for-2022.02.2+485.pro2-version\", \"InstanceType\": \"system\"}, \"DomainExecutionRoleArn\": \"execution-role-arn\"}}"
  3. Create a new RStudioServerPro application in the existing domain. The RStudio version defaults to 2022.02.2-485.pro2.

    aws sagemaker create-app \     --domain-id domainId \     --user-profile-name domain-shared \     --app-type RStudioServerPro \     --app-name default

Your RStudioServerPro application is now downgraded to version 2022.02.2-485.pro2.

Changes to BYOI Images

If you use a BYOI image with RStudio and update your RStudioServerPro version to 2023.03.2-547.pro5, you must upgrade your custom images to use the 2023.03.2-547.pro5 release and redeploy your existing RSessions. If you attempt to load a non-compatible image in an RSession of a domain using the 2023.03.2-547.pro5 version, the RSession fails because it cannot parse parameters that it receives. To prevent failure, update all of the deployed custom images in your existing RStudioServerPro application.

The RSW_VERSION in the Dockerfile must be consistent with the Posit Workbench version used in RStudio on SageMaker. You can validate the current version in Posit Workbench. To do so, use the version name that's located in the lower left corner of the Posit Workbench launcher page.

... ARG RSW_VERSION=2023.03.3-547.pro5 ENV RSTUDIO_FORCE_NON_ZERO_EXIT_CODE="1" ARG RSW_NAME=rstudio-workbench ARG OS_CODE_NAME=bionic ARG RSW_DOWNLOAD_URL=https://s3.amazonaws.com/rstudio-ide-build/server/${OS_CODE_NAME}/amd64 RUN RSW_VERSION_URL=`echo -n "${RSW_VERSION}" | sed 's/+/-/g'` \ && curl -o rstudio-workbench.deb ${RSW_DOWNLOAD_URL}/${RSW_NAME}-${RSW_VERSION_URL}-amd64.deb \ && gdebi -n ./rstudio-workbench.deb
Note

If you see the following warning, there is a version mismatch between the RSW_VERSION and the Posit Workbench version used in RStudio on SageMaker. Despite this warning, versions 2023.03.2-547.pro5 and 2023.03.2-454.pro2 are compatible images.

Session version 2023.03.2+454.pro2 does not match server version 2023.03.3-547.pro5 - this is an unsupported configuration, and you may experience unexpected issues as a result.