Binderhub: Feature request: install an utility and have it ready to use after building

Created on 10 May 2018  路  13Comments  路  Source: jupyterhub/binderhub

Hi,
I would like to use an utility like this one https://github.com/ericchiang/pup.

I install it without any problem using go get github.com/ericchiang/pup in postBuild.

But, it's not ready to use, I must open a notebook and run:

! chmod +x /home/jovyan/go/bin/pup
! export PATH="/home/jovyan/go/bin:$PATH"

Thank you

All 13 comments

this relates to https://github.com/jupyter/repo2docker/issues/196 as well - I think once that issue is tackled, we could more easily support this as a hacky solution

Maybe we should simply add /home/jovyan/{local}/bin to the path. That would support the immediate need for having executables that users bring along at a later stage.

not a bad idea...

@minrk what do you think about @betatim 's suggestion as a stop-gap?

@betatim good idea. But probably it's also necessary to give the user the permission to set chmod +x to installed utilities in /home/jovyan/{local}/bin, in postBuild file

postBuild runs as the user that owns /home/jovyan so you can change permissions on files there.

Ok, great @betatim and sorry for my error.

Than your idea is fully a great idea, thank you.
With /home/jovyan/{local}/bin in the path, the problem is solved. It would be a small great new feature

Is this just a matter of adding something like

# So users can move executables here with postBuild
ENV PATH {{ /home/jovyan/{local}/bin:${PATH}}}

to here: https://github.com/jupyter/repo2docker/blob/master/repo2docker/buildpacks/base.py#L73

?

@aborruso you want to give this a go and create PR?

@betatim wow, done https://github.com/jupyter/repo2docker/pull/311

And thank you @choldgraf

@betatim @choldgraf another related question.

If I add in the postBuild something like

npm install mapshaper --prefix /home/jovyan/bin

the path of the installed utility wiI be /home/jovyan/bin/node_modules/mapshaper.

If I install a go utility, in example using go get github.com/ericchiang/pup, the path of the utilty will be /home/jovyan/go/bin/pup.

A solution could be - having /home/jovyan/local/bin in the PATH - to add these rows in postBuild?

cd /home/jovyan/locale/bin
ln -s /home/jovyan/locale/bin/node_modules/mapshaper/bin/mapshaper mapshaper
ln -s /home/jovyan/go/bin/pup pup

Thank you

@betatim than is it just enabled in mybinder?

Thank you for all

No, it hasn't been deployed yet. I will try and get to it today.

Was this page helpful?
0 / 5 - 0 ratings