-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(backend): configurable log level for driver / launcher images #11278
base: master
Are you sure you want to change the base?
Conversation
Hi @CarterFendley. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
d66664a
to
ce4527f
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. Thank you for tackling this, @CarterFendley!
Maybe worth adding just one unit test to verify if setting both env vars will generate the Workflow yaml with the new flags. |
Will do :) |
3f73d4c
to
714901f
Compare
Okay in this commit I have updated the compiler tests with logic to optional take in environment variables and set them: if tt.envVars != nil {
for _, envVar := range tt.envVars {
parts := strings.Split(strings.ReplaceAll(envVar, " ", ""), "=")
os.Setenv(parts[0], parts[1])
// Unset after test cases has ended
defer os.Unsetenv(parts[0])
}
} To test cases and golden files have been added to test the logic included in this PR. {
jobPath: "../testdata/hello_world.json",
platformSpecPath: "",
argoYAMLPath: "testdata/with_logging/hello_world.yaml",
envVars: []string{"DRIVER_LOG_LEVEL=5", "LAUNCHER_LOG_LEVEL=5"},
},
{
jobPath: "../testdata/importer.json",
platformSpecPath: "",
argoYAMLPath: "testdata/with_logging/importer.yaml",
envVars: []string{"DRIVER_LOG_LEVEL=5", "LAUNCHER_LOG_LEVEL=5"},
}, |
/lgtm |
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.
Thank you @CarterFendley.
Looks good. I just left a few minor comments.
@@ -303,8 +318,9 @@ func (c *workflowCompiler) addContainerExecutorTemplate(refName string) string { | |||
InitContainers: []wfapi.UserContainer{{ | |||
Container: k8score.Container{ | |||
Name: "kfp-launcher", | |||
Image: GetLauncherImage(), | |||
Command: []string{"launcher-v2", "--copy", component.KFPLauncherPath}, | |||
Image: c.launcherImage, |
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.
Any reason for this change besides optimization?
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.
No not really, just made it a bit concise to add flags and follows the pattern used in the other Container definitions for driver / launcher
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: droctothorpe The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: carter.fendley <[email protected]>
Signed-off-by: carter.fendley <[email protected]>
Signed-off-by: carter.fendley <[email protected]>
Signed-off-by: carter.fendley <[email protected]>
Signed-off-by: carter.fendley <[email protected]>
714901f
to
264d809
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
I wanted to install this and run it, and also verify that it's backwards compatible. All looks good with that, but I noticed one problem. You missed one of the launcher invocations, roughly here pipelines/backend/src/v2/driver/driver.go Lines 389 to 405 in c2a7713
The symptom is that even though I set LAUNCHER_LOG_LEVEL to something other than 1, the user code (impl) container logs always say Setting log level to: '1'
Launcher is invoked twice, in two different ways 🤦.
Once you add it, you should see it in the output of podSpecPatch in a container-driver log. Roughly:
And then the user code container log should respect the launcher log setting: |
@CarterFendley is there anything pending in this PR? |
@hbelmiro Yes, as noted by Greg, we want to make sure that the main container for the Had some discussion on slack about the possible implementations. I am OOO probably all of next week, will add that feature soon after I am back |
Description of your changes:
This PR adds the ability to change log level in the driver / launcher containers. This is implemented in a similar pattern as the overrides for driver / launcher images. Specifically, you can add the following environment variables to the
ml-pipeline
deployments:Note: A numerical value such as the literal
3
not"3"
here will be invalid deployment spec and validation on the spec will fail causingkubectl edit
to reject it with the message:error: deployments.apps "ml-pipeline" is invalid
.Other minor alterations
workflowCompiler.driverImage
andworkflowCompiler.launcherImage
attributes which are populated here. This is a very minor change but seemed better to invoke only once and match other such usages (in importer.go and dag.go). If there are reasons this should be re-invoked, please let me know.Feedback wanted
The environment variable for this is similar to the
V2_LAUNCHER_IMAGE
andV2_DRIVER_IMAGE
but without theV2_
prefix. If anyone has preferences here, I do not, so happy to take any path.Checklist: