-
Notifications
You must be signed in to change notification settings - Fork 243
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
Support autoBuild
and deployByDefault
on Image and Kubernetes/OpenShift components
#6654
Support autoBuild
and deployByDefault
on Image and Kubernetes/OpenShift components
#6654
Conversation
✅ Deploy Preview for odo-docusaurus-preview canceled.
|
Skipping CI for Draft Pull Request. |
ec42a2c
to
055f71a
Compare
055f71a
to
683389a
Compare
8d11bed
to
3cfabfe
Compare
eaf492f
to
04052e5
Compare
It will be used for integration tests.
This will allow supporting cases where we need to run a custom command, but this is not implemented yet on odo (cases with 'odo dev --debug' and 'odo deploy'). In this case, this helper will allow updating the Devfile for example to unmark the current default command as non-default, and mark the custom one as default.
'odo build-images' should build all images regardless of the 'autoBuild' property.
This helps understand what resources are being patched.
…t of image components to auto-create See devfile/api#852 (comment) for more context.
|
||
- apply: | ||
component: autobuild-true-and-referenced | ||
id: image-autobuild-true-and-referenced |
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.
nit:
I think command ID could simply be image-autobuild-true
because if a command is defined for a component, it most definitely is referenced.
Same for other commands.
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.
Done in 65812b8
(#6720)
helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project"), commonVar.Context) | ||
helper.CopyExample(filepath.Join("source", "nodejs", "Dockerfile"), filepath.Join(commonVar.Context, "Dockerfile")) |
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.
Can you not use source/nodejs
directly?
helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project"), commonVar.Context) | |
helper.CopyExample(filepath.Join("source", "nodejs", "Dockerfile"), filepath.Join(commonVar.Context, "Dockerfile")) | |
helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context) |
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.
The source/nodejs
project does not have a debug
command in its sources, that's why. I remember that's why I did not use it. But you're right - I'll add the debug command and use it instead.
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.
Done in be23bbf
(#6720)
var err error | ||
var envvars []string | ||
if podman { | ||
envvars = append(envvars, "ODO_PUSH_IMAGES=false") |
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.
Side note: I wonder if we should implement ODO_PUSH_IMAGES
for odo dev
on cluster as well.
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.
On cluster, we are using PODMAN_CMD=echo
which is faster IMO. But yes, we could do the same thing on cluster.
if podman { | ||
devSession.WaitEnd() | ||
} |
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.
Why only for podman? I assume this has something to do with namespaces? Every test on cluster uses a different namespace, which is not true for podman. Still, I wonder if for the sake of simplicity we should wait for command to end on cluster as well.
Or, if you think this would save us time, perhaps we can implement this for all the remaining tests, in a separate PR of course.
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.
Yes, that was the idea, to save some time. On the cluster, it is not needed to wait, as we'll be cleaning the entire namespace after the test. On Podman, I had some issues if not waiting, due to how Podman kind of isolates things.
We can take a look in a different PR, if we can save more time on other tests.
linesErr, _ := helper.ExtractLines(stderr) | ||
var skipped []string | ||
for _, l := range linesErr { | ||
if strings.Contains(l, "Kubernetes components are not supported on Podman. Skipping:") { |
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.
Just so that it is easier to understand, would you mind adding a sample line in the comments?
if strings.Contains(l, "Kubernetes components are not supported on Podman. Skipping:") { | |
// Example line: Kubernetes components are not supported on Podman. Skipping: k8s-deploybydefault-true-and-referenced, k8s-deploybydefault-true-and-not-referenced. | |
if strings.Contains(l, "Kubernetes components are not supported on Podman. Skipping:") { |
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.
See a85e969
(#6720)
if comp.Kubernetes == nil && comp.Openshift == nil { | ||
continue | ||
} |
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.
Same comment as above, I don't think this condition will ever be hit since we are filtering the components based on their dedicated types.
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.
Done in 9544a55
(#6720)
/hold cancel |
@rm3l The changes I've suggested are more of nit picks. Since Philippe has already approved the PR, if we want to get this PR in with this release, I am fine if you want to take them up in a followup PR. |
Co-authored-by: Parthvi Vala <pvala@redhat.com>
Actually, there were some comments that made sense :) So I applied them. I'll make the other changes in a subsequent PR. Thanks for the feedback! |
Flaky /override OpenShift-Integration-tests/OpenShift-Integration-tests |
@rm3l: Overrode contexts on behalf of rm3l: OpenShift-Integration-tests/OpenShift-Integration-tests 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. |
/lgtm |
/hold I noticed that the |
Set deployByDefault to false on innerloop-pod component. Otherwise, since it is not referenced by any apply command, it will be automatically created by *both* 'odo dev' and 'odo deploy'.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/hold cancel The issues with |
/lgtm |
Flaky test /override OpenShift-Integration-tests/OpenShift-Integration-tests |
@rm3l: Overrode contexts on behalf of rm3l: OpenShift-Integration-tests/OpenShift-Integration-tests 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. |
Flaky E2E test (#6582) /override windows-integration-test/Windows-test |
@rm3l: Overrode contexts on behalf of rm3l: windows-integration-test/Windows-test 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. |
…Default`) (#6720) * Remove additional non-nil checks on component fields since they are already filtered by type We are confident that the fields we expect (comp.{Image,Kubernetes,OpenShift}) are non-nil. * Rename 'libdevfile.GetImageComponentsToPush' into 'libdevfile.GetImageComponentsToPushAutomatically' * Document with examples cases where 'deployByDefault' and 'autoBuild' are `false` and the component is not referenced * Rename 'image-autobuild-true-and-referenced' command into 'image-autobuild-true' in test Devfile * Simplify parsing the output on Podman in the tests when looking for K8s/OpenShift components * Use 'source/nodejs' instead of 'source/devfiles/nodejs/project' in the tests * Revert "Rename 'image-autobuild-true-and-referenced' command into 'image-autobuild-true' in test Devfile" This reverts commit 65812b8.
What type of PR is this:
/kind feature
What does this PR do / why we need it:
This adds support for the following fields:
autoBuild
on Image ComponentsdeployByDefault
on Kubernetes and OpenShift ComponentsSee devfile/api#852 (comment)
Which issue(s) this PR fixes:
Fixes #5694
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer:
Documentation is here: https://deploy-preview-6654--odo-docusaurus-preview.netlify.app/docs/development/devfile#how-odo-determines-components-that-are-applied-automatically