Skip to content

Commit

Permalink
Prepping for 0.7.x, with many changes to support latest versions; see…
Browse files Browse the repository at this point in the history
… CHANGELOG.md
  • Loading branch information
thmttch committed Nov 28, 2017
1 parent 04ec108 commit 6e9e33d
Show file tree
Hide file tree
Showing 17 changed files with 228 additions and 135 deletions.
28 changes: 14 additions & 14 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ driver:
# you can restore this if you want, but it'll be slooooooow
#name: vagrant
name: docker
# https://github.com/test-kitchen/kitchen-docker/issues/207
use_sudo: false
driver_config:
binary: /usr/local/bin/docker
# install latest if not present
Expand All @@ -14,21 +16,12 @@ provisioner:
name: chef_solo

platforms:
# ubuntu: 2 LTS, and the latest
- name: ubuntu-12.04
- name: ubuntu-14.04
- name: ubuntu-15.04
# debian: stable, oldstable
# TODO 7.9 and 8.2 were recently released
- name: debian-7.8
- name: debian-8.1
# centos
- name: centos-5.11
# TODO 6.7 is the latest
- name: centos-6.6
- name: centos-7.1.1503
# redhat: 5.9, 6.6, 7.1
# TODO what's the platform name in docker?
- name: ubuntu-16.04
- name: debian-8.9
- name: debian-9.2
- name: centos-6.9
- name: centos-7.4

suites:
- name: default
Expand All @@ -38,3 +31,10 @@ suites:
anaconda:
flavor: 'x86_64'
accept_license: 'yes'
- name: nbservice
run_list:
- recipe[anaconda::default]
attributes:
anaconda:
flavor: 'x86_64'
accept_license: 'yes'
55 changes: 54 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,59 @@
# CHANGELOG

## 0.6.0
## 0.7.0

Many, many changes and fixes to support both the latest Chef version and the
latest Anaconda versions.

Adds support for Anaconda 4.4.0 and 5.0.1! 5.0.1 is now the default.

### Cookbook changes:

- Adds a `system_path` attribute, for adding Anaconda's bin path to `PATH`.

### Chef changes:

- Dot notation attributes (eg `node.attr1.prop1`) have been deprecated and is
now an error; converted everything to hash/bracket notation (eg
`node['attr1']['prop1']`).
- Cleanups to metadata.rb.

### Updated tested list of OSes

The list of tested OSes has been refined to the latest and penultimate (major)
stable versions. Note that just because an OS is not on the tested list does
not mean it won't work, it just means it is not part of the official test
suite. My experience has been it generally will.

- Ubuntu:
- Removed tests for: 12.04, 15.04
- Added tests for: 16.04
- Debian:
- Removed tests for: 7.8, 8.1
- Added tests for: 8.9, 9.1
- CentOS:
- Removed tests for: 5.11, 6.6, 7.1
- Added tests for: 6.9, 7.4
- Red Hat: completed removed from test suite, in favor of CentOS only

### Development, fixes:

- Gemfile now annotated with rvm metadata for ruby version and gemset.
- Fixed vagrant-trigger to correctly populate /var/chef/cache on provision.
- Fixed bad call to `Chef::Log` with `fatal`.

## 0.6.2

First official 0.6.x release; see 0.6.0 changelog for details.

Note that this reverts the release process back to using Chef 11.x/ChefDK 0.3.6
because of <https://github.com/chef/chef/issues/3888>.

## 0.6.1 (broken, untagged release thanks to ChefDK)

Do not use.

## 0.6.0 (unreleased thanks to ChefDK)

**This is a backwards-INCOMPATIBLE release**

Expand Down
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# for rvm: https://rvm.io/workflow/projects
#ruby=2.4.2
#ruby-gemset=chef-continuum-anaconda

source 'https://rubygems.org'

gem 'berkshelf'
gem 'chefspec'

gem 'test-kitchen'
# removed in favor of kitchen-docker
#gem 'kitchen-vagrant'
gem 'kitchen-docker'

gem 'foodcritic'

gem 'chef-rewind'

gem 'nokogiri', '~> 1.5.0'
gem 'nokogiri'
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Chef cookbook for installing [Continuum Analytic](http://continuum.io/)'s
distribution for large-scale data processing, predictive analytics, and
scientific computing". Specifically:

- Anaconda 2.2 or 2.3
- Anaconda 2.2, 2.3, 4.4.0, 5.0.1 (the default)
- python2 or python3
- x86 or x86_64
- Miniconda
Expand All @@ -31,6 +31,8 @@ uses:
- RSpec/[Chefspec](https://github.com/sethvargo/chefspec) for rapid testing;
3.3.2

**Note that the release process uses Chef 11 because of <https://github.com/chef/chef/issues/3888>**

In addition:

- [Vagrant](https://www.vagrantup.com) to provide an out-of-the-box working
Expand Down Expand Up @@ -65,13 +67,13 @@ installer itself.
# means conda is already in PATH via /etc/profile.d
$> vagrant ssh
$vagrant> conda --version
conda 3.14.1
conda 4.3.30

# or you add it to PATH manually
$> vagrant ssh
$vagrant> export PATH=/opt/anaconda/2.3.0/bin:${PATH}
$vagrant> export PATH=/opt/anaconda/5.0.1/bin:${PATH}
$vagrant> conda --version
conda 3.14.1
conda 4.3.30
```

It includes a Jupyter (IPython) notebook server accessible at <http://33.33.33.123:8888>
Expand Down Expand Up @@ -101,6 +103,8 @@ The following are user-configurable attributes. Check
- `version`: the Anaconda version to install. Valid values are:
- 2.2.0
- 2.3.0
- 4.4.0
- 5.0.1
- latest (for miniconda only)
- `python`: which version of Python to install for. Valid values are:
- python2
Expand All @@ -118,6 +122,7 @@ The following are user-configurable attributes. Check
no defaults)**; any other value will reject the license.
- `owner`: the user who owns the install
- `group`: the group who owns the install
- `system_path`: adds the bin path to the system's profile.d directory

### `recipe[anaconda::shell_conveniences]`

Expand Down Expand Up @@ -183,7 +188,13 @@ your own run service template:
end
```

## Tests
## Developer setup and config

install chef-dk; i installed using homebrew: https://github.com/chef/chef-dk

eval "$(chef shell-init bash)" && script/cibuild

### Tests

To run the full test suite:

Expand Down Expand Up @@ -233,8 +244,6 @@ Standard stuff:

## TODO

- add a pre-provision for kitchen tests to avoid redownloading the installer on
every test (really slows down the tests)
- https://github.com/poise/python is now deprecated, in favor of
https://github.com/poise/poise-python; see if the python workaround is still
necessary
Expand Down
33 changes: 15 additions & 18 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,21 @@ Vagrant.configure('2') do |config|

# provisioning

# dev optimization: anaconda's big, so put it in the cache for development if
# it's already been downloaded
[
'Anaconda-2.2.0-Linux-x86.sh',
'Anaconda-2.2.0-Linux-x86_64.sh',
'Anaconda3-2.2.0-Linux-x86.sh',
'Anaconda3-2.2.0-Linux-x86_64.sh',
'Anaconda-2.3.0-Linux-x86.sh',
'Anaconda-2.3.0-Linux-x86_64.sh',
'Anaconda3-2.3.0-Linux-x86.sh',
'Anaconda3-2.3.0-Linux-x86_64.sh',
].each do |f|
if File.exists?(f)
config.vm.provision :shell do |shell|
shell.inline = 'if [[ ! -f $1 ]]; then cp $1 $2; fi'
shell.args = [ "/vagrant/#{f}", '/var/chef/cache' ]
end
end
# dev optimization: anaconda installers are big, so put it in the guest's
# chef cache if it's available on the host
config.trigger.before :provision, :stdout => true do
run_remote <<-SCRIPT
VAGRANT_MOUNT=/vagrant/docker/container/installers
for f in $(ls ${VAGRANT_MOUNT}); do
echo "checking for ${f} in cache"
if [[ ! -f /var/chef/cache/${f} ]]; then
cp -v ${VAGRANT_MOUNT}/${f} /var/chef/cache
else
echo "${f} already in cache"
fi
done
SCRIPT
end

config.vm.provision :chef_solo do |chef|
Expand Down
Empty file removed attributes/.gitkeep
Empty file.
54 changes: 40 additions & 14 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# for miniconda this must be 'latest'
default.anaconda.version = '2.3.0'
default['anaconda']['version'] = '5.0.1'
# the version of python: either 'python2' or 'python3'
default.anaconda.python = 'python2'
default['anaconda']['python'] = 'python2'
# the architecture: nil to autodetect, or either 'x86' or 'x86_64'
default.anaconda.flavor = nil
default['anaconda']['flavor'] = nil
# either 'anaconda' or 'miniconda'
default.anaconda.install_type = 'anaconda'
default['anaconda']['install_type'] = 'anaconda'
# add system-wide path to profile.d?
default['anaconda']['system_path'] = false

default.anaconda.installer_info = {
default['anaconda']['installer_info'] = {
'anaconda' => {
'2.2.0' => {
'python2' => {
Expand All @@ -33,6 +35,30 @@
'x86_64' => '3be5410b2d9db45882c7de07c554cf4f1034becc274ec9074b23fd37a5c87a6f',
},
},
'4.4.0' => {
'python2' => {
'uri_prefix' => 'https://repo.continuum.io/archive',
'x86' => nil,
'x86_64' => nil,
},
'python3' => {
'uri_prefix' => 'https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com',
'x86' => '4cc10d65c303191004ada2b6d75562c8ed84e42bf9871af06440dd956077b555',
'x86_64' => '3be5410b2d9db45882c7de07c554cf4f1034becc274ec9074b23fd37a5c87a6f',
},
},
'5.0.1' => {
'python2' => {
'uri_prefix' => 'https://repo.continuum.io/archive',
'x86' => nil,
'x86_64' => nil,
},
'python3' => {
'uri_prefix' => 'https://repo.continuum.io/archive',
'x86' => nil,
'x86_64' => nil,
},
},
},
'miniconda' => {
'latest' => {
Expand All @@ -51,20 +77,20 @@
}

# specific versions are installed _under_ this directory
default.anaconda.install_root = '/opt/anaconda'
default.anaconda.accept_license = 'no'
default.anaconda.package_logfile = nil
default['anaconda']['install_root'] = '/opt/anaconda'
default['anaconda']['accept_license'] = 'no'
default['anaconda']['package_logfile'] = nil

default.anaconda.owner = 'anaconda'
default.anaconda.group = 'anaconda'
default.anaconda.home = "/home/#{node.anaconda.owner}"
default['anaconda']['owner'] = 'anaconda'
default['anaconda']['group'] = 'anaconda'
default['anaconda']['home'] = "/home/#{node['anaconda']['owner']}"

default.anaconda.notebook = {
default['anaconda']['notebook'] = {
# by default, listens on all interfaces; there will be a warning since
# security is disabled
'ip' => '*',
'port' => 8888,
'owner' => node.anaconda.owner,
'group' => node.anaconda.group,
'owner' => node['anaconda']['owner'],
'group' => node['anaconda']['group'],
'install_dir' => '/opt/ipython/server',
}
3 changes: 3 additions & 0 deletions chefignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,6 @@ Vagrantfile
# Travis #
##########
.travis.yml

# local anaconda installers should not be part of the cookbook
Anaconda*-*-Linux-*.sh
1 change: 1 addition & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
container
36 changes: 17 additions & 19 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
name 'anaconda'
maintainer 'Matt Chu'
maintainer_email '[email protected]'
license 'MIT'
description 'Installs/Configures anaconda'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.6.0'
name 'anaconda'
maintainer 'Matt Chu'
maintainer_email '[email protected]'
license 'MIT'
description 'Installs/Configures anaconda'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.7.0'

supports 'ubuntu', '= 12.04'
supports 'ubuntu', '= 14.04'
supports 'ubuntu', '= 15.04'
source_url 'https://github.com/thmttch/chef-continuum-anaconda'
issues_url 'https://github.com/thmttch/chef-continuum-anaconda/issues'

chef_version '>= 13'

supports 'debian', '= 7.8'
supports 'debian', '= 8.1'
supports 'ubuntu', '= 14.04'
supports 'ubuntu', '= 16.04'

supports 'centos', '= 5.11'
supports 'centos', '= 6.6'
supports 'centos', '= 7.1.1503'
supports 'debian', '= 8.9'
supports 'debian', '= 9.2'

# TODO
#supports 'redhat', '= 5.9'
#supports 'redhat', '= 6.6'
#supports 'redhat', '= 7.1'
supports 'centos', '= 6.9'
supports 'centos', '= 7.4'

depends 'apt'
depends 'runit'
Expand Down
Loading

0 comments on commit 6e9e33d

Please sign in to comment.