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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix bentoml containerize command help message #2957

Merged
merged 5 commits into from Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions bentoml/bentos.py
Expand Up @@ -465,9 +465,15 @@ def containerize(
)
return False
else:
logger.info(f'Successfully built docker image "{docker_image_tag}"')
custom_tags = False if not isinstance(docker_image_tag, str) else True
aarnphm marked this conversation as resolved.
Show resolved Hide resolved
logger.info(
f'To run your newly built Bento container, use: "docker run -it --rm -p 3000:3000 {docker_image_tag}"'
'Successfully built docker image for "%s" with tags "%s"',
str(bento.tag),
docker_image_tag if not custom_tags else ",".join(docker_image_tag),
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me like we should make this variable always an array.

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 remember we have this discussion before, let me do that.

)
logger.info(
'To run your newly built Bento container, use: "docker run -it --rm -p 3000:3000 %s"',
docker_image_tag[0] if custom_tags else docker_image_tag,
)
return True

Expand Down
20 changes: 10 additions & 10 deletions bentoml_cli/containerize.py
Expand Up @@ -196,29 +196,29 @@ def containerize( # type: ignore
BENTO is the target BentoService to be containerized, referenced by its name
and version in format of name:version. For example: "iris_classifier:v1.2.0"
`bentoml containerize` command also supports the use of the `latest` tag
'bentoml containerize' command also supports the use of the 'latest' tag
which will automatically use the last built version of your Bento.
You can provide a tag for the image built by Bento using the
`--tag` flag. Additionally, you can provide a `--push` flag,
'--docker-image-tag' flag. Additionally, you can provide a '--push' flag,
which will push the built image to the Docker repository specified by the
image tag.
You can also prefixing the tag with a hostname for the repository you wish
to push to.
e.g. `bentoml containerize IrisClassifier:latest --push --tag
repo-address.com:username/iris` would build a Docker image called
`username/iris:latest` and push that to docker repository at repo-address.com.
e.g. 'bentoml containerize IrisClassifier:latest --push --tag
repo-address.com:username/iris' would build a Docker image called
'username/iris:latest' and push that to docker repository at repo-address.com.
By default, the `containerize` command will use the current credentials
By default, the 'containerize' command will use the current credentials
provided by Docker daemon.
`bentoml containerize` also uses Docker Buildx as backend, in place for normal `docker build`.
'bentoml containerize' also uses Docker Buildx as backend, in place for normal 'docker build'.
By doing so, BentoML will leverage Docker Buildx features such as multi-node
builds for cross-platform images, Full BuildKit capabilities with all of the
familiar UI from `docker build`.
familiar UI from 'docker build'.
We also pass all given args for `docker buildx` through `bentoml containerize` with ease.
We also pass all given args for 'docker buildx' through 'bentoml containerize' with ease.
"""
from bentoml._internal.utils import buildx

Expand Down Expand Up @@ -268,7 +268,7 @@ def containerize( # type: ignore
if platform and len(platform) > 1:
if not push:
logger.warning(
"Multiple `--platform` arguments were found. Make sure to also use `--push` to push images to a repository or generated images will not be saved. For more information, see https://docs.docker.com/engine/reference/commandline/buildx_build/#load."
"Multiple '--platform' arguments were found. Make sure to also use '--push' to push images to a repository or generated images will not be saved. For more information, see https://docs.docker.com/engine/reference/commandline/buildx_build/#load."
)
if push:
load = False
Expand Down