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

flowey: follow-up to remaining binary size comparison comments #909

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

justus-camp-microsoft
Copy link
Contributor

#475 got merged with some outstanding comments. This should clean up the comments that were remaining on that PR.

Included in this change:

  1. Hang off a new conditional dep_on job for publishing the baseline artifact instead of hijacking the build_and_publish_openhcl_igvm_from_recipe node
  2. Adds an artifact resolver for the baseline size artifact to eliminate having to guess/plumb paths through
  3. Moves git_merge_commit from flowey_lib_common to flowey_lib_hvlite and renamed to gh_merge_commit as this node is somewhat tied to specifically our repo.
  4. Outstanding question: Do we want to also diff the aarch64 binary? We're currently uploading an artifact for it but only diffing the x86_64 binary.

@@ -4,6 +4,7 @@
//! Gets the merge commit of a PR to base branch

use flowey::node::prelude::*;
use flowey_lib_common::install_git;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the flowey idiom is to use the full node-path as part of the import and req calls.

Copy link
Contributor

Choose a reason for hiding this comment

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

...on that note - you'll want to add a reqv on the install_git's side-effect as part of the emit_rust_step, to make sure that git is actually installed.

(ideally, flowey would warn about unused imports... but that's a tricky problem to solve in the general case)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, is it fair to say this node was meant for locally run nodes? Might just be doing something wrong, but actually calling it gives this error on generation:

error while processing flowey_lib_common::install_git: Missing essential request: LocalOnlyAutoInstall
Error: in job 'verify openhcl binary size [x64]': encountered one or more errors

Do GitHub and ADO guarantee that git is available on the machine?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's quite possible that this node has not been properly wired up to work in non-local contexts, yes.

Do GitHub and ADO guarantee that git is available on the machine?

I think you should be thinking about this the other way - given that the gh_merge_commit node is not gh/ado specific, and could conceivably be run locally (e.g: if someone wanted to run verify-size locally), it feels like we shouldn't assume git is installed on the machine, no?

of course, the fact we're talking about git muddies the convo a bit (i.e: of course they'll have git installed, who doesn't have git installed?), but the broader point is that when you're writing flowey code, you really want to be doing the best you can to accurately declare the expectations you have of the environment you're running jobs in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went ahead and modified the node so that it should work on CI and locally

let auto_install = auto_install.ok_or(anyhow::anyhow!(
"Missing essential request: LocalOnlyAutoInstall",
))?;
let auto_install = auto_install.unwrap_or(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Its a little boilerplate-ey at the moment, but look at other instances of LocalOnly requests to see how you should handle the different behaviors on each backend.

i.e: the request should still be required if you run on a local backend

let artifact_dir = rt.read(artifact_dir);

let openvmm_openhcl_x86_output = OpenvmmSizeCheckArtifact {
bin: artifact_dir.join("x64-openhcl-baseline").join("openhcl"),
Copy link
Contributor

Choose a reason for hiding this comment

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

this doesn't seem quite right. at least - it doesn't line up with the format from the publish node above.

hmm, are you sure your artifact download node is returning the right directory? i.e: shouldn't it return the directory directly containing the artifact contents, as opposed to a directory containing another directory, which then contains the artifact contents?

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.

2 participants