-
Notifications
You must be signed in to change notification settings - Fork 1
API Clients
The official Python client for Pulsar LIMS is pulsarpy. There is also an extension called pulsarpy-dx which extends pulsarpy in order to add support for importing sequencing results from the DNAnexus platform into Pulsar.
Here, I discuss how to configure the Heroku app to support running Python scripts - particularly a scheduled service that runs each day to look for new sequencing results on DNAnexus and import them into Pulsar. This will be the script [import_seq_results.py](https://github.com/StanfordBioinformatics/pulsarpy_dx/blob/master/pulsarpy_dx/scripts/import_seq_results.py)
from the pulsarpy-dx git repository.
Heroku apps uses what are called buildpacks to manage the deployment of your app, a process which begins when you push your code in GitHub to Heroku. Normally, however, your app begins with a single build-pack, which is automatically set when you push for the first time. In the case of Pulsar LIMS, that buildpack is heroku/ruby
, which can be verified via the command heroku buildpacks
. When deploying a new version of the app, this buildpack will install the dependencies specified in our Gemfile.
It is often useful to have one or more additional buildpacks configured for an app, however, and this is the scenario we run into with Pulsar. Since the client is coded in Python, if we want the app to run scheduled Python jobs via Heroku Scheduler, we need to enable Python support for our app. This is done by adding the Python buildpack:
heroku buildpacks:add heroku/python
You can be explicit about what version of Python support you get by adding a file by the name of runtime.txt
in the app's root directory, and adding a version, i.e. python-3.7.1
; see Specifying a Python Runtime
for more details. Otherwise, you'll get the default version, which will be some version in Python 3.
Since our scheduled job will make use of the Pulsarpy DX package, which is in PyPI, we need to add it to a requirements.txt file in the app's root folder.