Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shalberd committed Aug 16, 2024
1 parent 007d392 commit 8b87c7e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
20 changes: 15 additions & 5 deletions elyra/airflow/bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@

logger = logging.getLogger("elyra")
enable_pipeline_info = os.getenv("ELYRA_ENABLE_PIPELINE_INFO", "true").lower() == "true"
# not only log File Operations output of NotebookFileOp, RFileOp, PythonFileOp to stdout so it appears in runtime / container logs
# and also Airflow and KFP GUI logs, but also put output to S3 storage
enable_generic_node_script_output_to_s3 = os.getenv("ELYRA_GENERIC_NODES_ENABLE_SCRIPT_OUTPUT_TO_S3", "true").lower() == "true"
# not only log File Operations output of NotebookFileOp, RFileOp, PythonFileOp to stdout so it appears
# in runtime / container logs and also Airflow and KFP GUI logs, but also put output to S3 storage
enable_generic_node_script_output_to_s3 = (
os.getenv("ELYRA_GENERIC_NODES_ENABLE_SCRIPT_OUTPUT_TO_S3", "true").lower() == "true"
)
pipeline_name = None # global used in formatted logging
operation_name = None # global used in formatted logging

Expand Down Expand Up @@ -230,7 +232,14 @@ def execute(self) -> None:
import papermill

print("Processing file:", notebook)
papermill.execute_notebook(notebook, notebook_output, kernel_name=kernel_name, log_output=True, stdout_file=sys.stdout, stderr_file=sys.stderr)
papermill.execute_notebook(
notebook,
notebook_output,
kernel_name=kernel_name,
log_output=True,
stdout_file=sys.stdout,
stderr_file=sys.stderr
)
duration = time.time() - t0
OpUtil.log_operation_info("notebook execution completed", duration)

Expand Down Expand Up @@ -575,7 +584,8 @@ def main():
input_params = OpUtil.parse_arguments(sys.argv[1:])
OpUtil.log_operation_info("starting operation")
t0 = time.time()
# must be commented out in airgapped images if packages from https://github.com/elyra-ai/elyra/blob/main/etc/generic/requirements-elyra.txt
# must be commented out in airgapped images if packages from
# https://github.com/elyra-ai/elyra/blob/main/etc/generic/requirements-elyra.txt
# already installed via central pip env during container build
OpUtil.package_install()

Expand Down
21 changes: 16 additions & 5 deletions elyra/kfp/bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@

logger = logging.getLogger("elyra")
enable_pipeline_info = os.getenv("ELYRA_ENABLE_PIPELINE_INFO", "true").lower() == "true"
# not only log File Operations output of NotebookFileOp, RFileOp, PythonFileOp to stdout so it appears in runtime / container logs
# and also Airflow and KFP GUI logs, but also put output to S3 storage
enable_generic_node_script_output_to_s3 = os.getenv("ELYRA_GENERIC_NODES_ENABLE_SCRIPT_OUTPUT_TO_S3", "true").lower() == "true"
# not only log File Operations output of NotebookFileOp, RFileOp, PythonFileOp to stdout so it appears
# in runtime / container logs and also Airflow and KFP GUI logs, but also put output to S3 storage
enable_generic_node_script_output_to_s3 = (
os.getenv("ELYRA_GENERIC_NODES_ENABLE_SCRIPT_OUTPUT_TO_S3", "true").lower() == "true"
)
pipeline_name = None # global used in formatted logging
operation_name = None # global used in formatted logging

Expand Down Expand Up @@ -380,7 +382,15 @@ def execute(self) -> None:
import papermill

print("Processing file:", notebook)
papermill.execute_notebook(notebook, notebook_output, kernel_name=kernel_name, log_output=True, stdout_file=sys.stdout, stderr_file=sys.stderr, **kwargs)
papermill.execute_notebook(
notebook,
notebook_output,
kernel_name=kernel_name,
log_output=True,
stdout_file=sys.stdout,
stderr_file=sys.stderr,
**kwargs
)
duration = time.time() - t0
OpUtil.log_operation_info("notebook execution completed", duration)

Expand Down Expand Up @@ -758,7 +768,8 @@ def main():
input_params = OpUtil.parse_arguments(sys.argv[1:])
OpUtil.log_operation_info("starting operation")
t0 = time.time()
# must be commented out in airgapped images if packages from https://github.com/elyra-ai/elyra/blob/main/etc/generic/requirements-elyra.txt
# must be commented out in airgapped images if packages from
# https://github.com/elyra-ai/elyra/blob/main/etc/generic/requirements-elyra.txt
# already installed via central pip env during container build
OpUtil.package_install(user_volume_path=input_params.get("user-volume-path"))

Expand Down

0 comments on commit 8b87c7e

Please sign in to comment.