Setting a base image in config.yaml
To specify a base image to build a truss container image from in yourconfig.yaml
configure a base_image
.
config.yaml
python_executable_path
is a path to a python executable with which to run your server.
Example usage
This example truss demonstrates how to properly configure a base image for Nvidia NeMo TitaNet:config.yaml
Configuring private base images with build time secrets
Secrets of the formDOCKER_REGISTRY_<REGISTRY_URL>
will be supplied to your model build to authenticate image pulls from private container registries.
For information on where to store secret values see the secrets guide.
For example, to configure docker credentials to a private dockerhub repository your config.yaml
should include the following secret and placeholder:
config.yaml
DOCKER_REGISTRY_https://index.docker.io/v1/
with a base64 encoded username:password
secret value:
us-west2
your config.yaml
should include the following secret and placeholder:
config.yaml
Creating a custom base image
While it’s possible to create your own base image from scratch, it may be easier to use a truss server image as a starting point. All of the base images used by truss can be found by going to docker hub. Each image tag is tied to a specific python version and may support a GPU. For example, the image with the tag3.11-gpu-v0.7.16
is for Python 3.11 and has GPU support.
On the other hand, image 3.9-v0.7.15
is for Python 3.9 and does not have GPU support. Based on your project requirements you can select the appropriate base image.
Next, we can write our Dockerfile
.
Dockerfile
truss-server-base
as our base image. This base image comes with some python dependencies installed.
If you want to override the versions of these default python dependencies you can simply uninstall the package and reinstall it using the RUN pip install
command.
You can even add you own files or directories to this Dockerfile if required. Once you have your Dockerfile set up, you can build, tag, and push the image to your own docker registry.
Build, tag, and push your custom base image
Docker installation required
For this portion, docker needs to be installed and running on your system. Additionally, you will need docker installed on your command line.my-custom-base-image
with the name for your docker image.
Next, to tag the image you can run the command: