Ribbon icon indicating copy to clipboard operation
Ribbon copied to clipboard

Running Ribbon without internet access

Open psammarco opened this issue 2 years ago • 5 comments

Hello,

I am trying to get Ribbon to work on Ubuntu 18.04.0 with sandboxed user account and no access to the internet.

The Ribbon webpage loads up fine, however nothing really happens when loading a pair of bam + bai files. Looking at the Firefox developer console we can see the Uncaught TypeError: _CLI is null error popping up upon selecting the two files. Firefox version is 101.0.1 64bit.

The two files are located in a shared folder the user has R access to it.

I would really appreciate your help to figure this out and hopefully get it resolved. See the screenshot of the error below this message. screenshot-1

Regards

psammarco avatar Jul 29 '22 13:07 psammarco

Can you try checking out the branch offline-mode and launching an http server on port 1234:

git clone https://github.com/marianattestad/ribbon
cd ribbon
git fetch --all
git checkout offline-mode
python3 -m http.server 1234

Then you can open http://localhost:1234/ and that error should disappear.

robertaboukhalil avatar Jul 29 '22 14:07 robertaboukhalil

Hello, @robertaboukhalil,

I have tried what you suggested but it makes no difference.

After running python3 -m http.server 1234 I opened firefox http://localhost:1234/ then loaded the ribbon index page in a different tab.

I have also tried firefox http://localhost:1234/path/to/ribbon/index.html but I get a 404 error. I doubt what I have been doing has got much sense to be honest. Do I have to setup some sort of webserver to serve the ribbon folder?

Could you please help me figure out what I am doing wrong?

Thank you for your help. Much appreciated.

Regards

psammarco avatar Aug 04 '22 10:08 psammarco

@psammarco a few things to try:

  • Did you switch to the offline-mode branch on the Ribbon repo before launching the server? You'll need to do git fetch --all first to make sure git knows about the branch
  • You should launch the server from the Ribbon folder so that going to localhost:1234 will open the Ribbon app
  • In the browser, open Dev Tools --> Network tab --> filter by "wasm". Click on one of these and it should show Request URL: http://localhost:1234/wasm/base/base.wasm -- please share a screenshot of what you see if not

Screen Shot 2022-08-06 at 10 22 29 AM

Normally, you don't need a webserver to serve the ribbon folder because the .wasm assets are loaded from the biowasm CDN. But since you want to run Ribbon without internet access, you need a web server to serve .wasm assets (wouldn't work from a file:/// URL)

robertaboukhalil avatar Aug 06 '22 17:08 robertaboukhalil

Hello @robertaboukhalil ,

thanks for the patience and help. I have now managed to get the offline mode started, however the problem is still persisting. image

Here is the screenshot you have asked me image

Thanks

psammarco avatar Aug 11 '22 13:08 psammarco

That's strange, from your screenshot, the file aioli.worker.js is downloaded from cdn.biowasm.com instead of the local server, as it's behaving on my end.

Can you try clearing your cache and trying again? Also, if you go to http://localhost:1234/js/vis.js and do a hard refresh, do you see this chunk of code:

	// Create Aioli (and the WebWorker in which WASM code will run)
	_CLI = await new Aioli({
		tool: "samtools",
		version: "1.10",
		urlPrefix: `${window.location.origin}/wasm/samtools`,
	}, {
		urlAioli: `${window.location.origin}/wasm/aioli.worker.js`,
		urlBaseModule: `${window.location.origin}/wasm/base`,
	});

robertaboukhalil avatar Aug 12 '22 00:08 robertaboukhalil

Hello @robertaboukhalil ,

based on the http server response I am not sure the page was found, and looking at the output from the query I don't see the block mentioned. Output is attached. Though is insanely long :| .

Thanks. image

vjs.js.txt

psammarco avatar Aug 18 '22 11:08 psammarco

I can see at the very bottom of vis.js:

// Create Aioli (and the WebWorker in which WASM code will run)
_CLI = await new Aioli("samtools/1.10");

which means it's not using the correct branch.

Can you make sure you checked out the offline-mode branch as described in https://github.com/MariaNattestad/Ribbon/issues/50#issuecomment-1199455428?

Running git status should show that you are on the branch offline-mode, not main

robertaboukhalil avatar Aug 18 '22 16:08 robertaboukhalil

Hello @robertaboukhalil ,

I am pretty sure I have switched to offline-mode branch. But for some reason the system is not picking it up.

zpietro.sammarco@hpc-prod-grid-login-001:/tools/apps/ribbon$ git status
On branch offline-mode
Your branch is up-to-date with 'origin/offline-mode'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   README.md
	modified:   js/vis.js
	deleted:    wasm/aioli.worker.js
	deleted:    wasm/base/base.js
	deleted:    wasm/base/base.wasm
	deleted:    wasm/base/config.json
	deleted:    wasm/samtools/config.json
	deleted:    wasm/samtools/samtools.data
	deleted:    wasm/samtools/samtools.js
	deleted:    wasm/samtools/samtools.wasm

no changes added to commit (use "git add" and/or "git commit -a")
zpietro.sammarco@hpc-prod-grid-login-001:/tools/apps/ribbon$

psammarco avatar Aug 23 '22 12:08 psammarco

Hmm, it looks like you're on the offline branch but with the code from main. Running git status should just show On branch offline-mode without any of the lines that say modified or deleted.

Can you try git stash then git pull origin offline-mode and see if that makes git status look different.

Alternatively, you can download the offline mode branch code as a zip file and try again in a new folder: https://github.com/MariaNattestad/Ribbon/archive/refs/heads/offline-mode.zip

robertaboukhalil avatar Aug 23 '22 15:08 robertaboukhalil

Hey @robertaboukhalil ,

I downloaded the offline-mode branch directly and its now working. Thanks a lot for your help :)

Regards

psammarco avatar Aug 24 '22 09:08 psammarco

I'm sorry to comment on this old fixed issue, but I had the exact same problem, and it was solved by following the procedure here. It's quite hard to find it, as it's only documented in a closed issue. Would you accept a pull request to add this procedure to the README file?

fa2k avatar May 30 '23 17:05 fa2k

What is the use case?

On Tue, May 30, 2023 at 10:59 AM Marius Bjørnstad @.***> wrote:

I'm sorry to comment on this old fixed issue, but I had the exact same problem, and it was solved by following the procedure here. It's quite hard to find it, as it's only documented in a closed issue. Would you accept a pull request to add this procedure to the README file?

— Reply to this email directly, view it on GitHub https://github.com/MariaNattestad/Ribbon/issues/50#issuecomment-1568847293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4W4PLP3KH7VNGO3D4YKY3XIYYOLANCNFSM55AZLLGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MariaNattestad avatar May 31 '23 02:05 MariaNattestad

What is the use case?

I work with patient data, and due to confidentiality and IT security requirements, the sequence data are currently held in an "air-gapped" infrastructure - no connection to other systems. We are trying to get it integrated with the wider hospital IT system. Even when it becomes possible in the future, it may take a lot of process to open the firewall for biowasm.com.

We are trying to do genomic diagnosis of rare diseases. Genome ribbon is really useful in at least two situations related to structural variants, when callers don't call the right variant and IGV isn't very intuitive:

  • Visualising how a single long nanopore read with an SV aligns to the reference genome
  • Show how a genome assembly from PacBio aligns to the reference genome (in fact, I learned about Ribbon from PacBio)

fa2k avatar May 31 '23 19:05 fa2k

@fa2k Wow, I'm happy to hear you are finding Ribbon useful for doing such important work! This makes a lot of sense now. @robertaboukhalil and I discussed, and we can make the process a little faster too, so we'll do that and document it in the README. Thanks for bringing this use case to our attention!

MariaNattestad avatar May 31 '23 21:05 MariaNattestad

@fa2k okay done, #56 uses static assets instead of the biowasm.com CDN, which means that now deployment without access to the internet is easy on the main branch, and we've documented this in the README as well. Thanks again!

MariaNattestad avatar Jun 01 '23 03:06 MariaNattestad

Thanks a lot for this @MariaNattestad , fantastic!

fa2k avatar Jun 01 '23 07:06 fa2k