From 980ef9cc13e540a04450c7c1402a33fa07b842a1 Mon Sep 17 00:00:00 2001 From: Adam Laiacano Date: Tue, 17 Jan 2023 14:48:29 -0500 Subject: [PATCH 1/3] add a note about building containers manually --- docker/README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docker/README.md b/docker/README.md index 2db67a5f2..13a6fca69 100644 --- a/docker/README.md +++ b/docker/README.md @@ -11,3 +11,34 @@ The following table provides a list of Dockerfiles that you can use to build the | `merlin-hugectr` | `dockerfile.ctr` | | NVTabular and HugeCTR | | `merlin-tensorflow` | `dockerfile.tf` | | NVTabular, TensorFlow, and HugeCTR Tensorflow Embedding plugin | | `merlin-pytorch` | `dockerfile.torch` | | NVTabular and PyTorch | + + +# Building these containers locally + +Building our containers is a two-step process. We first build the Merlin `BASE_IMAGE` using the `dockerfile.merlin` file. This container depends on two upstream containers: `nvcr.io/nvidia/tritonserver` and `nvcr.io/nvidia/tensorflow`, from which it pulls the necessary dependencies for Triton Inference Server and RAPIDS tools. It also builds and installs other Merlin requirements, such as scikit-learn, XGBoost, etc. + +At the time of this writing, the two-stage build process takes roughly 1 hour. Running all of the tests for all Merlin libraries can take a couple of additional hours, depending on which framework you're building. + +## Building the `BASE_IMAGE` + +We tag this image as `nvcr.io/nvstaging/merlin/merlin-base:${MERLIN_VERSION}` and it is used to create the framework-specific containers. There are `ARG`s in the Dockerfile to define which version of the containers to use. You can override the defaults when building the image like below. + +```bash +docker build . -f dockerfile.merlin -t nvcr.io/mycompany/merlin-base:${MERLIN_VERSION} --build-arg DLFW_IMAGE=22.12 +``` + +In this example we are tagging the base image as `nvcr.io/mycompany/merlin-base:${MERLIN_VERSION}`. The tag Merlin uses when building this image in our own build pipeline is `nvcr.io/nvstaging/merlin/merlin-base:${MERLIN_VERSION}`. _Note that this intermediate image is not made available publicly, but the framework-specific containers based on it are._ + +## Building a framework-specific container + +We also provide Dockerfiles for creating framework-specific containers: `dockerfile.tf`, `dockerfile.torch`, and `dockerfile.ctr`. These are all based on the `BASE_IMAGE` created in the previous step and install the associciated deep learning frameworks. + +To build the Pytorch container, we will specify the `BASE_IMAGE` build arg to use the base image we just created. + +```bash +docker build . -f dockerfile.torch -t ngcr.io/mycompany/merlin-torch:${MERLIN_VERSION} --build-arg BASE_IMAGE=nvcr.io/mycompany/merlin-base:${MERLIN_VERSION} +``` + +## Default Arguments + +Each of the Dockerfiles have many `ARG`s defined, most of which have defaults set. Sometimes the defaults fall out of date, because the Merlin team overrides them in our build process as demonstrated above. To see the latest versions used in each of our containers, see the [Merlin Support Matrix](https://nvidia-merlin.github.io/Merlin/main/support_matrix/index.html) From b8ddea8a596b58f65711f8a0a7843ae754a5ceab Mon Sep 17 00:00:00 2001 From: Adam Laiacano Date: Tue, 17 Jan 2023 15:40:10 -0500 Subject: [PATCH 2/3] fix wording --- docker/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/README.md b/docker/README.md index 13a6fca69..660a5c6c9 100644 --- a/docker/README.md +++ b/docker/README.md @@ -13,7 +13,7 @@ The following table provides a list of Dockerfiles that you can use to build the | `merlin-pytorch` | `dockerfile.torch` | | NVTabular and PyTorch | -# Building these containers locally +# Building the Merlin containers locally Building our containers is a two-step process. We first build the Merlin `BASE_IMAGE` using the `dockerfile.merlin` file. This container depends on two upstream containers: `nvcr.io/nvidia/tritonserver` and `nvcr.io/nvidia/tensorflow`, from which it pulls the necessary dependencies for Triton Inference Server and RAPIDS tools. It also builds and installs other Merlin requirements, such as scikit-learn, XGBoost, etc. @@ -41,4 +41,4 @@ docker build . -f dockerfile.torch -t ngcr.io/mycompany/merlin-torch:${MERLIN_VE ## Default Arguments -Each of the Dockerfiles have many `ARG`s defined, most of which have defaults set. Sometimes the defaults fall out of date, because the Merlin team overrides them in our build process as demonstrated above. To see the latest versions used in each of our containers, see the [Merlin Support Matrix](https://nvidia-merlin.github.io/Merlin/main/support_matrix/index.html) +Each of the Dockerfiles have many `ARG`s defined, most of which have defaults set. Sometimes the defaults fall out of date, because the Merlin team overrides them in our build process as demonstrated above. To see the `ARG` values used in each of our released containers, see the [Merlin Support Matrix](https://nvidia-merlin.github.io/Merlin/main/support_matrix/index.html) From 5ed0f160cce1698ad9a5018a216551483bf2eb89 Mon Sep 17 00:00:00 2001 From: Adam Laiacano Date: Wed, 14 Jun 2023 10:22:23 -0400 Subject: [PATCH 3/3] address feedback --- docker/README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docker/README.md b/docker/README.md index 660a5c6c9..2b0f0e05b 100644 --- a/docker/README.md +++ b/docker/README.md @@ -13,30 +13,32 @@ The following table provides a list of Dockerfiles that you can use to build the | `merlin-pytorch` | `dockerfile.torch` | | NVTabular and PyTorch | -# Building the Merlin containers locally +## Building the Merlin Containers Locally Building our containers is a two-step process. We first build the Merlin `BASE_IMAGE` using the `dockerfile.merlin` file. This container depends on two upstream containers: `nvcr.io/nvidia/tritonserver` and `nvcr.io/nvidia/tensorflow`, from which it pulls the necessary dependencies for Triton Inference Server and RAPIDS tools. It also builds and installs other Merlin requirements, such as scikit-learn, XGBoost, etc. -At the time of this writing, the two-stage build process takes roughly 1 hour. Running all of the tests for all Merlin libraries can take a couple of additional hours, depending on which framework you're building. +We then build framework-specific containers based off of the `BASE_IMAGE`. See the table above for which Dockerfile corresponds to which framework-specific container. -## Building the `BASE_IMAGE` +The base image is not made available publicly, but the framework-specific containers based on it are. The two-stage build process takes roughly 1 hour. Running all of the tests for all Merlin libraries can take a couple of additional hours, depending on which framework you're building. + +## Building The `BASE_IMAGE` We tag this image as `nvcr.io/nvstaging/merlin/merlin-base:${MERLIN_VERSION}` and it is used to create the framework-specific containers. There are `ARG`s in the Dockerfile to define which version of the containers to use. You can override the defaults when building the image like below. ```bash -docker build . -f dockerfile.merlin -t nvcr.io/mycompany/merlin-base:${MERLIN_VERSION} --build-arg DLFW_IMAGE=22.12 +docker build -t nvcr.io/mycompany/merlin-base:${MERLIN_VERSION} --build-arg TRITON_VERSION=23.04 - < docker/dockerfile.merlin ``` -In this example we are tagging the base image as `nvcr.io/mycompany/merlin-base:${MERLIN_VERSION}`. The tag Merlin uses when building this image in our own build pipeline is `nvcr.io/nvstaging/merlin/merlin-base:${MERLIN_VERSION}`. _Note that this intermediate image is not made available publicly, but the framework-specific containers based on it are._ +In this example we are tagging the base image as `nvcr.io/mycompany/merlin-base:${MERLIN_VERSION}`. The tag Merlin uses when building this image in our own build pipeline is `nvcr.io/nvstaging/merlin/merlin-base:${MERLIN_VERSION}`. -## Building a framework-specific container +## Building A Framework-Specific Container We also provide Dockerfiles for creating framework-specific containers: `dockerfile.tf`, `dockerfile.torch`, and `dockerfile.ctr`. These are all based on the `BASE_IMAGE` created in the previous step and install the associciated deep learning frameworks. -To build the Pytorch container, we will specify the `BASE_IMAGE` build arg to use the base image we just created. +To build the PyTorch container, we specify the `BASE_IMAGE` build arg to use the base image that we just created. ```bash -docker build . -f dockerfile.torch -t ngcr.io/mycompany/merlin-torch:${MERLIN_VERSION} --build-arg BASE_IMAGE=nvcr.io/mycompany/merlin-base:${MERLIN_VERSION} +docker build -t ngcr.io/mycompany/merlin-torch:${MERLIN_VERSION} --build-arg BASE_IMAGE=nvcr.io/mycompany/merlin-base:${MERLIN_VERSION} - < docker/dockerfile.torch ``` ## Default Arguments