Create virtualenv:
$ mkvirtualenv batch_scoring
Install package in virtualenv:
$ pip install -e .
Now batch_scoring
script should be available in your PATH.
Install the package itself:
$ python setup.py install
You can also create virtualenvs with different python versions:
$ mkvirtualenv batch_scoring_3 -p /usr/bin/python3.5
Build containers:
$ docker-compose build
Run tests in 2.7 and 3.5:
$ docker-compose run python27 make test $ docker-compose run python35 make test
Run batch-scoring from container:
$ docker-compose run python27 batch-scoring {args..} $ docker-compose run python35 batch-scoring {args..}
- update
__version__
indatarobot_batch_scoring/__init__.py
- perform acceptance tests, wait for tests to go green, get sign-off
- merge PR in github and get SHA
- tag release and push a tag to GitHub
git tag vX.Y.Z <SHA>
git push --tags
- This triggers Travis and Appveyor bots to runs automated tests and publish new version on PyPI when tests are passed.
- Travis and Appveyor also build the PyInstaller executables for Windows and OSX and push to S3.
- build the PyInstaller and Offlinebundle for Linux
- build the image for PyInstaller with
docker-compose build centos5pyinstaller
- build both releases with
make build_release_dockerized
(does not work on MacOS, use Linux instead). This will add the following to the dist dir:
- datarobot_batch_scoring_<TAG>_offlinebundle.zip
- datarobot_batch_scoring_<TAG>_offlinebundle.tar
- datarobot_batch_scoring_<TAG>_executables.Linux.x86_64.tar
- datarobot_batch_scoring_<TAG>_executables.Linux.x86_64.zip
Collect the PyInstaller artifacts for OSX and Windows from S3
When Travis and Appveyor finish their builds they upload the pyinstaller artifacts to a S3 bucket called
datarobot-batch-scoring-artifacts
. The OSX builds are in theosx-tagged-artifacts
dir. The Windows artifacts are inwindows-tagged-artifacts
. Both should have the tag name in their name. Collect the artifacts:- datarobot_batch_scoring_<TAG>_executables.Windows.x86_64.zip
- datarobot_batch_scoring_<TAG>_executables.OSX.x86_64.tar
upload the builds produced by step 5 and 6
- find new version tag that was pushed at https://github.com/datarobot/batch-scoring/tags
create
the release on github for selected tag and attach 6 files:
- datarobot_batch_scoring_<TAG>_executables.Linux.x86_64.tar
- datarobot_batch_scoring_<TAG>_executables.Linux.x86_64.zip
- datarobot_batch_scoring_<TAG>_offlinebundle.zip
- datarobot_batch_scoring_<TAG>_offlinebundle.tar
- datarobot_batch_scoring_<TAG>_executables.OSX.x86_64.tar
- datarobot_batch_scoring_<TAG>_executables.Windows.x86_64.zip
- update release subject and description
- publish new release
This is a bundle which allows users to install datarobot_batch_scoring offline using the existing Python2.7 or
Python3+ on the system. It includes all the dependencies and a script for bootstraps pip
.
- We will release this on our Github release page. The archive contains:
- helper_packages/ - packages like pip and virtualenv which can be used offline
- required_packages/ - the batch_scoring script and its dependencies
- OFFLINE_INSTALL_README.txt - install instructions
- get-pip.py - a script that allows us to bootstrap pip in user mode
This offline install method is suitable in situations where Python 2.7 or Python 3+ are available.
sudo
is not required.
See an overview of PyInstaller here
PyInstaller bundles all the code and dependencies, including the Python interpreter, into a single
directory or executable file. Right now we are creating three single-file
executables; batch_scoring_sse
, batch_scoring
and batch_scoring_deployment_aware
.
We make a special image just for building this executable.
PyInstaller build instructions - Linux
Dependencies: Docker, docker-compose, Make
- build the image for PyInstaller with
docker-compose build centos5pyinstaller
- build just the pyinstaller executables with
make pyinstaller_dockerized
. See the Release section of this readme for the official release process.- test the build with
test_pyinstaller_dockerized
PyInstaller build instructions - OSX / Other nixes
Dependencies: Make, Python>=3.5 Note this build is performed on Travis CI and the artifacts are uploaded on PRs to s3://datarobot-batch-scoring-artifacts/ on both PRs and tags
PyInstaller build instructions - Windows
Note this is done on Appveyor and the artifacts are uploaded on PRs to s3://datarobot-batch-scoring-artifacts/ on both PRs and tags
This is considered experimental because builds may not work on every platform we need to support. For example, we need to be careful that linux apps are forward compatible, and our seperate builds for OSX and Windows have not been tested on many every versions of those OSs.