lidaof / eg-react

WashU Epigenome Browser
https://epigenomegateway.wustl.edu
Other
66 stars 29 forks source link

loading of data from the cloud service where washu is located #333

Open seqyuan opened 10 months ago

seqyuan commented 10 months ago

I am using docker version of washu browser, I created the washu docker server on the cloud server using the following command

docker run -it -p 3000:3000 -v /data:/data epgg/eg-react
cd eg-react/frontend
npm start

My data is stored on the cloud service that built the washu service

My cloud server IP address is 192.168.2.234 By executing the following command on the local computer, I can access the washu browser built on the cloud server through http://127.0.0.1:3000 in the web browser ssh -N -f -L localhost:3000:localhost:3000 -p 22 tad@192.168.2.234

Is there any way to create a hub for the data in /data to reduce the upload, download and transmission of data, so that I can use washu to access the data of the cloud server where it is located as soon as possible?

I have tried the local track method, which requires uploading data from the local computer and is not suitable; I also tried to create a service port for the data in /data on the cloud server, using the following command:

In this way, I can access the data on the cloud server through the local computer browser through 127.0.0.1:8090/data/CTCF.bw, but this "url" cannot be recognized by washu's remote track method.

There may be ways that I haven't discovered in the tutorial. Do you have any good ways to quickly load the washu service on the cloud server and the local data where the service is located?

lidaof commented 9 months ago

Hi @seqyuan sorry for the late reply! You mentioned you can host your data on 127.0.0.1:8089, when you submit http://127.0.0.1:8090/data/CTCF.bw as a remote track, do you see any error message? I bet it's caused by the CORS issue, a quick google give me solution like this:

from http.server import HTTPServer, SimpleHTTPRequestHandler
import sys

class CORSRequestHandler(SimpleHTTPRequestHandler):

    def end_headers(self):
        self.send_header('Access-Control-Allow-Origin', '*')
        self.send_header('Access-Control-Allow-Methods', '*')
        self.send_header('Access-Control-Allow-Headers', '*')
        self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate')
        return super(CORSRequestHandler, self).end_headers()

    def do_OPTIONS(self):
        self.send_response(200)
        self.end_headers()

from: https://askubuntu.com/questions/1405271/how-do-i-enable-cors-for-a-local-python3-http-server

I haven't tried it though, can you test and let me know if it works or not.

Another option is that since in the docker image, the browser code was served with Apache2, you can also put bigwig files in the apache's www folder, also you need to enabe CORS in apache2.