#Imports for running this presentation live from IPython.html.widgets import interact, interactive from IPython.display import clear_output, display, HTML import numpy as np from scipy import integrate from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.colors import cnames from matplotlib import animation %matplotlib inline !docker run --rm busybox sh -c 'echo "Hello Docker World!"' %time !docker run --rm busybox sh -c 'echo "Hello Docker World!"' !docker search itk !docker --help !docker cp --help !docker images !docker pull odise/busybox-python !docker images !docker ps !docker run -d busybox sh -c 'sleep 3' !docker ps !docker ps -a !ls $PWD/images/ !docker run --rm --volume $PWD/images:/images busybox \ sh -c 'ls /images' %%writefile docker-ls-images/Dockerfile # Best practice for Dockerfile's: # specify exact versions whenever possible. FROM busybox:4986bf8c1536 MAINTAINER Matt McCormick RUN mkdir -p /images VOLUME /images CMD ["/bin/sh", "-c", "ls /images"] !docker build -t ls-images ./docker-ls-images !docker run --rm -v $PWD/images:/images ls-images !git clone https://github.com/thewtex/docker-itkka !cd docker-itkka !./build.sh !./run.sh !docker pull thewtex/itkka !docker run -it thewtex/itkka bash from IPython.display import YouTubeVideo YouTubeVideo("P38cLZJ0w2s") def solve_lorenz(N=10, angle=0.0, max_time=4.0, sigma=10.0, beta=8./3, rho=28.0): fig = plt.figure() ax = fig.add_axes([0, 0, 1, 1], projection='3d') ax.axis('off') # Prepare the axes limits ax.set_xlim((-25, 25)) ax.set_ylim((-35, 35)) ax.set_zlim((5, 55)) def lorenz_deriv((x, y, z), t0, sigma=sigma, beta=beta, rho=rho): """Compute the time-derivative of a Lorentz system.""" return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z] # Choose random starting points, uniformly distributed from -15 to 15 np.random.seed(1) x0 = -15 + 30 * np.random.random((N, 3)) # Solve for the trajectory t = np.linspace(0, max_time, int(250*max_time)) x_t = np.asarray([integrate.odeint(lorenz_deriv, x0i, t) for x0i in x0]) # Choose a different color for each trajectory colors = plt.cm.jet(np.linspace(0, 1, N)) for i in range(N): x, y, z = x_t[i,:,:].T lines = ax.plot(x, y, z, '-', c=colors[i]) plt.setp(lines, linewidth=2) ax.view_init(30, angle) plt.show() return t, x_t # A static view provides limited insights t, x_t = solve_lorenz(angle=0, N=10) # An interative visualization provides much more insight # into the parameters w = interactive(solve_lorenz, angle=(0.,360.), N=(0,50), sigma=(0.0,50.0), rho=(0.0,50.0)) display(w) YouTubeVideo('QqfjiuqVrV4') # Easy execution and sandboxing !docker pull jenkins !docker run --name myjenkins -p 8080:8080 -v /var/jenkins_home jenkins