Classes for running a Gretel Job as a local container
Runs a Gretel Job from a local container.
job – Job to run as docker container.
Trueif the container is running.
container_output_dir: Optional[str] = None¶
Output directory on the container where artifacts placed.
Status from the running docker container.
- Valid statuses include:
created, restarting, running, removing, paused, exited, or dead
If the container isn’t running, an “unknown” status will be returned.
Remove the docker container
Attempts to gracefully shutdown the container run.
image: str = None¶
The container image used for running the job
Checks to see if the container is ok.
ContainerRunError if there is a problem with the container. –
model: Model = None¶
The model associated with the container run
output_dir: Optional[Path] = None¶
Local file path to save artifacts to.
Run job via a local container. This method is async and will return after the job has started.
If you wish to block until the container has finished, the
waitmethod may be used.
stop(force: bool = False)¶
If there is a running container this command will stop that container.
force – If force is
SIGKILLwill be sent to the container, otherwise
wait(timeout: int = 30)¶
Blocks until a running container has completed. If the container hasn’t started yet, we wait until a
timeoutinterval is reached.
timeout – The time in seconds to wait for a container to start. If the timeout is reached, the function will return.
Checks that the local docker env is configured.
DockerEnvironmentError if the docker environment isn't –
configured correctly. –
extract_container_path(container: docker.models.containers.Container, container_path: str, host_path: str)¶
Writes all files from a container path to a host path