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

Implement devfile parser #2477

Closed
kadel opened this issue Dec 18, 2019 · 1 comment · Fixed by #2500
Closed

Implement devfile parser #2477

kadel opened this issue Dec 18, 2019 · 1 comment · Fixed by #2500
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/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation

Comments

@kadel
Copy link
Member

kadel commented Dec 18, 2019

The goal is to have a package to handle devfile deserialization

  • we need to create parser architecture that will handle parsing multiple devfile spec versions (currently there is 1.0.0 and 1.0.1-beta
  • the design should ideally avoid logic duplication. It should be possible to share common code between devfile spec versions as the expectation is that the new devfile versions will be mostly just adding new files

from the implementation plan:

Create a golang library for parsing and reading data from Devfile
Devfile is versioned file so the design of a library needs to be able to handle and support multiple Devfile versions at the same time

Parser high level design:

  • The parser would read the provided devfile.
  • From the devfile, parser would look for the API Version of the devfile and validate whether the API version in supported in odo.
  • The devfile schema is based on http://json-schema.org/draft-07/schema#
  • Hence, the parser would validate the integrity of the provided devfile with the devfile json schema of the respective API version.
  • Furthermore, parser would try to map devfile sections (projects, components, commands etc) to their respective Golang structs.
  • The idea is to have same Golang structs for the devfile sections across different API version contingent to the condition that the sections themselves are compatible across the API versions..
  • This is very similar to the way Golang structs are handled across different GVK versions in kubernetes. https://github.com/kubernetes/kubernetes/blob/ded2ff39c381b122951dd103dafb291755791921/staging/src/k8s.io/apimachinery/pkg/runtime/scheme.go#L32
  • The implementation details for this with respect to odo are being worked upon and once confirmed would be updated here.
@kadel
Copy link
Member Author

kadel commented Dec 18, 2019

/area devfile

@openshift-ci-robot openshift-ci-robot added the area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. label Dec 18, 2019
@girishramnani girishramnani added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Jan 6, 2020
@kadel kadel removed the points/21 label Jan 8, 2020
@girishramnani girishramnani added the estimated-size/XL (40-60) Rough sizing for Epics. About 3 sprints of work for a person label Jan 8, 2020
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/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants