Page MenuHomeElementl

Set entrypoint to empty when launching runs or steps iwth a custom command
AbandonedPublic

Authored by dgibson on Mar 11 2021, 10:31 PM.

Details

Summary

If we don't do this, the default beahvior is (i think) to append the command to whatever entrypoint has been set. This is almost certainly not what we want, at least in the docker deployment case where the entrypoint is 'dagster api grpc'.

Test Plan

BK

Diff Detail

Repository
R1 dagster
Branch
schema3
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

alangenfeld edited reviewers, added: sashank; removed: alangenfeld.
alangenfeld added a subscriber: sashank.

@sashank went through this cmd vs entrypoint distinction on the k8s stuff not long ago. I can never keep it straight

In some cases, users want their entrypoint to _not_ be dagster, because they could be using something like conda. This is because dagster isn't an available command in their virtual environment. Here's an example of where a similar problem came up in dagster-k8s: https://github.com/dagster-io/dagster/issues/3081.

This is a bit different from k8s though because there is no separate command and args arguments. Trying to look into the Docker docs to see what we might want to do here.

examples/deploy_docker/Dockerfile_pipelines
29–32

Reading this: https://phoenixnap.com/kb/docker-cmd-vs-entrypoint

I believe you want to separate this out into:

ENTRYPOINT ["dagster"]
CMD ["api", "grpc", "-h", "0.0.0.0", "-p", "4000", "-f", "repo.py"]

And then make the commands in the launcher just: api execute_step {} and api execute_run_with_structured_logs {}. Then the launcher will respect the entrypoint in the Dockerfile, and the user can edit the entrypoint as needed.

sashank requested changes to this revision.Mar 15 2021, 6:36 PM

Let me know if my suggestion doesn't makes or doesn't result in the desired behavior you're trying to achieve here. Not 100% familiar with the docker run launcher.

This revision now requires changes to proceed.Mar 15 2021, 6:36 PM