robotframework-browser icon indicating copy to clipboard operation
robotframework-browser copied to clipboard

"rfbrowser init": offline mode

Open simonmeggle opened this issue 5 years ago • 3 comments

The problem was already mentioned in #188 but closed with the comment that if there is a real need for a complete offline installation users should open new issues. Doing this now :-)

Python modules can be easily installed with pip install --no-index --find-links C:\Admin\pip-local -r requirements.txt so that there is no internet connection needed at all. Copying the module dir to the machine is possible only if the module installation does not include the compilation of platform dependent binaries. Depending on where and what you are testing, there is no guarantee that there is always a way to get the dependencies from internet (and fiddling with proxies can be a torture...)

It would be great if rfbrowser init could also use a local filesystem mirror of all node dependencies.

simonmeggle avatar Nov 09 '20 12:11 simonmeggle

Can rfbrowser init be called from pip? Ideally it would need just one (additional) line in requirements.txt.

stonux avatar Apr 25 '22 07:04 stonux

Can rfbrowser init be called from pip? Ideally it would need just one (additional) line in requirements.txt.

Does not make sense because this command starts the installation of nodejs modules and browser binary download.

simonmeggle avatar Apr 25 '22 07:04 simonmeggle

The only solution so far imho is to use RCC.

It can install python modules and call rfbrowser init afterwards. The hololib mechanism allows to provide a ZIP file which contains alls needed sources. I did some prototypes and it worked indeed completely offline. But this kind of setup needs a well thought out concept. The initial creation of RCC environments needs some time, the zip file creation needs a workflow and its distribution (can have hundrets of MB) can be tricky.

simonmeggle avatar Apr 25 '22 07:04 simonmeggle

Offline mode is hard in our library level, because we we relay on lot of external packages. And we clearly exceed the maximum size of PyPi package (50Mb). The current solution for offline from our side, is the Docker container, but I agree that docker is not way for everyone.

I think offline mode needs be done by users, example by containers or something similar tooling.

But because we are not going to implement this one, in foreseen future, I am going to close this issue.

aaltat avatar Nov 12 '23 20:11 aaltat

Hi, actually there is one usecase for offline mode -> running testcases on isolated environment (without access to the Internet), e.g. in customer premises. Containers are not an option. Could you guide how to perform offline installation?

pikopl avatar Jan 25 '24 11:01 pikopl

From my POV, besides containers, I do not see any way for an air gapped installation than doing it with RCC. It allows to import environments via hololib.zip file. But requires a machine of the same architecture with internet access somewhere else where the environment can be built on.

simonmeggle avatar Jan 25 '24 12:01 simonmeggle

We do believe that there are use cases for offline learning installer. But making one is not easy for several technical reasons, like starting from building installer for each different platform and hosting those files somewhere. Therefore we have decided that we are not doing work on this issue. That being said, if someone is willing to contribute for the project and finds solution for covering the hosting costs, we are willing to consider.

aaltat avatar Jan 26 '24 11:01 aaltat

Hi all! I'm also struggling with BrowserLibrary offline installation. Preferably, I would like to manually download all the required dependencies and install it later on the machine without connection to the Internet. Thus, I have a question: What exactly rfbrowser init command really do? My understanding is that:

  1. it downloads npm packages (these can be manually downloaded by me and installed while at offline mode later)
  2. it downloads the browsers (it should be not a problem to fetch portable chromium browser and setup it for BrowserLibrary to use)

Are there any steps that I left? Thanks in advance :)

migdzio avatar Jan 30 '24 16:01 migdzio

Nothing complicated, we offload the installation npm side: https://github.com/MarketSquare/robotframework-browser/blob/main/Browser/entry.py#L144

aaltat avatar Jan 30 '24 16:01 aaltat

Ah, did forget, we also call this https://github.com/MarketSquare/robotframework-browser/blob/main/Browser/entry.py#L171

Which does install the browser binaries, but again offload to Playwright side.

aaltat avatar Jan 30 '24 16:01 aaltat