Giter VIP home page Giter VIP logo

jaspy-old's Introduction

jaspy-old's People

Contributors

agstephens avatar asharwood avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

jaspy-old's Issues

Need a one-liner install

User should not need to run:

  1. install-miniconda.sh
  2. install-jaspy-env.sh

The running of (2) should automatically include (1) if not already up-to-date.

Quick sprint

  1. Add $SCRIPTDIR to all scripts and get python to work with this. - DONE

  2. Create script: create-blank-env.sh - DONE

  • use template
  1. Script: add-envs-repo.sh - DONE
  • cd top-level/../
  • git clone
  • cd jaspy/
  • link ...
  1. Script: list-jaspy-envs.sh - looks up all environments available, show as: - DONE
  • py2.7 environments (under )
    • env 1
    • env 2 ...
  1. See /doc/README.md for JASMIN docs

  2. Move to Cedadev and move issues across

  3. Review issues

  4. Script: write-env-docs.sh <env_dir> <env_dir> <env_dir>

  • environments/.../.../.md
  • Environment:
  • Install with: ----
    • Pkg: name , description, version, links...
  1. Check users I previously told about JASMIN /apps/contrib/

Re-factoring bash

Started with common.cfg.

More to do:

bin_dir=${JASPY_BASE_DIR}/jaspy/bin
bin_dir=${JASPY_BASE_DIR}/jaspy/miniconda_envs/jas${path_comps}/bin
bin_dir=${JASPY_BASE_DIR}/jaspy/miniconda_envs/jas${path_comps}/bin
bin_dir=${JASPY_BASE_DIR}/jaspy/miniconda_envs/jas${path_comps}/bin
bin_dir=${JASPY_BASE_DIR}/jaspy/miniconda_envs/jas${path_comps}/bin
bin_dir=${JASPY_BASE_DIR}/jaspy/miniconda_envs/${path_comps}/bin
bin_dir=${miniconda_env_dir}/bin

for binary in $(cat ${channel_urls_path} | grep http | sed 's|.*/||g'); do
for binary in $(cat ${channel_urls_path} | grep http | sed 's|.*/||g'); do

jaspy_version=$(echo $env_name | cut -d\- -f1)
jaspy_version=$(echo $env_name | cut -d\- -f1)

miniconda_env_dir=${JASPY_BASE_DIR}/jaspy/miniconda_envs/jas${path_comps}
miniconda_env_dir=${JASPY_BASE_DIR}/jaspy/miniconda_envs/${jaspy_version}/${miniconda_version}

miniconda_version=$(echo $env_name | cut -d\- -f2-3)
miniconda_version=$(echo $env_name | cut -d\- -f2-3)

path_comps=$(echo $channel_path | rev | cut -d/ -f1-2 | rev)
path_comps=$(echo $env_path | rev | cut -d/ -f2-3 | rev)
path_comps=$(echo $spec_dir | rev | cut -d/ -f2-3 | rev)
path_comps=$(echo $spec_dir | rev | cut -d/ -f2-3 | rev)
path_comps=$(echo $spec_dir | rev | cut -d/ -f2-3 | rev)
path_comps=$(echo $spec_file_dir | rev | cut -d/ -f2-3 | rev)
path_comps=$(echo $yaml_path | rev | cut -d/ -f2-3 | rev)

PLATFORM="linux-64"
PLATFORM=linux-64

Should module files manage "activate" themselves?

  • So that they are agnostic of the shell?
  • So that load and unload would both work?

To automate, could do:

  1. Capture env before activating
  2. Run source activate <conda-env>
  3. Capture env after activating
  4. Diff the two envs
  5. Put the changes in the envs into the ModuleFile directly (so that activation is not necessary).

Fix spec file listing the pip components issue

Need to modify workflow to:

  1. Input files: <env_name>-initial.yml
  2. Process with:
    • get URLs: conda list --explicit | conda list --explicit | grep '^http'
    • put them into new YAML structure
    • insert header YAML
    • insert pip section
      • Use: full versions in pip
    • insert test section
  3. Write to: <env_name>-spec.yml

Managing Aliases

To create an alias env:

  1. We have env: "my-env-r20181022"
  2. To create alias: "my-env-current":
  • cd .../envs/
  • ln -s my-env-r20181022 my-env-current

Then we will set up a separate ModuleFile for each:

  • /apps/modulefiles/my-env/r20181022
  • /apps/modulefiles/my-env/current

This means that "current" will be loaded by default if you do:

module load my-env

But you can specify a particular env with, e.g.:

module load my-env/r20181022
module load my-env/current

Example approach to managing module files

Examples of a simple module files:

$ cat /apps/modulefiles/jaspy2.7/tiny
#%Module -*- tcl -*-
##
## modulefile
##
proc ModulesHelp { } {
 puts stderr "\tAdds JASMIN Conda tools to your environment variables,"
}

module-whatis " Adds JASMIN Conda tools to your environment variables"

puts "source /apps/contrib/jaspy/bin/activate-this-env.sh jaspy2.7/tiny"

and

$ cat /apps/modulefiles/jaspy3.6/m3-4.5.4-r20180816
#%Module -*- tcl -*-
##
## modulefile
##
proc ModulesHelp { } {
 puts stderr "\tAdds JASMIN Conda tools to your environment variables,"
}

module-whatis " Adds JASMIN Conda tools to your environment variables"

puts "source /apps/contrib/jaspy/bin/activate-this-env.sh jaspy3.6/m3-4.5.4-r20180816"

And these use a script created from:

$ cat /vagrant-share/repos/jaspy/src/templates/activate-this-env.sh.tmpl
# Run with: source <activate-location> <env>

env_code=$1

env_search=$(echo $env_code | sed 's/\//\*/')
env_dir=$(find __JASPY_BASE_DIR__/jaspy/miniconda_envs/jaspy* -name "${env_search}")

env_name=$(basename $env_dir)
bin_dir=$(echo $env_dir | cut -d/ -f1-7)/bin

source ${bin_dir}/activate ${env_name}

Indexing a conda channel automatically creates links to docs etc

See this HTML page:

http://dist.ceda.ac.uk/jaspy/jaspy3.7/m3-4.5.11/

E.g.

 <tr>
      <td class="packagename"><a href="https://palletsprojects.com/p/click" alt="click">click</a></td>
      <td class="version">7.0</td>
      <td><a href="https://click.palletsprojects.com">doc</a></td>
      <td><a href="https://github.com/pallets/click">dev</a></td>
      <td class="tight">BSD-3-Clause</td>
<td>X</td><td></td>      <td class="summary">Python composable command line interface toolkit</td>
    </tr> 

Proposal for packages not resolved in `create-jaspy-env`

  1. E.g. An environment is defined as:
  • Id: jaspy3.6-m3-4.5.4-r20180816
  • Alias: jaspy3.6-v0.1.0
  1. We try to resolve all dependencies...but
  • some packages will conflict.
  1. So, if this happens, we can do:
    i. Separate out the command-line tools (that conflict) into their own individual sub-envs, e.g.:
    • jaspy3.6-m3-4.5.4-r20180816-ncl with alias: jaspy3.6-v0.1.0-ncl

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.