valhuber / OptLocking

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a POC for Optimistic Locking.

It is mainly a generated app, to explore various scenarios described in the opt_locking_readme.

Please click the link to see that file.

Note: you cannot run this under Codespaces; depends on a patched version of SAFRS.

Suggestion: open this in GitHub using "Project View" (Shift + ".")

Installation

 

Existing ALS

Using existing ALS/safrs, this should run OptLocking tests (see the readme), and behave run tests. To install, setup the virtual env:

  1. shared venv, or

  2. local venv - python3 -m venv venv; . venv/bin/activate; python3 -m pip install ApiLogicServer

 

safrs==3.1.0rc2 (WIP)

rc2 safrs requires the following (caution - still very brittle):

  1. Create a local venv:

python3 -m venv venv; . venv/bin/activate

  1. Install ApiLogicServer

pip install ApiLogicServer

  1. Update the local venv

python3 -m pip install -r requirements.txt

  1. Get the rc2 safrs

python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple safrs==3.1.0rc2

  1. Install yaml (a surprise)

sudo pip install pyyaml

But, fails in safrs_init: ModuleNotFoundError: No module named 'flask_swagger_ui'

  1. Install flask_swagger_ui

sudo pip install flask_swagger_ui

 

Failing in DB Bind

But, fails when running with security:

sqlalchemy.exc.UnboundExecutionError: Bind key 'authentication' is not in 'SQLALCHEMY_BINDS' config.

Thomas concurs that binds need recoding.

previously:

session = db.create_scoped_session(options={"bind": connection, "binds": {}}

currently:

from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker
session_factory = sessionmaker(bind=connection)
session = scoped_session(session_factory)

See this gist.

To be continued.

About


Languages

Language:Python 92.1%Language:Shell 2.7%Language:HTML 1.3%Language:JavaScript 1.2%Language:Dockerfile 1.1%Language:Gherkin 0.8%Language:PowerShell 0.5%Language:Mako 0.2%