superduper icon indicating copy to clipboard operation
superduper copied to clipboard

[TASK] Mount/ re-mount secrets on start

Open blythed opened this issue 10 months ago • 1 comments
trafficstars

  1. Secrets assumed to be mounted at /session/secrets
  2. Load these as env variables when program starts
  3. Add property to components to listen to certain env variables

Secrets volume looks like this:

|_/session/secrets
   |_OPENAI_API_KEY   // content is "sk-123294323923..."
   |_AWS_ACCESS_KEY_ID 
   |_...
@requires_secrets
def predict(self, X):
    ...

def requires_secrets(f):
    def wrapper(*args, **kwargs):
        try:
            f(*args, **kwargs)
        except MissingSecretException:
            CFG.load_secrets()
            f(*args, **kwargs)
    return wrapper

blythed avatar Dec 23 '24 09:12 blythed