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

Deploy Command for OCP #3478

Closed
wants to merge 63 commits into from

Conversation

EnriqueL8
Copy link
Contributor

@EnriqueL8 EnriqueL8 commented Jul 2, 2020

What type of PR is this?
/kind feature

Documentation changes: Please include [skip ci] in your commit message as well
/kind documentation
[skip ci]

What does does this PR do / why we need it:
This PR implements odo deploy and odo deploy delete see proposal #3368.

Which issue(s) this PR fixes:
Implements #3300

How to test changes / Special notes to the reviewer:

  • Login to an OCP cluster
  • odo create - I would recommend choosing a stack that exposes a server associated with it or create a sample nodejs express server in your project. So that you container doesn't crash with CrashLoopBackOff and you can access a running app with the url.
  • add to the devfile 2.0.0 two fields in the metadata: alpha.build-dockerfile and alpha.deployment-manifest (See proposal). Use this as manifest.
  • odo url create
  • run odo deploy --tag image-registry.openshift-image-registry.svc:5000/<namespace>/<image-name>:<tag>
  • access URL

EnriqueL8 and others added 30 commits June 4, 2020 14:39
Signed-off-by: Steven Groeger <groeges@uk.ibm.com>
Signed-off-by: Steven Groeger <groeges@uk.ibm.com>
Signed-off-by: Steven Groeger <groeges@uk.ibm.com>
 - Downloads Dockerfile into memory rather than onto the hosts machine
 - Validates if a Dockerfile is present in the project source, if one isn't specified by the devfile
 - Validates the contents of the Dockerfile (that there is a FROM on the first non-comment/non-whitespace line)
 - Validates the tag passed as an arg conforms to the correct character-set
 - Copies all project source files into the container rather than new/updated
 - Additional Testing
 - More appropriate error/warning messages
Co-authored-by: Cameron McWilliam <cam.mcwilliam@me.com>
* Add test List URL function

Signed-off-by: Steven Groeger <groeges@uk.ibm.com>

* Update logging within maifest deploy

Signed-off-by: Steven Groeger <groeges@uk.ibm.com>

* Add preliminary support for multiple manifest in single yaml

Signed-off-by: Steven Groeger <groeges@uk.ibm.com>

* Update service manifest with ClusterIP value before update.

Signed-off-by: Steven Groeger <groeges@uk.ibm.com>

* Merge deployDelete code and update to support multiple doc in yaml

Signed-off-by: Steven Groeger <groeges@uk.ibm.com>

* Fix source formatting

Signed-off-by: Steven Groeger <groeges@uk.ibm.com>

* Add some extra checks on waitManifestDeployComplete function

Signed-off-by: Steven Groeger <groeges@uk.ibm.com>
alpha.deployment-manifest


Signed-off-by: Steven Groeger <groeges@uk.ibm.com>
Signed-off-by: Steven Groeger <groeges@uk.ibm.com>
Signed-off-by: Steven Groeger <groeges@uk.ibm.com>
* Remove CommonPushOptions and do some clean up

* Move validation, add better user experience, remove devfile.yaml flag
Signed-off-by: Steven Groeger <groeges@uk.ibm.com>
@girishramnani
Copy link
Contributor

quick question how is this PR different from #3751?

@jaideepr97
Copy link

jaideepr97 commented Aug 20, 2020

quick question how is this PR different from #3751?

@girishramnani this PR came first and it introduces all the code for the odo deploy command from scratch, and performs an openshift specific build as the default strategy (using buildconfig)

#3751 is built on top of this PR and just extends the odo deploy function to also perform unprivileged builds on kubernetes clusters (using kaniko)

@EnriqueL8
Copy link
Contributor Author

@EnriqueL8
There is some dns resolution issue. Can we try image-registry.openshift-image-registry.svc.cluster.local?

Will try, thanks!

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Aug 24, 2020
@EnriqueL8
Copy link
Contributor Author

/retest

@EnriqueL8
Copy link
Contributor Author

/retest

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Aug 27, 2020
pkg/devfile/adapters/common/types.go Outdated Show resolved Hide resolved
pkg/occlient/occlient.go Show resolved Hide resolved
@openshift-ci-robot
Copy link
Collaborator

@EnriqueL8: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/v4.3-integration-e2e 9d9cb93 link /test v4.3-integration-e2e
ci/prow/v4.4-integration-e2e 9d9cb93 link /test v4.4-integration-e2e
ci/prow/v4.2-integration-e2e 9d9cb93 link /test v4.2-integration-e2e
ci/prow/unit 51a5d36 link /test unit
ci/prow/v4.5-integration-e2e 51a5d36 link /test v4.5-integration-e2e

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.

@scottkurz
Copy link
Contributor

@EnriqueL8, I built your branch from 51a5d36 on Win10.

One thing that surprised me is that the keys change after doing the odo url create --port 9080 I needed in order to run deploy.

Odo changed my devfile keys from:

 alpha.build-dockerfile:  https://raw.githubusercontent.com/... =>  dockerfile: https://.....
 alpha.deployment-manifest =>  manifest

Is this expected?

I noticed too that when I did odo url create with the same the 2.0.0-beta-1 these two lines were completely deleted during odo url create.

@EnriqueL8
Copy link
Contributor Author

@EnriqueL8, I built your branch from 51a5d36 on Win10.

One thing that surprised me is that the keys change after doing the odo url create --port 9080 I needed in order to run deploy.

Odo changed my devfile keys from:

 alpha.build-dockerfile:  https://raw.githubusercontent.com/... =>  dockerfile: https://.....
 alpha.deployment-manifest =>  manifest

Is this expected?

I noticed too that when I did odo url create with the same the 2.0.0-beta-1 these two lines were completely deleted during odo url create.

This shouldn't be the case - will investigate further

@scottkurz
Copy link
Contributor

Opened #3968 to address the loss of the unrecognized properties on rewrite.. and maybe this PR was planning on dealing with this sepearately, and making them "recognized" within the parser's odo-internal representation of the schema.

@scottkurz
Copy link
Contributor

Just to clarify, this doesn't attempt to implement the build args described here: devfile/api#51 (comment) correct?

components:
  - id: build-node-app      
    dockerfile:
        id: mycompany/my-node-stack-dockerfile/v2.2.2
        args: []

// if it does, then check we have an port setup in env.yaml
do.DeploymentPort = 0
if bytes.Contains(manifestBytes, []byte("{{.PORT}}")) {
deploymentPort, err := do.EnvSpecificInfo.GetPortByURLKind(envinfo.ROUTE)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this maybe should be revisited. We'd like to enable the use case where, on OCP, you can push without doing odo url create , which means there will only be a devfile entry, but no env.yaml entry for the Url.

@scottkurz
Copy link
Contributor

Another thought.. (and maybe some of this should be moved to follow-up issue(s)).. it seems by default the tag is based on the current project / NS, not the one embedded in the project env.yaml (whereas with a push the pod is created in the env.yaml NS).

@@ -142,6 +142,19 @@ jobs:
# - travis_wait make test-cmd-docker-devfile-url-pushtarget
# These tests need cluster login as they will be interacting with a Kube environment
- odo login -u developer
- travis_wait make test-cmd-devfile-catalog
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK we are already running the whole devfile target under https://github.com/openshift/odo/blob/master/Makefile#L374-L377, its just duplicating the jobs.

@openshift-merge-robot
Copy link
Collaborator

@EnriqueL8: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/v4.6-integration-e2e 51a5d36 link /test v4.6-integration-e2e

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.

@openshift-ci
Copy link

openshift-ci bot commented Mar 1, 2021

@EnriqueL8: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/unit 51a5d36 link /test unit
ci/prow/v4.6-integration-e2e 51a5d36 link /test v4.6-integration-e2e
ci/prow/v4.7-e2e-4x-psi 51a5d36 link /test v4.7-e2e-4x-psi
ci/prow/v4.7-integration-e2e 51a5d36 link /test v4.7-integration-e2e

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.

@girishramnani
Copy link
Contributor

thank you for this PR but it seems to have diverged, we can come back to this feature once we are ready, hence closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.