Skip to content

Commit

Permalink
[UX] Disable python output buffer by default (#1290)
Browse files Browse the repository at this point in the history
diable python output buffer
  • Loading branch information
Michaelvll authored Oct 28, 2022
1 parent edae25a commit 003dee8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sky/skylet/log_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,15 @@ def make_task_bash_script(codegen: str,
# set -a is used for exporting all variables functions to the environment
# so that bash `user_script` can access `conda activate`. Detail: #436.
# Reference: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html # pylint: disable=line-too-long
# PYTHONUNBUFFERED is used to disable python output buffering.
script = [
textwrap.dedent(f"""\
#!/bin/bash
source ~/.bashrc
set -a
. $(conda info --base 2> /dev/null)/etc/profile.d/conda.sh > /dev/null 2>&1 || true
set +a
export PYTHONUNBUFFERED=1
cd {constants.SKY_REMOTE_WORKDIR}"""),
]
if env_vars is not None:
Expand Down

0 comments on commit 003dee8

Please sign in to comment.