Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

simplify signature initialization for optimization #354

Merged
merged 3 commits into from
Dec 16, 2024
Merged

Conversation

lukehinds
Copy link

@lukehinds lukehinds commented Dec 15, 2024

Remove unnecessary lazy loading mechanism for signature compile

This makes the initialization flow singular (__init__ based), which will reduce unneeded lazy loading on first call, and save cycles from calling _ensure_signatures_loaded

2024-12-15T21:47:27.3dZ [info     ] Started server process [49486] module=server pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/.venv/lib/python3.11/site-packages/uvicorn/server.py
2024-12-15T21:47:27.3dZ [info     ] Waiting for application startup. module=on pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/.venv/lib/python3.11/site-packages/uvicorn/lifespan/on.py
2024-12-15T21:47:27.3dZ [info     ] Application startup complete.  module=on pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/.venv/lib/python3.11/site-packages/uvicorn/lifespan/on.py
2024-12-15T21:47:27.3dZ [info     ] Uvicorn running on http://localhost:8989 (Press CTRL+C to quit) module=server pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/.venv/lib/python3.11/site-packages/uvicorn/server.py

<incoming request>

2024-12-15T21:47:33.3dZ [info     ] Loaded 61 signature groups     module=signatures pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/src/codegate/pipeline/secrets/signatures.py
2024-12-15T21:47:33.3dZ [info     ] Compiled 148 regex patterns    module=signatures pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/src/codegate/pipeline/secrets/signatures.py
2024-12-15T21:47:33.3dZ [info     ]
Found secrets:                module=secrets pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/src/codegate/pipeline/secrets/secrets.py
2024-12-15T21:47:33.3dZ [info     ]
Service: Amazon               module=secrets pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/src/codegate/pipeline/secrets/secrets.py
2024-12-15T21:47:33.3dZ [info     ] Type: Secret Access Key        module=secrets pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/src/codegate/pipeline/secrets/secrets.py
2024-12-15T21:47:33.3dZ [info     ] Original: src/codegate/pipeline/secrets/signatures.py: module=secrets pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/src/codegate/pipeline/secrets/secrets.py
2024-12-15T21:47:33.3dZ [info     ] Encrypted: REDACTED<$d4niwf9MeN2YFmNgUO3KyYmoWg8TlI5EkeK2hwQhT+Bt7LzbHbAElgpyU7J44xCJQiHrGdrLxTtoobqL/QRKfbdOolc+9gR6FqqghzWkQmKZcX8=> module=secrets pathname=/Users/lhinds/repos/stacklok/codegate-repos/codegate/src/codegate/pipeline/secrets/secrets.py```

Luke Hinds added 3 commits December 15, 2024 22:00
Remove unnecessary lazy loading mechanism from signatures since they are always
loaded during server startup when CodegateSecrets is created. This simplifies
the code and makes the initialization flow singular, which will reduce
uneeded lazy loading on every call
@lukehinds lukehinds merged commit e794d57 into main Dec 16, 2024
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants