Registration is open for TensorFlow Dev Summit 2020 Learn more

tfx.orchestration.config.docker_component_config.DockerComponentConfig

View source on GitHub

Class DockerComponentConfig

Component config which holds docker run args.

Inherits From: BaseComponentConfig

Attributes:

  • docker_server_url: URL to the Docker server. For example, unix:///var/run/docker.sock or tcp://127.0.0.1:1234. Uses environment viarable to initialize the docker client if this parameter is not set. Default: None.
  • environment: Environment variables to set inside the container, as a dictionary or a list of strings in the format ["SOMEVARIABLE=xxx"].
  • name: The name for this container.
  • privileged: Give extended privileges to this container. Default: False.
  • remove: Remove the container when it has finished running. Default: False.
  • user: Username or UID to run commands as inside the container.
  • volumes: A dictionary to configure volumes mounted inside the container. The key is either the host path or a volume name, and the value is a dictionary with the keys: {bind: mode}. For example: {'/home/user1/': {'bind': '/mnt/vol2', 'mode': 'rw'}, '/var/www': {'bind': '/mnt/vol1', 'mode': 'ro'}}
  • additional_run_args: Additional run args to pass to docker.client.containers.run. See https://docker-py.readthedocs.io/en/stable/containers.html#docker.models.containers.ContainerCollection.run.

__init__

View source

__init__(
    docker_server_url=None,
    environment=None,
    name=None,
    privileged=False,
    user=None,
    volumes=None,
    **kwargs
)

Initialize self. See help(type(self)) for accurate signature.

Methods

from_json_dict

View source

from_json_dict(
    cls,
    dict_data
)

Convert from dictionary data to an object.

to_json_dict

View source

to_json_dict()

Convert from an object to a JSON serializable dictionary.

to_run_args

View source

to_run_args()