Skip to content

Commit

Permalink
Pipe logs to $cwd/.logs instead of /logs for @Batch & @kubernetes (Ne…
Browse files Browse the repository at this point in the history
  • Loading branch information
savingoyal authored Nov 4, 2021
1 parent ac7d7df commit e9158ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions metaflow/plugins/aws/batch/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

from .batch_client import BatchClient

# Redirect structured logs to /logs/
LOGS_DIR = "/logs"
# Redirect structured logs to $PWD/.logs/
LOGS_DIR = "$PWD/.logs"
STDOUT_FILE = "mflog_stdout"
STDERR_FILE = "mflog_stderr"
STDOUT_PATH = os.path.join(LOGS_DIR, STDOUT_FILE)
Expand Down Expand Up @@ -71,7 +71,8 @@ def _command(self, environment, code_package_url, step_name, step_cmds, task_spe
# the `true` command is to make sure that the generated command
# plays well with docker containers which have entrypoint set as
# eval $@
cmd_str = "true && mkdir -p /logs && %s && %s && %s; " % (
cmd_str = "true && mkdir -p %s && %s && %s && %s; " % (
LOGS_DIR,
mflog_expr,
init_expr,
step_expr,
Expand Down
7 changes: 4 additions & 3 deletions metaflow/plugins/aws/eks/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

from .kubernetes_client import KubernetesClient

# Redirect structured logs to /logs/
LOGS_DIR = "/logs"
# Redirect structured logs to $PWD/.logs/
LOGS_DIR = "$PWD/.logs"
STDOUT_FILE = "mflog_stdout"
STDERR_FILE = "mflog_stderr"
STDOUT_PATH = os.path.join(LOGS_DIR, STDOUT_FILE)
Expand Down Expand Up @@ -148,7 +148,8 @@ def _command(
# The `true` command is to make sure that the generated command
# plays well with docker containers which have entrypoint set as
# eval $@
cmd_str = "true && mkdir -p /logs && %s && %s && %s; " % (
cmd_str = "true && mkdir -p %s && %s && %s && %s; " % (
LOGS_DIR,
mflog_expr,
init_expr,
step_expr,
Expand Down

0 comments on commit e9158ba

Please sign in to comment.