Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

install: clean instructions for kata-manager#279

Merged
grahamwhaley merged 1 commit intokata-containers:masterfrom
marcov:fix-kata-manager
Oct 23, 2018
Merged

install: clean instructions for kata-manager#279
grahamwhaley merged 1 commit intokata-containers:masterfrom
marcov:fix-kata-manager

Conversation

@marcov
Copy link
Copy Markdown
Contributor

@marcov marcov commented Oct 19, 2018

Use a one-line code block for the installation command, and document the
dry run option.

Fixes: #275

Signed-off-by: Marco Vedovati mvedovati@suse.com

$ bash -c "$(curl -fsSL \
$ https://raw.githubusercontent.com/kata-containers/tests/master/cmd/kata-manager/kata-manager.sh) \
install-packages"
```bash
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I guess this is fine to keep as a ```bash block, but when we test this doc, this block will effectively be a nop (since we've already installed the packages in the section above. But atleast we will be running this code I guess.

How about this though - create a new section between the two existing sections:

To remove the Kata Packages

$ bash -c "$(curl -fsSL https://raw.githubusercontent.com/kata-containers/tests/master/cmd/kata-manager/kata-manager.sh) remove-packages"

That way, when we test this doc by executing the code blocks from top to bottom we'll:

  1. Install a docker system (with Kata packages).
  2. Remove the Kata packages.
  3. Re-install the Kata packages.

😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a smart idea, but the doc should be made for humans and not for the tests to pass. What about adding the remove-packages in the CI script? Or have a CI job dedicated to installing with kata manager.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a smart idea, but the doc should be made for humans and not for the tests to pass.

Unless, of course, our target users are AI monsters 😛

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I agree. The problem is that to avoid completely reworking the CI, the docs are executed as scripts from top to bottom. So if we don't want to add the new section, I'd suggest we leave this document as it is, knowing that the "Install the Kata packages only" section will be executed (but do nothing). Or, we could split the doc into two so that the CI can execute both docs in clean environments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Kind of a compromise, we could add a html comment with the code to execute?

<!---
Code needed for CI purposes, ignore this comment.

```bash
$ bash -c "$(curl -fsSL https://raw.githubusercontent.com/kata-containers/tests/master/cmd/kata-manager/kata-manager.sh) remove-packages"
```
--->

ps: could you point me to the shell script running all the code blocks in md files?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

wfm - atleast we'll be testing the docs!

The script that converts the docs to shell scripts is:

(btw, have you seen https://github.com/kata-containers/tests/blob/master/.ci/README.md ?)

That script is what https://github.com/kata-containers/tests/tree/master/cmd/kata-manager calls too to avoid duplication.

Copy link
Copy Markdown
Contributor Author

@marcov marcov Oct 19, 2018

Choose a reason for hiding this comment

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

Just to be sure I am understanding correctly

  • static-checks.sh will call kata-doc-to-script.sh to syntax check the content of ```bash code blocks with bash -n.
  • .ci/test-install-docs.sh calls kata-manager install-docker-system whenever an update to install/.*md is detected.

No one however will try to install kata using the content of install/installing-with-kata-manager.md.
So adding the extra code in the comment makes sense only if we setup an additional step to install kata using this doc. Am I right?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes. But I'm working on improving the CI scripts in this repo to test the remaining install docs (installing-with-kata-manager.md and installing-with-kata-doc-to-script.md) on #278.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

repetita iuvant :)

@jodh-intel
Copy link
Copy Markdown

Hi @marcov - I think that until we can resolve kata-containers/tests#828, this doc is going to have to state in a note that you need git/golang installed, etc.

Use a one-line code block for the installation command, and document the
dry run option.

Fixes: kata-containers#275

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
@marcov
Copy link
Copy Markdown
Contributor Author

marcov commented Oct 19, 2018

@jodh-intel if maybe kata-containers/tests#829 lands shortly 🤞, we can avoid doing that and then opening another PR just to remove the extra deps

Otherwise, no problem adding the extra text :)

Copy link
Copy Markdown

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @marcov!

lgtm

This command does the following:
1. Installs Kata Containers packages
2. Installs Docker
3. Configure Docker to use the Kata OCI runtime by default
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not strictly part of this PR, but this should say "Configures".

Copy link
Copy Markdown
Contributor

@grahamwhaley grahamwhaley left a comment

Choose a reason for hiding this comment

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

As a pragmatic fix, and to get the install directions actually working...
lgtm

install-docker-system"
```

<!--
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

bleh, the first time we have buried HTML in our mardown documents I believe.....

@grahamwhaley grahamwhaley merged commit ad91157 into kata-containers:master Oct 23, 2018
devimc pushed a commit to devimc/kata-documentation that referenced this pull request Sep 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants