-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No logging in container for python scripts nodes #3222
Comments
A coworker of mine just today approached me with the same problem. Will verify ... I am having him submit both python and jupyter generic pipeline nodes / tasks as well. He mentioned the same: why don't I see the log infos in Airflow Web GUI Task logs ... very similar to me to your problem described here. The issue is independent of the runtime, be it Kubeflow pipelines or Airflow. Verified with us, too: pythonFileOp and RFileOp have similar snytax, subprocess.run, in both kfp and airflow bootstrapper.py https://github.com/elyra-ai/elyra/blob/main/elyra/kfp/bootstrapper.py#L521 https://github.com/elyra-ai/elyra/blob/main/elyra/airflow/bootstrapper.py#L332 i.e. We only see the name of the processed file in stdout and no logs in case of python or r nodes: whereas ipynb notebookFileOp https://github.com/elyra-ai/elyra/blob/main/elyra/kfp/bootstrapper.py#L357 probably handles cell logging differently, which is why we see its python output. I found the following info on subprocess: https://docs.python.org/3/library/subprocess.html#using-the-subprocess-module
|
This is how we do it
|
Hi @paloma-rebuelta @romeokienzler @harshad16 just a quick update on my code change tested so we can see the actual logs in python and R nodes processed in KFP or Airflow. I decided to let the called process error exception (on non-zero return code) trickle up in subprocess by means of "check=True", as it's been before here in that part of Elyra code.
In terms of new behavior, see some samples, in my case Airflow, using different python content: @romeokienzler @kevin-bates @lresende @harshad16 I wonder why elyra developers initially decided to put the stdout script output into a file and then put that file into the elyra s3 bucket ... in my PR, I will add script output to stdout and log it in whatever system it runs on, leaving log collection to the system. Do we want to keep putting python or r or notebook output stdout to S3 bucket file like here https://github.com/elyra-ai/elyra/blob/main/elyra/kfp/bootstrapper.py#L492 Searching for architectural input here. Also posted this question in elyra Slack general channel. Since I am now piping all script run output to stdout, including stderr, I am getting the following, understandable, warning after running
|
@harshad16 @romeokienzler regarding notebook logs and cell output that @paloma-rebuelta sees when executing Jupyter notebooks code (see her first code example ipynb that I also ran today), when airflow or kfp log level is only set to INFO (not debug), it seems the log info or cell output is not written:
so we have to do some more work in bootstrapper.py for NotebookFileOps, too, it seems, with regards to logger and stdout and stderr ... I'll test this out. i.e. nteract/papermill#433 (comment) https://github.com/nteract/papermill/blob/main/papermill/engines.py#L221 Update:
need to find out why cell output got logged twice: log read interrupted but container base still running. but good to see that the three additional arguments to
make sure that in any case, cell content is logged correctly and when there is a raise or unknown error, that, too, is logged.
at https://github.com/elyra-ai/elyra/blob/main/elyra/airflow/bootstrapper.py#L229C13-L229C91 |
Describe the issue
Hello! I have a problem with my elyra pipelines not showing logs.
I have looked for issues on github but couldn't find anything related, and i am not sure if I am missing some needed config or if this is a bug.
When I run an elyra pipeline with two nodes, one a jupyter notebook and one a python script, only the jupyter notebook one shows the logging. I am not sure why this is the case as they are both managed the same way.
This problem also happens if the pipeline only has python scripts, just using this example as it shows the difference well.
I have added screenshots of my example, and in the logs screenshot there's the jupyter notebook one that clearly shows the expected outputs, whereas the other one doesn't have anything
Any help would be really appreciated!
To Reproduce
Steps to reproduce the behavior:
Screenshots or log output
Expected behavior
I would expect identical logging for both nodes, given the fact that the code is the same. I haven't managed to get anything to output in the python script nodes.
Deployment information
Describe what you've deployed and how:
The text was updated successfully, but these errors were encountered: