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

Documents steps for component creation #4982

Merged
merged 8 commits into from
Aug 11, 2021
Merged

Documents steps for component creation #4982

merged 8 commits into from
Aug 11, 2021

Conversation

dharmit
Copy link
Member

@dharmit dharmit commented Aug 10, 2021

What type of PR is this?
/kind documentation

What does this PR do / why we need it:
what: $subject
why: because it helps users new to odo

Which issue(s) this PR fixes:

Fixes part of #4895

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

  • Update changelog

  • I have read the test guidelines

How to test changes / Special notes to the reviewer:

@netlify
Copy link

netlify bot commented Aug 10, 2021

✔️ Deploy Preview for odo-docusaurus-preview ready!

🔨 Explore the source changes: e15c6c3

🔍 Inspect the deploy log: https://app.netlify.com/sites/odo-docusaurus-preview/deploys/61128577150507000729e565

😎 Browse the preview: https://deploy-preview-4982--odo-docusaurus-preview.netlify.app

@netlify
Copy link

netlify bot commented Aug 10, 2021

✔️ Deploy Preview for odo-docusaurus-preview ready!

🔨 Explore the source changes: 6a4e77e

🔍 Inspect the deploy log: https://app.netlify.com/sites/odo-docusaurus-preview/deploys/611373c2ae6c6e0007618166

😎 Browse the preview: https://deploy-preview-4982--odo-docusaurus-preview.netlify.app

This is to ensure relevant folks are pinged for reviews.
Changelog.md Outdated
@@ -11,10 +11,11 @@

### Tests

