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

Adds documentation on Devfile file reference #3487

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

cdrage
Copy link
Member

@cdrage cdrage commented Jul 3, 2020

What type of PR is this?

/kind documentation
[skip ci]

TO PREVIEW: Click on: https://charliedrage.com/odo/file-reference/

What does does this PR do / why we need it:

This PR adds documentation regarding each section of Devfile and what we
support / do not support

Which issue(s) this PR fixes:

N/A

How to test changes / Special notes to the reviewer:

N/A

Signed-off-by: Charlie Drage charlie@charliedrage.com

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign cdrage
You can assign the PR to them by writing /assign @cdrage in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cdrage
Copy link
Member Author

cdrage commented Jul 3, 2020

Please NOTE:

The file formatting in this PR will be reflected within the gh-pages branch AFTER it's been merged.

I do need help with regards to figuring out which parts are implemented and not implemented yet, see: https://github.com/openshift/odo/pull/3487/files#diff-cbdbdd6ef8f9eed70da67b2888a01b64R116

@cdrage
Copy link
Member Author

cdrage commented Jul 3, 2020

Document is best viewed in the markdown format: https://github.com/openshift/odo/blob/8da8401ae08f4a9b358dbe12c0855836b849323c/docs/file-reference/index.md

Specifically, the reason for the > note formatting + YAML + description is because I will be using https://github.com/slatedocs/slate for the output.


# Introduction

> A full odo Devfile example using Spring Boot
Copy link

Choose a reason for hiding this comment

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

Should we move this example to somewhere below? I think it flows better if we describe what odo and devfiles are first before we start giving out devfile example.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi Elson, the example needs to remain as the first thing since this is consumed by https://github.com/slatedocs/slate

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you elaborate, @cdrage, please? How is this document supposed to be consumed?


**odo**

odo is a fast, iterative, and straightforward CLI tool for developers who write, build, and deploy applications on OpenShift.
Copy link

Choose a reason for hiding this comment

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

We support both Kubernetes and OpenShfit.


What is a devfile?

A devfile is a portable file that describes your development environment. It allows for a portable developmental environment without the need of reconfiguration.
Copy link

Choose a reason for hiding this comment

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

Consider to change "It allows for a portable developmental environment.. " to "It allows reproducing a portable developmental environment... "


With a devfile you can describe:

* The source code being used
Copy link

Choose a reason for hiding this comment

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

Consider to remove since I think it is the same as the last item (project).

With a devfile you can describe:

* The source code being used
* Development components such as IDE tools (VSCode) and application runtimes (Yarn / NPM)
Copy link

Choose a reason for hiding this comment

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

