gray-lifeguard-89900
10/05/2022, 12:16 PMfreezing-airport-6809
freezing-airport-6809
gray-lifeguard-89900
10/06/2022, 7:55 AMfreezing-airport-6809
freezing-airport-6809
freezing-airport-6809
high-park-82026
hallowed-mouse-14616
10/12/2022, 2:28 PMgray-lifeguard-89900
10/13/2022, 7:46 AMglamorous-carpet-83516
10/17/2022, 9:52 PMgray-lifeguard-89900
10/18/2022, 7:23 AMglamorous-carpet-83516
10/18/2022, 4:37 PMSince there’s also a scenario that AWS batch job status SUCCEEDED, while plugin reports error back and task status keep running.Could you share some code snippet that I can reproduce? I didn’t run into this issue before.
gray-lifeguard-89900
10/20/2022, 11:59 AMimport typing
import pandas as pd
import numpy as np
from flytekitplugins.awsbatch import AWSBatchConfig
from flytekit import task
config = AWSBatchConfig(
platformCapabilities="EC2",
)
@task(task_config=config)
def generate_normal_df(n:int, mean: float, sigma: float) -> pd.DataFrame:
raise Exception
return pd.DataFrame({"numbers": np.random.normal(mean, sigma,size=n)})
@task
def compute_stats(df: pd.DataFrame) -> typing.Tuple[float, float]:
return float(df["numbers"].mean()), float(df["numbers"].std())
@workflow
def wf(n: int = 200, mean: float = 0.0, sigma: float = 1.0) -> typing.Tuple[float, float]:
return compute_stats(df=generate_normal_df(n=n, mean=mean, sigma=sigma))
gray-lifeguard-89900
10/20/2022, 12:00 PMgray-lifeguard-89900
10/20/2022, 12:00 PMglamorous-carpet-83516
10/20/2022, 7:08 PMglamorous-carpet-83516
10/20/2022, 7:53 PMgray-lifeguard-89900
10/21/2022, 6:37 AMgray-lifeguard-89900
10/21/2022, 6:44 AMgray-lifeguard-89900
10/21/2022, 6:45 AM2022-10-20T11:57:41.508Z
{"asctime": "2022-10-20 11:57:41,507", "name": "flytekit.entrypoint", "levelname": "ERROR", "message": "!! Begin User Error Captured by Flyte !!"}
@ingestionTime
1666267062341
@log
601097174345:/aws/batch/job
@logStream
base_image/default/76b45eaac132413883c7cb26bfd95fad
@message
{"asctime": "2022-10-20 11:57:41,507", "name": "flytekit.entrypoint", "levelname": "ERROR", "message": "!! Begin User Error Captured by Flyte !!"}
@timestamp
1666267061508
asctime
2022-10-20 11:57:41,507
levelname
ERROR
message
!! Begin User Error Captured by Flyte !!
name
flytekit.entrypoint
gray-lifeguard-89900
10/21/2022, 6:45 AM2022-10-20T11:57:41.508Z
{"asctime": "2022-10-20 11:57:41,508", "name": "flytekit.entrypoint", "levelname": "ERROR", "message": "Traceback (most recent call last):\n\n File \"/usr/local/lib/python3.8/site-packages/flytekit/exceptions/scopes.py\", line 203, in user_entry_point\n return wrapped(*args, **kwargs)\n File \"/opt/program/src/main.py\", line 126, in generate_normal_df\n raise Exception\n\nMessage:\n\n \n\nUser error."}
@ingestionTime
1666267062341
@log
601097174345:/aws/batch/job
@logStream
base_image/default/76b45eaac132413883c7cb26bfd95fad
@message
{"asctime": "2022-10-20 11:57:41,508", "name": "flytekit.entrypoint", "levelname": "ERROR", "message": "Traceback (most recent call last):\n\n File \"/usr/local/lib/python3.8/site-packages/flytekit/exceptions/scopes.py\", line 203, in user_entry_point\n return wrapped(*args, **kwargs)\n File \"/opt/program/src/main.py\", line 126, in generate_normal_df\n raise Exception\n\nMessage:\n\n \n\nUser error."}
@timestamp
1666267061508
asctime
2022-10-20 11:57:41,508
levelname
ERROR
message
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flytekit/exceptions/scopes.py", line 203, in user_entry_point
return wrapped(*args, **kwargs)
File "/opt/program/src/main.py", line 126, in generate_normal_df
raise Exception
Message:
User error.
name
flytekit.entrypoint
gray-lifeguard-89900
10/21/2022, 6:45 AM2022-10-20T11:57:41.508Z
{"asctime": "2022-10-20 11:57:41,508", "name": "flytekit.entrypoint", "levelname": "ERROR", "message": "!! End Error Captured by Flyte !!"}
@ingestionTime
1666267062341
@log
601097174345:/aws/batch/job
@logStream
base_image/default/76b45eaac132413883c7cb26bfd95fad
@message
{"asctime": "2022-10-20 11:57:41,508", "name": "flytekit.entrypoint", "levelname": "ERROR", "message": "!! End Error Captured by Flyte !!"}
@timestamp
1666267061508
asctime
2022-10-20 11:57:41,508
levelname
ERROR
message
!! End Error Captured by Flyte !!
name
flytekit.entrypoint
gray-lifeguard-89900
10/21/2022, 6:45 AM2022-10-20T11:57:41.507Z
{"asctime": "2022-10-20 11:57:41,507", "name": "flytekit", "levelname": "ERROR", "message": "Exception when executing ", "exc_info": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.8/site-packages/flytekit/exceptions/scopes.py\", line 203, in user_entry_point\n return wrapped(*args, **kwargs)\n File \"/opt/program/src/main.py\", line 126, in generate_normal_df\n raise Exception\nException\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.8/site-packages/flytekit/core/base_task.py\", line 479, in dispatch_execute\n native_outputs = self.execute(**native_inputs)\n File \"/usr/local/lib/python3.8/site-packages/flytekit/core/python_function_task.py\", line 163, in execute\n return exception_scopes.user_entry_point(self._task_function)(**kwargs)\n File \"/usr/local/lib/python3.8/site-packages/flytekit/exceptions/scopes.py\", line 214, in user_entry_point\n raise FlyteScopedUserException(*_exc_info())\nflytekit.exceptions.scopes.FlyteScopedUserException"}
@ingestionTime
1666267062341
@log
601097174345:/aws/batch/job
@logStream
base_image/default/76b45eaac132413883c7cb26bfd95fad
@message
{"asctime": "2022-10-20 11:57:41,507", "name": "flytekit", "levelname": "ERROR", "message": "Exception when executing ", "exc_info": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.8/site-packages/flytekit/exceptions/scopes.py\", line 203, in user_entry_point\n return wrapped(*args, **kwargs)\n File \"/opt/program/src/main.py\", line 126, in generate_normal_df\n raise Exception\nException\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.8/site-packages/flytekit/core/base_task.py\", line 479, in dispatch_execute\n native_outputs = self.execute(**native_inputs)\n File \"/usr/local/lib/python3.8/site-packages/flytekit/core/python_function_task.py\", line 163, in execute\n return exception_scopes.user_entry_point(self._task_function)(**kwargs)\n File \"/usr/local/lib/python3.8/site-packages/flytekit/exceptions/scopes.py\", line 214, in user_entry_point\n raise FlyteScopedUserException(*_exc_info())\nflytekit.exceptions.scopes.FlyteScopedUserException"}
@timestamp
1666267061507
asctime
2022-10-20 11:57:41,507
exc_info
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flytekit/exceptions/scopes.py", line 203, in user_entry_point
return wrapped(*args, **kwargs)
File "/opt/program/src/main.py", line 126, in generate_normal_df
raise Exception
Exception
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flytekit/core/base_task.py", line 479, in dispatch_execute
native_outputs = self.execute(**native_inputs)
File "/usr/local/lib/python3.8/site-packages/flytekit/core/python_function_task.py", line 163, in execute
return exception_scopes.user_entry_point(self._task_function)(**kwargs)
File "/usr/local/lib/python3.8/site-packages/flytekit/exceptions/scopes.py", line 214, in user_entry_point
raise FlyteScopedUserException(*_exc_info())
flytekit.exceptions.scopes.FlyteScopedUserException
levelname
ERROR
message
Exception when executing
name
flytekit
gray-lifeguard-89900
10/21/2022, 6:46 AMglamorous-carpet-83516
10/21/2022, 8:31 PMgray-lifeguard-89900
11/11/2022, 8:57 AMhallowed-mouse-14616
11/11/2022, 2:41 PMgray-lifeguard-89900
11/11/2022, 2:45 PMgray-lifeguard-89900
12/28/2022, 3:13 PMgray-lifeguard-89900
12/28/2022, 4:55 PMhallowed-mouse-14616
01/03/2023, 2:26 PMglamorous-carpet-83516
01/03/2023, 6:42 PMgray-lifeguard-89900
01/03/2023, 7:10 PMglamorous-carpet-83516
01/04/2023, 10:10 AMgray-lifeguard-89900
01/04/2023, 11:20 AMgray-lifeguard-89900
01/04/2023, 11:22 AMgray-lifeguard-89900
01/04/2023, 4:25 PMgray-lifeguard-89900
01/04/2023, 4:26 PMgray-lifeguard-89900
01/04/2023, 4:27 PMglamorous-carpet-83516
01/04/2023, 5:03 PMgray-lifeguard-89900
01/04/2023, 5:53 PMimport typing
import pandas as pd
import numpy as np
from flytekit import task, workflow, Resources
from flytekitplugins.awsbatch import AWSBatchConfig
config = AWSBatchConfig(
platformCapabilities="EC2",
)
# task executed in flyte k8s cluster
@task(requests=Resources(cpu="100m", mem="200Mi"))
def generate_normal_df(n: int, mean: float, sigma: float) -> pd.DataFrame:
return pd.DataFrame({"numbers": np.random.normal(mean, sigma, size=n)})
# task executed in AWS batch job
@task(requests=Resources(mem="2Gi", cpu="1"), task_config=config)
def compute_stats(df: pd.DataFrame) -> typing.Tuple[float, float]:
<http://logger.info|logger.info>(f"Running task compute_stats on {timestamp_day()}")
raise ValueError("Intended Error Test")
return float(df["numbers"].mean()), float(df["numbers"].std())
@workflow
def wf(n: int = 200, mean: float = 0.0, sigma: float = 1.0) -> typing.Tuple[float, float]:
return compute_stats(df=generate_normal_df(n=n, mean=mean, sigma=sigma))
glamorous-carpet-83516
01/04/2023, 11:55 PMgray-lifeguard-89900
01/05/2023, 8:25 AMgray-lifeguard-89900
01/05/2023, 8:25 AMgray-lifeguard-89900
01/05/2023, 8:26 AMglamorous-carpet-83516
01/05/2023, 6:17 PMgray-lifeguard-89900
01/05/2023, 9:20 PMglamorous-carpet-83516
01/06/2023, 9:54 AMgray-lifeguard-89900
01/07/2023, 12:54 PMfreezing-airport-6809
freezing-airport-6809
gray-lifeguard-89900
01/23/2023, 1:09 PMglamorous-carpet-83516
01/23/2023, 3:41 PMgray-lifeguard-89900
02/13/2023, 8:48 AMglamorous-carpet-83516
02/13/2023, 4:36 PMglamorous-carpet-83516
02/13/2023, 4:37 PMgray-lifeguard-89900
02/13/2023, 5:07 PMgray-lifeguard-89900
02/14/2023, 8:48 PMgray-lifeguard-89900
02/14/2023, 8:49 PMgray-lifeguard-89900
02/14/2023, 8:49 PMgray-lifeguard-89900
02/14/2023, 8:52 PMglamorous-carpet-83516
02/14/2023, 10:56 PMglamorous-carpet-83516
02/14/2023, 10:57 PMgray-lifeguard-89900
02/15/2023, 8:21 AMglamorous-carpet-83516
02/15/2023, 6:54 PMgray-lifeguard-89900
02/16/2023, 1:51 PMgray-lifeguard-89900
02/16/2023, 1:51 PMgray-lifeguard-89900
02/16/2023, 1:52 PMfreezing-airport-6809
freezing-airport-6809