OpenSenseAction / OPENSENSE_sandbox

Collection of runable examples with software packages for processing opportunistic rainfall sensors
BSD 3-Clause "New" or "Revised" License
13 stars 16 forks source link

Integrate all SubModules via Start script #33

Closed georges-schutz closed 2 years ago

georges-schutz commented 2 years ago

This is linked to the issue https://github.com/OpenSenseAction/OPENSENSE_sandbox/issues/30

github-actions[bot] commented 2 years ago

Binder :point_left: Launch a binder notebook on branch _georges-schutz/OPENSENSE_sandbox_outsourceenvironment/main

cchwala commented 2 years ago

@georges-schutz Can you check the current state of this PR. I do not see any changed files, but I would like to continue with it in the afternoon.

georges-schutz commented 2 years ago

@georges-schutz Can you check the current state of this PR. I do not see any changed files, but I would like to continue with it in the afternoon.

The current script is submitted but not yet putting all the path to the environemnt Also the git submodule update --init is not yet done

cchwala commented 2 years ago

This is the correct URL to start the binder for this PR https://mybinder.org/v2/gh/OpenSenseAction/OPENSENSE_sandbox_environment/main?urlpath=git-pull%3Frepo%3Dhttps%253A%252F%252Fgithub.com%252Fgeorges-schutz%252FOPENSENSE_sandbox_outsource_environment%26urlpath%3Dlab%252Ftree%252FOPENSENSE_sandbox_outsource_environment%252Fnotebooks%252Findex.ipynb%26branch%3Dmain

cchwala commented 2 years ago

It does not work with sys.path.append because this is only done temporarily.

We will need to do conda develop <directory> for which the package conda-build has to be installed (see https://stackoverflow.com/a/32748920/356463)

cchwala commented 2 years ago

The start script will be run from the env repo. I made a PR there.

Now trying to add the start script to the env repo

this URL should be the correct one to get a binder based on the env repo from my PR in the env repo https://mybinder.org/v2/gh/cchwala/OPENSENSE_sandbox_environment/test_start_script?urlpath=git-pull%3Frepo%3Dhttps%253A%252F%252Fgithub.com%252Fgeorges-schutz%252FOPENSENSE_sandbox_outsource_environment%26urlpath%3Dlab%252Ftree%252FOPENSENSE_sandbox_outsource_environment%252Fnotebooks%252Findex.ipynb%26branch%3Dmain

georges-schutz commented 2 years ago

We may need to add to the postBuild (OPENSENSE_sandbox_environment) an element that recursively search's and runs start scripts in order to keep the start script in the content repository. I am just not sure at what moment the postBuild is running may be we need to put such a recursive start script in the OPENSENSE_sandbox_environment repository.

cchwala commented 2 years ago

The problem is that the nbgitpuller is probably pulling the content repo after everything is built. I am doing some testing right now. I will give an update within the next 30 minutes.

cchwala commented 2 years ago

My current start script is trying to change to the content repo dir to init the submodules. But this fails, because the dir does not exist when the start script is run. That means that nbgitpuller is run after the start script.

Hence, we cannot run things in an automated way like this.

We could do a git clone of the content repo in the start script and not use nbgitpuller at all. But then we loose the flexibility to get different branches or forks as content in the binder.

What I will do now, is to add some sort if "init script" that manually has to be run in the first cell of the index notebook. That will allow us to have a working version for everybody via binder without running custom commands to set things up (submodule init, R installation, python paths).

cchwala commented 2 years ago

Using the "init script" can work, but I have some issues with conda. If I run this script in the index.ipynb with !bash init.sh it will run the command in a new bash which is in the default conda env and not the one that the notebook is running in...

Working on a fix...

cchwala commented 2 years ago

Closing this, in the hope that #38 will provide a solution without investing more hours...

@georges-schutz Thanks for the effort you have put into splitting the repos and make things work.

We will have to revisit the problem with the initialization at some time...