Skip to content
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

provide an alternative solution to the usage of tee command #1297

Closed
mattanf2 opened this issue Jun 20, 2021 · 1 comment · Fixed by #1584
Closed

provide an alternative solution to the usage of tee command #1297

mattanf2 opened this issue Jun 20, 2021 · 1 comment · Fixed by #1584
Assignees

Comments

@mattanf2
Copy link

We were previously advised that when calling the python program inside a container. we should call it with a line such as:
python -u main.py 2>&1 | tee /hkube-logs/stdout.log

However, it turns out that if we add the "tee /hkube-logs/stdout.log" section to the script and main.py crashes. hkube will not detect the crash and will run the algorithm either forever or untill ttl is reached.

"tee /hkube-logs/stdout.log" section is therefor unusable. I can add code to write logs to the "/hkube-logs/stdout.log" file. However the last time I checked. hkube_python_wrapper uses a lot of print() commands (instead of logging using a logger) that would not be captured this way.

Please advise on how to proceed.

@yehiyam yehiyam self-assigned this Apr 25, 2022
@yehiyam yehiyam linked a pull request Apr 26, 2022 that will close this issue
@yehiyam
Copy link
Contributor

yehiyam commented May 1, 2022

example algorithm in python that should replicate that:

import ctypes
import time 
def start(args, hkubeapi):
    time.sleep(1)
    print('sending ctype error')
    data = ctypes.c_char_p(-1).value #<- I think you only need this
    return "hello"

@yehiyam yehiyam reopened this May 1, 2022
@yehiyam yehiyam assigned tamir321 and unassigned yehiyam May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants