https://dagster.io/ logo
#ask-community
Title
# ask-community
v

Vlad Dumitrascu

06/07/2021, 5:49 PM
Hi fellow Dagster devs, I have a question. I sold my team on Dagster/Dagit pipelines for a few automated things that have become critical in our production. They work great on my local machine. But, when I try to send my users (in the same network) a link to my machine, they can't access it. I am sending them the network alias to my machine, followed by a colon (:) and then the port number that Dagit is configured on (default port 3000). So, it looks something like: http://my-computer-name:3000 ...they just get a loading screen in their browser that never resolves. The other things I've set up for them (using python module HTTP setting up a simple proxy server) work similarly, but they actually let the users connect (on a different port, say 8000). What do I have to do to let Dagit open the port for my users? I'm launching Dagit with the executable "dagit" from the project folder I want to serve out, per the documentation. I suspect it's the windows firewall not having an opening at that port number. I tried to open the port with a BAT file that starts Dagit, and settiing up a rule:
Copy code
set DAGSTER_PROJ_DIR=%~dp0
ECHO OFF
ECHO Opening Port 3000 in Firewall of local machine, to allow workgroup access by link.

set PORT=3000
set RULE_NAME="Dagster Open Port %PORT%"
netsh advfirewall firewall show rule name=%RULE_NAME% >nul
if not ERRORLEVEL 1 (
    rem Rule %RULE_NAME% already exists.
    echo A rule already exists with name: %RULE_NAME%
) else (
    echo Rule %RULE_NAME% does not exist. Creating...
    netsh advfirewall firewall add rule name=%RULE_NAME% dir=in action=allow protocol=TCP localport=%PORT%
)
...but I still have the issue. I tried searching on this channel and found a brief reply saying to "use 0.0.0.0" . How do I implement this with Dagit?
a

alex

06/07/2021, 9:54 PM
just get a loading screen in their browser that never resolves
is this the dagster page with loading spinners or the browser trying to make the initial connection? What version of dagit are you running?
v

Vlad Dumitrascu