Given that for odo usage, our focus is on the container components (we don't even use IDE tools info in odo), consider to change to something like "Development components such as container definition for build and application runtimes."

| name | string | yes | Name of your endpoint |
| targetPort | integer | yes | Port number that you are targeting |
| configuration | [configurationObject](#configurationobject) | no | Configuration attributes regarding the port number and protocol(s) being used |
| attributes | [attributesObject](#attributesobject) | no | UNKNOWN, TODO: FILL IN HERE! |
Copy link

Choose a reason for hiding this comment

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

Attributes are optional map of free-form additional info.
Note: this applies to all attributes fields in all levels with a devfile, not specific to this one

| github | [githubObject](#githubobject) | Pull from GitHub |
| zip | [zipObject](#zipobject) | Get from a zip location |

## gitObject
Copy link

Choose a reason for hiding this comment

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

Consider to make all these object titles to be consistent, e.g. "git Object" instead of "gitObject".
Note: this comment applies to all object section titles

Copy link
Member Author

Choose a reason for hiding this comment

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

The reasoning for the camelCase is to fit with the other string, integer and boolean listings of variable types.


| Key | Type | Description |
|------------|---------------------------|---------------------------|
| execObject | [execObject](#execobject) | The CLI command to be ran |
Copy link

Choose a reason for hiding this comment

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

The key should be "exec"

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, you're right. Thanks

| Key | Type | Required | Description |
|-----------|---------|----------|--------------------------------------------------------------------------------|
| kind | string | yes | Kind of group the command is part of. Options: `build`, `run`, `test`, `debug` |
| isDefault | boolean | no | Identifies that it is the default command to be ran |
Copy link

Choose a reason for hiding this comment

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

Add: Only one default command can be defined for each group.

| kind | string | yes | Kind of group the command is part of. Options: `build`, `run`, `test`, `debug` |
| isDefault | boolean | no | Identifies that it is the default command to be ran |

# Universal objects
Copy link

Choose a reason for hiding this comment

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

attributes can be added to univerisal objects

> Download the application

```sh
$ odo create nodejs --downloadSource
Copy link
Member

Choose a reason for hiding this comment

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

Should be --starter now with #3425 merged

@cdrage
Copy link
Member Author

cdrage commented Jul 7, 2020

Thanks for reviewing @elsony I've addressed your requested changes!

If you haven't used odo yet, we recommend going through our [Deploying a devfile using odo guide](https://odo.dev/docs/deploying-a-devfile-using-odo/).


# Devfile Properties
Copy link
Member

@kadel kadel Jul 8, 2020

Choose a reason for hiding this comment

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

Wouldn't be better to just link to official devfile reference? How are we going to keep this updated as devfile spec changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, as it stands, this is more a devfile doc which should probably live under the devfile project as it doesn't really have much information pertaining to what can be done with odo and devfiles…

Copy link
Member Author

Choose a reason for hiding this comment

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

@metacosm I do agree as well. I'm hoping we get this document upstream instead of the odo site, but unsure if we will be able to with time constraints regarding the alpha release of odo / Devfile v2.

@cdrage
Copy link
Member Author

cdrage commented Jul 9, 2020

Hey all, to preview this please visit: https://charliedrage.com/odo/file-reference/


# Introduction

> A full odo Devfile example using Spring Boot
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you elaborate, @cdrage, please? How is this document supposed to be consumed?

isDefault: true
```

> Download the application
Copy link
Contributor

Choose a reason for hiding this comment

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

That seems randomly put and completely unrelated to the perceived (at least by me) intent of the document…

$ odo push
```

**odo**
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this section needed?


What is a devfile?

A devfile is a portable file that describes your development environment. It allows reproducing a portable developmental environment without the need of reconfiguration.
Copy link
Contributor

Choose a reason for hiding this comment

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

Portable how? What kind of development environment?

* A list of pre-defined commands that can be run
* Projects to initially clone

Odo takes this devfile and transforms it into a workspace of multiple containers running on OpenShift, Kubernetes or Docker.
Copy link
Contributor

Choose a reason for hiding this comment

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

What's a workspace?


Odo takes this devfile and transforms it into a workspace of multiple containers running on OpenShift, Kubernetes or Docker.

Devfiles are YAML files with a defined schema.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would still be helpful to repeat it here because that's where the information is needed.


Devfiles are YAML files with a defined schema.

## Unsupported features
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better to start with supported features, in my opinion.

If you haven't used odo yet, we recommend going through our [Deploying a devfile using odo guide](https://odo.dev/docs/deploying-a-devfile-using-odo/).


# Devfile Properties
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, as it stands, this is more a devfile doc which should probably live under the devfile project as it doesn't really have much information pertaining to what can be done with odo and devfiles…

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jul 13, 2020

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

Test name Commit Details Rerun command
ci/prow/v4.4-integration-e2e b383808 link /test v4.4-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.

@metacosm
Copy link
Contributor

Why all the force pushes? Why are the tests run? It all makes it very difficult to follow up on the review… 😢

@cdrage
Copy link
Member Author

cdrage commented Jul 15, 2020

Why all the force pushes? Why are the tests run? It all makes it very difficult to follow up on the review…

Force of habit haha! Should of put in separate commits.

Unfortunately tests are ran regardless even though it's only doc changes :(

Did you also have a look at the website preview with regards how to consume the file? https://charliedrage.com/odo/file-reference/

@metacosm
Copy link
Contributor

metacosm commented Jul 16, 2020

Why all the force pushes? Why are the tests run? It all makes it very difficult to follow up on the review…

Force of habit haha! Should of put in separate commits.

Especially for docs, there really is no need to force push. This should only be reserved to cases where there is a conflict that needs to be fixed and, if possible, only after the review process is finished (though fixing the conflict might require a second pass).

Unfortunately tests are ran regardless even though it's only doc changes :(

You can specify that tests shouldn't run by adding [skip ci] to your commits (though I still think that CI should be skipped automatically for commits affecting some non-code paths)…

Did you also have a look at the website preview with regards how to consume the file? https://charliedrage.com/odo/file-reference/

Yes, thank you.

Copy link
Member

@dharmit dharmit left a comment

Choose a reason for hiding this comment

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

Mostly naming suggestions.

docs/file-reference/index.md Show resolved Hide resolved
docs/file-reference/index.md Show resolved Hide resolved
docs/file-reference/index.md Outdated Show resolved Hide resolved
docs/file-reference/index.md Show resolved Hide resolved
docs/file-reference/index.md Outdated Show resolved Hide resolved
docs/file-reference/index.md Outdated Show resolved Hide resolved
docs/file-reference/index.md Show resolved Hide resolved
docs/file-reference/index.md Outdated Show resolved Hide resolved
docs/file-reference/index.md Outdated Show resolved Hide resolved
**What type of PR is this?**
> Uncomment only one ` /kind` line, and delete the rest.
> For example, `> /kind bug` would simply become: `/kind bug`

> 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 adds documentation regarding each section of Devfile and what we
support / do not support

**Which issue(s) this PR fixes**:

N/A

**How to test changes / Special notes to the reviewer**:

N/A

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
@cdrage
Copy link
Member Author

cdrage commented Jul 31, 2020

I will have to merge this as-is for now in order to get documentation in time for alpha release. We can update / edit this at a later date / go through this with the docs team @boczkowska @Preeticp

@cdrage cdrage merged commit 9c93a29 into redhat-developer:master Jul 31, 2020
cdrage added a commit that referenced this pull request Aug 4, 2020
* Adds documentation on Devfile file reference (#3487)

**What type of PR is this?**
> Uncomment only one ` /kind` line, and delete the rest.
> For example, `> /kind bug` would simply become: `/kind bug`

> 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 adds documentation regarding each section of Devfile and what we
support / do not support

**Which issue(s) this PR fixes**:

N/A

**How to test changes / Special notes to the reviewer**:

N/A

Signed-off-by: Charlie Drage <charlie@charliedrage.com>

* Update file reference documentation (#3675)

**What type of PR is this?**
> Uncomment only one ` /kind` line, and delete the rest.
> For example, `> /kind bug` would simply become: `/kind bug`

/kind documentation
[skip ci]

**What does does this PR do / why we need it**:

Updates the file reference documentation to not have the introductory
section and move unsupported features to the bottom.

**Which issue(s) this PR fixes**:

N/A

**PR acceptance criteria**:

N/A

**How to test changes / Special notes to the reviewer**:

N/A

Signed-off-by: Charlie Drage <charlie@charliedrage.com>

* make odo delete work on s2i components in experimental mode (#3649)

* Fixes GetRunningPodNameByComponent for the CLI runners (#3666)

* increase ResponseHeaderTimeout (#3674)

* Make the file sync destination more consistent (#3662)

* Make the file sync destination more consistent

Signed-off-by: John Collier <John.J.Collier@ibm.com>

* Update tests to use PROJECTS_ROOT

Signed-off-by: John Collier <John.J.Collier@ibm.com>

* Fix workdir in tests

Signed-off-by: John Collier <John.J.Collier@ibm.com>

* Remove more references to nodejs-starter

Signed-off-by: John Collier <John.J.Collier@ibm.com>

* Update more sample devfiles

Signed-off-by: John Collier <John.J.Collier@ibm.com>

* make odo catalog list components work outside of experimental mode (#3669)

* make odo catalog list components work outside of experimental mode

* moved the logic to cli

* Ignore error while checking for imagestream support

* rearranged the catalog list

* Validate exec subcommands in a composite (#3658)

* Validate exec subcommands in composite

* Add integration test

* added --s2i flag for `odo create` command

* corrected error messages

* Corrected flag description and validation

* added --s2i flag for `odo create` command

* Make Devfile the default deployment mechanism for odo

**What type of PR is this?**
> Uncomment only one ` /kind` line, and delete the rest.
> For example, `> /kind bug` would simply become: `/kind bug`

/kind feature

**What does does this PR do / why we need it**:

Makes Devfile the default deployment mechanism, removing S2I in favour
of Devfile deployment.

**Which issue(s) this PR fixes**:

Closes #3550

**How to test changes / Special notes to the reviewer**:

Run:

```sh
odo preference set experimental false
odo create --starter nodejs
odo push
```

Co-authored-by: Girish Ramnani <girishramnani95@gmail.com>
Co-authored-by: Mrinal Das <mrinald7@gmail.com>
Co-authored-by: Tomas Kral <tkral@redhat.com>
Co-authored-by: John Collier <John.J.Collier@ibm.com>
Co-authored-by: Devang Gaur <devang.gaur.7@gmail.com>
@cdrage cdrage deleted the file-reference branch January 14, 2022 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants