Resource management
Dependencies and runtime environment
By default, all multinode
compute primitives run on the python:3-bullseye Docker image.
Although this may suffice, you may require additional dependencies, or even a completely different runtime environment.
Additional python dependencies
multinode
will look for a requirements.txt
file in your current working directory, and will automatically install all the listed dependencies on the cloud workers. If a requirements.txt
file is not found, a warning will be raised, and the standard python:3-bullseye image will be used.
Sometimes, you may want to install a particular dependency, but only for a specific function. For example, this may reduce the time it takes to pull the image when the worker is provisioning. To do this, use the additional_dependencies
keyword argument in the decorator.
# file: requirements.txt
pandas==1.4.3
numpy==1.21.2
pillow==8.3.1
# file: code.py
import multinode as mn
@mn.function()
def some_standard_function():
# Code will run on a worker with
# pandas, numpy, and pillow installed
@mn.function(additional_dependencies=[
"torch==1.9.0",
"botorch==0.6.5",
])
def some_torch_function():
# Code will run on a worker with
# pandas, numpy, pillow, torch, and botorch installed
Custom docker images
Coming soon
This feature is not available yet. We're working hard to bring it to you as soon as possible!