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
odo deploy command #5228
odo deploy command #5228
Conversation
Updating |
9671ae9
to
f9f95ca
Compare
✔️ Deploy Preview for odo-docusaurus-preview ready! 🔨 Explore the source changes: 00d67eb 🔍 Inspect the deploy log: https://app.netlify.com/sites/odo-docusaurus-preview/deploys/619e064c88d4720007e9242a 😎 Browse the preview: https://deploy-preview-5228--odo-docusaurus-preview.netlify.app |
d25161a
to
558111b
Compare
042d170
to
1d82d29
Compare
This problem has been fixed in devfile/api |
1d82d29
to
3bfc49a
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.
Only docs review.
odo can be used to deploy components in a similar manner they would be deployed by a CI/CD system, | ||
by first building the images of the containers to deploy, then by deploying the Kubernetes resources | ||
necessary to deploy the components. |
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.
Should we clarify here that odo deploy
works only for devfiles having schemaVersion 2.2.0 or above? Or is that not accurate and odo deploy
would work if it finds the required key-values even if the devfile schemaVersion was below 2.2.0?
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.
It is accurate. If the devfile revision is lower than 2.2.0, the devfile library will not validate the file:
✗ invalid devfile schema. errors :
- commands.6.composite.group.kind: commands.6.composite.group.kind must be one of the following: "build", "run", "test", "debug"
- a command referencing an `Image` component that, when applied, will build the image of the container to deploy, | ||
- a command referencing a `Kubernetes` component that, when applied, will create Kubernetes resources in the cluster. | ||
|
||
With the following example `devfile.yaml` file, a container image will be built by using the `Dockerfile` present in the directory, |
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.
IMO, having a fully functional devfile would help here. That way, we can address the point of odo deploy
support for devfile 2.2.0 or higher (if we need to.)
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.
I would prefer not to add a complete devfile. There are a lot of mandatory parts in the devfile that won't be related to this subject, that will make a very long file and will be difficult for the reader to focus on the important parts
I added the schemaVersion
to highlight that it should be >= 2.2.0
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.
OK. Makes sense. If you think adding a link to a fully functional devfile would make sense, then you could add it. Otherwise, it's OK. We can revisit the discussion if anyone asks for such a devfile. 😄
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.
Reviewed only the integration test to figure out how to and what to test for odo deploy
.
64cc361
to
da5939f
Compare
@dharmit thanks for the review on doc, I made the changes |
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.
Still reviewing the code. But it's a lot of files, so not waiting till I'm done.
pkg/odo/cli/deploy/deploy.go
Outdated
// RecommendedCommandName is the recommended command name | ||
const RecommendedCommandName = "deploy" | ||
|
||
// LoginOptions encapsulates the options for the odo command |
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.
s/LoginOptions/DeployOptions/g
on this file, maybe?
pkg/devfile/components.go
Outdated
return false, nil | ||
} | ||
|
||
// AddKubernetesComponentToDevfile adds service definition to devfile as an inlined Kubernetes component |
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.
It's no longer just service definition. You moved the code but forgot to update the comment.
pkg/devfile/components.go
Outdated
return addKubernetesComponent(crd, name, componentContext, devfile, devfilefs.DefaultFs{}) | ||
} | ||
|
||
// AddKubernetesComponent adds the crd information to a separate file and adds the uri information to a devfile component |
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.
// AddKubernetesComponent adds the crd information to a separate file and adds the uri information to a devfile component | |
// addKubernetesComponent adds the crd information to a separate file and adds the uri information to a devfile component |
pkg/devfile/components.go
Outdated
return devfileData | ||
} | ||
|
||
// GetComponentsToPush returns the list of Kubernetes components to push, |
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.
// GetComponentsToPush returns the list of Kubernetes components to push, | |
// GetKubernetesComponentsToPush returns the list of Kubernetes components to push, |
d7d8b00
to
1a9ccda
Compare
/test v4.9-integration-e2e
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kadel 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 |
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
/test psi-kubernetes-integration-e2e
|
/test psi-kubernetes-integration-e2e
|
@@ -10,8 +10,8 @@ import ( | |||
"github.com/pkg/errors" | |||
) | |||
|
|||
// simpleCommand is a command implementation for non-composite commands | |||
type simpleCommand struct { | |||
// execCommand is a command implementation for non-composite 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.
Should the file be renamed to command_exec.go
as well?
/lgtm #5228 (comment) is not a blocker and can be done separately. However, in case you change it in this PR, can you please ask Tomas to lgtm it again if I'm not around tomorrow? |
* Update devfile library * deploy cmd * Init "odo deploy" command reference * Integration test * Fix odo deploy * Filter components to apply during odo push * Output * Remove redondant level 1 title * Doc review * Use server-side apply to apply Kubernetes components * Review * Replace PROJECT_ROOT with PROJECTS_ROOT
/kind feature
What does this PR do / why we need it:
Which issue(s) this PR fixes:
Fixes #5151
PR acceptance criteria:
Unit test
Integration test
Documentation
I have read the test guidelines
How to test changes / Special notes to the reviewer: