Skip to content

Executions API#

You can create an Execution by calling Job.run and retrieve it via Job.get_executions.

Execution #

app_id property #

app_id

Application id for the execution.

args property #

args

Arguments set for the execution.

duration property #

duration

Duration in milliseconds the execution ran.

final_status property #

final_status

Final status of the execution. Can be UNDEFINED, SUCCEEDED, FAILED or KILLED.

hdfs_user property #

hdfs_user

Filesystem user for the execution.

id property #

id

Id of the execution.

job_name property #

job_name

Name of the job the execution belongs to.

job_type property #

job_type

Type of the job the execution belongs to.

progress property #

progress

Progress of the execution.

state property #

state

Current state of the execution.

Can be: INITIALIZING, INITIALIZATION_FAILED, FINISHED, RUNNING, ACCEPTED, FAILED, KILLED, NEW, NEW_SAVING, SUBMITTED, AGGREGATING_LOGS, FRAMEWORK_FAILURE, STARTING_APP_MASTER, APP_MASTER_START_FAILED, GENERATING_SECURITY_MATERIAL, or CONVERTING_NOTEBOOK.

stderr_path property #

stderr_path

Path in Hopsworks Filesystem to stderr log file.

stdout_path property #

stdout_path

Path in Hopsworks Filesystem to stdout log file.

submission_time property #

submission_time

Timestamp when the execution was submitted.

success property #

success

Boolean to indicate if execution ran successfully or failed.

RETURNS DESCRIPTION

bool. True if execution ran successfully. False if execution failed or was killed.

user property #

user

User that submitted the execution.

await_termination #

await_termination(timeout: float | None = None)

Wait until execution terminates.

PARAMETER DESCRIPTION
timeout

The maximum waiting time in seconds. If None the waiting time is unbounded. Note: the actual waiting time may be bigger by approximately 3 seconds.

TYPE: float | None DEFAULT: None

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

delete #

delete()

Delete the execution.

Potentially dangerous operation

This operation deletes the execution.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.

download_logs #

download_logs(
    path: str | None = None,
) -> tuple[str | None, str | None]

Download stdout and stderr logs for the execution.

Downloading and printing the logs
# Download logs
out_log_path, err_log_path = execution.download_logs()

out_fd = open(out_log_path, "r")
print(out_fd.read())

err_fd = open(err_log_path, "r")
print(err_fd.read())
PARAMETER DESCRIPTION
path

path to download the logs.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
stdout

Path to downloaded log for stdout.

TYPE: str | None

stderr

Path to downloaded log for stderr.

TYPE: str | None

get_url #

get_url()

Get url to view execution details in Hopsworks UI.

stop #

stop()

Stop the execution.

Potentially dangerous operation

This operation stops the execution.

RAISES DESCRIPTION
hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when handling the request.