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

add OCIS_ENABLE_OCM env var #9784

Merged
merged 2 commits into from
Aug 12, 2024
Merged

add OCIS_ENABLE_OCM env var #9784

merged 2 commits into from
Aug 12, 2024

Conversation

butonic
Copy link
Member

@butonic butonic commented Aug 12, 2024

We added a new OCIS_ENABLE_OCM env var that will enable all ocm flags and add ocm to the services started by the runtime.

Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
@@ -56,6 +56,7 @@ type Runtime struct {
Services []string `yaml:"services" env:"OCIS_RUN_EXTENSIONS;OCIS_RUN_SERVICES" desc:"A comma-separated list of service names. Will start only the listed services." introductionVersion:"pre5.0"`
Disabled []string `yaml:"disabled_services" env:"OCIS_EXCLUDE_RUN_SERVICES" desc:"A comma-separated list of service names. Will start all default services except of the ones listed. Has no effect when OCIS_RUN_SERVICES is set." introductionVersion:"pre5.0"`
Additional []string `yaml:"add_services" env:"OCIS_ADD_RUN_SERVICES" desc:"A comma-separated list of service names. Will add the listed services to the default configuration. Has no effect when OCIS_RUN_SERVICES is set. Note that one can add services not started by the default list and exclude services from the default list by using both envvars at the same time." introductionVersion:"pre5.0"`
EnableOCM bool `yaml:"enable_ocm" env:"OCIS_ENABLE_OCM" desc:"Enable all OCM config flags and start the ocm service." introductionVersion:"%%NEXT%%"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need an extra envvar for this? Whats wrong with OCIS_ADD_RUN_SERVICES=ocm?

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAICT pm wanted a single env var to enable ocm. that means we have to also make the runtime pick up the env var to start the service.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please let's NOT do this. We have too many envvars anyways. We cannot add envvars for specific deployment scenarios. Next week there'll be OCIS_MY_CUSTOM_DEPLOYMENT which start antivirus and webfinger but not search.

Tell PO OCIS_ADD_RUN_SERVICES IS a single envvar.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. I was trying to argue that the helm chart is the layer that uses feature flags like this. @micbar was against it. And the whole point of this PR is to add a feature flag env var OCIS_ENABLE_OCM that sets all the other env vars. Making it also enable the service at least makes it not a half baked solution ...

all or nothing IMO

Copy link
Collaborator

@kobergj kobergj Aug 12, 2024

Choose a reason for hiding this comment

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

I was trying to argue that the helm chart is the layer that uses feature flags like this

I'm 100% with you here. Please let's not do things we both know are wrong.

And the whole point of this PR is to add a feature flag env var OCIS_ENABLE_OCM that sets all the other env vars

Why don't we just default them all to true? Then OCIS_ADD_RUN_SERVICES would suffice the requirements. What is the point in starting ocm service if you don't want to use it anyways?

Copy link
Member Author

Choose a reason for hiding this comment

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

setting them to true results in various error messages in the log because the ocm service cannot be contacted.

Looking at the list item New variable like OCIS_ENABLE_OCM should summarize most of the variable to simplify enablement of ocm we could just add OCIS_ENABLE_OCM to the existing boolean env vars and not start ocm ... but that seems to just be a half assed solution.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at the list item New variable like OCIS_ENABLE_OCM should summarize most of the variable to simplify enablement of ocm we could just add OCIS_ENABLE_OCM to the existing boolean env vars and not start ocm

I'd like that more. The runtime already listens to: OCIS_ADD_RUN_SERVICES, OCIS_EXCLUDE_RUN_SERVICES and OCIS_RUN_SERVICES. Listening to a fourth envvar will only make it more complicated and produces edge cases that need to be considered. (e.g. OCIS_EXCLUDE_RUN_SERVICES=ocm and OCIS_ENABLE_OCM=true)

OCIS_ENABLE_OCM activates all service specific envvars, ocm service needs to be started separately. That sounds nice and simple to me.

Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
@butonic butonic requested a review from kobergj August 12, 2024 14:59
Copy link

@butonic butonic merged commit abe40fd into master Aug 12, 2024
4 checks passed
ownclouders pushed a commit that referenced this pull request Aug 12, 2024
@butonic butonic deleted the add-enable-ocm-variable branch August 13, 2024 07:04
@ScharfViktor ScharfViktor mentioned this pull request Aug 20, 2024
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants