-
Notifications
You must be signed in to change notification settings - Fork 56
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
openshift_secondary_metadata_parser: Add 'version' parsing #314
openshift_secondary_metadata_parser: Add 'version' parsing #314
Conversation
@@ -295,6 +295,26 @@ impl OpenshiftSecondaryMetadataParserPlugin { | |||
} | |||
} | |||
|
|||
fn process_version( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets declare this pub
(same for supported_version
) so that it could be reused in porting cincinnati-graph-data to Rust
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't we just run this whole plugin in the one-shot CI tool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, but it needs to be public so that we could import it in cincinnati-graph-data
CI too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, eventually, in cincinnati-graph-data we'd run one-shot graph-builder? Sounds good to me, its a long shot though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a one-shot invocation of this plugin more achievable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the plugin perspective there's no other mode as one-shot as they don't compile to standalone binaries. It needs an embedding binary which in our case could be the graph-builder or the policy-engine. Just to mention it, I've toyed with the idea to make all of these the same binary with several sub-commands.
@wking: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better idea for iterate and check
loop:
let str_version = String::from_utf8_lossy(&version);
if supported_versions.contains(&str_version.trim()) {
Ok(())
} else {
Err(format_err!(
"unrecognized graph-data version {}; supported versions: {:?}",
str_version,
supported_versions
))
}
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
970b318
to
ce738f5
Compare
d229e3c
to
372989d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good so far, one nit-pick
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
af88b44
to
3b3e674
Compare
cincinnati/src/plugins/internal/graph_builder/openshift_secondary_metadata_parser/plugin.rs
Outdated
Show resolved
Hide resolved
3b3e674
to
89c15ec
Compare
bd5d7e3
to
eaad2cb
Compare
Green :). I've dropped the diff edits and moved to just the |
All green, and I think I've addressed all the earlier review feedback or dropped the changes being reviewed ;). One remaining thread is "public or not?", and I'd rather punt on that for now, and see if we can get the one-shot plugin approach going for graph-data CI. |
I'd find it cleaner if we split the version bump at least into a separate commit, and preferably accomplish it by merging the separate #343 first. |
Node order has no semantic significance, but folks reading Cincy JSON by eye may have an easier time of things if the nodes are sorted by SemVer version and key order is stable within each node. This script will ingest arbitrary Cincinnati JSON on stdin and write the stable, ordered analog to stdout. Using this on our test fixtures will also make fixture diffs slightly more human readable.
Generated with: $ for X in e2e/tests/testdata/*.json; do A="$(hack/graph-normalize.sh < "${X}")"; echo "${A}" > "${X}"; done
In preparation for consuming the 'version' file that graph-data grew in [1]. This gets us the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
Dropping the production suffix. I don't really care where the fixture data comes from, but get-graph-pe-staging and get-graph-pe-production will only be serving a single graph-data commit at once. Using get-graph-pe instead will make it easier for folks to use this Justfile to get graph dumps based on arbitrary graph-data commits which they have fed into their local graph builder to be consumed by their local policy engine. With this change, generating new fixtures should work like: $ echo "${GRAPH_DATA_COMMIT_HASH}" >e2e/tests/testdata/metadata_revision $ just run-graph-builder-e2e & $ just just run-policy-engine & $ just e2e-fixtures-capture-only $ killall just Also rename our current fixtures to match the new, suffix-less pattern, and update the e2e suite to no longer require the suffix.
Consuming the 'version' file that graph-data grew in [1], so the logs will contain more useful error messages when the plugin is fed an incompatible schema version. Bumping the graph-data commit used for CI moves us to the first main-line commit to include the 'version' file: cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782 2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial 2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file [1]: openshift/cincinnati-graph-data#233
eaad2cb
to
60a9aca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: steveeJ, wking The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherrypick release-4.6 |
@wking: new pull request created: #379 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
So we can explain why we're blocking the different edges [1] (the promql -> PromQL type change is in flight with [2]). The zz in the filename for the vSphere hostname block ensures that one sorts last alphabetically, because it's the broadest block, and legacy Cincinnati services will prefer the final regular expression they load for a given 'to' target. This is basically a second attempt at my earlier 39bc2fb (blocked-edges/4.7.4*: Targeted edge blocking and version 1.1.0, 2021-09-01, openshift#1056), which ended up getting reverted in da1254a (Revert "blocked-edges/4.7.4*: Targeted edge blocking and version 1.1.0", 2021-09-21, openshift#1078) because the production Cincinnati was mad about the 1.1.0 version string. [3] taught Cincinnati to relax, and now that's live (and we never shipped any versions that would be mad about 1.1.0 to customers, the 4.6.0 Update Service operator went out before [4]). [1]: openshift/enhancements#821 [2]: openshift/enhancements#910 [3]: openshift/cincinnati#538 [4]: openshift/cincinnati#314
So we can explain why we're blocking the different edges [1] (the promql -> PromQL type change is in flight with [2]). The zz in the filename for the vSphere hostname block ensures that one sorts last alphabetically, because it's the broadest block, and legacy Cincinnati services will prefer the final regular expression they load for a given 'to' target. This is basically a second attempt at my earlier 39bc2fb (blocked-edges/4.7.4*: Targeted edge blocking and version 1.1.0, 2021-09-01, openshift#1056), which ended up getting reverted in da1254a (Revert "blocked-edges/4.7.4*: Targeted edge blocking and version 1.1.0", 2021-09-21, openshift#1078) because the production Cincinnati was mad about the 1.1.0 version string. [3] taught Cincinnati to relax, and now that's live (and we never shipped any versions that would be mad about 1.1.0 to customers, the 4.6.0 Update Service operator went out before [4]). [1]: openshift/enhancements#821 [2]: openshift/enhancements#910 [3]: openshift/cincinnati#538 [4]: openshift/cincinnati#314
So we can explain why we're blocking the different edges [1] (the promql -> PromQL type change is in flight with [2]). The zz in the filename for the vSphere hostname block ensures that one sorts last alphabetically, because it's the broadest block, and legacy Cincinnati services will prefer the final regular expression they load for a given 'to' target. This is basically a second attempt at my earlier 39bc2fb (blocked-edges/4.7.4*: Targeted edge blocking and version 1.1.0, 2021-09-01, openshift#1056), which ended up getting reverted in da1254a (Revert "blocked-edges/4.7.4*: Targeted edge blocking and version 1.1.0", 2021-09-21, openshift#1078) because the production Cincinnati was mad about the 1.1.0 version string. [3] taught Cincinnati to relax, and now that's live (and we never shipped any versions that would be mad about 1.1.0 to customers, the 4.6.0 Update Service operator went out before [4]). [1]: openshift/enhancements#821 [2]: openshift/enhancements#910 [3]: openshift/cincinnati#538 [4]: openshift/cincinnati#314
Consuming the
version
file that graph-data grew in openshift/cincinnati-graph-data#233, so the logs will contain more useful error messages when the plugin is fed an incompatible schema version.