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

Use Feature Gates to enable or disable features #847

Merged
merged 1 commit into from
Jun 21, 2020

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Jun 17, 2020

There are a number of features that are being developed and likely to be
disabled by default in their early stage.

Instead of adding a temporary config for each feature and maintaining
them separately, this patch introduces Feature Gates to toggle the
features. It will be easier to choose code branch based on FeatureGates'
"Enabled" method and to promote features to beta and GA.

Closes #846

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-all: to trigger all tests.
  • /skip-all: to skip all tests.

These commands can only be run by members of the vmware-tanzu organization.

weiqiangt
weiqiangt previously approved these changes Jun 18, 2020
Copy link
Contributor

@weiqiangt weiqiangt left a comment

Choose a reason for hiding this comment

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

This idea is great, LGTM.

@weiqiangt
Copy link
Contributor

One more question: will this bring gates flags, like --featureGates=ClusterPolicy=true ?

@tnqn
Copy link
Member Author

tnqn commented Jun 18, 2020

One more question: will this bring gates flags, like --featureGates=ClusterPolicy=true ?

No, the library supports it but I didn't add that CLI flag as we use config file.

@tnqn
Copy link
Member Author

tnqn commented Jun 18, 2020

/test-all

@tnqn
Copy link
Member Author

tnqn commented Jun 18, 2020

/test-windows-conformance

@ksamoray
Copy link
Contributor

Is there a way to reduce the per-feature overhead of changing yamls->featureset->feature?
On every new feature there are quite a lot of files to be changed, then reviewed merged etc and would be nice to have this more compact.
IDK if this is either possible and would rather stick to some standard.

@tnqn
Copy link
Member Author

tnqn commented Jun 18, 2020

Is there a way to reduce the per-feature overhead of changing yamls->featureset->feature?
On every new feature there are quite a lot of files to be changed, then reviewed merged etc and would be nice to have this more compact.
IDK if this is either possible and would rather stick to some standard.

Perhaps the feature list can be removed from yamls, I added it for convenience to edit, but we should have a doc to list experimental features and their stage anyway so user can refer to that doc to configure features.
For the change in antrea_features.go, I don't think it can be more compact than it is. Currently it needs two lines of code, one for feature name, one for its default value and stage.

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

These commands can only be run by members of the vmware-tanzu organization.

@tnqn
Copy link
Member Author

tnqn commented Jun 18, 2020

/test-all
/skip-whole-conformance

Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

LGTM. Just some minor comments on "code comments".

build/yamls/antrea-eks.yml Outdated Show resolved Hide resolved
pkg/features/antrea_features.go Outdated Show resolved Hide resolved
pkg/features/antrea_features.go Outdated Show resolved Hide resolved
pkg/features/antrea_features.go Outdated Show resolved Hide resolved
@tnqn tnqn force-pushed the featuregate branch 2 times, most recently from 4501511 to a74c5eb Compare June 19, 2020 06:29
There are a number of features that are being developed and likely to be
disabled by default in their early stage.

Instead of adding a temporary config for each feature and maintaining
them separately, this patch introduces Feature Gates to toggle the
features. It will be easier to choose code branch based on FeatureGates'
"Enabled" method and to promote features to beta and GA.
@tnqn
Copy link
Member Author

tnqn commented Jun 19, 2020

/test-all

@tnqn
Copy link
Member Author

tnqn commented Jun 19, 2020

/test-windows-conformance

1 similar comment
@tnqn
Copy link
Member Author

tnqn commented Jun 19, 2020

/test-windows-conformance

@jianjuns
Copy link
Contributor

/test-windows-conformance

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

So this seems like the ideal solution for thinks like Antrea-specific Network Policies. After your reply in #846 (comment), I still don't know whether the Antrea OVS Proxy implementation belongs under FeatureGates or not. It may be interesting for some users to - indefinitely - have the ability to disable it and fall back to using kube-proxy only (without getting a warning...).

However this is orthogonal to your PR. It is more about deciding what goes under FeatureGates and what is kept at the top-level of the configuration. So we may want to have this conversation in #772 instead. And I am only bringing it up because your issue (#846) used EnableAntreaProxy as a motivating example.

@tnqn tnqn merged commit ff265f1 into antrea-io:master Jun 21, 2020
@tnqn
Copy link
Member Author

tnqn commented Jun 21, 2020

@antoninbas Sure, let's discuss whether antrea service proxy should be an experimental feature or an optional feature in #772

@tnqn tnqn mentioned this pull request Jun 21, 2020
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Sep 22, 2020
There are a number of features that are being developed and likely to be
disabled by default in their early stage.

Instead of adding a temporary config for each feature and maintaining
them separately, this patch introduces Feature Gates to toggle the
features. It will be easier to choose code branch based on FeatureGates'
"Enabled" method and to promote features to beta and GA.
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Sep 23, 2020
There are a number of features that are being developed and likely to be
disabled by default in their early stage.

Instead of adding a temporary config for each feature and maintaining
them separately, this patch introduces Feature Gates to toggle the
features. It will be easier to choose code branch based on FeatureGates'
"Enabled" method and to promote features to beta and GA.
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.

Use Feature Gates to enable or disable features
7 participants