Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aborruso opened this issue May 10, 2018 · 13 comments
Closed

Comments

@aborruso
Copy link

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

@choldgraf
Copy link
Member

this relates to jupyterhub/repo2docker#196 as well - I think once that issue is tackled, we could more easily support this as a hacky solution

@betatim
Copy link
Member

betatim commented May 10, 2018

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.

@choldgraf
Copy link
Member

not a bad idea...

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

@aborruso
Copy link
Author

aborruso commented May 11, 2018

@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

@betatim
Copy link
Member

betatim commented May 11, 2018

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

@aborruso
Copy link
Author

aborruso commented May 11, 2018

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

@choldgraf
Copy link
Member

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

?

@betatim
Copy link
Member

betatim commented May 11, 2018

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

@aborruso
Copy link
Author

@betatim wow, done jupyterhub/repo2docker#311

And thank you @choldgraf

@aborruso
Copy link
Author

aborruso commented May 12, 2018

@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
Copy link
Member

betatim commented May 16, 2018

Fixed in jupyterhub/repo2docker#311

@betatim betatim closed this as completed May 16, 2018
@aborruso
Copy link
Author

@betatim than is it just enabled in mybinder?

Thank you for all

@betatim
Copy link
Member

betatim commented May 16, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants