question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker executor launches using virtualenv python

See original GitHub issue

Summary

If I run Dagit using a virtulaenv, the Docker executor tries to run a command with my virtual environment’s python (which doesn’t exist in the Docker container)

Reproduction

Run dagit from within a virtualenv. Then create a config that looks something like this:

execution:
  config:
    image: <Docker Image>
...

And the launched command should fail since it will have something like this as its default command:

"Cmd": [
                "/Users/nlarusstone/.virtualenvs/pipeline/bin/python3",
                "-m",
                "dagster",
                "api",
                "execute_step",
               ....

Error will look like:

/opt/venv/bin/python3: can't open file '/Users/nlarusstone/.virtualenvs/pipeline/bin/python3': [Errno 2] No such file or directory

Additional Info about Your Environment

Dagster 0.14.20 OSX 11.6.2 Docker 20.10.11

Message from the maintainers:

Impacted by this bug? Give it a 👍. We factor engagement into prioritization.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gibsondancommented, Jun 22, 2022

https://github.com/dagster-io/dagster/pull/8571 will fix the first issue you ran into and is something we’ve been meaning to do for a while, thanks for bringing it to our attention

1reaction
gibsondancommented, Jun 22, 2022

Hi @nlarusstone - sorry for the trouble here. I think we can clean this up so that the default entry point is just “dagster” in this case.

In the meantime, running your code in your own grpc server (https://docs.dagster.io/concepts/repositories-workspaces/workspaces#running-your-own-grpc-server) is one potential workaround that I believe would make your steps run just using ‘dagster’ as the entrypoint rather than a specific python environment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Elegantly activating a virtualenv in a Dockerfile - Python⇒Speed
One solution is to explicitly use the path to the binaries in the virtualenv. In this case we only have two repetitions, but...
Read more >
Integrating Python Poetry with Docker
In a nutshell, your build stage installs everything into the virtualenv, and the final stage just copies the virtualenv over into a small...
Read more >
Docker Containers, Python Virtual Environments, & Virtual ...
Let's jump right in! This is a practical hands-on guide and introduction to docker containers, python virtual environments, and virtual ...
Read more >
Multi-job pipelines using shell executor fundamentally ... - GitLab
python3 venv embeds absolute paths in the generated environment ... In a docker executor, the job workspace is mounted and always appears of ......
Read more >
Running PySpark with Virtualenv - Henning Kropp
In this post we show what this means for Python environments being used by Spark. YARN Application Deployment. As mentioned earlier does YARN ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found