New doc: create custom application container image#775
New doc: create custom application container image#775mvincerx merged 1 commit intoclearlinux:masterfrom
Conversation
| Overview | ||
| ******** | ||
|
|
||
| The official |CL-ATTR| container base images are published on Docker\* Hub and |
There was a problem hiding this comment.
Suggest making sentence 2 & 3 come before 1 as they are the primary topic of the doc.
There was a problem hiding this comment.
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]
"""
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
👍 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 |
There was a problem hiding this comment.
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.
| @@ -0,0 +1,402 @@ | |||
| .. _custom-app-container: | |||
|
|
|||
| Create customized application container images | |||
There was a problem hiding this comment.
| 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
| 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. |
There was a problem hiding this comment.
| 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 |
There was a problem hiding this comment.
| $ docker run -it --rm clearlinux/python | |
| docker run -it --rm clearlinux/python |
|
|
||
| .. code-block:: bash | ||
|
|
||
| $ docker ps |
There was a problem hiding this comment.
| $ 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. |
There was a problem hiding this comment.
| to do further experiments on it later. |
| >>> tf.__version__ | ||
| '1.13.1' | ||
|
|
||
| #. In a third console, save the container as clearlinux/python:tensorflow_added. |
There was a problem hiding this comment.
| #. In a third console, save the container as clearlinux/python:tensorflow_added. | |
| #. In a third console, save the container with a new tag. |
mvincerx
left a comment
There was a problem hiding this comment.
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 | |||
| Overview | ||
| ******** | ||
|
|
||
| The official |CL-ATTR| container base images are published on Docker\* Hub and |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
👍 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 |
| Dockerfile: | ||
|
|
||
|
|
||
| .. contents:: |
There was a problem hiding this comment.
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.
|
|
||
|
|
||
| Customize an application image at runtime | ||
| ========================================= |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
| >>> tf.__version__ | ||
| '1.13.1' | ||
|
|
||
| #. In a third console, save the container as clearlinux/python:tensorflow_added. |
a91f2a1 to
bf04cd0
Compare
|
I will give final feedback on this before 12 noon PST. I want to merge this by EOB today PST. |
|
@puneetse. Please search the |
|
@puneetse I'll check in on this Sat. am. |
| #. Run :command:`git diff`. | ||
|
|
||
| .. code-block:: bash | ||
| #. Next, enter this command to show the edits made after |
There was a problem hiding this comment.
There should be no command to enter here. It should be run`git diff`` and examine the output. It should look like this below...
|
@MCamp859, I'll take over this PR. Puneet and I can collaborate here on out. Thanks |
a3f3bef to
f6d1422
Compare
|
@puneetse, see latest commit after CI checks are completed. |
|
@mvincerx thanks for bearing through all these iterations to get to the final product. |
|
@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. |
|
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. |
|
@puneetse, please see emails. |
|
|
||
| .. code-block:: bash | ||
|
|
||
| docker run clearlinux/machine-learning-ui:31090 swupd info |
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
@puneetse, please see my comment above. This is the last piece of data I need before we can merge.
There was a problem hiding this comment.
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
- 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>
ed0df67 to
fb7d0bc
Compare
Signed-off-by: MCamp859 maryx.camp@intel.com