dglazkov / polymath

MIT License
132 stars 9 forks source link

Implement a more robust config store #98

Open dglazkov opened 1 year ago

dglazkov commented 1 year ago

JSON config files are great for small-scale projects, but a more robust solution is needed for larger scale.

https://github.com/dglazkov/polymath-host uses Firestore, for example. Here's a path to get there, expressed as a set of interlocked patterns:

(to be continued)

dglazkov commented 1 year ago
dglazkov commented 1 year ago

@jkomoros @dalmaer PTAL

dglazkov commented 1 year ago

I'll start hacking on this and see what happens.

dglazkov commented 1 year ago

d7e5e8519847697692d6c481b586f7310b6a8f2b was part of this.

dglazkov commented 1 year ago

f4396ee9b942a8df6679dcf202b55e31094e98f7 and fd04a01a901c9dd5483f8e6cb3832c6a41037f1e too! I am not great at my commit messages.

dglazkov commented 1 year ago

So I have three different kinds of stores: JSONConfigStore, FirestoreConfigStore, and EnvConfigStore. All three are working ™️ andserver.py currently uses JSONConfigStore. I checked, and it's a two-line change to swap it over to Firestore.

dglazkov commented 1 year ago

Oh yeah! and server.py also uses EnvConfigStore for the keys etc. This means that we can easily shift this to JSON or Firestore if want.

dalmaer commented 1 year ago

Would it be silly meta to have a config that sets up the type of store so it's zero loc?

Eg. Either an ENV that has the type and then info (JSON and file say). Or JSON (points to Firestore).

dglazkov commented 1 year ago

Not silly at all!

dglazkov commented 1 year ago
dglazkov commented 1 year ago
dglazkov commented 1 year ago