Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

New doc: create custom application container image#775

Merged
mvincerx merged 1 commit intoclearlinux:masterfrom
MCamp859:mc-customize-app-cont
Oct 4, 2019
Merged

New doc: create custom application container image#775
mvincerx merged 1 commit intoclearlinux:masterfrom
MCamp859:mc-customize-app-cont

Conversation

@MCamp859
Copy link
Copy Markdown
Contributor

Signed-off-by: MCamp859 maryx.camp@intel.com

@MCamp859 MCamp859 requested a review from puneetse September 10, 2019 17:53
Overview
********

The official |CL-ATTR| container base images are published on Docker\* Hub and
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.

Suggest making sentence 2 & 3 come before 1 as they are the primary topic of the doc.

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.

I agree, except I recommend combining sentence 1 and 2. Something like:
"""
The official |CL-ATTR| container-based images are published as Docker images on Docker Hub [hyperlink]
"""

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.

They are 2 different things so separate thoughts. The "official" CL docker image (i.e. https://hub.docker.com/_/clearlinux) is different from these CL-based application container images (i.e. https://hub.docker.com/u/clearlinux).

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.

Agreed. They're separate. What I struggle with as a reader in this paragraph is: Why do I need to know this information (in original)? If you want me, as a reader, to explore these links because they're relevant to the guide, then tell me why. Both links can be included. For example, you could state: "In this guide, we use the "official" CL Docker image for the first examples. Then we use an already published image on Docker Hub [url] for the last example.

I'd like to see the Overview tied to the examples in the guide.

published as `Docker images on Docker Hub`_. The source for these Docker images
is available on `GitHub`_\*.

In this guide, the phrase *Clear Linux\* OS container base images* is used to
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.

In this guide, the phrase Clear Linux* OS container base images is used to

This can be moved to the bottom of this section and make reference to custom-clear-container.rst for creating a generic CL container image.

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.

👍 Agreed. "In this guide [...]" should follow the bullet list.

Comment thread source/guides/maintenance/custom-app-container.rst Outdated
to edit |CL| container base images for the following situations:


* Customize an application image Dockerfile by adding a bundle
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.

This whole section is redundant with the TOC and manually maintained going forward. It is better addressed by changing the TOC tree depth to 2 and ensuring good section titles.

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.

👍

@@ -0,0 +1,402 @@
.. _custom-app-container:

Create customized application container images
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.

Suggested change
Create customized application container images
Modify existing application container images

We should make a clear distinction between this and custom-clear-container.rst to avoid confusion.
custom-clear-container.rst should be a "Create from scratch" while this one is a modify/customize existing

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.

👍

Besides generating a new Docker image by editing the Dockerfile, you can
modify a published |CL| container at runtime. This approach can
help to accelerate the feature development process. This section describes
steps to add Tensorflow\* into the clearlinux/python container at runtime.
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.

Suggested change
steps to add Tensorflow\* into the clearlinux/python container at runtime.
steps to add Tensorflow\* into a clearlinux/python container at runtime, as an example.


.. code-block:: bash

$ docker run -it --rm clearlinux/python
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.

Suggested change
$ docker run -it --rm clearlinux/python
docker run -it --rm clearlinux/python


.. code-block:: bash

$ docker ps
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.

Suggested change
$ docker ps
docker ps

#. After the machine-learning-tensorflow bundle is installed in the container,
in the first console, import Tensorflow, which will be successful now. You
could also save the updated container using the command :command:`docker commit <Container_ID>`
to do further experiments on it later.
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.

Suggested change
to do further experiments on it later.

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.

👍

>>> tf.__version__
'1.13.1'

#. In a third console, save the container as clearlinux/python:tensorflow_added.
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.

Suggested change
#. In a third console, save the container as clearlinux/python:tensorflow_added.
#. In a third console, save the container with a new tag.

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.

👍

Copy link
Copy Markdown
Contributor

@puneetse puneetse left a comment

Choose a reason for hiding this comment

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

Thanks for doing the conversion on this @MCamp859. Please feel free to reach out to me if any of the suggestions need clarification.

Copy link
Copy Markdown
Contributor

@mvincerx mvincerx left a comment

Choose a reason for hiding this comment

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

Afternoon @MCamp859. This guide needs some re-organization first. Then decisive edits to simplify.
The final section, Customize an application image at runtime is a good example of how numbered steps simplify and emphasize user action. Please use that as a model. In general, feel free to remove any other text that doesn't serve the objective of each example--that is, long descriptions.

@@ -0,0 +1,402 @@
.. _custom-app-container:

Create customized application container images
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.

👍

Overview
********

The official |CL-ATTR| container base images are published on Docker\* Hub and
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.

I agree, except I recommend combining sentence 1 and 2. Something like:
"""
The official |CL-ATTR| container-based images are published as Docker images on Docker Hub [hyperlink]
"""

published as `Docker images on Docker Hub`_. The source for these Docker images
is available on `GitHub`_\*.

In this guide, the phrase *Clear Linux\* OS container base images* is used to
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.

👍 Agreed. "In this guide [...]" should follow the bullet list.

to edit |CL| container base images for the following situations:


* Customize an application image Dockerfile by adding a bundle
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.

👍

Dockerfile:


.. contents::
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.

Please remove this second TOC. It's unnecessary. Top-level TOC, revised as :depth: 2, is sufficient.
Also, remove the header Examples. See my comments below for more on this.

Comment thread source/guides/maintenance/custom-app-container.rst Outdated


Customize an application image at runtime
=========================================
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.

Revise header as Example 3 ....


Besides generating a new Docker image by editing the Dockerfile, you can
modify a published |CL| container at runtime. This approach can
help to accelerate the feature development process. This section describes
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.

Revise para.
This section describes how to modify a published |CL| container at runtime. In this example, we add Tensorflow* to the :command:clearlinux/python container. This approach can help accelerate the feature development process.

#. After the machine-learning-tensorflow bundle is installed in the container,
in the first console, import Tensorflow, which will be successful now. You
could also save the updated container using the command :command:`docker commit <Container_ID>`
to do further experiments on it later.
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.

👍

>>> tf.__version__
'1.13.1'

#. In a third console, save the container as clearlinux/python:tensorflow_added.
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.

👍

@MCamp859 MCamp859 force-pushed the mc-customize-app-cont branch 2 times, most recently from a91f2a1 to bf04cd0 Compare September 19, 2019 18:57
@MCamp859
Copy link
Copy Markdown
Contributor Author

@puneetse @mvincerx Please review the latest commit.
All your feedback is done and the Overview could use another read-through...

@mvincerx
Copy link
Copy Markdown
Contributor

I will give final feedback on this before 12 noon PST. I want to merge this by EOB today PST.
@puneetse Please make any comments before then.

@mvincerx
Copy link
Copy Markdown
Contributor

Hi @MCamp859. After talking with @puneetse, I decided to push directly to this branch.
Please hold all commits until further knowtice.

@mvincerx
Copy link
Copy Markdown
Contributor

@puneetse. Please search the .rst file for my embedded TODO tags. Please give more context to the other examples, similar to what we discussed in Example 1.

@mvincerx
Copy link
Copy Markdown
Contributor

@puneetse I'll check in on this Sat. am.

Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
#. Run :command:`git diff`.

.. code-block:: bash
#. Next, enter this command to show the edits made after
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.

There should be no command to enter here. It should be run`git diff`` and examine the output. It should look like this below...

Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
@mvincerx
Copy link
Copy Markdown
Contributor

@MCamp859, I'll take over this PR. Puneet and I can collaborate here on out. Thanks

@mvincerx mvincerx force-pushed the mc-customize-app-cont branch from a3f3bef to f6d1422 Compare September 23, 2019 22:56
@mvincerx
Copy link
Copy Markdown
Contributor

@puneetse, see latest commit after CI checks are completed.

Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated
@puneetse
Copy link
Copy Markdown
Contributor

@mvincerx thanks for bearing through all these iterations to get to the final product.
I've tested all of the steps with my purposed changes above. Once you've reviewed and merged, I will do a final walkthrough. The rest of the grammatical and flow improvements I'll leave up to you.

@mvincerx
Copy link
Copy Markdown
Contributor

@puneetse. Glad we can keep improving this and make it more practical. I'll restart testing it--got sidetracked earlier today-- so I'll push more revisions and let you know before EOB.

@mvincerx
Copy link
Copy Markdown
Contributor

FYI: I resolved errors when running docker build commands. I validated docker commands --but had one minor error in Example 3 running the Python repl. Let's discuss Wed.

@mvincerx
Copy link
Copy Markdown
Contributor

@puneetse, please see emails.

Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Copy link
Copy Markdown
Contributor

@mvincerx mvincerx left a comment

Choose a reason for hiding this comment

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

@puneetse. We're so close to ready on this. See Ln 133. When I validate, I still receive an error (see my comment). If you want to supply me with the output, just add a comment there. I'll take care of it.

Comment thread source/guides/maintenance/custom-app-container.rst Outdated
Comment thread source/guides/maintenance/custom-app-container.rst Outdated

.. code-block:: bash

docker run clearlinux/machine-learning-ui:31090 swupd info
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.

@puneetse, this is the last remaining problem. I've run step 2 above twice now. On Step 3, I receive the same error message that was logged as this issue last March. If you can supply stdout for sample output, that'd be great.

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.

@puneetse, please see my comment above. This is the last piece of data I need before we can merge.

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.

The command above worked fine for me. It should look like the output of any other swupd info with 31090

docker run clearlinux/machine-learning-ui:31090 swupd info
Distribution:      Clear Linux OS
Installed version: 31090
Version URL:       https://cdn.download.clearlinux.org/update
Content URL:       https://cdn.download.clearlinux.org/update

Or, we can change it to this so that it matches the pattern in a previous section.:

docker run clearlinux/machine-learning-ui:31090 cat /usr/lib/os-release
NAME="Clear Linux OS"
VERSION=1
ID=clear-linux-os
ID_LIKE=clear-linux-os
VERSION_ID=31090
PRETTY_NAME="Clear Linux OS"
ANSI_COLOR="1;35"
HOME_URL="https://clearlinux.org"
SUPPORT_URL="https://clearlinux.org"
BUG_REPORT_URL="mailto:dev@lists.clearlinux.org"
PRIVACY_POLICY_URL=http://www.intel.com/privacy

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.

@puneetse. Please review latest commit.

- Add CLI steps to contextualize diff output.
- Add Sphinx roles for clarity of command flags.
- Apply edits for clarity of sequence and prior to output diffs.

<michael.vincerra@intel.com>
@mvincerx mvincerx force-pushed the mc-customize-app-cont branch from ed0df67 to fb7d0bc Compare October 4, 2019 17:13
@mvincerx mvincerx merged commit fbfe5f4 into clearlinux:master Oct 4, 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