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

Add parent support (devfile 2.0) to devfile #2919

Closed
2 tasks
elsony opened this issue Apr 17, 2020 · 11 comments · Fixed by #3432
Closed
2 tasks

Add parent support (devfile 2.0) to devfile #2919

elsony opened this issue Apr 17, 2020 · 11 comments · Fixed by #3432
Assignees
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. estimated-size/XL (40-60) Rough sizing for Epics. About 3 sprints of work for a person kind/user-story An issue of user-story kind v2 Issue or PR that applies to the v2 of odo
Projects

Comments

@elsony
Copy link

elsony commented Apr 17, 2020

/kind user-story

User Story

As a devfile developer, I would like use the new devfile 2.0 support to set the parent of a devfile (devfile/api#25)

Acceptance Criteria

  • If a devfile has the parent specified, load the devfile and the parent to generate a merged devfile to be used by odo
  • Support the merge model defined by the devfile 2.0 specification

Links

  • Related issue:

/kind user-story
/area devfile

@elsony elsony added this to For consideration in Sprint 183 via automation Apr 17, 2020
@openshift-ci-robot openshift-ci-robot added kind/user-story An issue of user-story kind area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. labels Apr 17, 2020
@elsony
Copy link
Author

elsony commented Apr 20, 2020

@kadel I think your team has done some POC work on this before. Do you have the link to code of that POC?

@kadel
Copy link
Member

kadel commented Apr 22, 2020

@kadel I think your team has done some POC work on this before. Do you have the link to code of that POC?

sure

but we need to have parser in place before we can start working on this. #2918 needs to be addressed first
/status blocked

@kadel kadel added the status/blocked Denotes an issue or PR that is blocked on something (e.g., issue/PR in different repo) label Apr 22, 2020
@elsony elsony added this to For consideration in Sprint 184 via automation May 8, 2020
@elsony elsony removed this from For consideration in Sprint 183 May 8, 2020
@elsony elsony removed this from For consideration in Sprint 184 May 29, 2020
@elsony elsony added this to For consideration in Sprint 185 via automation May 29, 2020
@girishramnani girishramnani moved this from For consideration to To do in Sprint 185 Jun 1, 2020
@mik-dass
Copy link
Contributor

mik-dass commented Jun 2, 2020

@kadel @elsony Are we planing to support kubernetes and ID parent references too?

@mik-dass
Copy link
Contributor

mik-dass commented Jun 3, 2020

@kadel @elsony Do we want to download the parent devfile too in the repo? Also what if the parent devfile also has a parent reference?

@girishramnani
Copy link
Contributor

the parser got merged so we are unblocked

@girishramnani girishramnani added triage/needs-information Indicates an issue needs more information in order to work on it. and removed status/blocked Denotes an issue or PR that is blocked on something (e.g., issue/PR in different repo) labels Jun 3, 2020
@kadel
Copy link
Member

kadel commented Jun 3, 2020

@kadel @elsony Are we planing to support kubernetes and ID parent references too?

Not at this time. We can consider it in the future, but there will be problems like what to do if odo is using docker mode etc... For this reason, I would defer this for now and just focus just on uri reference.

@kadel @elsony Do we want to download the parent devfile too in the repo? Also what if the parent devfile also has a parent reference?

No, we don't need to keep the parent devfile.
You can assume that parent devfile doesn't have parents.

@mik-dass
Copy link
Contributor

mik-dass commented Jun 4, 2020

  • If schema version is V1, do nothing
  • If schema version is V2, but has no parent, do nothing
  • If schema version is V2 and has a parent
  • Fetch the devfile without downloading, check if it the same API version or not. If not, error out.
  • If no overrides are present in the local devfile, extract the components and commands from the parent devfile and append with the local one.
  • If overrides are present, check the names in the local and search in the parent. If not found, error out. If found, merge the local and parent devfile and override the parent's values, maybe by using https://github.com/imdario/mergo
  • Add unit and integration tests for the various above scenarios.

@girishramnani girishramnani added estimated-size/XL (40-60) Rough sizing for Epics. About 3 sprints of work for a person triage/ready and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Jun 4, 2020
@mik-dass mik-dass moved this from To do to In progress in Sprint 185 Jun 18, 2020
@girishramnani girishramnani added this to For consideration in Sprint 186 via automation Jun 22, 2020
@girishramnani girishramnani removed this from In progress in Sprint 185 Jun 22, 2020
@girishramnani girishramnani moved this from For consideration to In progress in Sprint 186 Jun 22, 2020
@neeraj-laad
Copy link
Contributor

@kadel

You can assume that parent devfile doesn't have parents.

What is the rational for adding this constraint. This will become very restrictive and we'll end up with lots of copy/paste of information all over devfiles.

I think we should reconsider this.

@dharmit
Copy link
Member

dharmit commented Jun 22, 2020

Need answers on devfile/api#25 (comment) to move further smoothly without being blocked.

@mik-dass
Copy link
Contributor

mik-dass commented Jun 25, 2020

@cdrage
Copy link
Member

cdrage commented Jun 25, 2020

FYI / my notes, this is a good example on how a parent should be implemented / used within the Devfile: https://raw.githubusercontent.com/devfile/kubernetes-api/master/devfile-support/samples/with-nodejs-parent.devfile.yaml

schemaVersion: 2.0.0
metadata:
  name: with-parent
parent:
  uri: https://raw.githubusercontent.com/che-incubator/devworkspace-api/proposal-25-variant-1-define-stacks/devfile-support/samples/nodejs-stack.devfile.yaml
  projects:
    - name: example
      git:
          branch: 'mybranch'
commands:
  - exec:
      id: sayHello
      label: Say Hello
      commandLine: echo "hello"
      component: nodejs

@mik-dass mik-dass moved this from In progress to For review in Sprint 186 Jul 6, 2020
@girishramnani girishramnani removed this from For review in Sprint 186 Jul 13, 2020
@girishramnani girishramnani added this to For consideration in Sprint 187 via automation Jul 13, 2020
@girishramnani girishramnani moved this from For consideration to For review in Sprint 187 Jul 13, 2020
Sprint 187 automation moved this from For review to Done Jul 23, 2020
@rm3l rm3l added the v2 Issue or PR that applies to the v2 of odo label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. estimated-size/XL (40-60) Rough sizing for Epics. About 3 sprints of work for a person kind/user-story An issue of user-story kind v2 Issue or PR that applies to the v2 of odo
Projects
Archived in project
Sprint 187
  
Done
Development

Successfully merging a pull request may close this issue.

9 participants