NSLS-II / wishlist

an issue tracker for the big picture
1 stars 0 forks source link

How would you hack on a project like chxtools in a root-priveleged environment #68

Closed ericdill closed 9 years ago

ericdill commented 9 years ago

I will fill out this later. Sitting at CHX with @dchabot @afluerasu and @yugangzhang and don't have time to fully flesh this out

tacaswell commented 9 years ago

This is the issue I ran into getting ready for the SAC demo and ended up installing a user-space version of the stack.

danielballan commented 9 years ago

http://conda.pydata.org/docs/install/central.html

ericdill commented 9 years ago

I am unsure if that link is helpful. I'm looking to understand how I would go about getting functionality similar to python setup.py develop for a package like chxtools in one of our admin controlled environments

klauer commented 9 years ago

Did python setup.py develop --user not work either?

tacaswell commented 9 years ago

Please don't use --user, it breaks the venv isolation.

danielballan commented 9 years ago

I come bearing answers! There are two use cases here.

  1. Include "develop" source installations in a root-controlled env like collection.

    As root:

    # cd /home/xf11id/shared/chxtools
    # conda develop -n collection .
    added /home/xf11id/shared/chxtools
    completed operation for: /home/xf11id/shared/chxtools

    Demonstration that this worked -- here I'm logged in as a normal user, not root:

    $ cd
    $ source activate collection
    discarding /opt/conda/bin from PATH
    prepending /opt/conda_envs/collection/bin to PATH
    (collection)$ python
    Python 3.4.3 |Continuum Analytics, Inc.| (default, Jun  4 2015, 15:29:08) 
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import chxtools
    >>> chxtools.__file__
    '/home/xf11id/shared/chxtools/chxtools/__init__.py'

    The conda develop command is a not-so-mature feature of conda (more on that) but it solves our problem.

  2. As a non-root user, create a custom, user-controlled environment with collection plus custom, possibly develop-installed packages.

    Begin my creating a new enviornment called my-collection and installing the collection metapackage.

    $ conda create -n my-collection collection 
    $ source activate my-collection
    discarding /opt/conda/bin from PATH
    prepending /home/dallan/mc/envs/my-collection/bin to PATH
    (my-collection)$ cd /home/xf11id/shared/chxtools
    (my-collection)$ python setup.py develop
    ... [removed the setup.py output for brevity] ...
    Finished processing dependencies for chxtools==0.0.0

    Demonstration that this worked:

    (my-collection)$ cd
    (my-collection)$ python
    Python 3.4.0 |Continuum Analytics, Inc.| (default, Mar 17 2014, 16:13:14) 
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import chxtools
    >>> chxtools.__file__
    '/home/xf11id/shared/chxtools/chxtools/__init__.py'
ericdill commented 9 years ago

Wow nice find on conda develop! Thanks for figuring this out! I would imagine these can become part of the nsls-ii.github.io docs?

ericdill commented 9 years ago

Seems like conda develop has some issues right now: https://github.com/conda/conda-build/issues/637. Not sure how this impacts us

danielballan commented 9 years ago

Yeah. It failed to work for me today at XPD; I have to use python setup.py install. I think it's just not that stable or maintained yet. We'll have to handle these issues as they come.

On Wed, Oct 14, 2015 at 3:03 PM Eric Dill notifications@github.com wrote:

Seems like conda develop has some issues right now: conda/conda-build#637 https://github.com/conda/conda-build/issues/637. Not sure how this impacts us

— Reply to this email directly or view it on GitHub https://github.com/NSLS-II/wishlist/issues/68#issuecomment-148158739.

msarahan commented 9 years ago

FWIW, "conda develop" is used internally at Continuum, and will be maintained or replaced as necessary to have full functionality. No ETA promise, though. Sorry.

danielballan commented 9 years ago

Thanks for chiming in. That's good to know. I have faith conda will get there when it can. We'll make some PRs if we need it urgently. On Wed, Oct 14, 2015 at 9:21 PM Mike Sarahan notifications@github.com wrote:

FWIW, "conda develop" is used internally at Continuum, and will be maintained or replaced as necessary to have full functionality. No ETA promise, though. Sorry.

— Reply to this email directly or view it on GitHub https://github.com/NSLS-II/wishlist/issues/68#issuecomment-148249112.

danielballan commented 9 years ago

Installing conda build in the root default env solved my issue with conda develop. I edited our deployment bash script to make this standard at all beamlines. For posterity: check nsls-ii.github.io/conda.html for updates on this.