Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to batch config loading for tron deployments #3956

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

nemacysts
Copy link
Member

Right now we make at most 2N calls to the Tron API during config deployments: N to get the current configs and at most N if all services have changes.

To start, I'd like to reduce this to N by allowing GET /api/config to return all the configs so that the only requests needed are POSTs for changed configs. Since I'm a little worried about how tron-pnw-prod will fare with returning all the configs in a single request, using this new endpoint is behind a feature toggle. Hopefully this works out and we don't need to add pagination to the endpoint :)

Depending on how this goes, we can look into batching up the POSTs so that we can also do that in a single request (or at least <N requests if we want to chunk things a bit more).

NOTE: this requires Yelp/Tron#996

Right now we make at most 2N calls to the Tron API during config
deployments: N to get the current configs and at most N if all services
have changes.

To start, I'd like to reduce this to N by allowing GET /api/config to
return all the configs so that the only requests needed are POSTs for
changed configs. Since I'm a little worried about how tron-pnw-prod will
fare with returning all the configs in a single request, using this new
endpoint is behind a feature toggle. Hopefully this works out and we
don't need to add pagination to the endpoint :)

Depending on how this goes, we can look into batching up the POSTs so
that we can also do that in a single request (or at least <N requests if
we want to chunk things a bit more).
@nemacysts nemacysts marked this pull request as ready for review September 11, 2024 20:08
@@ -162,6 +170,7 @@ def main():
k8s_enabled_for_cluster = (
yaml.safe_load(master_config).get("k8s_options", {}).get("enabled", False)
)
new_configs: Dict[str, str] = {} # service -> new_config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

til create_complete_config gives us back just a str; definitely not what i woulda expected by the name

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea :(

paasta_tools/setup_tron_namespace.py Outdated Show resolved Hide resolved
@nemacysts nemacysts merged commit 7fc5f94 into master Sep 17, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants