Please note that this file is no substitute for reading and understanding the Airflow documentation. This file is only intended to provide a quick start for the SAS providers. Unless an issue relates specifically to the SAS providers, the Airflow documentation should be consulted.
Follow instructions at https://airflow.apache.org/docs/apache-airflow/stable/installation/index.html to install Airflow. If you just want to evaluate the SAS providers, then the simplest path would be to install via PYPI and run Airflow on the local machine in a virtual environment.
If you want to build the package from these sources, install the build module using pip install build
and then run python -m build
from the root of the repository which will create a wheel file in the dist subdirectory.
The SAS provider is available as a package published in PyPI. To install it, switch to the Python environment where Airflow is installed, and run the following command:
pip install sas-airflow-provider
If you would like to install the provider from a package you built locally, run:
pip install dist/sas_airflow_provider_xxxxx.whl
There are a few ways to provide the package:
_PIP_ADDITIONAL_REQUIREMENTS
Set this variable to the command line that will be passed to pip install
In order to connect to SAS Viya from the Airflow operator, you will need to create a connection. The easiest way to do this is to go into the Airflow UI under Admin/Connections and create a new connection using the blue + button. Select SAS from the list of connection types, and enter sas_default as the name. The applicable fields are host (http or https url to your SAS Viya install), login and password. It is also possible to specify an OAuth token by creating a json body in the extra field. For example {"token": "oauth_token_here"}
. If a token is found it is used instead of the user/password.
Please be aware of security considerations when storing sensitive information in a
connection. Consult https://airflow.apache.org/docs/apache-airflow/stable/security/index.html for details.
TLS verification can be disabled (not recommended) by specifying the following in
the extra field {"ssl_certificate_verification": false }
.
In addition, a custom TLS CA certificate bundle file can be used as follows:
{"ssl_certificate_verification": "/path/to/trustedcerts.pem"}
. Note that the path used for the CA certificate bundle must reference a location within the Airflow pods.
Inbound security rules must allow communication from the Airflow web server pod through the ingress defined for SAS Viya. Connection timeout errors might occur if the rule is not in place.
See example files in the src/sas_airflow_provider/example_dags directory. These dags can be modified and placed in your Airflow dags directory.
Mac note: If you are running Airflow standalone on a Mac, there is a known issue regarding how process forking works. This causes issues with the urllib which is used by the operator. To get around it set NO_PROXY= in your environment prior to running Airflow in standalone mode. Eg: `export NO_PROXY=""`
You will need to create a SAS Studio Flow or a Job Definition before you can reference it from a DAG. The easiest way is to use the SAS Studio UI to do this.
We welcome your contributions! Please read CONTRIBUTING.md for details on how to submit contributions to this project.
This project is licensed under the Apache 2.0 License.