Skip to content

Instantly share code, notes, and snippets.

@mjuric
Created June 29, 2015 23:04

Revisions

  1. mjuric created this gist Jun 29, 2015.
    98 changes: 98 additions & 0 deletions eups-magics-and-conda-demo.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,98 @@
    ##########################################
    # Cleanup of the environment for the demo
    rm -f ~/.eups/default
    rm -rf ~/demo
    rm -rf ~/miniconda

    #####################################################
    # Demo of miniconda
    #

    # Get conda from:
    # http://conda.pydata.org/miniconda.html
    cd $HOME
    mkdir demo && cd demo
    wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh
    bash Miniconda-latest-MacOSX-x86_64.sh -b

    # Put it on your path
    export PATH="$HOME/miniconda/bin:$PATH"
    alias conda="time conda"
    conda list

    # Install numpy
    conda install numpy

    # Install sqlalchemy
    conda install sqlalchemy

    # Install IPython
    conda install ipython-notebook

    #####################################
    # Demo of ipython_eups

    # get MAF
    cd $HOME/demo
    git clone [email protected]:mjuric/sims_maf_notebooks.git
    cd sims_maf_notebooks/notebooks
    ln -s ~/projects/sims_maf_notebooks/notebooks/enigma_1189_sqlite.db
    ls -l
    ipython notebook AstrometryMetrics.ipynb

    # show the git repo, discuss README.md
    # website: https://github.com/mjuric/ipython_eups

    # Install ipython_eups
    cd $HOME/demo
    wget http://eupsforge.net/ipython-eups
    chmod +x ipython-eups
    alias ipython="$PWD/ipython-eups"

    # run the notebook
    wget https://raw.githubusercontent.com/mjuric/ipython_eups/master/doc/eups-magics-overview.ipynb
    ipython notebook eups-magics-overview.ipynb

    # I have EUPS installed in /Users/mjuric/projects/eups

    # I have the directives prepared in eups_magics
    cd sims_maf_notebooks/notebooks
    git checkout eups_magics
    ls -l
    ipython notebook AstrometryMetrics.ipynb

    # If you want to know more:
    # https://github.com/mjuric/ipython_eups

    ########################################################
    # Demo of conda-distributed LSST stack (binary installs)

    # Conda package manager: http://conda.pydata.org/docs/

    # Add mjuric's binary channel http://anaconda.org
    cd $HOME/demo
    conda config --add channels http://conda.anaconda.org/mjuric

    # Install MAF (binary distrib!)
    conda install sims_maf

    # cheat a bit to speed things up
    # rm -rf ~/miniconda
    # mv ~/miniconda.with_stack ~/miniconda
    # conda list

    # setup EUPS
    eups # it's not there (this will result in an error)
    source eups-setups.sh # now it will be source into the environment
    eups list

    # run the MAF notebook again
    cd sims_maf_notebooks/notebooks
    git checkout master

    setup sims_maf
    ipython notebook AstrometryMetrics.ipynb

    # if you want to know more:
    # https://github.com/mjuric/incubator/tree/master/conda-recipes
    # WARNING: This is a hack, needs cleaning up.