06/07/2021, 9:56 PM
thanks for the reply! No, just the browser trying to connect. No dagster spinner. How can I tell which version of dagit I'm running
version 0.11.2? (that's in my local dagit running on my machine).
a

alex

06/07/2021, 9:57 PM
yep - have you used other web apps in this same way? My guess is that its a networking issue that is not really dagster specific
v

Vlad Dumitrascu

06/07/2021, 10:00 PM
agreed. Yes, I have a ProxyServer serving out port 8000 on my machine to make another webpage available. So, i think the concept is sound. I agree, I think it's my firewall not opening up the port. The proxy server using python
SimpleHTTPServer
or
http.server
(PY 3+) module is created by a script, and running the script opens the port. Closing the script closes the port. That works great. Was hoping for something similar in Dagster. Yes, it's not a Dagster issue, but I thought it would be something within the realm of issues most users face trying to use Dagit, which seems to be designed for serving out from a web link.
...or is Dagit intended to only be used by 1 individual on their own machine?
a

alex

06/07/2021, 10:02 PM
there are websockets in the mix with dagster, we just last week improved the fallback when websockets are not available so you can try updating dagit and dagster that said, im unsure if websockets are the issue if the initial static resources are not even loading
Dagit can serve multiple people, our kubernetes helm deployment for example uses it directly
v

Vlad Dumitrascu

06/07/2021, 10:07 PM
maybe it's my path. what's the proper way to form that link for 'workgroup' consumption - I mean machines on the same network, but not your machine? I assumed you change:
<http://127.0.0.1:3000>
for...
<http://your-pc-network-alias:3000>
...that seems to work in the proxy server method. Does that look right to you?
...obviously, if I send the first path as a link, it would go to THEIR computer's port 3000 (which is not configured to do anything)...so, I'm sending my PC's path.
a

alex

06/07/2021, 10:15 PM
I think so but I dont have experience with windows networking
a

Anton Friberg

06/08/2021, 7:54 AM
@Vlad Dumitrascu To expose dagit on 0.0.0.0 start it with
Copy code
dagit -h 0.0.0.0
d

Daniel Kim

06/08/2021, 4:19 PM
@Vlad Dumitrascu I develop locally on Windows 10 and had same issue. What worked for me on my company's VPN, I have to provide fully qualified domain name, not just the computer/PC name. I also have a flask server running and I've never had to provide full domain name, but with dagster for some reason, I do. At the terminal, I just issue the ping command:
ping localhost
and it should provide the full domain name. I also run dagit via
dagit -h 0.0.0.0
. Hope this works for you!
❤️ 1
v

Vlad Dumitrascu

06/08/2021, 5:34 PM
@Anton Friberg @Daniel Kim Thank you! Running it with
-h 0.0.0.0
did the trick!
blob clap 1
celebrate 1
just so I learn something: why does this work?
d

Daniel Kim

06/08/2021, 6:58 PM
Not sure what exactly is your question. If you're wondering the difference between 127.0.0.1 vs 0.0.0.0, maybe this explains. Sorry, computer networking knowledge is not my strong suite.
v

Vlad Dumitrascu

06/15/2021, 6:45 PM
Guys, I wish I could say this is "problem solved". But, it's not. After running with
-h 0.0.0.0
for a few days, my Remote Desktop became unresponsive and could not connect to the computer anymore. You see, as with many companies in COV-19 times, we are working remote....so we access our PC's through VPN and Windows Remote Desktop. Since all this works over ports in the firewall, I think it's imperative that Dagster plays nicely and stays in its own lane. I suspect that putting Dagster/Dagit on port 0.0.0.0 (default port) is hogging that port, or somehow interfering with other services trying to communicate. The solution - not the hacky workaound, guys - is to have Dagster ACTUALLY work on port 3000 (or whatever single port is open for it). So, I'm asking again, is there an "official" way( from the mouth of Dagster developers, preferably the person responsible for network code) for this to work? What is the solution to open port 3000 on a Windows Machine to allow Dagster to serve out the Dagit UI for people on the same network. This is a very simple question. Just dump the info, guys...don't bother asking me 30 questions about 'why I want to do this' or other parrying moves common on stackoverflow threads. How do I blast open a gateway on port 3000 and just let Dagit through?
Here's the result of that BAT script above. It looks to me like there is 'rule' created to let 'Any' program through at port 3000. Am I missing something?
a

Anton Friberg

06/17/2021, 9:49 AM
@Vlad Dumitrascu I am not familiar with Windows but 0.0.0.0 is not a port but rather tells the application to listen on all IP addresses. 127.0.0.1 would only listen on the loopback device which is only receiving traffic from your own machine. There is no issue on Windows with exposing port 3000 on 0.0.0.0 and it would only interfer with other applications that communicate over port 3000. The VPN is to connect your computer with another network and could be setup in any number of ways. The remote desktop is communicating on port 3389 by default so is not affected by dagster. To answer your questions (even though I am not a dagster developer). The official way to expose a developer setup of dagster on port 3000 outside your own machine is "dagit -h 0.0.0.0 -p 3000" https://docs.dagster.io/_apidocs/cli#dagit . This will (not accounting for other applications and firewalls on your machine) "open access on port 3000 and let other users in). But since we have no idea how your network looks like or what is running on your machine we cannot help you.
v

Vlad Dumitrascu

06/17/2021, 5:21 PM
Thanks @Anton Friberg I am looking into the documentation link you sent. I did not know about the port argument. That might just do it. I'd like to keep it very sandboxed to known ports and addresses, so that I can debug it. Otherwise, like you pointed out, there are so many layers going on with the network and the firewall, etc, that it would be very hard for anyone to help(except our IT dept, but then they would just throw up their hands and tell me not to do whatever was above their understanding - but that's another story). I think you've given me some good info. Full disclosure, here's how I'm doing this: I run
dagit
without any arguments. This opens up a connection on default port 3000. I can see it if I go to
*127.0.0.1*:3000
, as per the tutorials. This is me, using a browser on my machine to connect to Dagster on my machine. Handy, but I wanted to share this interface to others. So, I replaced the
127.0.0.1
in that address above with the network alias of my PC...something like
my_computer.group.<http://our_company.com|our_company.com>
(not real). This approach worked when I used python's simple proxy server combined with some JavaScript webpages I serve on this machine. But not in dagit. I will try to explicitly say port 3000, although I can confirm it's on port 3000 because that's my browser link?! I have a separate issue with Threaded Dagster crashing after 14 hours or so on some long processes, and taking out my Remote Desktop connection(which also requires our VPN, so another layer to worry about). It may be that the bug is somewhere in the threading code, and not the network code? So, I could be barking up the wrong tree. But, either way I need to fix it, so I'm trying all things. Thanks again for everyone's help. So far, I like Dagster, and the community is great (honestly, these days I pick API's more on community support than feature list).
a

Anton Friberg

06/17/2021, 5:25 PM
@Vlad Dumitrascu You could try the same port that you said worked for a simple proxy server in python and the javascript pages. It might simply be that some ports are firewalled somewhere along the chain. Good luck regardless!
v

Vlad Dumitrascu

06/21/2021, 7:06 PM
I think this resolves my issue. I believe the connection issue I have following this fix is because of an overly greedy pipeline in multithreaded mode. So, anyone reading this thread later - the above commands to dagit resolve the access problem. 👍👍
4 Views