Package your Python-based analytics solutions in a portable, repeatable, and reusable manner. This repo contains five SAS Studio custom steps which help you create, activate, and switch between virtual Python environments for use within SAS Viya.
A general idea :
Refer the "About" tab on each of the individual steps for more details on what they are used for.
This step helps you create a virtual environment. Input arguments required :
- A name provided for your virtual environment (which can optionally be expressed as a full path to a persistent location, for future retrieval)
- Additional packages you would like installed inside this virtual environment. As instructions note, you can provide a space-delimited string, or a path to a requirements.txt file.
This step helps you activate an existing virtual environment. It requires a single argument to a folder path pointing to your virtual environment.
This step helps you save details of all the packages currently installed in your environment, to a requirements.txt. You can reuse this requirements.txt file for other environments or create a new virtual environment based on this definition. You provide a single argument pointing to the path where you want your requirements.txt to be saved.
This step switches a SAS Studio session, currently under a virtual Python environment, to the Python environment that was in operation earlier. This step does not require any arguments.
This step helps users generate a relevant, more compact requirements.txt for a project containing one or more Python programs. The resulting requirements.txt can be used for specifying configuration for a virtual environment meant for running the said project.
- A SAS Viya 4 environment (monthly release 2021.2.1 or later) with SAS Studio Flows
- Python configured with the above environment (preferably using the SAS Configurator for Open Source)
- Python virtualenv package installed in above Python environment (the base environment)
Refer to the steps listed in the main README.md
When successfully uploaded, the following structure will be present in the Shared Section of your SAS Studio application - Custom Steps tab.
Version 1.1 (12JUL2022)
- Added new Custom Step - "Python - Obtain requirements from project directory" : Ju1 12 2022
Version 1.0 (20MAY2022)
- Renamed to "Python - " as per Wilbram's advice; shuffled order of About tab on "Freeze" : Jun 15 2022
Refer this blog for background. The ability to create and use virtual Python environments for use within SAS Viya helps data scientists create portable solutions, maintain solution integrity, and exploit the integration between SAS and Python to the fullest extent.
Watch this example!
This repository contains 5 custom steps which are offered as examples of how you could create, activate, switch between, and package virtual Python environments from within SAS Viya applications and tools, such as SAS Studio. It makes use of Custom Steps, a component within SAS Studio which help users package repeatable steps in an user-friendly manner.