- runs nightly test of main branch of odo against [SBO master branch](https://github.com/redhat-developer/service-binding-operator) ([4942](https://github.com/openshift/odo/issues/4942))
- runs nightly test of main branch of odo against [SBO master branch](https://github.com/redhat-developer/service-binding-operator) ([#4942](https://github.com/openshift/odo/issues/4942))
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Member Author

Choose a reason for hiding this comment

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

It would help if you elaborate beyond a "?".

Copy link
Member

Choose a reason for hiding this comment

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

What is this change? It is completely unrelated to this PR

Copy link
Member Author

Choose a reason for hiding this comment

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

1f0ac44

I hope that helps.

#4983

I hope that helps as well.

Among the various ways described above, irrespective of how you created the component, the next step to create the resources for our component on the cluster would be to run `odo push`

Note that first run of `odo push` could take a long time for the Spring Boot petclinic project. This is because of the dependencies being pulled by Spring Boot framework. Subsequent `odo push` runs shouldn't take longer when working on the same Kubernetes cluster.
Copy link
Member

Choose a reason for hiding this comment

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

Spring Boot framework is not pulling any dependencies. Spring boot is one of the dependency.
petclinic uses maven to manage java dependencies

Copy link
Member Author

Choose a reason for hiding this comment

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

I have reworded it. PTAL.

Copy link
Contributor

@valaparthvi valaparthvi left a comment

Choose a reason for hiding this comment

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

Overall the doc looks good to me. Good work :)

website/docs/using-odo/create-component.md Outdated Show resolved Hide resolved
website/docs/using-odo/create-component.md Outdated Show resolved Hide resolved
```
Now you will have a `devfile.yaml` in your current working directory. But odo is just not done asking you questions yet.
4. Lastly, odo asks you if you would like to download a starter project. Since we already cloned the petclinic project, we answer in No by typing `n` and hitting the return key:
Copy link
Contributor

Choose a reason for hiding this comment

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

Lastly, odo asks you if you would like to download a starter project.

Asking from a reader's perspective: What is a starter project?

I had this question a lot of times when I was getting started with odo; it might help to give starter project an alias, say example project in the brackets. Or better yet, add the hyperlink to the starter project section in the doc.

hitting the return key

Return key? Shouldn't it be the enter key?

Copy link
Member Author

Choose a reason for hiding this comment

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

Asking from a reader's perspective: What is a starter project?

I had this question a lot of times when I was getting started with odo; it might help to give starter project an alias, say example project in the brackets. Or better yet, add the hyperlink to the starter project section in the doc.

Thanks for the catch! I had put a reference in the beginning of the doc. So I didn't put it here. But then I removed that statement and didn't remember to put it here. Updated. PTAL.

Return key? Shouldn't it be the enter key?

They are the same. I have observed "Return" used more widely in docs.

website/docs/using-odo/create-component.md Outdated Show resolved Hide resolved
Comment on lines 105 to 106
$ odo create
Copy link
Contributor

Choose a reason for hiding this comment

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

Would && work on windows/mac? If not, should we separate the 2 commands?
Also, it would help with copying the command if you separate odo create in a different code block.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would && work on windows/mac? If not, should we separate the 2 commands?

I'm inclined to think it will work. @kadel can you help check if this works on Windows?

Also, it would help with copying the command if you separate odo create in a different code block.

I intentionally put it in the same block because the entire thing works just fine. But I'm on Fedora. Worth checking if it works on Windows. Mac, I would be surprised if it doesn't work.

## Push the component to Kubernetes

odo follows a "create & push" workflow for almost all the commands. Meaning, most odo commands won't create resources on Kubernetes cluster unless you run `odo push` command.
Copy link
Contributor

Choose a reason for hiding this comment

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

most odo commands won't create resources on Kubernetes cluster

I am still confused whether we should mention just the K8s cluster or OCP as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO k8s. OCP is for docs.openshift.com, not for upstream.

website/docs/using-odo/create-component.md Outdated Show resolved Hide resolved
Among the various ways described above, irrespective of how you created the component, the next step to create the resources for our component on the cluster would be to run `odo push`

Note that first run of `odo push` could take a long time for the Spring Boot petclinic project. This is because of the dependencies being pulled by maven for Spring Boot framework. Subsequent `odo push` runs shouldn't take longer when working on the same Kubernetes cluster.
Copy link
Contributor

Choose a reason for hiding this comment

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

Subsequent odo push runs shouldn't take longer when working on the same Kubernetes cluster.

Again, should it just be K8s or OCP as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

website/docs/using-odo/create-component.md Outdated Show resolved Hide resolved
[Component](../getting-started/basics#component) is the most basic unit of operation for odo. And the way to create one is using `odo create` (short for `odo component create`) command.

In simplest terms, when you "create" an odo component, you populate your current working directory with the file `devfile.yaml`. It is a manifest file that contains information about various resources (URL, Storage, Services, etc.) that correspond to your component, and will be created on the Kubernetes cluster when you execute `odo push` command. Most odo commands will first modify (add or remove configuration from) this file, and then subsequent `odo push` will create or delete the resources from the Kubernetes cluster. However, odo users are not expected to know how the `devfile.yaml` is organized; it is the odo commands that would create, update, or delete it.
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a manifest file that

I would rather prefer we say Devfile is a manifest file than calling it It.

Copy link
Contributor

Choose a reason for hiding this comment

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

However, odo users are not expected to know how the devfile.yaml is organized; it is the odo commands that would create, update, or delete it.

What do you think about highlighting this line in a separate para perhaps or just highlighting it here? It would sort of take away the pressure of learning a new thing i.e. Devfile.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense. Done both.

@valaparthvi
Copy link
Contributor

One more thing; I think you forgot to mention that a single directory can contain only one component.

@dharmit
Copy link
Member Author

dharmit commented Aug 11, 2021

One more thing; I think you forgot to mention that a single directory can contain only one component.

I forgot. But I'm not sure if adding that info in this doc makes sense. I'm more inclined to put it in odo component command reference doc.

Anyhow, I have added it in 6a4e77e. PTAL.

@kadel PTAL. Let me know if you folks would like to word it differently.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Aug 11, 2021
@valaparthvi
Copy link
Contributor

The doc lgtm to me for now, I don't see any immediate change we need to make to it.

@dharmit
Copy link
Member Author

dharmit commented Aug 11, 2021

Nesting odo components is not expected to work well.

When you say this, it gives an impression that managing nested components is possible with odo, which is not the possible, is it?

Why does it seem that way? I have mentioned that it is "not" expected to work well. I can change it to "not supported" instead of
"not expected to work well" if that helps. But I'm confused why it sounds exactly opposite of what I have written there.

@kadel
Copy link
Member

kadel commented Aug 11, 2021

This lookgs good, but I think that there is one important piece missing. "How to access the application".
There is a lot of details about how to create a component, but not how to access it after running odo push.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Aug 11, 2021
@dharmit
Copy link
Member Author

dharmit commented Aug 11, 2021

This lookgs good, but I think that there is one important piece missing. "How to access the application".
There is a lot of details about how to create a component, but not how to access it after running odo push.

That will be put up in doc for URL. At the moment, we have kept doc for env vars after the component creation doc. But I think it makes more sense to write doc for creating and accessing URL.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@kadel
Copy link
Member

kadel commented Aug 11, 2021

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Aug 11, 2021
@openshift-ci
Copy link

openshift-ci bot commented Aug 11, 2021

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Aug 11, 2021
@openshift-ci openshift-ci bot merged commit 7d206a9 into redhat-developer:main Aug 11, 2021
@dharmit dharmit deleted the 4895-create-component branch April 18, 2022 08:41
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. lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants