To help deploy Prosper API services, a .deb builder/installer has been developed.
Prophet is a troublesome library to install. Required build-from-source to get working with dh-virtualenv.
Best-practice may be to host precompiled binary on a private PyPI service (GemFury, DevPi)
git clone --recursive https://github.com/stan-dev/pystan.git
cd pystan
python setup.py install
pip install matplotlib #for png.h and freetype.h
cd ..
git clone https://github.com/facebookincubator/prophet.git
cd prophet/python
python setup.py install
Additionally, for windows, required VS2015 C++ binaries and to build from source. See wheels/
for precompiled windows packages. Also, Prophet will not work on mac systems.
The Prophet endpoint relies on API keys to gate access. Roll new ones for users with scripts/manage_api.py
and don't forget to back up publicAPI/cache/apikeys.json
for best results.
The build will automatically snatch up the new keys and build them into its installer. DO BACKUP -- INSTALLER WILL SMASH RELEASED APIKEYS.JSON FILE ON INSTALL
[LOGGING]
discord_webhook = #SECRET
Configure the discord_webhook
value in scripts/app.cfg
to enable Discord Logging. Service has already been built-in with python logging handlers to help alert if/when something goes catastrophically wrong.
ProsperAPI is set up to use dh-virtualenv. This should wrap up the project into a .deb file for easy installing/deploying
- Debian system (tested on Ubuntu 16)
- Python 3.x (developed for Python 3.5)
- pip packages
- wheel
- setuptools
- virtualenv
- Plumbum
- matplotlib
- pystan
- fbprophet
- dpkg
- dh-virtualenv v1.0
sudo apt-get install dpkg
sudo apt-get install dh-virtualenv
sudo apt-get install debhelper
sudo apt-get install python3-pip
sudo pip3 install wheel
sudo pip3 install setuptools
- see notes about build-from-source for fbprophet
sudo dpkg-buildpackage -us -uc
- `sudo dpkg -i prosper-api_[version]_amd64.deb
sudo systemctl status crest_endpoint.service
to make sure deploy is correct
Deploys a virgin virtualenv for code to run in. Does not adjust production python on machine.
source /opt/venvs/prosper-api/bin/activate
sudo /opt/venvs/prosper-api/bin/python
<-- for running python directly