Running Dagster as a Service in Windows #7223
Replies: 6 comments 7 replies
-
when you want to deploy a new version of the code base (like added a new job or changed existing job configuration), do you need to re-install? |
Beta Was this translation helpful? Give feedback.
-
Hi! Have you made additional steps to use python in the cmd? if yes, which ones? I get this error following from nssm with the steps that you specify: "'dagit' is not recognized as an internal or external command, operable program or batch file." I already made the steps that I find in another generic article https://qr.ae/pveLQ0 and if I run the bat it works just fine (the problem is with nssm) |
Beta Was this translation helpful? Give feedback.
-
How do I locate DAGSTER_HOME folder? |
Beta Was this translation helpful? Give feedback.
-
to follow this guide in 2024 you need to know that dagit is now known as dagster-webserver Also worth noting that using nssm (which acts as a permanent wrapper for the .bat) avoids windows “Error 1053 the service did not respond to the start or control request in a timely fashion” |
Beta Was this translation helpful? Give feedback.
-
Hello, I have dagster running as a service out of my DAGSTER_HOME folder, how do I configure the service to use a dagster project not in the DAGSTER_HOME folder? |
Beta Was this translation helpful? Give feedback.
-
In case people can't get it to work because they try to run it in a virtual environment try this:
You have to put call in front of the venv activation. When you run venv\scripts\activate in a batch script, it is run in a new command shell, and once the activation is done, the shell exits. This means the environment changes (like activating the virtual environment) do not persist in the original command shell where your batch script is running. |
Beta Was this translation helpful? Give feedback.
-
Credits
This note was written by @jragbeer about running Dagster as a service in Windows. Thanks for the contribution!
Guide
Suppose you’re running on Windows 10 and want to run Dagster continuously with a bit more resiliency.
By running the
dagster-daemon run
anddagit
commands in the command prompt (cmd.exe), you can get going with Dagster and enjoy all of its features. If those windows close, Dagster no longer runs and your neither do your scheduled processes. If there’s an unexpected restart event, Dagster doesn’t restart.The way to ensure that your Dagster process runs regardless of open windows or restarts is run it as a service. Using NSSM, that is easy to do. Following these steps, I was able to get Dagster running as a service, which would survive unexpected restarts and logouts. I’ve only tested this method with Windows 10, but I’ve confirmed it’s worked well on 3 different PCs.
pip install dagster dagit
in a Command Prompt (with admin privileges).nssm install dagster_service
– dagster_service in this case is the name of the service you’ll see in the Services app in Windows.nssm install dagster_service
withnssm install dagit_service
and "dagster_service.bat" with "dagit_service.bat".Beta Was this translation helpful? Give feedback.
All reactions