Python Apps allow you to run Python code on Alli Marketplace's infrastructure in isolation.
Learning Python is left to the reader, but its rewards are vast. Once you are familiar enough to run Python locally, you should be good to go to run it on Alli Marketplace.
Configuration
In addition to the common configuration, there is some extra configuration required for these Apps.
External Dependencies
Currently, all Python dependencies (Libraries and packages that you would download to use. Examples are numpy, requests, boto3) are pre-installed in the Alli Marketplace system. In order to add a package, you must contact the Development Team. In the future, this will change to a requirement of the App editor.
Here is a list of all currently available Python packages:
-
apiclient
-
awscli
-
boto3
-
bs4
-
datetime
-
facebookads
-
googleads
-
httplib2
-
numpy
-
oauth2client
-
openpyxl
-
pandas
-
paramiko
-
psycopg2
-
pyasn1==0.3.4
-
pytz
-
requests
-
slackclient
-
sqlalchemy
-
unicodecsv
In addition to these external dependencies, you may specify multiple requirements.txt files in your upload. These files are used by the Python installation scripts (PIP) to specify what packages to install. In these files are lists of packages to install.
See here for more information.
In order to install public packages from GitHub (that are not available on PyPA, or for different versions) you will need to use the git+git scheme with the GitHub URL.
git+git scheme with the GitHub URL
|
In order to install a private package from GitHub (packages private and proprietary to PMG), you will need to use the git+ssh scheme with the GitHub URL. The user git will also need to be specified.
|
Your Script
The Python script invoked in the Execution should return an exit code of 0 to indicate a successful run. Any other exit code indicates failure.
Additionally, your script should stop its work if it receives a SIGTERM (15) signal.
Scheduling
Multiple Python Apps can run at a single time. The exact number for maximum parallel Python Executions depends on system load, but defaults to 8 under normal conditions.