Giter VIP home page Giter VIP logo

Comments (5)

bparees avatar bparees commented on July 21, 2024

Probably caused by the entrypoint override changes. Previously we would
have been running the base image entrypoint script (which probably
specifies bash) with the assemble script as the arg. Now we're not. So
you're going to have to use bash, or enable it yourself. The tricks we use
to enable it don't work with sh (even when sh is a symlink to bash, the
behavior changes)

https://github.com/openshift/s2i-base/blob/master/bin/container-entrypoint

Ben Parees | OpenShift

On Aug 11, 2016 00:44, "Graham Dumpleton" [email protected] wrote:

Am trying the latest all-in-one VM we have based on 1.1.3 alpha 3 and
there is a change in behaviour around builds. Don't know if this is because
a change in s2i used, the S2I builder image I am using as base, or even
some CentOS package.

I am using sourceStrategy.scripts to override default S2I scripts and
pull in versions from a HTTP server.

Previously when the assemble script pulled in this way was using /bin/sh
in #! line, then the scl_enable would be triggered by virtue of the ENV,
BASH_ENV or PROMPT_COMMAND hack. This is no longer occurring so the SCL
bin directory for Python is not in the path.

I can see that not right by adding env to start of assemble script. When
#! uses /bin/sh I see:

HOSTNAME=wagtail-4-build
OPENSHIFT_BUILD_NAME=wagtail-4
OPENSHIFT_BUILD_SOURCE=https://github.com/GrahamDumpleton/openshift3-wagtail.git
ENV=/opt/app-root/etc/scl_enable
PYTHON_VERSION=2.7
PATH=/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
OPENSHIFT_BUILD_NAMESPACE=snakes
STI_SCRIPTS_URL=image:///usr/libexec/s2i
PWD=/opt/app-root/src
STI_SCRIPTS_PATH=/usr/libexec/s2i
OPENSHIFT_BUILD_REFERENCE=master
HOME=/opt/app-root/src
SHLVL=2
WARPDRIVE_DEBUG=true
BASH_ENV=/opt/app-root/etc/scl_enable https://github.com/GrahamDumpleton/openshift3-wagtail.gitENV=/opt/app-root/etc/scl_enablePYTHON_VERSION=2.7PATH=/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binOPENSHIFT_BUILD_NAMESPACE=snakesSTI_SCRIPTS_URL=image:///usr/libexec/s2iPWD=/opt/app-root/srcSTI_SCRIPTS_PATH=/usr/libexec/s2iOPENSHIFT_BUILD_REFERENCE=masterHOME=/opt/app-root/srcSHLVL=2WARPDRIVE_DEBUG=trueBASH_ENV=/opt/app-root/etc/scl_enable
PROMPT_COMMAND=. /opt/app-root/etc/scl_enable
_=/usr/bin/env

Note how ENV, BASH_ENV and PROMPT_COMMAND are still set and PATH doesn't
include SCL bin directory for Python, nor the LD_LIBRARY_PATH change.

If I modify the assemble script so that uses /bin/bash, then it all works
again and env at start of script shows:

MANPATH=/opt/rh/python27/root/usr/share/man:
HOSTNAME=wagtail-5-build
OPENSHIFT_BUILD_NAME=wagtail-5
X_SCLS=python27
OPENSHIFT_BUILD_SOURCE=https://github.com/GrahamDumpleton/openshift3-wagtail.git
LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64
PYTHON_VERSION=2.7
PATH=/opt/rh/python27/root/usr/bin:/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
OPENSHIFT_BUILD_NAMESPACE=snakes
STI_SCRIPTS_URL=image:///usr/libexec/s2i
PWD=/opt/app-root/src
STI_SCRIPTS_PATH=/usr/libexec/s2i
OPENSHIFT_BUILD_REFERENCE=master
HOME=/opt/app-root/src
SHLVL=2
WARPDRIVE_DEBUG=true
XDG_DATA_DIRS=/opt/rh/python27/root/usr/share:/usr/local/share:/usr/share
PKG_CONFIG_PATH=/opt/rh/python27/root/usr/lib64/pkgconfig
_=/usr/bin/env https://github.com/GrahamDumpleton/openshift3-wagtail.gitLD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64PYTHON_VERSION=2.7PATH=/opt/rh/python27/root/usr/bin:/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binOPENSHIFT_BUILD_NAMESPACE=snakesSTI_SCRIPTS_URL=image:///usr/libexec/s2iPWD=/opt/app-root/srcSTI_SCRIPTS_PATH=/usr/libexec/s2iOPENSHIFT_BUILD_REFERENCE=masterHOME=/opt/app-root/srcSHLVL=2WARPDRIVE_DEBUG=trueXDG_DATA_DIRS=/opt/rh/python27/root/usr/share:/usr/local/share:/usr/sharePKG_CONFIG_PATH=/opt/rh/python27/root/usr/lib64/pkgconfig_=/usr/bin/env

