Function to either load sandbox image and start a new docker container by
passing the "sandbox.image.location" and "sandbox.image.name" or start an
existing container using the argument "container".
Teradata recommends to run this function once before running
td_test_script()on object of class "ScriptTableOperator".
Sandbox image loading on user's system is skipped if the image with the same name is already loaded.
There can be only one container started from within tdplyr at any given point.
At the end of the session, image loaded and/or container started by the function is cleaned up. If the image loading is skipped, then the image is not cleaned up.
td_cleanup_sandbox_env()to manually cleanup image/container started by the function. If the image loading is skipped, then the image is not cleaned up.
User should be careful while providing "sandbox.image.location" and "sandbox.image.name". If an incorrect "sandbox.image.name" (that does not match the name and/or tag of the image) is provided, then:
The image will not be loaded. User should re-run the function with correct "sandbox.image.name".
If the user's system already has an image with the image name and tag same as the image specified in "sandbox.image.location", then image loading is skipped.
td_setup_sandbox_env( sandbox.image.location = NULL, sandbox.image.name = NULL, container = NULL )
Optional Argument. Required if "sandbox.image.location"
and "sandbox.image.name" are not specified.
# Get remote data source connection. con <- td_get_context()$connection # Example 1: Load the image from the location specified in # "sandbox.image.location" argument and start a container. # This is useful when the user wants to run user scripts in a new # container created from a new docker image. td_setup_sandbox_env(sandbox.image.location = "<path_to_docker_image>", sandbox.image.name = "rstosandbox:1.0") # Example 2: Start an existing container specified in "container" argument. # This is useful when the user wants to run user script in an # existing container. td_setup_sandbox_env(container = "<container_name_or_id>")