Metadata-Version: 2.1
Name: skidward
Version: 0.0.1.dev331
Summary: scheduler for python scripts
Home-page: https://gitlab.adimian.com/open-source/skidward/
Author: See AUTHORS
Author-email: contact@adimian.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Operating System :: POSIX
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown
Requires-Dist: bcrypt (==3.1.6)
Requires-Dist: cronex (==0.1.3.1)
Requires-Dist: Flask (==1.0.2)
Requires-Dist: Flask-Admin (==1.5.3)
Requires-Dist: Flask-Security (==3.0.0)
Requires-Dist: Flask-SQLAlchemy (==2.3.2)
Requires-Dist: redis (==3.0.1)
Requires-Dist: SQLAlchemy (==1.2.16)
Requires-Dist: redis-log-handler (==0.0.1.dev9)
Requires-Dist: psycopg2-binary (==2.7.6.1)
Requires-Dist: python-dotenv (==0.10.1)
Requires-Dist: PyYAML (==3.13)
Requires-Dist: SQLAlchemy-Utils (==0.33.11)
Requires-Dist: fire (==0.1.3)

# Skidward

Scheduler For Python Scripts

## Prerequisites
The project was built with Python 3.6.7 and requires a working Postgres and Redis setup.  
Please refer to your operating system's specific installation instructions per package.

* Python 3.6.7
* Postgres (tested on 11 and up)
* Redis (tested on 5 and up)

## Installation
- Install the requirements

        $ pip install -r requirements.txt

- Create user (called a 'role') in postgres and give it ownership over the new db
**Note:** It is recommended to create a user with a password, even for development purposes.

        $ createuser skidwarduser
        $ createdb skidwarddb -O skidwarduser

The application uses environment variables to offer flexible configuration options.  
Before using the application, review the configuration in the `.env` file to match your desired setup.  
A typical connectionstring looks like this:
    `SQLALCHEMY_DATABASE_URI='postgresql://USER:PASSWORD@localhost/DATABASENAME'` 

- Copy the `.env.default` file to the skidward module and rename to `.env`.  

        $ cp .env.default skidward/.env

- Publish available workers on the namespace in the database

        $ python -m skidward publish-workers

- Create an admin user for use in the application

        $ python -m skidward create-admin USER_EMAIL

#### Development
- Install the development requirements

        $ pip install -r requirements-dev.txt

- Set up the git pre-commit hook required for development

        $ pre-commit install

*Optional:* If you want to install demo-workers from a proxy,
navigate to the root of your virtual environment and create a `pip.conf` file.

        $ touch pip.conf
        $ echo "[global]" >> pip.conf
        $ echo "extra-index-url = URL_TO_PROXY" >> pip.conf

## Running the application
There's an admin interface provided to communicate with the application,  
and then there's the backend side doing the operations.

### 1. Web interface
- Point Flask to the location of the web application

        $ export FLASK_APP=skidward.web

- Run the default setup (in the same session as the previous command)

        $ flask run

### 2. Scheduler side
- Start a new scheduler process (in the fore- or background)

        $ python -m skidward start-scheduler        # Runs in your session
        $ python -m skidward start-scheduler true   # Creates a new process running in the background



