Cumbersome Environment definitions can significantly impact startup times for executions that use that Environment.
Use clear naming conventions and descriptions
Reason: A common reason environments get duplicated is that users are unsure if an existing environment meets their needs. Using clear and descriptive names for all environments makes it easier for new users and admins to understand the catalog. This clarity helps make Domino easier to work with and maintain.
Solution: Keep things clear for everyone by using these tips:
-
Use clear, descriptive names for your environments.
-
Enforce a standard of quality in naming and Dockerfile commenting.
-
Make sure you don’t make a copy of an environment without renaming it.
Limit global environments
Reason: Focusing on a few global environments with broad uses is more beneficial than creating many specialized ones.
Solution: Follow these ideas for limiting global environments:
-
Use the default compute environment as the base.
-
Create a global environment and image that meets 80-90% of the community’s requirements.
Create one environment per team to avoid sprawl
Reason: When a user asks for a new environment with specific features, consider adding those to an existing global environment instead of making a new environment. Having fewer global environments makes it easier to maintain them.
Solution: Here are some ideas to keep sprawl to a minimum:
-
Individual users’ environments should be based on a primary global environment.
-
Always based on the latest standard base image.
Audit and archive environments regularly
Reason: Avoid sprawl to maintain control of your environments and prevent slow executions.
Solution: Follow these tips to create a culture of tidiness around environment management:
-
Share responsibility for environment management.
-
Clean up old or poorly maintained environments.
-
Be assertive about pruning unnecessary environments.
-
Team leads/SMEs are responsible for keeping images up-to-date.
-
Have few global environments.
-
If several users need to install something larger than 1G, it may be time to update your base image.
-
Use Organizations to manage access to restricted environments.
These are our best practices for building more efficient Docker images.
Reduce the Environment image size
Reason: If the environment image needed for a Workspace, Job, or other task is not on the compute node where it will run, it must first be sent over the network from the image registry in a compressed format. After the transfer, the image is then decompressed on the compute node. Transferring and decompressing the image slows startup time, and the delay increases as the image size grows.
Solution: Follow these tips to minimize the Environment image size:
-
Choose the smallest base image that suits your needs, either an existing Domino Environment or a custom image.
-
Install only essential software via the Dockerfile.
-
Consider creating several smaller, special-purpose Environments rather than one larger, general-purpose Environment.
Limit dependency file usage
Reason: Every package listed in a dependency file, like requirements.txt
, is installed via a network transfer for every execution. This causes startup latency and is vulnerable to network failures.
Solution: Follow these tips to minimize usage of dependency files:
-
Move packages from dependency files to the Environment’s Dockerfile.
-
Packages in the Dockerfile are installed just once during Environment creation.
-
Eliminate rarely used packages from dependency files. On the rare occasions they are needed, install them manually in the running execution or as part of your execution’s code.
Cache global environments on the executor machine image
Reason: If users create environments with base images that are very different from what is cached on the machine image, it can take a long time to pull the necessary images when launching executors.
Solution: To improve the startup time for your users:
-
Cache your global environments in the executor template machine image so that each new executor will start with the cached base Docker image for any environment.
-
Domino Standard Environments describes the pre-configured environments that come with Domino.
-
Create a Domino Environment using an existing environment or start from a custom setup.
-
Edit an Environment to enable tools, run scripts, or manage environment variables.
-
Set default Environments establishes a starting point for all new projects or an environment for a specific project.