This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Database design and deploy for API user accounts and metering #20
Comments
achimnol
added a commit
that referenced
this issue
Nov 16, 2016
* To see how to manage database, run: `python -m sorna.gateway.models --help`. - You can combine `--drop-tables`, `--create-tables`, and `--populate-fixtures` to choose which operations to execute. * Also fixes some minor formatting issues pointed out by flake8.
achimnol
added a commit
that referenced
this issue
Nov 16, 2016
* Also add server-side default to GUID field. Currently we cannot use SQLAlchemy's ORM because of aiopg, and without ORM we need to specify SQL-level default values when inserting a new row.
achimnol
added a commit
that referenced
this issue
Nov 20, 2016
* Replaces aiopg with asyncpg for better performance. (Actually we use SQLAlchemy as a SQL compiler without ORM, so it doesn't matter much how the DB API looks like.) * Adapts test cases to use the database as well. (using the default setting: sorna db granted to postgres/develove on localhost)
achimnol
added a commit
that referenced
this issue
Nov 20, 2016
achimnol
added a commit
that referenced
this issue
Nov 23, 2016
achimnol
added a commit
that referenced
this issue
Nov 23, 2016
achimnol
added a commit
that referenced
this issue
Nov 24, 2016
* Tracking remaining resources instead of quota allow more flexible billing policy by renewing them or adding specific amounts.
achimnol
added a commit
that referenced
this issue
Dec 3, 2016
achimnol
added a commit
that referenced
this issue
Dec 4, 2016
* It is a generalized event dispatcher for the gateway/manager server. Now the gateway can add appropriate handlers when asynchronous events such as kernel termination occur. Like manager-agent interaction, this also uses aiozmq.rpc facilities. * Implemented concurrency usage check further. - Now it is decremented when the kernel is actually destroyed. - TODO: decrement as well when the agent instance is destroyed or failed to deliver heartbeats due to HW/network failure. We need to reviv Redis subscription in sorna.gateway and dispatch "instance_terminated" event when shadow keys expires.
achimnol
added a commit
that referenced
this issue
Dec 5, 2016
achimnol
added a commit
that referenced
this issue
Dec 16, 2016
* Gateway now has a grace period when starting up to detect currently alive agents and synchronize the database. - It collects all received events without processing them. Then chooses and runs the latest ones for each instance. * We now use Python 3.6 async-generators. The first case is InstanceRegistry.enumerate_instance() method. * InstanceRegistry's get_kernel/get_instance methods now have a variant to retrieve only a single field from the Redis hash. * InstanceRegistry's get_kernel method now has a batched variant.
achimnol
added a commit
that referenced
this issue
Dec 20, 2016
* Ensure "forget_instance" upon instance_terminated event to prevent bogus heartbeat timeout detections. * Add missing file.
achimnol
added a commit
that referenced
this issue
Dec 21, 2016
achimnol
added a commit
that referenced
this issue
Dec 21, 2016
achimnol
added a commit
that referenced
this issue
Dec 22, 2016
achimnol
added a commit
that referenced
this issue
Dec 22, 2016
achimnol
added a commit
that referenced
this issue
Jan 6, 2017
achimnol
added a commit
that referenced
this issue
Jan 11, 2017
* Various bug fixes. - Don't forget_instance() when agent is lost. Required to check revival and resetting. - Fix wrong return value checks for HGETALL redis API: it returns an empty dict instead of None when the key does not exist. - update_kernel_usage() and update_instance_usage() needs to be able to access "stale" kernel information. * Shorten the range of connection leases from the redis pool. * Improve code styles. - Use parenthesis to long-hanging lines if possible. - Use .execute() instead of .fetchval() when the SQL query is doing insertion or updates. - Use more f-strings for brevity.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Details in WIP.
The text was updated successfully, but these errors were encountered: