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

docs: Improve top-level README #3558

Merged
merged 1 commit into from
Feb 16, 2022

Conversation

jodh-intel
Copy link
Contributor

Various improvements to the top-level README file:

  • Moved the following sections from the runtime's README to the
    top-level README:
    • License
    • Platform support / Hardware requirements
  • Added the following sections to the top-level README:
    • Configuration
    • Hypervisors
  • Improved formatting of the Documentation section in the top-level
    README.
  • Removed some unused named links from the top-level README.

Fixes: #3557.

Signed-off-by: James O. D. Hunt james.o.hunt@intel.com

@jodh-intel jodh-intel requested a review from a team as a code owner January 26, 2022 10:46
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated
Comment on lines 76 to 79
## Configuration

See the [runtime configuration details](src/runtime/README.md#configuration) and
the [stateless systems](src/runtime/README.md#stateless-systems)
documentation.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm undecided whether this is the best approach (reference the config details in the runtime's README) or whether we should just move those details to the top-level README since the config file doesn't just apply to the runtime. Thoughts folks?

Copy link
Member

Choose a reason for hiding this comment

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

The config file doesn't just apply to the runtime, but doesn't everything that we describe in that README only apply to the runtime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Jakob-Naucke - I'm not totally clear on what you're saying here. The license and platform support applies to the whole project so that's why I've moved it to the top-level. The config is a bit more debatable since although it's technically for the runtime (it's read by the runtime), it also affects other parts of the system (such as the agent). Are you saying we should move that config detail into the top-level too? That would make the information more visible but I left it in the runtime README since if we moved the full details to the top-level README, it felt a bit odd for the runtime's README to refer to another file for it's configuration. It's debatable though ;)

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I'm too brief lately :) I meant: While the Kata Containers config does not only affect the runtime, AFAICT, everything we describe in https://github.com/kata-containers/kata-containers/tree/main/src/runtime#configuration does only affect the runtime. Thus, right now, I don't see a reason to move it up anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack. I've updated the Configuration for both README's to give a bit of extra information to users.

@jodh-intel
Copy link
Contributor Author

Ugh. The static checker is failing to validate a correct URL:

[static-checks.sh:584] ERROR: found HTTP error status codes for URL https://www.amd.com (403)
ERROR: Invalid URL 'https://www.amd.com' found in the following files:

README.md

The problem appears to be that the site in question is filtering on the user agent. Our CI checker doesn't set one, hence the HTTP 403 ("forbidden") error message.

For now, I've just removed that link since currently there is no good way to fix the static checker's URL check in a generic way.

@fidencio
Copy link
Member

A head's up that may affect your PR.

In the Architecture Committee meeting from January 25th, 2022, the Architecture Committee has agreed on using the "Dismiss stale pull request approvals when new commits are pushed" configuration from GitHub. It basically means that if your PR has been rebased or updated, the approvals given will be erased.

In order to minimize traumas due to the new approach, please, consider adding a note on the changes done before the rebase / force-push, and also pinging the reviewers for a subsequent round of reviews.

Thanks for your understanding!

Related issue: kata-containers/community#249

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@jodh-intel jodh-intel force-pushed the docs-rework-readme branch 3 times, most recently from 9160dc9 to e779aff Compare February 1, 2022 08:51
@jodh-intel
Copy link
Contributor Author

Ping for reviews y'all!

Copy link
Member

@Jakob-Naucke Jakob-Naucke left a comment

Choose a reason for hiding this comment

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

Thank you @jodh-intel, also for the spelling updates. I have two other minor comments...

README.md Outdated Show resolved Hide resolved
Comment on lines 53 to 54
> - The runtime will read the configuration file from one of [two
> possible locations](#stateless-systems).
Copy link
Member

Choose a reason for hiding this comment

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

What about the /opt/kata tree?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, there's a bit more detail here, indeed. it'd be more accurate to say what it will do by default.

If we want to provide more detail, we can find a nice way to describe what actually happens, hopefully more succinctly than I do in my blather that follows:

It'll first check if a config path is specified in annotations associated with the pause container (yuck - I hope no one ever does this), and then it'll check for a path specified within the CreateTaskRequest (this is what is done in the case of kata-deploy install, since we look at /opt/kata...), and then finally check the two default locations on the host filesystem, with /etc/kata-containers taking precedence over /usr/share/defaults/kata-containers....).

See:

func loadRuntimeConfig(s *service, r *taskAPI.CreateTaskRequest, anno map[string]string) (*oci.RuntimeConfig, error) {
if s.config != nil {
return s.config, nil
}
configPath := oci.GetSandboxConfigPath(anno)
if configPath == "" && r.Options != nil {
v, err := typeurl.UnmarshalAny(r.Options)
if err != nil {
return nil, err
}
option, ok := v.(*crioption.Options)
// cri default runtime handler will pass a linux runc options,
// and we'll ignore it.
if ok {
configPath = option.ConfigPath
} else {
// Some versions of containerd, such as 1.4.3, and 1.4.4
// still rely on the runtime options coming from
// github.com/containerd/cri-containerd/pkg/api/runtimeoptions/v1
// Knowing that, instead of breaking compatibility with such
// versions, let's work this around on our side
oldOption, ok := v.(*oldcrioption.Options)
if ok {
configPath = oldOption.ConfigPath
}
}
}
// Try to get the config file from the env KATA_CONF_FILE
if configPath == "" {
configPath = os.Getenv("KATA_CONF_FILE")
}
_, runtimeConfig, err := katautils.LoadConfiguration(configPath, false)
if err != nil {
return nil, err
}
// For the unit test, the config will be predefined
if s.config == nil {
s.config = &runtimeConfig
}
return &runtimeConfig, nil
}

fidencio
fidencio previously approved these changes Feb 1, 2022
Copy link
Member

@fidencio fidencio left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @jodh-intel!

### Hardware requirements

The [Kata Containers runtime](src/runtime) provides a command to
determine if your host system is capable of running and creating a
Copy link
Member

Choose a reason for hiding this comment

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

I, personally, think that kata-runtime check is not the best way to check whether the host system is capable of running and creating a Kata Container.

As we're 100% Kubernetes focused nowadays, I'd rather see us working on and recommending NFD instead.

But hey, I guess this is the best we have now.

Copy link
Member

Choose a reason for hiding this comment

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

I find the tool useful as a starting point, however -- most people will come here to test in their VM environment, and this helps. I do wonder if we need /want this here versus user/developer guide?

@fidencio
Copy link
Member

fidencio commented Feb 2, 2022

/test

@fidencio
Copy link
Member

fidencio commented Feb 2, 2022

/retest

egernst
egernst previously approved these changes Feb 4, 2022
Copy link
Member

@egernst egernst left a comment

Choose a reason for hiding this comment

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

Nice improvements! I left a bit of feedback, mostly just agreeing with Jakob :)

README.md Outdated Show resolved Hide resolved
### Hardware requirements

The [Kata Containers runtime](src/runtime) provides a command to
determine if your host system is capable of running and creating a
Copy link
Member

Choose a reason for hiding this comment

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

I find the tool useful as a starting point, however -- most people will come here to test in their VM environment, and this helps. I do wonder if we need /want this here versus user/developer guide?

Comment on lines 53 to 54
> - The runtime will read the configuration file from one of [two
> possible locations](#stateless-systems).
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, there's a bit more detail here, indeed. it'd be more accurate to say what it will do by default.

If we want to provide more detail, we can find a nice way to describe what actually happens, hopefully more succinctly than I do in my blather that follows:

It'll first check if a config path is specified in annotations associated with the pause container (yuck - I hope no one ever does this), and then it'll check for a path specified within the CreateTaskRequest (this is what is done in the case of kata-deploy install, since we look at /opt/kata...), and then finally check the two default locations on the host filesystem, with /etc/kata-containers taking precedence over /usr/share/defaults/kata-containers....).

See:

func loadRuntimeConfig(s *service, r *taskAPI.CreateTaskRequest, anno map[string]string) (*oci.RuntimeConfig, error) {
if s.config != nil {
return s.config, nil
}
configPath := oci.GetSandboxConfigPath(anno)
if configPath == "" && r.Options != nil {
v, err := typeurl.UnmarshalAny(r.Options)
if err != nil {
return nil, err
}
option, ok := v.(*crioption.Options)
// cri default runtime handler will pass a linux runc options,
// and we'll ignore it.
if ok {
configPath = option.ConfigPath
} else {
// Some versions of containerd, such as 1.4.3, and 1.4.4
// still rely on the runtime options coming from
// github.com/containerd/cri-containerd/pkg/api/runtimeoptions/v1
// Knowing that, instead of breaking compatibility with such
// versions, let's work this around on our side
oldOption, ok := v.(*oldcrioption.Options)
if ok {
configPath = oldOption.ConfigPath
}
}
}
// Try to get the config file from the env KATA_CONF_FILE
if configPath == "" {
configPath = os.Getenv("KATA_CONF_FILE")
}
_, runtimeConfig, err := katautils.LoadConfiguration(configPath, false)
if err != nil {
return nil, err
}
// For the unit test, the config will be predefined
if s.config == nil {
s.config = &runtimeConfig
}
return &runtimeConfig, nil
}

Copy link
Member

@egernst egernst left a comment

Choose a reason for hiding this comment

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

Good improvements, just some additional feedback.

@jodh-intel
Copy link
Contributor Author

@egernst, @Jakob-Naucke - ptal. The configuration is more confusing then even Eric listed. Hopefully, the verbiage on this PR will make things clearer 😄

Copy link
Member

@Jakob-Naucke Jakob-Naucke left a comment

Choose a reason for hiding this comment

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

Thanks @jodh-intel -- I have some comments again

src/runtime/README.md Outdated Show resolved Hide resolved
src/runtime/README.md Outdated Show resolved Hide resolved
src/runtime/README.md Outdated Show resolved Hide resolved
@jodh-intel jodh-intel force-pushed the docs-rework-readme branch 2 times, most recently from aa7a1db to 22180a9 Compare February 14, 2022 17:09
@jodh-intel
Copy link
Contributor Author

/test

@jodh-intel
Copy link
Contributor Author

Ping for re-review folks.

Various improvements to the top-level README file:

- Moved the following sections from the runtime's README to the
  top-level README:
  - License
  - Platform support / Hardware requirements
- Added the following sections to the top-level README:
  - Configuration
  - Hypervisors
- Improved formatting of the Documentation section in the top-level
  README.
- Removed some unused named links from the top-level README.

Also improvements to the runtime README:

- Removed confusing mention of the old 1.x runtime name.
- Clarify the binary name for the 2.x runtime and the utility program.

> **Note:**
>
> We cannot currently link to the AMD website as that site's
> configuration causes the CI static checks to fail. See
> kata-containers/tests#4401

Fixes: kata-containers#3557.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
@jodh-intel
Copy link
Contributor Author

@fidencio, @egernst - ptal so we can try to get this landed...

@jodh-intel
Copy link
Contributor Author

/test

Copy link
Member

@fidencio fidencio left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @jodh-intel!

@GabyCT GabyCT merged commit ced5e91 into kata-containers:main Feb 16, 2022
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.

Move some details from runtime README to top-level README
6 participants