Skip to content

Add acme-buddy support - #34

Merged
weshinsley merged 24 commits into
masterfrom
VIMC-8716
Dec 1, 2025
Merged

weshinsley merged 24 commits into
masterfrom
VIMC-8716

Conversation

@weshinsley

@weshinsley weshinsley commented Nov 11, 2025 •

Copy link
Copy Markdown
Contributor

This PR puts the config and container creation code for acme, which we use in many places, into acme.py, so a typical deployment might look like

mrc-ide/packit-deploy#32

essentially calling the constellation functions
acme_cfg = config.config_acme(dat) and
acme_container = acme.acme_buddy_container(cfg, proxy, tls_volume)

It implements also the suggestions in vimc/montagu-deploy#22 regarding the different environment variables needed for different providers (HDB vs Cloudflare)

@codecov

codecov Bot commented Nov 12, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.79518% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.29%. Comparing base (9973b1b) to head (4c3c523).
⚠️ Report is 25 commits behind head on master.

Files with missing lines Patch % Lines
src/constellation/config.py 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #34      +/-   ##
==========================================
+ Coverage   97.22%   97.29%   +0.06%     
==========================================
  Files          14       16       +2     
  Lines        1588     1661      +73     
  Branches       98      101       +3     
==========================================
+ Hits         1544     1616      +72     
  Misses         35       35              
- Partials        9       10       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@weshinsley weshinsley changed the title Add acme function] Add acme-buddy support Nov 12, 2025
@weshinsley
weshinsley marked this pull request as ready for review November 27, 2025 16:08

@EmmaLRussell EmmaLRussell left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess the main test of this will be in the deployments that use it, as it's difficult to test without a real domain. This repo isn't really set up for integration tests. Or documentation - but I guess the test is a good example to work from..

Comment thread src/constellation/acme.py
self.port = config_integer(data, ["acme_buddy", "port"])
self.dns_provider = config_string(data, ["acme_buddy", "dns_provider"])
self.env = config_dict(data, ["acme_buddy", "env"])
if "ACME_BUDDY_STAGING" in os.environ:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this an env var and not a config value? Is the idea that this allows you to test "real" configs with a fake acme buddy set up?

@weshinsley weshinsley Dec 1, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question - in acme buddy, either the --staging flag or existence of a non-empty ACME_BUDDY_STAGING environment var achieve the same purpose - perhaps in constellation I should accept it as optional in both the config, and the environment...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, I treat the env part of the config as a block, whatever it contains, so ACME_BUDDY_STAGING can be passed in as acme_buddy: env: ACME_BUDDY_STAGING. If the environment variable is present, then that overwrites the config, which is I think the right way round.

Comment thread src/constellation/acme.py Outdated
Comment thread src/constellation/config.py Outdated
Comment thread src/constellation/acme.py Outdated
@weshinsley
weshinsley merged commit dcb34a3 into master Dec 1, 2025
9 checks passed
@plietar
plietar deleted the VIMC-8716 branch December 1, 2025 15:29
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.

3 participants