commit | 9653bf804ac7cb2ccb17943a8f3fd87afc28c791 | [log] [tgz] |
---|---|---|
author | Matt Chu <matt.chu@gmail.com> | Mon Apr 27 17:09:17 2015 -0700 |
committer | Matt Chu <mchu@kabam.com> | Fri Oct 02 15:19:29 2015 -0700 |
tree | 9ce7692efc51196a912ef93ebae4d6b8db6d5d50 | |
parent | 57dd98ed3b63b352f352d6a47646289d25bba860 [diff] |
numerous changes for next major release: **This is a backwards-INCOMPATIBLE release** API, cookbook changes: - Refactored attributes to be cleaner and more readable - The user and group are now created if they don't exist, and by default are installed under anaconda/anaconda - New attributes for configuring notebook server - The OS architecture (x86 versus x86_64) is now autodetected by default Platform, support changes: - Added support for Anaconda 2.3 (all pythons and all architectures) - Removed support for all Anacondas < 2.2.0 - updated metadata.rb 'supports' tags (hopefully this doesn't break anything) Tools changes: - Migrated to chefdk 0.8.1 - upgraded gems - updated chefspec - updated documentation - removed rbenv/rvm files Testing changes: - Moved to kitchen-docker for Docker-based testing, which is much much much faster - Updated supported (tested) platforms: - ubuntu: - removed: 12.10, 13.04, 13.10 - added: 15.04 - debian: - removed: 6.0.5 - added: 7.8, 8.1 (7.9 and 8.2 not in fauxhai yet) - centos: - removed: 5.8, 6.0, 6.3 - added: 5.11, 6.6, 7.1.1503 - redhat (chefspec only, no kitchen testing): - removed: 5.8, 6.3 - added: 5.9, 6.6, 7.1.1503
Chef cookbook for installing Continuum Analytic's Anaconda: "completely free Python distribution for large-scale data processing, predictive analytics, and scientific computing". Specifically:
This also serves as an example for developing and testing Chef cookbooks. It uses:
In addition:
If you want to just have a working Anaconda VM, install:
For the full experience (e.g. running the test suite), also install:
The sample Vagrantfile will build you an Anaconda VM with no changes necessary; note it might take a few minutes to download the Anaconda installer itself.
$> vagrant up --provision ... # the sample image includes `recipe[anaconda::shell_conveniences]`, which # means conda is already in PATH via /etc/profile.d $> vagrant ssh $vagrant> conda --version conda 3.14.1 # or you add it to PATH manually $> vagrant ssh $vagrant> export PATH=/opt/anaconda/2.3.0/bin:${PATH} $vagrant> conda --version conda 3.14.1
It includes a Jupyter (IPython) notebook server accessible at http://33.33.33.123:8888
Lastly, to use it in a cookbook:
include_recipe 'anaconda::default'
You MUST include recipe[anaconda::python_workaround]
, otherwise subsequent chef runs will fail. See the issue for details.
The main recipe is anaconda::default
. Include it in your runlist, and it will install the package as well as any necessary dependencies.
The following are user-configurable attributes. Check attributes/default.rb for more details.
anaconda
version
: the Anaconda version to install. Valid values are:python
: which version of Python to install for. Valid values are:flavor
: what architecture the instance is. Valid values are:install_type
: which Anaconda distribution to install. Valid values are:install_root
: the parent directory of all anaconda installs. note that individual installs go into #{install_root}/#{version}
accept_license
: must be explicitly set to the string yes
(there are no defaults); any other value will reject the license.owner
: the user who owns the installgroup
: the group who owns the installrecipe[anaconda::shell_conveniences]
Include this to have the environment set for all users (login shells) via /etc/profile.d
. Useful for development.
anaconda_package
You can use the anaconda_package
resource to install new packages into the Anaconda environment:
# I don't know what 'astroid' is, just using it as a sample package anaconda_package 'astroid' do # the other supported action is `:remove` action :install end
See the resource definition for additional options; in general, all it does is present the same options as conda install
/conda remove
.
anaconda_nbservice
This only works with a full Anaconda installation! I.e. the notebook service will not work out-of-the-box if installed with miniconda.
The anaconda_nbservice
will run a Jupyter notebook server as a runit service:
anaconda_nbservice 'notebook-server' do # listen on all interfaces; there will be a warning since security is # disabled ip '*' port '8888' install_dir '/opt/ipython/server' service_action [ :enable, :start ] end
The standard configuration should be good enough, but you might need to write your own run service template:
anaconda_nbservice 'server-with-custom-template' do user ipython_user group ipython_group install_dir install_dir template_cookbook 'your_cookbook' # note that if your template name is TEMPLATE, then this value should be # 'TEMPLATE", but the file should be 'sv-TEMPLATE-run.erb' run_template_name 'your_template_name' run_template_opts({ ... }) service_action [ :enable, :start ] end
To run the full test suite:
# this will take a while, especially the first time $> script/cibuild ... # check the final result; bash return codes: 0 is good, anything else is not $> echo $?
to run just the chefspecs:
$> rspec
to run just the test kitchen serverspec integration tests:
# this is done via docker/kitchen-docker # the list of OSes is defined in .kitchen.yml $> kitchen verify # test a specific OS; `kitchen list` $> kitchen verify default-ubuntu-1204
check for style issues with Foodcritic
$> foodcritic
Standard stuff:
git tag
'edAuthor:: Matt Chu (matt.chu@gmail.com)