So the environment variables to trigger scl_enable have been removed as
expected, plus the PATH and LD_LIBRARY_PATH changes.

What would have changed such that the ENV, BASH_ENV and PROMPT_COMMAND
hack would no longer work when assemble uses /bin/sh rather than /bin/bash
?

If this doesn't work for assemble, this may mean that the hack for
triggering scl_enable may not work either for case where using oc rsh or oc
exec with a program implemented as a /bin/sh script. I haven't test this
case but needs to be checked as well as work out why assemble now can
only use /bin/bash.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#139, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AEvl3vzKEpo2QuoNrOyi9B9FeFD6l3lFks5qeqicgaJpZM4Jhywh
.

from s2i-python-container.

bparees avatar bparees commented on July 21, 2024

Oc rsh should be fine because it starts an interactive shell. Oc exec may
or may not be, but that hasn't changed.

Ben Parees | OpenShift

On Aug 11, 2016 00:58, "Ben Parees" [email protected] wrote:

Probably caused by the entrypoint override changes. Previously we would
have been running the base image entrypoint script (which probably
specifies bash) with the assemble script as the arg. Now we're not. So
you're going to have to use bash, or enable it yourself. The tricks we use
to enable it don't work with sh (even when sh is a symlink to bash, the
behavior changes)

https://github.com/openshift/s2i-base/blob/master/bin/container-entrypoint

Ben Parees | OpenShift

On Aug 11, 2016 00:44, "Graham Dumpleton" [email protected]
wrote:

Am trying the latest all-in-one VM we have based on 1.1.3 alpha 3 and
there is a change in behaviour around builds. Don't know if this is because
a change in s2i used, the S2I builder image I am using as base, or even
some CentOS package.

I am using sourceStrategy.scripts to override default S2I scripts and
pull in versions from a HTTP server.

Previously when the assemble script pulled in this way was using /bin/sh
in #! line, then the scl_enable would be triggered by virtue of the ENV,
BASH_ENV or PROMPT_COMMAND hack. This is no longer occurring so the SCL
bin directory for Python is not in the path.

I can see that not right by adding env to start of assemble script. When
#! uses /bin/sh I see:

HOSTNAME=wagtail-4-build
OPENSHIFT_BUILD_NAME=wagtail-4
OPENSHIFT_BUILD_SOURCE=https://github.com/GrahamDumpleton/openshift3-wagtail.git
ENV=/opt/app-root/etc/scl_enable
PYTHON_VERSION=2.7
PATH=/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
OPENSHIFT_BUILD_NAMESPACE=snakes
STI_SCRIPTS_URL=image:///usr/libexec/s2i
PWD=/opt/app-root/src
STI_SCRIPTS_PATH=/usr/libexec/s2i
OPENSHIFT_BUILD_REFERENCE=master
HOME=/opt/app-root/src
SHLVL=2
WARPDRIVE_DEBUG=true
BASH_ENV=/opt/app-root/etc/scl_enable https://github.com/GrahamDumpleton/openshift3-wagtail.gitENV=/opt/app-root/etc/scl_enablePYTHON_VERSION=2.7PATH=/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binOPENSHIFT_BUILD_NAMESPACE=snakesSTI_SCRIPTS_URL=image:///usr/libexec/s2iPWD=/opt/app-root/srcSTI_SCRIPTS_PATH=/usr/libexec/s2iOPENSHIFT_BUILD_REFERENCE=masterHOME=/opt/app-root/srcSHLVL=2WARPDRIVE_DEBUG=trueBASH_ENV=/opt/app-root/etc/scl_enable
PROMPT_COMMAND=. /opt/app-root/etc/scl_enable
_=/usr/bin/env

