Git Product home page Git Product logo

anaconda's Introduction

Anaconda Puppet Module

Puppet module for installing anaconda, managing environments, and installing conda packages.

Usage

(Testing on OS X and Ubuntu)

Git clone this repo into your puppet modules directory. Then you can test it using the snippet below in a file and running puppet apply.

File: test2.pp

# Install anaconda into /opt/anaconda
include anaconda

# Create env named test1 with python3.3
anaconda::env{test1:
    anaconda_version => "4.2.0",
    python           => "3.6",
}

# Create env named test2 - /opt/anaconda/envs/test2
# Use python in /opt/anaconda/envs/test2/bin/python
anaconda::env{test2:}  

# Install packages into root env
anaconda::package{dnspython: }

# Install packages into env test2
anaconda::package{dnspython: env => "test2" }

# The env test2 is a dependency when installing packages into it
# Install a number of packages into test2
anaconda::env{test2:}
anaconda::package{[dnspython,rope, py]: 
    env => "test2"
}

Run using this command where --modulepath points to the directory where you have installed this puppet module:

puppet apply modules/anaconda/test2.pp --modulepath=modules

Install R kernel

  $conda_r_installs = [ 
                'r', 'r-essentials', 'r-irkernel', 
                'bokeh', 'ggplot', 'ggplot2',
                'r-matrix', 'r-nlme', 'r-lme4',
                'dplyr', 'shiny',
                'tidyr', 'caret', 'nnet'
                ]
                
  anaconda::env { r:
    anaconda_version => '4.4',
    language         => 'r'
  } ->

  anaconda::package { $conda_r_installs:
    env      => 'r',
    language => 'r'
  }

Anaconda class

This class simply installs Anaconda into /opt/anaconda and accepts the license agreement. The path is hardcoded for now.

anaconda::env

define anaconda::env( $anaconda_version='1.5', $python='2.7')

Create a Python environment. Overriding the anaconda_version, or python version will create the env with the appropriate versions.

Parameters

anaconda_version

Default: '4.4.0'

language

Default: 'python'

exec_timeout

The timeout used for the exec puppet resource. The time is in seconds.
Default: '300'

anaconda::package

In future versions, this could be a true package provider, but for now it is just a defined type.

define anaconda::package( $env=undef, $base_path='/opt/anaconda')
...
anaconda::env{"test2":}
anaconda::package{[dnspython,rope, py]: 
    env => "test2"
}

If you set the env, you create a dependency on a anaconda::env type that matchs the env. It will not auto-create the environment if you forget the dependency.

anaconda::channel

Channels are the path that conda takes to look for packages. Details can be found here.

Parameters

channel

The name of the channel to add.
Default: $title

base_path

The path to the base directory of anaconda.
Default: '/opt/anaconda'

Things to Improve

  • Create a true package provider
  • Allow installation path to be defined - hard-coded to /opt/anaconda
  • Packages cannot be specified with versions -- they install the latest version valid in the env.

anaconda's People

Contributors

bkreider avatar conzar avatar dpshelio avatar jqueguiner avatar readuni1 avatar

Watchers

 avatar

Forkers

yorickps eroesch

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.