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

Update PhotonStateManager related configuration #865

Merged
merged 4 commits into from
Jun 13, 2024

Conversation

SapiensAnatis
Copy link
Owner

@SapiensAnatis SapiensAnatis commented Jun 9, 2024

  • Adds support for the key-per-file configuration provider to the app.
  • Also fixes the lambda for adding IPhotonStateApi to make it pull an updated value for the base URL.
  • Miscellaneous refactoring to PhotonStateManager config, including better use of DI and IConfiguratioon.

This includes several breaking changes for PhotonStateManager:

  • PHOTON_TOKEN environment variable -> PhotonOptions__Token
  • ENABLE_HTTPS environment variable no longer used, consult ASP.NET docs for alternative

This is primarily intended to solve the issue of the API having to re-template and restart each time the state manager is deployed, due to the fact that Nomad selects a random port for the state manager. Currently the URL is stored as an env variable which requires a container restart to reflect a change.

Previously this has been solved by using the public URL however this results in going through Cloudflare and Caddy again.

I could also put the state manager on a static port, but I'm not sure whether Consul would still re-template in the 5 second window that the service is deleted. This is also recommended against in the docs as it makes it harder for Nomad to schedule jobs.

This could solve the issue of the API having to re-template and restart
each time the state manager is deployed, due to the fact that Nomad
selects a random port for the state manager.

Previously this has been solved by using the public URL however this
results in going through Cloudflare and Caddy again.

I could also put the state manager on a static port, but I'm not sure
whether Consul would still re-template in the 5 second window that the
service is deleted. This is also recommended against in the docs as it
makes it harder for Nomad to schedule jobs.
- Remove ENABLE_HTTPS env var in favour of official config
- Remove PHOTON_TOKEN env var from both projects
- Update PSM Program.cs to better use IOptions
@SapiensAnatis SapiensAnatis changed the title Make state manager url hot-reloadable Update PhotonStateManager related configuration Jun 13, 2024
@SapiensAnatis SapiensAnatis merged commit c6317de into main Jun 13, 2024
8 checks passed
@SapiensAnatis SapiensAnatis deleted the feature/psm-config branch June 13, 2024 22:32
SapiensAnatis added a commit that referenced this pull request Jun 30, 2024
- Adds support for the
[key-per-file](https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration-providers#key-per-file-configuration-provider)
configuration provider to the app.
- Also fixes the lambda for adding `IPhotonStateApi` to make it pull an
updated value for the base URL.
- Miscellaneous refactoring to PhotonStateManager config, including
better use of DI and `IConfiguratioon`.

This includes several breaking changes for PhotonStateManager:
- `PHOTON_TOKEN` environment variable -> `PhotonOptions__Token`
- `ENABLE_HTTPS` environment variable no longer used, consult ASP.NET
docs for alternative

---

This is primarily intended to solve the issue of the API having to
re-template and restart each time the state manager is deployed, due to
the fact that Nomad selects a random port for the state manager.
Currently the URL is stored as an env variable which requires a
container restart to reflect a change.

Previously this has been solved by using the public URL however this
results in going through Cloudflare and Caddy again.

I could also put the state manager on a static port, but I'm not sure
whether Consul would still re-template in the 5 second window that the
service is deleted. This is also recommended against in the docs as it
makes it harder for Nomad to schedule jobs.
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.

1 participant