BookmarkSubscribeRSS Feed

How to run SAS Viya products in Google Cloud Platform (GCP)

Started ‎09-22-2017 by
Modified ‎09-22-2017 by
Views 7,113

I hear that question and wonder why people would ask. SAS Viya products can be installed on a virtual machine (VM) that meets the software requirements.  Google Cloud Platform (GCP) has an Infrastructure as a Service (IaaS) capability, Google Compute Engine (GCE), which can create a VM instance with the required OS and resources for SAS Viya products.  So what is the issue?

 

But the question is really “how can GCP make the SAS Viya product deployments easier” to allow me to go from zero to running the SAS solution in GCP.

 

This post takes you through the steps on how to achieve this goal. Keep in mind this is a simple deployment, not focused on creating a production environment.  This environment does not include the required security considerations necessary to protect your environment and your assets.  In addition, prior to deploying SAS Viya product, an infrastructure-sizing exercise should be performed so your environment meets your performance expectations.

 

To be able to go from zero to running, we have to look at SAS Viya products’ install and configuration capabilities. If this is not easily automatable, then we would be stuck.  SAS designed the SAS Viya products to use Ansible, open-source automation engine, which installs and configures the SAS Viya product on one or more operating systems.  Now that we can automate the software deployment, what about the cloud deployment?

 

With Google, GCP has a Cloud Deployment Manager capability which allows you to create a template of the whole deployment so you can use one command to standup everything. But I did something even simpler with GCP and used the Google Cloud Shell with the Google Cloud APIs.  The Google Cloud APIs provide simple commands to create GCP objects and execute commands inside GCE instances.

 

With SAS using Ansible and Google Cloud APIs, I can easily automate the deployment of a SMP and MPP SAS Viya product from zero to running with a few simple steps. Below are the detailed steps to automate SAS Visual Data Mining and Machine Learning (VDMML) in Google.   I started with no VM(s) and about 30 mins later I had a running ready to use VDMML Visual system.

 

Step 1 - Pre-Steps

These are items that need to be done to allow for end-to-end automation of the SAS Viya product in Google Cloud allowing the resulting deployment be a system ready for users to access.

  1. Software Order Email (SOE) – A SAS Viya product order from SAS.  Please contact your sales rep.
  2. LDAP – SAS Viya products require an LDAP for the Visual interfaces. This is documenting your LDAP configuration information in a sitedefault.yml file, SAS Viya deployment configuration script, so the deployment will configure the software to the LDAP.
  3. SAS deployment script – Script that tweaks the OS from missing pre-requirements, install Ansible, and run the SAS Viya product Ansible playbook.  This is simply automating the few commands noted in the SAS Viya deployment guide.  This would automate the SSSD configuration with the LDAP on the OS (nsswitch and pam) for SAS Studio security, which is optional.  Please talk with SAS if you would like to see an example.

Some SAS people might be asking, what about the SAS Software Depot? With SAS Viya products, we moved this to a RPM repository that is on the internet.  Now, GCE instances can go directly to SAS to pull down the specific packages needed versus setting up a special local SAS Software Depot.  Note, you can create a mirror RPM repository, similar to other repositories like RedHat, and point the deployment to use the mirror (please refer to the SAS Deployment Guide for more details on how to create a mirror repository).

 

Here is a screen shot of my GCP project where I just created one instance for my LDAP:

startGood.png

 

Step 2 – Storing Files in Google Cloud Platform Storage

To automate the deployment in Google Cloud, we use the GCP Storage bucket for all the files the automation pushes into the GCP Compute Engine instances. The user would create a Google Cloud Platform Storage bucket and place the following files:

  1. SAS Ansible Playbook (SAS_Viya_playbook.tgz) - SAS Playbook file from the SOE
  2. LDAP configuration file (sitedefault.yml) - LDAP properties for the SAS Viya environment to use and configured by the SAS playbook.  Note, it is recommend to add the administrator property so you don't need to use "sasboot".
  3. SAS deployment script (e.g. SASDeploy.sh) – Custom script you create to tweak the OS, install Ansible, run the SAS playbook.  Basically a simple cut and paste commands from the SAS Deployment Guide for SAS Viya product.

Here is a screen shot of my GCP Storage bucket with the files:

storage.png

 

Step 3 - Google Cloud API commands

In the Google Cloud Shell, you will access the Google Cloud SDK for Cloud APIs or you can install the Google Cloud SDK on your own system. The following commands are how you can deploy a SMP or MPP VDMML environment with Google Cloud APIs:

# Create instance and wait to running
gcloud compute instances create "${instanceName}" --zone "us-east1-c" \
--machine-type "n1-standard-32" --subnet "default" --tags "https-server" \
--image "rhel-6-v20170829" --image-project "rhel-cloud" --boot-disk-size "200"\
--boot-disk-type "pd-ssd" --boot-disk-device-name "${instanceName}"

# Move files from Google Storage bucket into the GCE instances
# Copy the SAS playbook and uncompress the file so it is ready to be use:
gcloud compute ssh ${instanceName} --zone us-east1-c --command \
"gsutil cp gs://${gstorageLoc}/SAS_Viya_playbook.tgz ~/SAS_Viya_playbook.tgz;tar xzvf ~/SAS_Viya_playbook.tgz"

# Copy the LDAP configuration file to the appropriate directory
gcloud compute ssh ${instanceName} --zone us-east1-c --command \
"gsutil cp gs://${gstorageLoc}/sitedefault.yml ~/sas_viya_playbook/roles/consul/files/sitedefault.yml"

# Copy the SAS deployment script and make it executable on the OS
gcloud compute ssh ${instanceName} --zone us-east1-c --command \
"gsutil cp gs://${gstorageLoc}/SASDeploy.sh ~/SASDeploy.sh;chmod 777 ~/SASDeploy.sh"

# Execute the SAS deployment script
gcloud compute ssh ${instanceName} --zone us-east1-c --command "~/SASDeploy.sh"

 

Resulting deployment in GCP: results.png

   

Note, some tweaks for MPP deployment:

  1. You would need to call “gcloud compute instances create” multiple times to create the instances. This can easily be done in a loop, just make sure to remember the instance names for the SAS deployment script.
  2. Use the Google Cloud API user for the ansible multi-machine install, so we need to setup passwordless ssh for that user by copying the private key to the main instance.
  3. (Optional) Recommended to only enable "https" port exposed to the internet on the SAS Viya management node. The SAS Viya workers don't need to expose any more ports to internet.

 

And that’s it

This post shows how a simple VDMML Visual environment can stand up quickly in GCP for a play environment. The SMP deployment took around 22 mins and the MPP took around 30 mins.  This is not focused on the production environment where a client will have more security wrapped around and a sizing done.  But this shows two things:

  1. SAS Viya products can run in Google Cloud Platform
  2. Automation is easy with Google Cloud APIs and SAS usage of Ansible
Version history
Last update:
‎09-22-2017 10:51 AM
Updated by:
Contributors

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags