incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trevor McKay (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMBARI-1779) Remove hard references to /usr/lib/pythonX.Y/site-packages from all files (shell scripts, java, poms, python)
Date Thu, 04 Apr 2013 17:07:19 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-1779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13622525#comment-13622525
] 

Trevor McKay commented on AMBARI-1779:
--------------------------------------

A summary of changes by file in ambari_build.patch

ambari-agent/src/main/python/ambari-machine

  Add wrapper for ambari-agent/machine.py and place in /usr/sbin/ to eliminate site-packages
reference.

ambari-agent/src/main/python/ambari-agent.py

  Add wrapper for ambari-agent/main.py and place in /usr/sbin to eliminate site-packages reference.

ambari-agent/conf/unix/ambari-agent

  Removed python version checks, the rpm will check the version.  Stop calling  the main.py
script out of
site-packages and call new wrapper /usr/sbin/ambari-agent.py instead.  Invoke the script directly
instead
of using "python blah".

ambari-server/sbin/ambari-server

  Removed python version checks, the rpm will check the version.  Invoke the /usr/sbin/ambari-server.py
script
directly instead of using "python blah".

ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java

  Change default location of bootstrap.py and setupAgent.py to /usr/lib/exec/ambari-server/

ambari-server/src/main/python/setupAgent.py

  Invoke /usr/sbin/ambari-machine wrapper instead of referencing machine.py out of site-packages.

ambari-server/conf/unix/ambari.properties

  Set "bootstrap.script" and "bootstrap.setup_agent.script" to reference /usr/lib/exec/ambari_server/*
instead of referencing site-packages.

ambari-agent/pom.xml

  Add python.ver (new default), python.exec, and python.requires properties.
Change install.dir to agent.install.dir and make the default dependent on python.ver.
Use python.exec for maven commands, defaulted to python2
Set location of ambari-agent.py and ambari-machine to /usr/sbin.

ambari-server/pom.xml

  Change python.ver to be just the version number (not the requires clause)
Add python.exec and python.requires.
Use python.exec for maven commands, defaulted to python2
Move bootstrap.py and setupAgent.py out of site-packages to /usr/lib/exec/ambari-server/

ambari-web/pom.xml

  Add python.exec property to be consistent and default to python2.
Not sure this even matters, it is an environment variable to npm.... ??

Changes to flags:

-Dpython.ver -- Sets the python version.  This value is used in the 
"requires" clause in generated rpms.  

For ambari-agent, it is also used in construction of the python lib path 
(/usr/lib/python${python.ver} by default. A default was added to 
ambari-agent/pom.xml of 2.7 since other things already touched 2.7.  

In ambari-server/pom.xml it is defaulted to 2.6 but since the
requires clause is >= it doesn't really matter.  That's the only thing
it is currently used for in ambari-server.

So, in general when building from the top level this can be set to
the python version for the agent host.  When building from a subdir
obviously it can be controlled individually.

-Dpython.exec -- Defaults to python2.  This is the command that maven
uses to run python scripts during the build.  Python2 gets rid of the
python2.6/2.7 problem.

-Dpython.requires -- The requires clause for rpms.  Defaults to >= python.ver

-Dagent.install.dir -- This used to be install.dir but I added "agent." to make
it clear when building from the top level.  It is only used in agent.

Default is /usr/lib/python${python.ver}/site-packages/ambari_agent


                
> Remove hard references to /usr/lib/pythonX.Y/site-packages from all files (shell scripts,
java, poms, python)
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AMBARI-1779
>                 URL: https://issues.apache.org/jira/browse/AMBARI-1779
>             Project: Ambari
>          Issue Type: Improvement
>          Components: build
>    Affects Versions: 1.2.0
>         Environment: Fedora 
>            Reporter: Trevor McKay
>         Attachments: ambari_build.patch
>
>
> Hard references to /usr/lib/pythonX.Y/site-packages should be eliminated from the build
process and java/runtime scripts for portability.
> Any python modules in site-packages should be importable (ie, a proper package) and will
be found on the standard python path.  Therefore, any code that needs to be run from those
modules can be run with python wrapper scripts located in /usr/bin or /usr/sbin (for example)
without an explicit path reference.
> Python code in site-packages that is not importable should be made so and run from a
wrapper, or it should be relocated (to /usr/lib/exec/ambari, for example)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message