Note how ENV, BASH_ENV and PROMPT_COMMAND are still set and PATH doesn't
include SCL bin directory for Python, nor the LD_LIBRARY_PATH change.

If I modify the assemble script so that uses /bin/bash, then it all
works again and env at start of script shows:

MANPATH=/opt/rh/python27/root/usr/share/man:
HOSTNAME=wagtail-5-build
OPENSHIFT_BUILD_NAME=wagtail-5
X_SCLS=python27
OPENSHIFT_BUILD_SOURCE=https://github.com/GrahamDumpleton/openshift3-wagtail.git
LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64
PYTHON_VERSION=2.7
PATH=/opt/rh/python27/root/usr/bin:/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
OPENSHIFT_BUILD_NAMESPACE=snakes
STI_SCRIPTS_URL=image:///usr/libexec/s2i
PWD=/opt/app-root/src
STI_SCRIPTS_PATH=/usr/libexec/s2i
OPENSHIFT_BUILD_REFERENCE=master
HOME=/opt/app-root/src
SHLVL=2
WARPDRIVE_DEBUG=true
XDG_DATA_DIRS=/opt/rh/python27/root/usr/share:/usr/local/share:/usr/share
PKG_CONFIG_PATH=/opt/rh/python27/root/usr/lib64/pkgconfig
_=/usr/bin/env https://github.com/GrahamDumpleton/openshift3-wagtail.gitLD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64PYTHON_VERSION=2.7PATH=/opt/rh/python27/root/usr/bin:/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binOPENSHIFT_BUILD_NAMESPACE=snakesSTI_SCRIPTS_URL=image:///usr/libexec/s2iPWD=/opt/app-root/srcSTI_SCRIPTS_PATH=/usr/libexec/s2iOPENSHIFT_BUILD_REFERENCE=masterHOME=/opt/app-root/srcSHLVL=2WARPDRIVE_DEBUG=trueXDG_DATA_DIRS=/opt/rh/python27/root/usr/share:/usr/local/share:/usr/sharePKG_CONFIG_PATH=/opt/rh/python27/root/usr/lib64/pkgconfig_=/usr/bin/env

So the environment variables to trigger scl_enable have been removed as
expected, plus the PATH and LD_LIBRARY_PATH changes.

What would have changed such that the ENV, BASH_ENV and PROMPT_COMMAND
hack would no longer work when assemble uses /bin/sh rather than
/bin/bash?

If this doesn't work for assemble, this may mean that the hack for
triggering scl_enable may not work either for case where using oc rsh or oc
exec with a program implemented as a /bin/sh script. I haven't test this
case but needs to be checked as well as work out why assemble now can
only use /bin/bash.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#139, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AEvl3vzKEpo2QuoNrOyi9B9FeFD6l3lFks5qeqicgaJpZM4Jhywh
.

from s2i-python-container.

GrahamDumpleton avatar GrahamDumpleton commented on July 21, 2024

In this case I am using the openshift/python images. I am not using my own images defining an Entrypoint. I thought the changes would only kick in if Entrypoint was actually used, or is it because of some implicit Entrypoint that is always returned for Docker images, that the change is always kicking in?

from s2i-python-container.

bparees avatar bparees commented on July 21, 2024

if by openshift/python you mean openshift/python-33-centos7 or centos/python-34-centos7, etc, then thsoe images all define an entrypoint they inherit from the base image:
https://github.com/openshift/s2i-base/blob/master/Dockerfile#L80

which is the entrypoint script i was talking about that runs bash. (and is no longer being invoked thanks to the changes to override the entrypoint when invoking assemble).

from s2i-python-container.

GrahamDumpleton avatar GrahamDumpleton commented on July 21, 2024

Closing this on basis that is a requirement that custom assemble and run scripts best use bash.

from s2i-python-container.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.