Skip to content

Commit

Permalink
Fix entrypoint issue with @Batch (#534)
Browse files Browse the repository at this point in the history
* Fix mkdir issue with @Batch execution

For some container images (woth entrypoint defined as `eval $@`) the current
batch command fails to execute properly. This patch fixes the behavior.

* Update logic
  • Loading branch information
savingoyal authored May 20, 2021
1 parent ae9dcab commit 6258cdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion metaflow/plugins/aws/batch/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ def _command(self,
# 1) initializes the mflog environment (mflog_expr)
# 2) bootstraps a metaflow environment (init_expr)
# 3) executes a task (step_expr)
cmd_str = 'mkdir -p /logs && %s && %s && %s; ' % \

# 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; ' % \
(mflog_expr, init_expr, step_expr)
# after the task has finished, we save its exit code (fail/success)
# and persist the final logs. The whole entrypoint should exit
Expand Down

0 comments on commit 6258cdf

Please sign in to comment.