This repo contains a python flask application to configure step parameters for pipeline jobs.
Make sure, your python is version 3.5 or higher and your pip is using this correct python:
$ python --version
$ pip --version
$ which python
$ which pipCreate a virtualenv environment, here the environment is called 'env':
$ virtualenv env --no-site-packagesor better
$ virtualenv --no-site-packages -p [path to your python] envIf you are on a Mac, use venv instead of virtualenv, because mathplotlib needs a framework build of Python
$ python -m venv envActivate the environment:
$ source env/bin/activateInstall the requirements:
$ pip install -r requirements.txtIn Ubuntu, I had trouble doing that, because of issues with permissions when accessing some python libs in my HOME directory. I resolved that by pointing the HOME environment variable to another folder:
$ export HOME=/opt/home
$ sudo chown [your user name]:[your group] /opt/homeWith
$ python manage.py runserver [-b <binding ip>] [-p <port>]you should be able to run the Flask application.
If you're done with coding, you can deactivate the environment with the command
$ deactivateIf you haven't done so, install the node.js flightplan library and tool globally:
$ npm install -g flightplanIf there is no command fly available in your cmd, please troubleshoot issues with your $PATH.
In the folder where package.json is located, install the npm packages to use flightplan in your project:
$ npm installMake changes to target and config in flightplan.js as necessary. Then use flightplan to create a new version entry in package.json and as a git commit with
$ fly version:local [ patch | minor | major ]Finally, deploy the application with
$ fly deploy:productionIf this does not work, make sure ssh-agent is running. If not, run ssh-agent and set the resulting environment variables. Then, run:
eval `ssh-agent -s`
ssh-add -k ~/.ssh/id_rsaLocate lightsheet service file:
$ locate systemd | grep lightsheet
/etc/systemd/system/lightsheet.serviceRestart lightsheet services:
$ sudo systemctl stop lightsheet
$ sudo systemctl start lightsheet$ sudo systemctl restart nginxSupervisor config file is located in
/etc/supervisor/conf.d/pipeline.confAfter making changes to the supervisor config file, reload the configuration with
sudo supervisorctl reread; sudo supervisorctl update;Restart the application with
sudo supervisorctl restart 'pipeline:'We use MongoDB to store the data. To open a Mongo cmd, type
mongo --host [your mongodb host]:[mongodb port]Some other helpful commands:
> use lightsheet
> db.jobs.help()
> db.jobs.findOne()
> db.jobs.drop()
> db.jobs.remove({ state: { $eq: 'ERROR'} })
> db.step.remove({ "text1": { $exists: true } })
> db.parameter.find( { name: { $gt: 'test' } } )
> db.parameter.find(ObjectId("5b12047ea275276dec9a2eb9"))Backup and restore
 mongodump --host 10.40.3.155 --port 27036 --db lightsheet --out /opt/tmp/dump/
 mongorestore --drop -d lightsheet /opt/tmp/dump/lightsheet/