DevOps BootCamp (DOBC) is a free course hosted by the OSU Open Source Lab. The course is dedicated to teaching core software development and systems operation skills to passionate OSU students and community members.
DOBC is always 100% free for in-person and online students.
DevOps Bootcamp’s curriculum is available for you to learn at your own pace. Get started now!
The DevOps BootCamp content is available for free but meet-space guided lectures are offered throughout the year. Check the schedule below for our in-person lectures; each lecture covers a different part of the curriculum covering the entire course during the OSU academic school year.
Warning
If you are working ahead be aware that the schedule and slides may be subject to change. Check back regularly.
Lesson | Date/Time | Location | Description |
DevOps Daycamp | Oct 1, 10am-3pm | OSU KEC 1001 | DevOps DayCamp (DOBC Kickoff) |
Fall Meeting 2 | Nov 5, 11am-3pm | OSU KEC 1001 | Files, Verson Control, Programming |
Fall Meeting 3 | Dec 3, 11am-3pm | OSU KEC 1001 | Frameworks, Testing and CI |
Lesson | Date/Time | Location | Description |
Lesson | Date/Time | Location | Description |
We appreciate the help! To donate, go to http://osuosl.org/donate.
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
DevOps is a field which takes skills from Software Development and Operations Engineering to create and run applications more effectively.
TLDR: Development + Operations == Better Services
TLDR: Couch to DevOps in 1 school year
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
A 10,000ft view of the world
What other vocabulary can you think of related to DevOps?
What about Silicon Valley, Programming, System Administration, etc?
Note
This is a TODO. It’s basically an exercise or activity but with a cheeky name. Try them out if you don’t feel confident in a topic.
#! /usr/bin/env python
# This is a code block.
# Most of the time you can copy this code and run it exactly as is.
# It should be clear Where it 'goes' and how to run it based on context.
print('Hello world!')
$ echo Hello World # Copy the text after `$` into your termianal and press enter.
Trick question: how would you read this
#!/bin/python
dogs = ['$BREED_ONE', '$BREED_TWO', '$BREED_THREE']
for breed in dogs:
print(breed)
Replace the $BREED_N with actual dog breeds.
#!/bin/python
dogs = ['corgie', 'pug', 'french bulldog']
for breed in dogs:
print(breed)
Install an SSH Client (install Putty)
Log into your remote Linux environment using the credentials given to you.
- Under Host Name (or IP address) enter <user>@<host>, under Port enter <port>.
- You will be prompted for your password in new window, it will hide the password as you type it.
We suggest you install Vagrant, a tool which makes it easy to run and acquire Virtual Machines.
You may also need to install VirtualBox, a tool necessary for Vagrant to function.
Challenge Change your password on your Linux machine.
$ passwd
Changing password for user <user>.
Changing password for <user>.
(current) UNIX password: # Enter old password, hidden
New password: # Enter new password, also hidden
Retype new password:
passwd: all authentication tokens updated successfully.
Don’t forget: when you login next time, use the new password you just set.
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
Slackware
ArchLinux
Required course for all CS Students at OSU.
Required course for all CS Students at OSU.
OSDev.org is a wiki dedicated to helping people develop their own operating systems. It’s a big leap from this lesson, but great if you’re interested in learning the nitty-gritty.
Operating Systems Design and Implementation by Andrew S. Tanenbaum is a classsic in the world of OS Development. It’s also a big leap, but can teach you more about how Operating Systems work than you ever thought there was to know.
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
You... ish.
$ whoami # your username
$ who # who is logged in?
$ w # who is here and what are they doing?
$ id # user ID, group ID, and groups you're in
Sometimes robots are users too: Apache, Mailman, ntp.
/etc/passwd:
root:x:0:0:root:/root:/bin/bash
username:password:uid:gid:uid info:home directory:shell
$ su $USER # become user, with THEIR password
$ su # become root, with root's password
$ sudo su - # use your password instead of root's
$ sudo su $USER # become $USER with your password
Act as themselves.
- ls -l to see file permissions.
- Check the file’s group and user.
- Check the file’s read, write, and execute bits.
$ cat /etc/passwd
# username:x:UID:GID:GECOS:homedir:shell
$ useradd <user_name> # vs adduser, the friendly Ubuntu version
$ userdel <user_name>
$ passwd
$ groupadd
$ usermod
$ groupmod
$ cat /etc/group
root:x:0:
[foo@compe ~]$ yum install httpd # Runs command as `foo` user
Loaded plugins: fastestmirror, ovl
ovl: Error while doing RPMdb copy-up:
[Errno 13] Permission denied: '/var/lib/rpm/__db.002'
You need to be root to perform this command.
[foo@compe ~]$ sudo yum install httpd # Runs command as `root` user.
password:
Loaded plugins: fastestmirror, ovl
[... installs correctly ...]
Warning
Acting as root is dangerous! You can accidentally delete your filesystem, forcing you to completley re-install your OS! Type carefully.
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
Everything in Linux is a file... except the things that aren’t.
Files have:
$ ls -il
total 8
2884381 drwxrwxr-x 5 test test 4096 Nov 6 11:46 Documents
2629156 -rw-rw-r-- 1 test test 0 Nov 13 14:09 file.txt
2884382 drwxrwxr-x 2 test test 4096 Nov 6 13:22 Pictures
Yes. Except the things that aren’t..
int read_medical_device_data(int device_file_pointer) {
// Open a connection to the device
int * stream = open(device_file_pointer);
// Write the stream of data to the screen
write(STDOUT, stream);
// Do some other stuff with that data
// Close the data stream
close(stream);
return EXIT_SUCCESS;
}
.jpg, .txt, .py
Not necessary, more of a recommendation.
$ ls
some_text_file squirrel
$ file some_text_file
some_text_file: ASCII text
$ file squirrel
squirrel: JPEG image data, JFIF standard 1.01
$ ls -l
drwxrwxr-x 5 test test 4096 Nov 6 11:46 Documents
-rw-rw-r-- 1 test test 0 Nov 13 14:09 file.txt
drwxrwxr-x 2 test test 4096 Nov 6 13:22 Pictures
---------- ------- ------- -------- ------------ -------------
| | | | | |
| | | | | File Name
| | | | +--- Modification Time
| | | +------------- Size (in bytes)
| | +----------------------- Group
| +-------------------------------- Owner
+---------------------------------------------- File Permissions
$ chown root myfile
# Change the owner of myfile to "root".
$ chown root:staff myfile
# Change the owner of myfile to "root" and group to "staff".
$ chown -hR root /mydir
# Change the owner of /mydir and subfiles to "root".
$ chgrp -R devops /home/$yourusername/bootcamp
# Make the group devops own the bootcamp dir
+-----+--------+-------+
| rwx | Binary | Octal |
+-----+--------+-------+
| --- | 000 | 0 |
| --x | 001 | 1 |
| -w- | 010 | 2 |
| -wx | 011 | 3 |
| r-- | 100 | 4 |
| r-x | 101 | 5 |
| rw- | 110 | 6 |
| rwx | 111 | 7 |
+-----+--------+-------+
For instance:
$ ls -alh my-script
-r-xr-xr-x 1 username username 1.9K Sep 27 09:44 my-script
$ cat my-script
#!/bin/bash
# The above line tells Linux how to invoke the script on my behalf.
echo 'This is a script being run without using bash!'
$ ./my-script # my-script is invoked just like a compiled binary!
This is a script being run without using bash!
Directories are also files!
$ ls -alh | grep foobarbaz
drw-rw-rw- 2 voigte voigte 4.0K Sep 29 10:47 foobarbaz
$ ls -alh foobarbaz # Below is the literal output, not psuedo-output
ls: cannot access foobarbaz/.: Permission denied
ls: cannot access foobarbaz/..: Permission denied
total 0
d????????? ? ? ? ? ? .
d????????? ? ? ? ? ? ..
$ touch foo # create empty file called foo
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
TLDR: To take care of installation, removal, and updates of software.
Popular Linux Package Managers:
Examples:
How to install a package from source:
Using grep as an example:
$ wget http://mirrors.kernel.org/gnu/grep/grep-2.25.tar.xz
$ tar -Jxvf grep-2.25.tar.xz
$ cd grep-2.25
$ ./configure --prefix=$HOME/bin/
$ make
$ make install
$ sudo apt install git gcc make ncurses-bin ncurses-base libncurses5-dev libncurses5-dev
[...]
$ git clone https://github.com/mtoyoda/sl.git
[...]
$ cd sl
$ make
gcc -O -o sl sl.c -lncurses
$ mkdir ~/bin
$ ln sl ~/bin/
$ echo "export PATH=$PATH:$HOME/bin" >> ~/.bashrc
$ source ~/.bashrc
$ whereis sl
sl: /home/username/bin/sl
$ sl
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
$ <program> --help
$ <program> -h
Most programs allow you to pass a help flag which will print out basic usage. This is useful as a quick reference for how to use the program.
$ man <program>
$ man man
MAN(1) Manual pager utils MAN(1)
NAME
man - an interface to the on-line reference manuals
SYNOPSIS
man [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L
locale] [-m system[,...]] [-M path] [-S list] [-e extension] [-i|-I]
[...]
DESCRIPTION
man is the system's manual pager. Each page argument given to man is
normally the name of a program, utility or function. The manual page
[...]
Note
Some distros use info instead of man. To learn more about the info command, see Further Reading.
To get on IRC, Use irssi or weechat in screen:
# This step is optional, but persistent IRC is cool
$ ssh <username>@<a remote linux server>
# start screen with the name 'irc'
$ screen -S irc
# start your client in the 0th window of the screen session
$ irssi
# or
$ weechat-curses
# exit irc screen with CTRL+a, CTRL+d
# exit ssh session with CTRL+d or 'exit'
# to get back to irc:
$ ssh <username>@<preferred shell host>
$ screen -dr IRC
In the IRC client run these commands
/connect irc.freenode.net
/nick <myawesomenickname>
/msg nickserv register <password> <email>
/nick <myawesomenickname>
/msg nickserv identify <password>
/join #devopsbootcamp
Tab-completion works with nicks
You get a hi-light when your name is said.
Symbols (@, +) are not part of names, show status in channel.
chanserv and nickserv are robots.
- /msg nickserv help to get nick help.
- /msg chanserv help to get channel help.
It’s okay to ask for help. Here are some things to keep in mind:
Contributions = expertise + time
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
VCS is how one tracks changes, modifications, and updates to source files over time. Creating a history of changes for a project over time.
Git is a Free and Open Source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. ( https://git-scm.com )
$ sudo yum install git
$ git config --global user.name "My Name"
$ git config --global user.email "myself@gmail.com"
$ git config --global core.editor "nano"
Create a project with Git:
$ mkdir my-project
$ cd my-project # Always run `git init` inside of a project folder!
$ git init # Never inside of your home directory.
Add and commit a file to your project with Git:
$ touch newfile.txt
$ git add newfile.txt
$ git commit # Edit message in Nano, save the file, exit to commit.
To see which files are staged, unstaged, or untracked:
$ git status
To look through your repository history:
$ git log
To create and checkout a branch:
$ git branch # Shows your branches and current branch
* master
$ git checkout -b <new-branch> # Switches to new branch `<branch name>`
$ git branch
master
* new-branch
$ git checkout master # Switches to existing branch `<branch name>`
Everybody uses VCS differently. Choose the workflow that works best for everybody involved.
$ cd /path/to/my/projects
$ git clone <some git url>
$ cd <new repo directory>
$ ls
$ git clone https://github.com/DevOpsBootcamp/tinsy-flask-app.git
See http://git.io/vcVmB for more details about the tinsy-flask-app repository.
$ cd tiny-flask-app
$ virtualenv venv
$ pip install -r requirements.txt
$ python script.py
Now if you go to <your ip address>:<http port> in your web-browser to see a live version of the app!
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
Programming is a big topic.
function f(x):
# This line is a comment, not run by the computer.
# Comments are only for human eyes.
if x is less than than 5
print "x is less than 5"
else if x is less than than 10
print "x is greater than five and less than 10"
else
print "x is greater than 10"
>>> x = "value"
>>> print(x)
value
>>> x = "different value"
>>> print(x)
different value
Data types dictate how a piece of data should be handled within a program.
Flow Control allows you to execute code only if certain conditions are met.
Conditionals are used to tell the program when to execute commands.
In pseudocode, they usually look something like
if some conditional statement is true
do something
else if some other conditional
do something else
else
do a final thing
Loops are used to do multiple things, usually an indefinite number of things.
For instance:
for every element, let's call it "foo", in a list "my_list"
if foo is greater than five
print(foo)
else
print(foo + " is too small")
While loops execute indefinitely (while something continues to be true).
For loops iterate over a list (array) of elements or to a specific number.
>>> user_input = get_input("Where would you like to go today? ")
>>> -> Where would you like to go today? Nebraska
>>> print(user_input)
>>> -> nebraska
>>> print(reverse(nebraska))
>>> -> aksarben
function read_file(x):
# Also check that it exists! How convenient!
if file_exists(x)
v = read_file_to_string(x)
return v
else
print("file does not exist")
return Null
struct dog {
breed: String
height: Float
color: String
age: Integer
}
spot = struct dog # Create a new variable of type `struct dog`
spot.breed = "corgie" # Assign each member a variable.
spot.height = 1.5
spot.color = "Blond"
spot.age = 1
print(spot.breed, spot.height, spot.color, spot.age)
class chair():
function init(material):
self.material = material
function rock():
print("The ", self.material, " chair rocks slowly.")
>>> my_chair = chair.init("plastic")
>>> my_chair.rock()
>>> -> The plastic chair rocks slowly.
import math_lib
print(math_lib.pi, math_lib.pow(2, 5), math_lib.tan(79.3))
# prints out "3.14 32 .951"
$ sudo <apt or yum> install python
Type | Example |
boolean | True |
integer | 7 |
long | 18,446,744,073,709,551,615 |
float | 12.4 |
string | "Hello World!" |
list | ['first', 'second'] |
dict (map) | {'key1': 'value', 'key2', 'value2'} |
tuple | ('value','paired value') |
object | anObjects.variable == <value> |
None |
# This is a comment
boolean = True # boolean
name = "Lucy" # string
age = 20 # integer
pi = 3.14159 # float
alphabet = ['a', 'b', 'c']
dictionary = {"pi":3.14159, "sqrt 1":1}
winter = ('December', 'January', 'February', 'March')
print(name + " is " + str(age+1) + " this " winter[3])
Open a REPL (Read Evaluate Print Loop):
$ python
>>> print("I'm in a REPL!")
>>> name = # <Your name>
>>> age = # <Your age>
>>> print(name + " is " + str(age))
>>> # We need to convert age from int to string so it can print!
if name == "Lucy":
for month in winter:
print name + " doesn't like " + month
else:
print "My name isn't Lucy!"
There are a few ways to use other code in your code:
from math import pi
x = pi
from math import *
x = pi
There are hundreds of Python libraries. If you’re trying to do something and think “This has probably been solved...”, Google it!
Some libraries to know:
$ sudo apt-get install python-virtualenv
$ sudo yum install
# In each project you work on, you'll want to run
$ virtualenv venv
$ source venv/bin/activate
(venv)$ pip install <package>
(venv)$ deactivate
Formalize the last TODO by writing them in Python.
Prove the program works by running the code!
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
To take care of the boring stuff.
Use a framework if you are making a cookie cutter application.
If a framework exists for what you’re doing, consider using it.
There are two types of websites: Static and Dynamic.
app.route('/delete', delete_account)
def delete_account():
if username was passed in the query parameters
and password was passed in the query parameters
and the user is in the database
and passed password is correct
database.remove_user(username)
return success
else
return failure
data = {"animal": "Cat", "number": 5}
template.render("You have {{ number }} {{ animal}}s! That's crazy.", data)
You have 5 cats! That's crazy.
Read the documentation on Flask, a simple Python Web-Framework and build a simple “Display the Time in each Timezone” Application.
When a user goes to our website they will see the server’s time and when they go to app-url/<timezone code> they will see the timezone in that area of the world.( http://flask.pocoo.org )
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
def add_double(x, y):
return 2*(x+y)
def test_add_double():
expect(add_double(1, 2) == 6)
Most test are consist of the same general structure:
Simulating behavior external to a program so your tests can run independently of other platforms.
You’re testing your program, not somebody else’s. Mock other people’s stuff, not your own.
$ run tests
Finding tests...
Running tests in tests/foo.ext
Running tests in tests/bar.ext
Running tests in misc/test_baz.ext
While you can write tests the hard way:
var = some_function(x)
if var == expected_output:
continue
else
print("Test X failed!")
$ run test
Test 5 failed!
It’s usually easier to use a framework.
def simple_test():
expect(some_function(x), expected_output)
$ run tests
....x.....
Test 5 failed.
Debug information:
...
def tests_setup():
connect to database
populate database with test data
def tests_teardown():
delete all data from test database
disconnect from database
def some_test()
setup is called automaically
use data in database
asset something is true
teardown is run automatically
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
Runs test suites for:
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
- se·cu·ri·ty ( siˈkyo͝oritē/ ) [ noun ]
The state of being free from danger or threat.
The safety of a state or organization against criminal activity such as terrorism, theft, or espionage.
Threat models allow you to focus and limit your security resources on what is necessary instead of what is possible.
<img src="http://example.com/?action="Delete All Accounts"
If you think you encountered a bug, make sure you can replicate it. If you can’t how can you expect the developers to recreate it?
Provide examples – it’s basically a bug report, but through private channels (not public tracker yet!)
Google waits 90 days to announce a bug after informing the developers.
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
Imagine a kitchen cupboard program that stores food currently in stock, where it is, recipes using it, expiration dates, etc.
<Table 1>
+---------------+-----------+-----------+
| <Primary key> | <Field 1> | <Field 2> |
+---------------+-----------+-----------+
| 1 | value | value` |
| ... | ... | ... |
+---------------+-----------+-----------+
<Table 2>
+---------------+-----------+--------------------------+
| <Primary key> | <Field 1> | <Foreign key to Table 1> |
+---------------+-----------+--------------------------+
| 1 | val | 7 |
| ... | ... | ... |
+---------------+-----------+--------------------------+
When you have to work with a lot of well structured data.
There are two broad types of databases.
CREATE TABLE nobel (
id int(11)
NOT NULL
AUTO_INCREMENT,
yr int(11),
subject varchar(15),
winner varchar(50)
)
ENGINE = InnoDB;
Craft a query to get the following data out of our Nobel table:
Don’t worry about getting it exactly right! Craft pseudo-SQL!
SELECT winner FROM nobel
WHERE yr=1952 AND subject='medicine'; #(Selman A. Wksman)
SELECT * FROM nobel
WHERE yr=1903 AND subject='physics'; #(3)
SELECT * FROM nobel
WHERE winner='Linus Pauling'; #(2)
SELECT COUNT(*) FROM nobel
AS n0 INNER JOIN nobel AS n1 on n0.winner=n1.winner
AND (n0.yr!=n1.1 or n0.subject!=n1.subject); #(16)
# Install mysql -- hit 'enter' to name your user root, and then enter
# again for password
$ sudo yum install mysql-server
$ sudo service mysqld start # Start the service
$ mysql_secure_installation # Use this to set the root password
# There is no current password
# Hit 'yes' or 'y' for all options
# Add a sensible password which you will remember
# DO NOT MAKE IT YOUR USUAL PASSWORD.
$ sudo service mysqld status # Make sure service is running
$ mysqladmin -u root -p ping # Ping the database
$ mysqladmin -u root -p create nobel # Create a table for Nobel prizes
Login to the mysql shell with your root user credentials:
$ sudo mysql -p
mysql> CREATE USER 'me'@'localhost'
IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON nobel.*
TO 'me'@'localhost'
WITH GRANT OPTION;
mysql> exit
# Get the database from the osl server
$ wget http://osl.io/nobel -O nobel.sql
# put the database in a file called nobel.sql
$ sudo mysql -p nobel < nobel.sql
# Open up mysql shell to execute queries
$ sudo mysql -p nobel
# List all the tables
SHOW TABLES;
# Print the layout of the database to the screen
DESCRIBE nobel;
#!/usr/bin/python
import MySQLdb
db = ("localhost","testuser","test123","nobel" )
cursor = db.cursor()
cursor.execute("SELECT subject, yr, winner FROM nobel WHERE yr = 1960")
data = cursor.fetchall()
for winner in data:
print "%s winner in %s: %s " % (winner[0], winner[1], winner[2])
db.close()
# SELECT * FROM nobel WHERE yr = 1960
for subject, yr, winner in session.query(Nobel).filter_by(yr=1960):
print "%s winner in %s: %s " % (subject, yr, winner)
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
(How to( find( the missing parenthesis)).
These tools look at your code files and never actually run the program.
Includes Linting and Type Checking.
Dynamic Code Analysis tools actually run your code and make verifications by watching how your program acts, where it fails, what it does in memory, and if your tests are adequate enough.
Includes Debuggers, Memory Profiling Tools, and Code Coverage.
$ valgrind ./tests/bin/lexer_tests
...
==6703== Conditional jump or move depends on uninitialised value(s)
...
==6703== by 0x4018C1: print_token (lexer.c:36)
==6703== by 0x4011F7: test_get_tok (lexer_tests.c:54)
==6703== by 0x4008CD: main (lexer_tests.c:8)
...
==6703== LEAK SUMMARY:
==6703== definitely lost: 192 bytes in 8 blocks
==6703== indirectly lost: 162 bytes in 10 blocks
$ python some_script.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in f
TypeError: unsupported operand type(s) for * : 'int' and 'NoneType'
src/times.js: line 407, col 20, Expected '{' and instead saw 'return'.
src/times.js: line 415, col 49, Missing semicolon.
src/times.js: line 407, col 58, 'error' is not defined.
The Linux kernel style guidelines are actually fun to read:
First off, I’d suggest printing out a copy of the GNU coding standards, and NOT read it. Burn them, it’s a great symbolic gesture.
NASA’s Jet Propulsion Laboratory style guidelines are very short and are concerned with automated tooling to do code analysis:
All loops shall have a statically determinable upper-bound on the maximum number of loop iterations.
Setup and enter the virtual environment.
$ virtualenv <virtualenv name>
New python executable in /path/to/<venv name>/bin/python
Installing setuptools, pip, wheel...
done.
$ soruce <venv name>/bin/activate
Install a package. This installs it in the current working directory and so does not ask for root permissions.
(<venv name>) $ pip install flask
[...]
To list all packages in the venv:
(<venv name>) $ pip freeze
click==6.6
Flask==0.11.1
itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.11
Deactivate (leave) the venv.
(<venv name>) $ deactivate
$
A Carbon Copy of the Production Environment(s)
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Use it for learning purposes at your own peril.
If you have any feedback, please fill out our General Feedback Survey.
The Domain Name System (DNS) translates human-readable URLs (devopsbootcamp.osuosl.org) into computer IP addresses (140.211.15.183).
It works by storing records in a distributed tree-like hierarchy. It was designed like this because it scales well.
Acronym | Name |
A, AAAA | IP Addresses |
MX | SMTP Mail Exchangers |
NS | Name Servers |
SOA | DNS Zone Authority |
PTR | Pointers for Reverse DNS Lookups |
CNAME | Domain Name Aliases |
The A record is used to map an IP address to a domain name. This is as close to a ‘regular’ record as you can get.
osuosl.org. 300 IN A 140.211.15.183
osuosl.org. 3600 IN MX 5 smtp3.osuosl.org.
osuosl.org. 3600 IN MX 5 smtp4.osuosl.org.
osuosl.org. 3600 IN MX 5 smtp1.osuosl.org.
osuosl.org. 3600 IN MX 5 smtp2.osuosl.org.
osuosl.org. 86258 IN NS ns1.auth.osuosl.org.
osuosl.org. 86258 IN NS ns2.auth.osuosl.org.
osuosl.org. 86258 IN NS ns3.auth.osuosl.org.
Tells you there is no answer to a query:
Host something.invalid.osuosl.org not found: 3(NXDOMAIN)
Some ISPs and others never serve NXDOMAINS, instead they point you at themselves.
$ dig ns .
;; ANSWER SECTION:
. 512297 IN NS i.root-servers.net.
. 512297 IN NS e.root-servers.net.
. 512297 IN NS d.root-servers.net.
. 512297 IN NS j.root-servers.net.
. 512297 IN NS b.root-servers.net.
. 512297 IN NS a.root-servers.net.
. 512297 IN NS f.root-servers.net.
. 512297 IN NS h.root-servers.net.
. 512297 IN NS g.root-servers.net.
. 512297 IN NS c.root-servers.net.
. 512297 IN NS m.root-servers.net.
. 512297 IN NS k.root-servers.net.
. 512297 IN NS l.root-servers.net.
First we query a NS record for .:
$ dig ns .
;; QUESTION SECTION:
;. IN NS
;; ANSWER SECTION:
. 518400 IN NS i.root-servers.net.
. 518400 IN NS a.root-servers.net.
. 518400 IN NS l.root-servers.net.
. 518400 IN NS f.root-servers.net.
. 518400 IN NS b.root-servers.net.
. 518400 IN NS d.root-servers.net.
. 518400 IN NS k.root-servers.net.
. 518400 IN NS g.root-servers.net.
. 518400 IN NS h.root-servers.net.
. 518400 IN NS m.root-servers.net.
. 518400 IN NS e.root-servers.net.
. 518400 IN NS c.root-servers.net.
. 518400 IN NS j.root-servers.net.
Next we query NS for org.:
$ dig ns com. @a.root-servers.net
;; QUESTION SECTION:
;org. IN NS
;; AUTHORITY SECTION:
org. 172800 IN NS a0.org.afilias-nst.info.
org. 172800 IN NS a2.org.afilias-nst.info.
org. 172800 IN NS b0.org.afilias-nst.org.
org. 172800 IN NS b2.org.afilias-nst.org.
org. 172800 IN NS c0.org.afilias-nst.info.
org. 172800 IN NS d0.org.afilias-nst.org.
;; ADDITIONAL SECTION:
a0.org.afilias-nst.info. 172800 IN A 199.19.56.1
a2.org.afilias-nst.info. 172800 IN A 199.249.112.1
b0.org.afilias-nst.org. 172800 IN A 199.19.54.1
b2.org.afilias-nst.org. 172800 IN A 199.249.120.1
<truncated>
Next we query NS for osuosl.org.:
$ dig ns osuosl.org. @199.19.56.1
;; QUESTION SECTION:
;osuosl.org. IN NS
;; AUTHORITY SECTION:
osuosl.org. 86400 IN NS ns3.auth.osuosl.org.
osuosl.org. 86400 IN NS ns2.auth.osuosl.org.
osuosl.org. 86400 IN NS ns1.auth.osuosl.org.
;; ADDITIONAL SECTION:
ns1.auth.osuosl.org. 86400 IN A 140.211.166.140
ns2.auth.osuosl.org. 86400 IN A 140.211.166.141
ns3.auth.osuosl.org. 86400 IN A 216.165.191.53
Next we query A for osuosl.org.:
$ dig a osuosl.org. @140.211.166.140
;; QUESTION SECTION:
;osuosl.org. IN A
;; ANSWER SECTION:
osuosl.org. 300 IN A 140.211.15.183
;; AUTHORITY SECTION:
osuosl.org. 86400 IN NS ns1.auth.osuosl.org.
osuosl.org. 86400 IN NS ns2.auth.osuosl.org.
osuosl.org. 86400 IN NS ns3.auth.osuosl.org.
;; ADDITIONAL SECTION:
ns1.auth.osuosl.org. 86400 IN A 140.211.166.140
ns2.auth.osuosl.org. 86400 IN A 140.211.166.141
ns3.auth.osuosl.org. 3600 IN A 216.165.191.53
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
“Configuration management is the process of standardizing resource configurations and enforcing their state across IT infrastructure in an automated yet agile manner.”
- Puppet Labs
user { 'audience':
ensure => present,
}
Infrastructure as code is the act of describing what you want your servers to look like once, and using that to provision many machines to look the same.
It turns pets into cattle. (more on this difference later)
[ Puppet Site ]
packages [nginx, python, vim]
state installed
update true
service nginx
state enabled
alert service myapp_daemon
package "apache" do
package_name "httpd"
action :install
end
service "apache" do
action [:enable, :start]
end
Note
Since chef uses Ruby you can do loops and other cool Ruby-isms in your configuration management. This can be a gift and a curse.
package { "apache":
name => "httpd",
ensure => present,
}
service { "apache":
name => "apache",
ensure => running,
enable => true,
require => Package["apache"],
}
Note
Since Puppet designed it’s own language for Configuration managent you are more limited in what you can express with Puppet, but this isn’t always a bad thing. It’s feature rich and can do pretty much anything Chef can.
- hosts: all
tasks:
- name: Install Apache
yum:
name: httpd
state: present
- name: Start Apache Service
service:
name: httpd
state: running
enabled: yes
Note
Ansible’s langauge is Yaml, which is basically JSON but easier to read and write. This is similar to Puppet in it limits the possible functionality, but again: these tools all achieve the same result, they just get there in different ways.
$ pip install ansible
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
[vm] # ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.6 110564 3164 ? Ss 2015 11:17 /lib/systemd/systemd --system --deserialize 15
root 2 0.0 0.0 0 0 ? S 2015 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 2015 3:55 [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S< 2015 0:00 [kworker/0:0H]
[... 120+ more lines ...]
[host] # ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 200328 5208 ? Ss Aug25 0:44 /sbin/init
root 2 0.0 0.0 0 0 ? S Aug25 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S Aug25 0:05 [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S< Aug25 0:00 [kworker/0:0H]
[... 240+ more lines ...]
$ ps aux # Lists all processes running on an OS
PID USER TIME COMMAND
1 root 0:00 sh
6 root 0:00 ps aux
Virtual Machines | Containers |
Complete process isolation | Fast startup |
‘Battle Tested’ | Little overhead |
Virtual Machines | Containers |
Slightly more overhead. | Security concerns. |
Slow startup. | No cross-kernel emulation. |
Cross-OS emulation. |
Virtual Machines | Containers |
VirtualBox | Docker |
VMWare | Rkt |
An Open Source VM Manager.
Widely used and supported on Linux, Mac, and Windows.
A closed source VM Manager.
VMWare is a widely used and tends to have better performance than Virtual Box. While it can emulate Linux it does not work natively on Linux.
The Kernel-based Virtual Machine.
Linux’s native infrastructure for handling Virtual Machines and emulation. Usually used in a larger emulation program, not alone.
The defacto CLI tool for creating and using containers.
Very popular and well integrated into other tools.
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
[...] a model for enabling ubiquitous, on-demand access to a shared pool of configurable computing resources.
Homepage | Content | Slides | Video |
Warning
This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.
Share the Love (and the Code)
In order of perceived usefulness:
That’s okay.
Sometimes you find the project, sometimes the project finds you.
Find a project
Read Contributing and Getting Started docs
Look at list of issues
Do a thing!
- Write a test
- Fix a typo
- Deploy and update the installation docs
DevOps is a hybrid of skills from both Software Development (Dev) and Computer Operations (Ops) intended to meet the unique demands of cloud computing. Software Developer and Systems Administrator are no longer mutually exclusive job titles. Devs need more Ops knowledge to understand how their application will run in the real world. Admins need more Dev knowledge to design infrastructure that fit an app’s needs efficiently and effectively. To top it off site reliability engineers and many modern security roles require at least a little background in both development and operations.
DevOps BootCamp is an OSU Open Source Lab program dedicated to teaching core software development and systems operation skills. The program is free and open to any interested OSU students, community member, and online go-getter. DevOps BootCamp provides a comprehensive Open Source education that is outside the scope of regular Linux Users Group meetings and OSU Coursework.
Our goal is to make the DevOps BootCamp program accessible to students and community members from all backgrounds. Students should:
Attendance is not mandatory but highly suggested to get the most out of DBOC; We will not spend class time reviewing material for those who skip a lecture and each classes curriculum will build on what you learned the previous session. All curriculum will be available online before and after class sessions to get caught up.
BootCamp mentors will be available at scheduled times outside of regular classes to help answer any questions about the training program’s content. If you attend a lesson and don’t understand something then you are encouraged to ask that question during the meeting since others are likely have the same question.
As the course progresses, you will need a laptop. We hope and recommend that you decide to set up your laptop to dual-boot to Linux as the course progresses, but it is not required. If you don’t own a laptop and are an OSU student you can check out a laptop from the OSU Library for at least 24 hours at a time.
As long as your laptop is new enough to boot from USB and connect to a wireless network the exact specifications do not matter. You will be provided with a remote virtual machine with which to do all class projects.
If you are not an OSU student and do not have access to a working laptop, contact the DevOps BootCamp (email devopsbootcamp) organizers and they will see whether one can be loaned out to you.
Join the mailing list for updates.
Join us on irc.freenode.net in #devopsbootcamp (students will be setting up an IRC network for the program early in the program).
If you’d like to help edit this site, email devopsbootcamp or ping anyone in #devopsbootcamp on Freenode with your GitHub username to get access to the web site repo. You’ll also want to learn the ReStructured Text markup language to edit the site, if you don’t already know it.
The DevOps BootCamp content is available for free but meet-space guided lectures are offered throughout the year. Check the schedule below for our in-person lectures; each lecture covers a different part of the curriculum covering the entire course during the OSU academic school year.
Warning
If you are working ahead be aware that the schedule and slides may be subject to change. Check back regularly.
Lesson | Date/Time | Location | Description |
DevOps Daycamp | Oct 1, 10am-3pm | OSU KEC 1001 | DevOps DayCamp (DOBC Kickoff) |
Fall Meeting 2 | Nov 5, 11am-3pm | OSU KEC 1001 | Files, Verson Control, Programming |
Fall Meeting 3 | Dec 3, 11am-3pm | OSU KEC 1001 | Frameworks, Testing and CI |
Lesson | Date/Time | Location | Description |
Lesson | Date/Time | Location | Description |
If you’re reading this it means you’re interested in running DOBC yourself. It may have been passed on to you, or you may just like the curriculum and want to use it to start your own DOBC. Either way, thank you for reading this!
This page is a growing checklist, warning, notes, and fables from those teaching and contributing to DOBC. If you read this, heed it’s warnings and take it’s lessons to heart you will no doubt be on your way to success.
As a lecturer you won’t always teach perfectly. You won’t get it perfect the first, second, third, or even last time – but you should always strive for perfection.
Take notes on what could have gone better, questions that were asked, and confusions students had. The DOBC curriculum can be very dense and sometimes it skims over important stuff. During each lesson be sure to improve the curriculum based on your notes. Whoever teaches it next time will thank you.