I have a streamlit app that is fully cached. In fact, I am using a 3rd party caching system running on a local port, and I can see that the cache is being used.
However, streamlit runs two distinct instances when it is started up:
# Windows Subsystem for Linux version 2.0, Running Ubuntu
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://172.21.141.16:8501
From my print statements, it appears as if only the local instance is accessing my cache hosted on a local port.
Simultaneously, the Network URL instance does not leverage the cache hosted on the local port at all and recalculates all of the long running processes that are happily caching themselves on the local side.
I am not exposing this system outside of a virtual machine, so I don't care about security.
My question amounts to: how do I force or eliminate the streamlit's double-instance runtime situation such that all running instances (if there must be two) are able to access the locally running cache?
At the same time, though, I need to preserve streamlit's network topology, as I can only access the external URL (http://172.21.141.16:8501) from the Windows host operating system.
Note that I am using a locally running cache because I want to access and accumulate cached values from multiple processes -- some front and some back.
Streamlit isn't running two instances, the URLs are indicating the relative URL (localhost) and your computer's public/network IP address.
Related
Follow the official doc I have buit a simple graphql server, and use express to serve it locally (for development), I also build a web app which uses Apollo-Client to get the data from the server.
Now I want to deploy my Apollo-Server to another computer which is on the same LAN, you can consider it as the "PROD".
I saw on the official site it recommends using Heroku, but I don't need any cloud platforms. What are the steps to serve my Apollo-Serve on a local machine? (because it's internal use only, I also want to turn on the graphql playground)
Assuming that:
You have your GraphQL server running at localhost:4000 (or any other port)
You have enabled the playground (it's enabled by default)
Your machine allows inbound network connections (at least from your LAN)
Then this is just a matter of figuring out what your machine's local network name or IP address is.
Let's say your local network name is wtf.local - then you should be able to connect to your server from another machine by going to the url http://wtf.local:4000
Or if you know your local IP, say 192.168.0.22, then try http://192.168.0.22:4000
I'm using WSL2 Ubuntu with Docker CE and Docker-Compose.
I want to access the containers I'm running (mostly Apache/MySQL/Wordpress containers) from my local network (sometimes same, sometimes other machines).
For example:
PC1: 192.168.178.20
PC2: 192.168.178.21
On PC1 is Windows + WSL2-Ubuntu with all the docker containers.
I want to access the containers from the Windows-Browser (Chrome) but also from the browser from PC2 (also Chrome, for mac).
Is this even possible? If yes, how?
I got webpack to work with hot reload from WSL2 but this seems very hard and I don't know where to start.
Is it possible to add DNS-Names for specific containers in my router? for example if you call "example.test" my router forwards to the IP from the Docker-Box?
There are a couple of solutions, some better than others.
Find the port number that your container is MAPPED to your host machine (PC1) and make sure you can browse that way. Then take the same URL to PC2 and try it out and see if it works. Make sure you are using the Fully Qualified Domain Name or IP address so it is resolved to find PC1.
Find the port number that your container is EXPOSED to your host machine (PC1) and make sure you can browse that way. Repeat the process as above.
Use a reverse proxy. I am biased and will say to use Traefik because of its relative simplicity (compared to nginx) to configure. It is just another container. It uses RULES (combination of URL Header, Port Number, Path, etc.) to route incoming connections to services/containers. In your case you will create a rule of URL Header (webapp1.corp.com) and port number (80) and route it to a specific container you have running. Then from either computer browser enter http://webapp1.corp.com the connection will be routed to the specific container. This is a very simplistic answer that is more complicated but you should get the gist.
You mentioned you are running multiple containers, so I recommend you use docker-compose if you aren't already using it.
I am running a Hyper-V lab for a client to test the functionality of a Powershell script and due to memory constraints, I would like to move my file and database VM servers off of my main desktop PC to my laptop. I set up Hyper-V on the laptop, and successfully exported/imported the VM's into the other Hyper-V server. I can boot them, all the configuration and files are intact however, I am predictably having trouble reconnecting to the domain they were a part of prior to the move. I understand I need an External virtual switch to handle that communication, as internal and private will not reach outside of the Hyper-V server they reside in. Obviously I would prefer to not use an external, but this is strictly to continue testing. I've trouble-shooted entering different DNS server values from the client machine's IPv4 properties and changing the virtual switch to External for the existing Hyper-V server, and re-register the DNS records on the DC. All result in the same error when I try to connect to the domain: "(error code 0x0000232B RCODE_NAME_ERROR) The query was for the SRV record for _ldap._tcp.dc."... "The DNS SRV records required to locate a AD DC for the domain are not registered in DNS".
In summary, I want to move a VM from the first server listed to the second, and then re-connect to the domain they were part of previously. Both machines are just running Windows 10, not Windows Servers, if that matters. Another note, I can do remote sessions from the desktop to the laptop just fine which would lead to believe this is not related to a firewall. Thanks!
The best it to set up a VLAN. If you can't do that, change the network class of your AD lab machine (192.168.55.x ?) to another in order to avoid conflicts.
Your DNS server has to be AD to make your machines connecting to it.
And last but not least, if you're on 2 different hyperV servers, you have to use external switch in hyperV:
https://redmondmag.com/articles/2018/05/04/hyper-v-private-networks.aspx
I've been asked to put together a Tomcat webserver on a Windows server that can host numerous instances of an application for our development, UAT, training and sandboxes systems. We had them all running on one instance of Tomcat 7 however that was causing the application to crash due to the number of them running and made it hard to update just one environment without bringing them all down. These sites are all internal use only and not public facing so we are using short DNS names to reach the sites.
What I am planning to do now is have multiple sessions that are started using batch files which is working apart from the fact that to reach the sites I have use the full IP, port number and directory name. If I try to access the sites using the short name it displays the main Tomcat sessions default page (running on port 80).
What I am hoping to do is have it so when we use the short name it redirects to the correct session (example below using 127.0.0.1 as an example IP address)
Typing site1 should redirect to 127.0.0.1:8081/site1
Typing site2 should redirect to 127.0.0.1:8081/site2
Typing site3 should redirect to 127.0.0.1:8082/site3
The access to my web application running Windows 2008 Server on localhost is fast; however, when I tried to access the web application through another PC (exp: http://xxx.xxx.xxx.xx:8080/appname) is takes about one minute to load a simple login page. Any input regarding this matter is much appreciated.
Further information, the firewall is already off and the setup within a LAN environment without Internet access.
With this little information it is almost impossible to debug your situation. However, I'll take a guess based on what you've provided.
If you're running on an internal LAN, the problem is likely that you don't have reverse DNS configured for your server. Your server has some made-up name for which only forward-DNS exists. When Tomcat receives a request it tries to look up the hostname based on the IP address, and this can take a long time to time-out.