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

Prevent config rendering on every process #3011

Merged
merged 11 commits into from
Jan 20, 2025

Conversation

gememma
Copy link
Member

@gememma gememma commented Jan 10, 2025

Closes #2936

@gememma gememma force-pushed the gemma/config-resolution-hang branch from 64265cd to 16d7df1 Compare January 10, 2025 15:00
@gememma gememma force-pushed the gemma/config-resolution-hang branch from 1affb5f to 2aa9588 Compare January 14, 2025 13:45
@meowjesty meowjesty self-assigned this Jan 14, 2025
@Razz4780 Razz4780 requested a review from DmitryDodzin January 14, 2025 14:43
Copy link
Member

@meowjesty meowjesty left a comment

Choose a reason for hiding this comment

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

Just some small stuff.

So if we save the config to an env var, we don't get the templating breaking on get_env secondary calls? Since we only do it once, is that what this PR is solving?

mirrord/config/Cargo.toml Show resolved Hide resolved
mirrord/config/src/feature/network/incoming.rs Outdated Show resolved Hide resolved
mirrord/config/src/lib.rs Outdated Show resolved Hide resolved
mirrord/config/src/lib.rs Outdated Show resolved Hide resolved
mirrord/config/src/lib.rs Outdated Show resolved Hide resolved
mirrord/config/src/lib.rs Outdated Show resolved Hide resolved
mirrord/config/src/lib.rs Outdated Show resolved Hide resolved
mirrord/config/src/lib.rs Outdated Show resolved Hide resolved
mirrord/config/src/lib.rs Outdated Show resolved Hide resolved
mirrord/cli/src/execution.rs Outdated Show resolved Hide resolved
@gememma
Copy link
Member Author

gememma commented Jan 14, 2025

So if we save the config to an env var, we don't get the templating breaking on get_env secondary calls? Since we only do it once, is that what this PR is solving?

@meowjesty That's correct - the config template variables get resolved when the config file is rendered by Tera, which previously happened on every process. This causes an issue when a process tries to, for example, call get_env() to render the config but the process doesnt have access to the same env as previous ones - doing the get_env() call only once will solve this :) plus I think this way is more sensible in terms of reducing pointless recalculation and having fewer sources of truth

Copy link
Member

@DmitryDodzin DmitryDodzin left a comment

Choose a reason for hiding this comment

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

I would check mirrord container due to changes to MIRRORD_CONNECT_TCP_ENV in exec, it should work but I would double check

mirrord/config/src/agent.rs Outdated Show resolved Hide resolved
mirrord/cli/src/execution.rs Outdated Show resolved Hide resolved
mirrord/config/src/lib.rs Show resolved Hide resolved
@gememma gememma requested a review from meowjesty January 20, 2025 13:06
Copy link
Member

@meowjesty meowjesty left a comment

Choose a reason for hiding this comment

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

🌎 🦖

@gememma gememma added this pull request to the merge queue Jan 20, 2025
Merged via the queue into metalbear-co:main with commit 36bfd3c Jan 20, 2025
17 checks passed
@gememma gememma deleted the gemma/config-resolution-hang branch January 20, 2025 20:05
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.

mirrord + vscode + templating seems to get ide to hang
3 participants