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

S2i build image with private pip repository #330

Closed
vincentarthur opened this issue Dec 5, 2018 · 5 comments
Closed

S2i build image with private pip repository #330

vincentarthur opened this issue Dec 5, 2018 · 5 comments

Comments

@vincentarthur
Copy link

vincentarthur commented Dec 5, 2018

Currently for using S2i to build image for Seldon, it's going through Internet. However, in some cases, the network is only for intranet only which unable to reach Internet. So a new requirement would be -
S2i build image stage should be able to configure whether to use Local private repository for installing python libraries. (Both conda url and folders for .whl)

@vincentarthur
Copy link
Author

@jklaise ,Thanks in advance.

@jklaise
Copy link
Member

jklaise commented Dec 5, 2018

@vincentarthur I've created a pull request #332 which enables you to use local Python wheels to install your runtime dependencies. This solution requires to put the wheels into a "whl" directory where your component source code lives. I understand this is not ideal as you probably want to reuse the same wheels for several components, we have an open issue for this (#324) but presently it seems non-trivial to extend the wrapping process to look for dependencies outside the local directory.

You can test this by using the modified assemble script as a parameter at build time as described here: (https://github.com/openshift/source-to-image/blob/master/docs/user_guide.md)

@vincentarthur
Copy link
Author

@jklaise Thanks for the PR. How about this ?

  • s2i build . -v /whl/dir:/whl image-name
  • (inside assemble) pip install --find-links /whl -r requirements.txt

@jklaise
Copy link
Member

jklaise commented Dec 6, 2018

@vincentarthur thanks, that looks a lot cleaner. For some reason I couldn't make it work with the -v flag but it does work with the -i (inject directories) flag, so the syntax would be s2i build -i /whl/dir:/whl . builder_image target_image, I think using the -i is preferable to -v as well as it doesn't leave the binaries hanging around after the build process finishes.

@jklaise
Copy link
Member

jklaise commented Dec 19, 2018

@vincentarthur you can now use the 0.5-SNAPSHOT s2i builder image to achieve the desired functionality, full syntax available here. Closed by #332.

@jklaise jklaise closed this as completed Dec 19, 2018
agrski pushed a commit that referenced this issue Dec 2, 2022
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

2 participants