Skip to content

Commit 9df43c1

Browse files
committed
reorganize and new repo
0 parents  commit 9df43c1

22 files changed

+1866
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
containers.json
2+
.vagrant/**

LICENSE

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Copyright (c) 2013 by Preston Holmes
2+
3+
Redistribution and use in source and binary forms of the software as well
4+
as documentation, with or without modification, are permitted provided
5+
that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above
11+
copyright notice, this list of conditions and the following
12+
disclaimer in the documentation and/or other materials provided
13+
with the distribution.
14+
15+
* The names of the contributors may not be used to endorse or
16+
promote products derived from this software without specific
17+
prior written permission.
18+
19+
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
21+
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
30+
DAMAGE.
31+

README.rst

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
JiffyLab
2+
========
3+
4+
JiffyLab is a project to provide an entirely web based environment for the
5+
instruction, or lightweight use of, Python and UNIX shell environment with
6+
zero-configuration of the user's machine.
7+
8+
Currently in early development status
9+
10+
The Problem
11+
-----------
12+
13+
Python is a wonderful first language, but sometimes introducing people to
14+
Python is bogged down by making sure that everyone has a usable development
15+
environment. This can often set a tone of frustration for beginners, as well as
16+
completely drain instructor and assistants time, instead of letting everyone
17+
"dive in".
18+
19+
There are other advantages to having a standardized environment:
20+
21+
* If the instructor is projecting the same thing as what the student sees, the
22+
student will be less likely to be thown off by inconsequential details such
23+
as differences in the shell prompt (> vs $ etc), different syntax
24+
highlighting colors, or use of some tool or feature not installed on the
25+
student's machine.
26+
27+
* When all students are using the same exact setup, they are more likely to be
28+
capable of helping their neighbor, as if they got it working on their screen,
29+
they can probably get it working on their neigbor - peers can more
30+
effectively visually "diff" what might be different.
31+
32+
* Even if the setup of a student machine goes smoothly at a technical level, it
33+
can still take time, especially if a significant number of material needs to
34+
be downloaded over slow links, or requires significant build time.
35+
36+
Trade-offs
37+
----------
38+
39+
Messing around with tools and your machine setup is of course part of being
40+
a developer - learning how to manage your system and Python 'PATH', learning an
41+
editor, virtualenvs, pip etc all need to happen. But not in your first hour as
42+
a new developer.
43+
44+
Another reason to have students work through the challenge of getting
45+
a working dev environment on their own machines is so that they can continue to
46+
teach themselves and learn on their own once past the introduction. This is
47+
very important, and should be built into any worthwhile instruction, it just
48+
doesn't need to happen at the beginning. Once students have learned some
49+
material, they will have much more context to understand what it is they are
50+
setting up, and will potentially have a greater motivation for getting it all
51+
working. So in the end I believe this trade-off is a bit of a red herring, as
52+
it is not about "either or", but "which comes first".
53+
54+
TODO Learn to work on a server
55+
56+
Quickstart
57+
----------
58+
59+
JiffyLab uses `Docker <http://docker.io>`_ which provides each student a
60+
sandboxed environment through the use of linux containers (think lightweight,
61+
process level virtual machines). Note that this technology is Linux specific,
62+
so does NOT run on Mac OS X. You can run this quite effectively inside a Linux
63+
virtual machine using `vagrant <http://vagrantup.com>`_ (in fact, this project
64+
was developed on a Mac).
65+
66+
# notes
67+
68+
vagrant virtualbox stall on raring box
69+

Vagrantfile

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
BOX_NAME = ENV['BOX_NAME'] || "raring"
5+
BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64.box"
6+
AWS_REGION = ENV['AWS_REGION'] || "us-east-1"
7+
AWS_AMI = ENV['AWS_AMI'] || "ami-d0f89fb9"
8+
9+
10+
# Add X.org Ubuntu backported 3.8 kernel
11+
kernel_upgrade = "add-apt-repository -y ppa:ubuntu-x-swat/r-lts-backport; " \
12+
"apt-get update -qq; apt-get install -q -y linux-image-3.8.0-19-generic; shutdown -r +1;"
13+
14+
Vagrant.configure("2") do |config|
15+
16+
17+
config.vm.provider :virtualbox do |vb, override|
18+
override.vm.box = 'raring'
19+
override.vm.box_url = 'http://cloud-images.ubuntu.com/raring/current/raring-server-cloudimg-vagrant-amd64-disk1.box'
20+
override.vm.network :private_network, ip:"10.10.10.10"
21+
vb_guest_install = "apt-get install -q -y linux-headers-3.8.0-19-generic dkms; " \
22+
"echo 'Downloading VBox Guest Additions...'; " \
23+
"wget -q http://dlc.sun.com.edgesuite.net/virtualbox/4.2.12/VBoxGuestAdditions_4.2.12.iso; "
24+
# Prepare the VM to add guest additions after reboot
25+
vb_guest_install << "echo -e 'mount -o loop,ro /home/vagrant/VBoxGuestAdditions_4.2.12.iso /mnt\n" \
26+
"echo yes | /mnt/VBoxLinuxAdditions.run\numount /mnt\n" \
27+
"rm /root/guest_additions.sh; ' > /root/guest_additions.sh; " \
28+
"chmod 700 /root/guest_additions.sh; " \
29+
"sed -i -E 's#^exit 0#[ -x /root/guest_additions.sh ] \\&\\& /root/guest_additions.sh#' /etc/rc.local; " \
30+
"echo 'Installation of VBox Guest Additions is proceeding in the background.'; " \
31+
"echo '\"vagrant reload\" can be used in about 2 minutes to activate the new guest additions.'; "
32+
override.vm.provision :shell, :path => "linux-setup.sh"
33+
end
34+
35+
config.vm.provider :rackspace do |rs, override|
36+
override.vm.box = "dummy"
37+
override.ssh.private_key_path = ENV["RS_PRIVATE_KEY"]
38+
rs.username = ENV["RS_USERNAME"]
39+
rs.api_key = ENV["RS_API_KEY"]
40+
rs.public_key_path = ENV["RS_PUBLIC_KEY"]
41+
rs.flavor = /512MB/
42+
rs.image = /Raring/
43+
override.vm.provision :shell, :path => "linux-setup.sh"
44+
end
45+
46+
end

docker-builds/anaconda/Dockerfile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Sets up a container for the web based lab login
2+
#
3+
# VERSION 0.0.1
4+
5+
# At some point, more of this will be pushed into its own docker image
6+
7+
FROM ubuntu
8+
MAINTAINER Preston Holmes "[email protected]"
9+
10+
RUN apt-get update -qq
11+
RUN apt-get install -y -q python-dev python-dev-all
12+
13+
# sshd
14+
RUN apt-get install -y -q openssh-server
15+
EXPOSE 22
16+
17+
RUN apt-get install -y -q sudo gcc make nano sqlite3
18+
19+
RUN apt-get install -y -q python-pip
20+
RUN pip install -U pip
21+
22+
# git
23+
RUN apt-get install -y -q libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
24+
RUN apt-get install -y -q git
25+
# TODO add git configs
26+
27+
RUN
28+
RUN
29+
RUN
30+
RUN
31+
RUN
32+
+187
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
#!/bin/bash
2+
# Copyright (c) 2012-2013 Continuum Analytics, Inc.
3+
# All rights reserved.
4+
#
5+
# NAME: Anaconda
6+
# VER: 1.5.0
7+
# PLAT: linux-64
8+
# DESCR: 1.4.0-888-g5c37ff3
9+
# BYTES: 321578266
10+
# LINES: 371
11+
# MD5: ef6521e88b7eeabd6b7bae1a41ad728e
12+
13+
unset LD_LIBRARY_PATH
14+
15+
THIS_DIR=$(cd $(dirname $0); pwd)
16+
THIS_FILE=$(basename $0)
17+
THIS_PATH="$THIS_DIR/$THIS_FILE"
18+
PREFIX=$HOME/anaconda
19+
BATCH=0
20+
21+
# TODO check if exists and is the right size etc and only download if needed
22+
curl -O http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-1.5.0-Linux-x86_64.sh
23+
24+
mkdir -p $PREFIX
25+
if (( $? )); then
26+
echo "ERROR: Could not create directory: $PREFIX" >&2
27+
exit 1
28+
fi
29+
30+
31+
PREFIX=$(cd $PREFIX; pwd)
32+
export PREFIX
33+
34+
cd $PREFIX
35+
36+
tail -n +371 "$THIS_DIR/Anaconda-1.5.0-Linux-x86_64.sh" | tar xf -
37+
38+
install_dist()
39+
{
40+
echo "installing: $1 ..."
41+
DIST=$PREFIX/pkgs/$1
42+
mkdir -p $DIST
43+
tar xjf ${DIST}.tar.bz2 -C $DIST || exit 1
44+
rm -f ${DIST}.tar.bz2
45+
}
46+
47+
install_dist python-2.7.4-0
48+
install_dist _license-1.1-py27_0
49+
install_dist astropy-0.2.1-np17py27_0
50+
install_dist atom-0.2.3-py27_0
51+
install_dist biopython-1.61-np17py27_0
52+
install_dist bitarray-0.8.1-py27_0
53+
install_dist boto-2.9.2-py27_0
54+
install_dist cairo-1.12.2-1
55+
install_dist casuarius-1.1-py27_0
56+
install_dist conda-1.5.2-py27_0
57+
install_dist cubes-0.10.2-py27_1
58+
install_dist curl-7.30.0-0
59+
install_dist cython-0.19-py27_0
60+
install_dist dateutil-2.1-py27_1
61+
install_dist disco-0.4.4-py27_0
62+
install_dist distribute-0.6.36-py27_1
63+
install_dist docutils-0.10-py27_0
64+
install_dist dynd-python-0.3.0-np17py27_0
65+
install_dist enaml-0.7.6-py27_0
66+
install_dist erlang-R15B01-0
67+
install_dist flask-0.9-py27_0
68+
install_dist freetype-2.4.10-0
69+
install_dist gevent-0.13.8-py27_0
70+
install_dist gevent-websocket-0.3.6-py27_2
71+
install_dist gevent_zeromq-0.2.5-py27_2
72+
install_dist greenlet-0.4.0-py27_0
73+
install_dist grin-1.2.1-py27_1
74+
install_dist h5py-2.1.1-np17py27_0
75+
install_dist hdf5-1.8.9-0
76+
install_dist imaging-1.1.7-py27_2
77+
install_dist ipython-0.13.2-py27_0
78+
install_dist jinja2-2.6-py27_0
79+
install_dist jpeg-8d-0
80+
install_dist libdynd-0.3.0-0
81+
install_dist libevent-2.0.20-0
82+
install_dist libnetcdf-4.2.1.1-1
83+
install_dist libpng-1.5.13-1
84+
install_dist libxml2-2.9.0-0
85+
install_dist libxslt-1.1.28-0
86+
install_dist llvm-3.2-0
87+
install_dist llvmpy-0.11.2-py27_0
88+
install_dist lxml-3.2.0-py27_0
89+
install_dist matplotlib-1.2.1-np17py27_1
90+
install_dist mdp-3.3-np17py27_0
91+
install_dist meta-0.4.2.dev-py27_0
92+
install_dist mpi4py-1.3-py27_0
93+
install_dist mpich2-1.4.1p1-0
94+
install_dist netcdf4-1.0.4-np17py27_0
95+
install_dist networkx-1.7-py27_0
96+
install_dist nltk-2.0.4-np17py27_0
97+
install_dist nose-1.3.0-py27_0
98+
install_dist numba-0.8.1-np17py27_0
99+
install_dist numexpr-2.0.1-np17py27_3
100+
install_dist numpy-1.7.1-py27_0
101+
install_dist opencv-2.4.2-np17py27_1
102+
install_dist openssl-1.0.1c-0
103+
install_dist pandas-0.11.0-np17py27_1
104+
install_dist pip-1.3.1-py27_1
105+
install_dist pixman-0.26.2-0
106+
install_dist ply-3.4-py27_0
107+
install_dist psutil-0.7.1-py27_0
108+
install_dist py-1.4.12-py27_0
109+
install_dist py2cairo-1.10.0-py27_1
110+
install_dist pycosat-0.6.0-py27_0
111+
install_dist pycparser-2.9.1-py27_0
112+
install_dist pycrypto-2.6-py27_0
113+
install_dist pycurl-7.19.0-py27_2
114+
install_dist pyflakes-0.7.2-py27_0
115+
install_dist pygments-1.6-py27_0
116+
install_dist pyparsing-1.5.6-py27_0
117+
install_dist pysal-1.5.0-np17py27_1
118+
install_dist pysam-0.6-py27_0
119+
install_dist pyside-1.1.2-py27_0
120+
install_dist pytables-2.4.0-np17py27_0
121+
install_dist pytest-2.3.4-py27_1
122+
install_dist pytz-2013b-py27_0
123+
install_dist pyyaml-3.10-py27_0
124+
install_dist pyzmq-2.2.0.1-py27_1
125+
install_dist qt-4.7.4-0
126+
install_dist readline-6.2-0
127+
install_dist redis-2.6.9-0
128+
install_dist redis-py-2.7.2-py27_0
129+
install_dist requests-1.2.0-py27_0
130+
install_dist rope-0.9.4-py27_0
131+
install_dist scikit-image-0.8.2-np17py27_1
132+
install_dist scikit-learn-0.13.1-np17py27_0
133+
install_dist scipy-0.12.0-np17py27_0
134+
install_dist shiboken-1.1.2-py27_0
135+
install_dist six-1.3.0-py27_0
136+
install_dist sphinx-1.1.3-py27_3
137+
install_dist spyder-2.2.0-py27_0
138+
install_dist sqlalchemy-0.8.1-py27_0
139+
install_dist sqlite-3.7.13-0
140+
install_dist statsmodels-0.4.3-np17py27_1
141+
install_dist sympy-0.7.2-py27_0
142+
install_dist system-5.8-1
143+
install_dist theano-0.5.0-np17py27_1
144+
install_dist tk-8.5.13-0
145+
install_dist tornado-3.0.1-py27_0
146+
install_dist util-linux-2.21-0
147+
install_dist werkzeug-0.8.3-py27_0
148+
install_dist xlrd-0.9.2-py27_0
149+
install_dist xlwt-0.7.5-py27_0
150+
install_dist yaml-0.1.4-0
151+
install_dist zeromq-2.2.0-1
152+
install_dist zlib-1.2.7-0
153+
install_dist anaconda-1.5.0-np17py27_0
154+
155+
mkdir $PREFIX/envs
156+
mkdir $HOME/.continuum 2>/dev/null
157+
158+
PYTHON="$PREFIX/pkgs/python-2.7.4-0/bin/python -E"
159+
$PYTHON -V
160+
if (( $? )); then
161+
echo "ERROR:
162+
cannot execute native linux-64 binary, output from 'uname -a' is:" >&2
163+
uname -a
164+
exit 1
165+
fi
166+
167+
echo "creating default environment..."
168+
CONDA_INSTALL="$PREFIX/pkgs/conda-1.5.2-py27_0/lib/python2.7/site-packages/conda/install.py"
169+
$PYTHON $CONDA_INSTALL --prefix=$PREFIX --pkgs-dir=$PREFIX/pkgs --link-all || exit 1
170+
echo "installation finished."
171+
172+
if [[ $PYTHONPATH != "" ]]; then
173+
echo "WARNING:
174+
You current have a PYTHONPATH environment variable set. This may cause
175+
unexpected behavior when running the Python interpreter in Anaconda.
176+
For best results, please verify that your PYTHONPATH only points to
177+
directories of packages that are compatible with the Python interpreter
178+
in Anaconda: $PREFIX"
179+
fi
180+
181+
echo "
182+
# added by Anaconda 1.5.0 installer
183+
export PATH=\"$PREFIX/bin:\$PATH\"" >>$BASH_RC
184+
185+
rm "$THIS_DIR/Anaconda-1.5.0-Linux-x86_64.sh"
186+
187+
exit 0

0 commit comments

Comments
 (0)