With SAS for Containers on Domino, users can readily launch multiple SAS environments to create SAS programs, models, and application in the familiar SAS Studio. SAS for Containers on Domino eases management for IT, and accelerates model development data science teams.
To use a SAS workspace, your administrator must configure a compute environment and interactive workspace for you. Once configured, you can switch your project to the SAS-enabled environment.
Contact your Domino representative for more information about configuring SAS workspaces on Domino.
Learn how to build SAS as a container. The following instructions are similar to the official SAS instructions for containerization, but with a few key differences specific to Domino. To learn about the benefits of running SAS as a container, see SAS: Build and run a container.
In this guide you learn how to:
-
Get your SAS license
-
Create a TAR file of SAS Studio.
-
Create a Docker image that includes:
-
SAS Studio TAR file
-
Dockerfile with instructions to build the Docker image.
-
Startup script provided by Domino
-
-
Use the Docker image to create pluggable workspaces in Domino.
-
Optional: Persist SAS preferences and add-ons.
To use a SAS workspace in Domino, you must have a valid SAS license file.
-
Go to
my.sas.com
to download the license file. -
Save the license file securely, you will use the license file to build the SAS docker image later.
Bundle SAS Studio in a TAR file to run in your Docker container.
-
Run the SAS Deployment Wizard to install SAS Studio on a Linux machine with the same version and distribution as the Domino compute environment that you want to run the SAS container on.
-
During the installation, change the default location for the SAS Studio installation to
/usr/local/SASHome
. -
Manually create a TAR file of SAS Studio that includes the
SASHome
directory.tar — cvf SASHomeTar.tar /usr/local/SASHome
.
The Dockerfile instructions must include the command to download and apply the valid SAS license file. The license file must be hosted on a server accessible through an HTTP request from the Domino cluster. When building the environment image, this file must be available to the build host without authentication restrictions.
Enter the following command in your Dockerfile Instructions:
`RUN apply-license <url_to_license_file>`
Base64 example
`ENV SAS_LICENSE=”UgbWFnbmEgYWx...pcXVhLgo=”`
`RUN apply-license $SAS_LICENSE`
Project file example
In your Pre Run Script:
`apply-license /mnt/my-sas-license.jwt`
Create a start script in your Docker image to start SAS Studio.
The following start script is a basic example, reach out to your Domino representative for guidance on creating a start script to suit your specific needs.
#!/usr/bin/env bash
set -o errexit -o pipefail
# Update SAS Settings to start in Domino project directory
sed -i "s#webdms.customPathRoot=#webdms.customPathRoot=$DOMINO_WORKING_DIR#g" \
/usr/local/SASHome/SASStudioBasic/3.8/war/config/config.properties
# Set the prefix path to the SAS web service
PREFIX_PATH="${DOMINO_PROJECT_OWNER}/${DOMINO_PROJECT_NAME}/notebookSession/${DOMINO_RUN_ID}"
PREFIX_FILE="${DOMINO_PROJECT_OWNER}#${DOMINO_PROJECT_NAME}#notebookSession#${DOMINO_RUN_ID}"
sed -i "s#path=\"/SASStudio\"#path=\"/${PREFIX_PATH}\"#g" /usr/local/SASHome/sas/appserver/studio/conf/Catalina/localhost/SASStudio.xml
mv /usr/local/SASHome/sas/appserver/studio/conf/Catalina/localhost/SASStudio.xml \
"/usr/local/SASHome/sas/appserver/studio/conf/Catalina/localhost/${PREFIX_FILE}#SASStudio.xml"
# Start SAS Studio and keep the container alive while it runs
sudo -E bash -c "/usr/local/SASHome/sas/sasstudio.sh start && while true ; do :; sleep 60 ; done"
Create the Docker image in a repository that Domino can access that includes the following:
-
SAS Studio TAR file
-
Domino-provided start up script
-
Dockerfile with instructions
Paste the following code into Pluggable Workspace Tools to enable the SAS workspace.
sas:
title: "SAS"
iconUrl: "https://upload.wikimedia.org/wikipedia/commons/1/10/SAS_logo_horiz.svg"
start: [ "/opt/domino/workspaces/sas/start" ]
httpProxy:
internalPath: "/{{ownerUsername}}/{{projectName}}/{{sessionPathComponent}}/{{runId}}/SASStudio/"
port: 8888
rewrite: false
requireSubdomain: false
To persist your SAS Studio preferences between Domino sessions, you can define a Post Run Script to automatically copy them to your Project Files when you Stop and Sync a session, and define a Pre Run Script to copy them from your Project Files into locations that SAS Studio recognizes at the start of subsequent sessions.
-
Add the following lines in the Pre Run Script.
# Copy preferences to workspace PREFS_DIR="$DOMINO_WORKING_DIR/.sasstudio5" mkdir -p $PREFS_DIR rsync -rpq $PREFS_DIR $HOME
-
Add the following lines in the Post Run Script.
# Copy preferences from workspace PREFS_DIR="$HOME/.sasstudio5" mkdir -p $PREFS_DIR rsync -rpq $PREFS_DIR $DOMINO_WORKING_DIR
These scripts save add-ons per project, so collaborators launching a workspace in the same project will have the same add-ons. However, the scripts save preferences per user in the project so that each user can have a different set of preferences.