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

Support pip in off-line environments #216

Open
hhorak opened this issue Oct 2, 2017 · 8 comments
Open

Support pip in off-line environments #216

hhorak opened this issue Oct 2, 2017 · 8 comments

Comments

@hhorak
Copy link
Member

hhorak commented Oct 2, 2017

More details in https://bugzilla.redhat.com/show_bug.cgi?id=1446978

I think this may be implemented by making the assemble scripts extensible; a simple approach would be to allow running some arbitrary script from the application sources during the assemble phase, for example we can say that s2i-assemble/*.sh will be sourced during the assemble process..

@GrahamDumpleton
Copy link
Contributor

This is returning back to action hooks of V2. Since there has been little interest in adding back action hooks across S2I builders in the past, for Python at least you can direct people to:

@GrahamDumpleton
Copy link
Contributor

FWIW, you likely could use this now to allow use of pipenv. I will try and get together a sample to show how.

@hhorak
Copy link
Member Author

hhorak commented Oct 24, 2017

I went through the powershift and powershift-image docs, but using those to change the assembly and run scripts seems like quite big overhead to me. IIUIC, that basically forces users to use powershift instead of either oc or web console. Why something like that should be better solution than allowing users to influence the scripts by a file in the application?

@GrahamDumpleton
Copy link
Contributor

Using powershift doesn't make people stop using oc or the web console.

Where the confusion probably arises is that powershift is a thing which has different optional parts under one command so you have one base command rather than many. What parts of that you install or use is up to a user.

The powershift-image part only works inside of a running container and doesn't work outside on your own computer, so it cannot replace oc or the web console.

Anyway, is a moot point. For the original issue which was supporting pip and easy_install in offline environments, you can see proof of concept of minimal changes to allow it at:

This was done as wrapper for now with intention of later creating PR with changes to be added to main S2I builder. All it needs to do is generate the configuration file for easy_install based off pip environment variables. That way you just need to set the environment variables to have pip work in offline mode and easy_install will follow.

The proof of concept was being tested by people who needed it but haven't heard back anything about it.

@hhorak
Copy link
Member Author

hhorak commented Oct 24, 2017

@torsava @mcyprian FYI

@hhorak
Copy link
Member Author

hhorak commented Nov 8, 2017

As this issue mentioned extensibility hooks in assemble script, this might be interesting to read, since there are many thoughts relevant to this issue:
openshift/source-to-image#573
https://github.com/getwarped/action-hooks

@mcyprian mcyprian added the P3 Priority 3 label Apr 24, 2018
@frenzymadness
Copy link
Member

Is this issue still relevant? I think that provided solutions might be easily applicable to any build and with the use of environment variables like PIP_FIND_LINKS and PIP_NO_INDEX it's pretty easy.

@GrahamDumpleton
Copy link
Contributor

It isn't pip which is the main issue but when setup.py and easy_install is used. You cannot control what happens with a setup.py or easy_install install using environment variables. You have to create a ~/.pydistutils.cfg. This is messy to do as need to use a custom assemble script wrapper or use a build input secret defined in the build config and have that added to the container at build time. Both are non obvious. What needs to be done is have ~/.pydistutils.cfg be generated if it doesn't already existed, with it being configured based on the values of the pip environment variables. This can be done from the assemble script and would mean only have to set pip environment variables.

Note that one may also need to look at what requirements there are for having pipenv work in an offline mode as it may required its own special configuration.

So I believe this issue is still relevant and needs to be looked into at some point. It is known some customers are needing to do this and are currently relying on custom assemble scripts which had to be provided to them.

@torsava torsava removed the P3 Priority 3 label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

5 participants