Skip to content

Commit

Permalink
cleanups for docker admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Hirschfeld committed Feb 28, 2014
1 parent 970984c commit cffc2b2
Show file tree
Hide file tree
Showing 11 changed files with 184 additions and 50 deletions.
6 changes: 1 addition & 5 deletions barclamps/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@ roles:
description: 'The global set of interface maps that should be used to figure out nic ordering.'
map: 'crowbar/interface_map'
# there are more roles BUT they are dynamically created

attribs:
- name: 'nics'
description: 'Ethernet Interface Ports'
map: 'ohai/crowbar_ohai/detected/network'
- name: 'switches'
description: 'Connected Networking Switches'
map: 'ohai/crowbar_ohai/switch_config'

- name: 'hint-admin-mac'
description: 'Hint for Admin MAC address'
map: 'admin_mac'
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Subsystem sftp /usr/lib/openssh/sftp-server
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
UsePAM no

# Do not use DNS
UseDNS no
3 changes: 3 additions & 0 deletions chef/cookbooks/kernel-panic/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# if docker, everything is cool. don't worry
return if node[:crowbar_ohai][:in_docker]

# Tell the kernel to reboot after 10 seconds on panic, if we want it to.
if node["panic"] and node["panic"]["reboot"] == true
if node["panic"]["timeout"]
Expand Down
112 changes: 112 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
_Autogenerated, do not edit!_
#OpenCrowbar Documentation Index

1. [Index](./Index.md)
1. [OpenCrowbar Directory Structure](./OpenCrowbar-DirectoryLayout.md)
1. [Deploy Guide](./deployment-guide/README.md)
1. [OpenCrowbar RPM Deployment on CentOS 6.5](./deployment-guide/Install-CentOS-RHEL-6.5-AdminNode.md)
1. [OpenCrowbar Developers' Guide](./development-guides/README.md)
1. [translation missing: en.docs.missing](./development-guides/api/README.md)
1. [OpenCrowbar API](./development-guides/api/api.md)
1. [Attribute (aka Attrib) APIs](./development-guides/api/attrib.md)
1. [Barclamp APIs](./development-guides/api/barclamp.md)
1. [Logging Barclamp API extensions](./development-guides/api/barclamp_logging.md)
1. [CMDB APIs](./development-guides/api/cmdb.md)
1. [Barclamp/Config APIs](./development-guides/api/deployment.md)
1. [Deployment-Role API](./development-guides/api/deployment_role.md)
1. [DHCP Database](./development-guides/api/dhcp_database.md)
1. [Group APIs](./development-guides/api/group.md)
1. [Interface (NICs) API](./development-guides/api/interfaces.md)
1. [Jig (aka CMDB interface) APIs](./development-guides/api/jig.md)
1. [Network API](./development-guides/api/network.md)
1. [Node APIs](./development-guides/api/node.md)
1. [Node Role APIs](./development-guides/api/node_role.md)
1. [Range API](./development-guides/api/range.md)
1. [Role APIs](./development-guides/api/role.md)
1. [Run APIs](./development-guides/api/run.md)
1. [Snapshot API](./development-guides/api/snapshot.md)
1. [Status APIs](./development-guides/api/status.md)
1. [Test APIs](./development-guides/api/test.md)
1. [translation missing: en.docs.missing](./development-guides/barclamps/README.md)
1. [Crowbar Barclamps](./development-guides/barclamps/barclamps.md)
1. [OpenCrowbar Suite Barclamps](./development-guides/barclamps/crowbar.md)
1. [OpenCrowbar Barclamp](./development-guides/barclamps/crowbar/barclamp.md)
1. [Deployer Barclamp](./development-guides/barclamps/crowbar/deployer.md)
1. [DNS Barclamp](./development-guides/barclamps/crowbar/dns.md)
1. [Logging Barclamp](./development-guides/barclamps/crowbar/logging.md)
1. [Network Barclamp](./development-guides/barclamps/crowbar/network.md)
1. [NTP Barclamp](./development-guides/barclamps/crowbar/ntp.md)
1. [Test Barclamp](./development-guides/barclamps/crowbar/test.md)
1. [Creating a New OpenCrowbar Barclamp](./development-guides/barclamps/new_barclamp.md)
1. [NOT UPDATED >>> Barclamp Info](./development-guides/barclamps/wrong_name.md)
1. [translation missing: en.docs.missing](./development-guides/code-contribution/README.md)
1. [Contributing to OpenCrowbar](./development-guides/code-contribution/contributing.md)
1. [translation missing: en.docs.missing](./development-guides/concepts/README.md)
1. [Core OCB Objects Design Information](./development-guides/concepts/OCB-DesignInfo.md)
1. [OpenCrowbar Concepts](./development-guides/concepts/concepts.md)
1. [translation missing: en.docs.missing](./development-guides/database/README.md)
1. [OpenCrowbar Database (Postgresql 9.3)](./development-guides/database/database.md)
1. [translation missing: en.docs.missing](./development-guides/dev-systems/README.md)
1. [openSUSE images <== This info is not current -- FixMe](./development-guides/dev-systems/dev-openSUSE-images.md)
1. [Configuration Guide - Ubuntu 12.04.03](./development-guides/dev-systems/dev-ubuntu-12.04.03.md)
1. [Crowbar Development Environment Using Fedora](./development-guides/dev-systems/dev-vm-Fedora.md)
1. [Crowbar Development Based Upon SUSE](./development-guides/dev-systems/dev-vm-SUSE.md)
1. [OpenCrowbar Development Environment Based Upon Ubuntu](./development-guides/dev-systems/dev-vm-Ubuntu.md)
1. [Getting started with Crowbar development](./development-guides/dev-systems/dev-vm.md)
1. [Docker Workload Containers](./development-guides/dev-systems/docker/README.md)
1. [translation missing: en.docs.missing](./development-guides/doc-format-guides/README.md)
1. [Adding Documentation](./development-guides/doc-format-guides/doc-dev-guide.md)
1. [Formatting Documentation](./development-guides/doc-format-guides/formatting.md)
1. [Topic Documentation](./development-guides/doc-format-guides/topic.md)
1. [translation missing: en.docs.missing](./development-guides/jigs/README.md)
1. [Chef Jig](./development-guides/jigs/chef.md)
1. [Configuration Managers (aka Jigs)](./development-guides/jigs/jigs.md)
1. [Noop Jig](./development-guides/jigs/noop.md)
1. [Script Jig](./development-guides/jigs/script.md)
1. [translation missing: en.docs.missing](./development-guides/model/README.md)
1. [OpenCrowbar Design Topics](./development-guides/model/00100_CB2_Design_Topics.md)
1. [Attrib Model](./development-guides/model/attrib.md)
1. [Barclamp Model](./development-guides/model/barclamp.md)
1. [Experimental OpenCrowbar Model](./development-guides/model/crowbar_model.md)
1. [Deployment Model](./development-guides/model/deployment.md)
1. [Deployment Role Model](./development-guides/model/deployment_role.md)
1. [Group Model](./development-guides/model/group.md)
1. [OpenCrowbar Data Models](./development-guides/model/model.md)
1. [Node Model](./development-guides/model/node.md)
1. [Node Role Model](./development-guides/model/node_role.md)
1. [Role Model](./development-guides/model/role.md)
1. [Run / Delayed Job](./development-guides/model/run.md)
1. [Snapshot Model](./development-guides/model/snapshot.md)
1. [User Model](./development-guides/model/user.md)
1. [translation missing: en.docs.missing](./development-guides/testing/README.md)
1. [BDD Testing](./development-guides/testing/bdd.md)
1. [BDD Domain Specific Language (DSL)](./development-guides/testing/bdd/dsl.md)
1. [BDD Internals](./development-guides/testing/bdd/internals.md)
1. [What are the BDD *rats?](./development-guides/testing/bdd/rats.md)
1. [Extending the DSL](./development-guides/testing/bdd/steps.md)
1. [BDD testing RESTful APIs](./development-guides/testing/bdd/steps_rest.md)
1. [BDD Tips and Tricks](./development-guides/testing/bdd/tips.md)
1. [OpenCrowbar Environment Simulator](./development-guides/testing/simulator.md)
1. [translation missing: en.docs.missing](./development-guides/training/README.md)
1. [OpenCrowbar Video Library](./development-guides/training/videos.md)
1. [translation missing: en.docs.missing](./development-guides/ui/README.md)
1. [Adding Localizations (i18n)](./development-guides/ui/localization.md)
1. [Adding Menu Items](./development-guides/ui/navigation.md)
1. [Tips & Tricks (UI Developer)](./development-guides/ui/tips_and_tricks.md)
1. [translation missing: en.docs.missing](./development-guides/workflow/README.md)
1. [Workflow Overview](./development-guides/workflow/dev-workflow-overview.md)
1. [Interact with Chef](./development-guides/workflow/knife-config.md)
1. [translation missing: en.docs.missing](./faq/README.md)
1. [Do you have a question?](./faq/do_you_have_a_question.md)
1. [Frequently Asked Questions (FAQ)](./faq/faq.md)
1. [translation missing: en.docs.missing](./licenses/README.md)
1. [Crowbar Framework Licenses](./licenses/crowbar.md)
1. [Deployer Barclamp Licenses](./licenses/crowbar/deployer.md)
1. [DNS Barclamp Licenses](./licenses/crowbar/dns.md)
1. [Crowbar Barclamp Licenses](./licenses/crowbar/licenses.md)
1. [Logging Barclamp Licenses](./licenses/crowbar/logging.md)
1. [Network Barclamp Licenses](./licenses/crowbar/network.md)
1. [Deployer Barclamp Licenses](./licenses/crowbar/ntp.md)
1. [Provisioner Barclamp Licenses](./licenses/crowbar/provisioner.md)
1. [Test Barclamp Licenses](./licenses/crowbar/test.md)
1. [NOT UPDATED >>> Licenses](./licenses/wrong_name.md)
2 changes: 1 addition & 1 deletion doc/development-guides/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenCrowbar Developers' Guide
# Development Guide

Welcome to the amazing fuzziness of OpenCrowbar!

Expand Down
24 changes: 24 additions & 0 deletions doc/development-guides/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
##Contributing Code

###Fork The Code

> we assume you already have a clone of `https://github.com/opencrowbar/core`
1. create a personal fork of the `https://github.com/opencrowbar/core`
1. Fork the code if you want to be able to submit changes
1. You may want to rename your fork in Github to something like 'crowbar-core' to make it easier to track. We'll assume that you did that in these directions
1. setup your git identity (one time only)
1. `git config --global user.name "user.name"`
1. `git config --global user.email "email.address"`
1. add a personal remote: `git remote add personal `https://github.com/[yourgitnamehere]/[crowbar-core]`
1. you can check your remotes using `git remote -v`

##To create a pull request

1. make your change and commit it: `git commit -a -m "I cut and pasted this"`
1. get the latest code from origin: `git fetch`
1. sync your code into the trunk: `git rebase`
1. you may have to merge changes using `git add [file]= and =git rebase --continue--`
1. run and pass all the BDD tests, [[link missing]]
1. push your change to your personal repo in a branch: `git push personal master:[my-pull-request-branch]`
1. from your Github fork UI, create a pull request from my-pull-request-branch
59 changes: 30 additions & 29 deletions doc/development-guides/dev-systems/dev-ubuntu-12.04.03.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#Configuration Guide - Ubuntu 12.04.03
# Configuration Guide - Ubuntu 12.04.03

Engineers value documentation that explains how to get a development workstation configured quickly. It is human nature to customize and change things - we do this frequently, but sometimes we need to get back to first base. This document will help to get you there.

##Installation and Configuration Information

> Note to reader, many of these steps are generic and should be moved to a higher level document.
> An attempt has been made to pre-stage downloads so several steps can be done in parallel
###Base OS Installed
1. VirtualBox, TWO network interfaces
1. bridge external (assumed to be on eth0)
Expand All @@ -14,31 +18,42 @@ Engineers value documentation that explains how to get a development workstation
1. make sure that you allow NON local hosts to use the proxy (in =/etc/cntlm.conf= set `gateway yes`)! Containers are not "local" and require your CNTLM proxy to act as a gateway.
1. SAMBA share: `sudo apt-get install samba`
1. Passwordless sudo: `sudo sed -ie "s/%sudo\tALL=(ALL:ALL) ALL/%sudo ALL=(ALL) NOPASSWD: ALL/g" /etc/sudoers`
1. Prep for docker
1. Prep for Docker
1. Review [http://docs.docker.io/en/latest/installation/ubuntulinux/]
* Using the recommended curl script is the easiest way to install docker
* DO NOT TEST docker until you follow the steps below!
1. `apt-get install git`
1. allow docker without sudo: =sudo usermod -a -G docker crowbar=
1. allow docker without sudo: `sudo usermod -a -G docker crowbar`
1. we recommend changing from AUFS to Device Mapper for storage (slower but more native)
1. `sudo vi /etc/default/docker`
1. add `DOCKER_OPTS="-s devicemapper"`
1. while you are here, you may want to set your proxy server
1. while you are here, you may want to set your proxy server (the #default is for CNTLM)
1. you'll need to reboot for this setting to take effect
1. prep for sledgehammer requirements: =sudo apt-get install rpm rpm2cpio=
1. time saving tip:
1. preload the with `docker pull opencrowbar/centos:6.5-4`
1. test docker, use `docker run -i -t centos /bin/bash`
1. prep for sledgehammer requirements: `sudo apt-get install rpm rpm2cpio`

###Position Boot Assets, see [[docker/Docker-TLDR]]
1. Copy the ISOs that you want for nodes to `$HOME/.cache/opencrowbar/tftpboot/isos`

###Checkout Code
1. create a personal fork of the `https://github.com/opencrowbar/core`
1. Fork the Code if you want to be able to submit changes
1. `git clone https://github.com/opencrowbar/core`
1. setup your git identity (one time only)
1. `git config --global user.name "user.name"`
1. `git config --global user.email "email.address"`
1. add a personal remote: =git remote add personal `https://github.com/[yourgitnamehere]/core`
1. get git: `sudo apt-get install git`
1. get the code: `git clone https://github.com/opencrowbar/core`
1. if you want to commit, please review [[..contributing.md]]

###Build Sledgehammer (do 1 time, but takes a while)
1. from core, `tools/build_sledgehammer.sh`

###Setup Docker Admin Node
1. Enter the OpenCrowbar repo `cd core`
1. For UI simulator & testing: `./tools/docker_admin.sh centos ./development.sh`
1. For Workload creation: `./tools/docker_admin.sh centos ./production.sh admin.opencrowbar.com`
1. For Workload creation: `tools/docker-admin.sh centos ./production.sh admin.opencrowbar.com`
1. the first time will be SLOW because Crowbar creates PXE boot images; however, they are saved outside the container for next time.
1. To monitor the logs inside the container, use `tail -f /var/log/crowbar/production.log`
1. You'll need to put the Admin container on a network the VMs can access
1. `brctl addif docker0 eth1`
1. You'll need to create some nodes in VMs (or Containers) ...
1. Boot the nodes so Crowbar can discover and manage them
1. Helpful Docker Items
1. `docker ps` to see if you are running a container
1. `docker inspect [foo]` to get the IP address of the container so you can =ssh root@foo= into it
Expand All @@ -55,18 +70,4 @@ Engineers value documentation that explains how to get a development workstation
1. compile the BDD code
1. update the config file (copy example.config to default.config and update)
1. `erl` then `bdd:test()`
1. Production on VMs allows you to create workloads and jigs that can only be tested by
1. Start with `tools/docker-admin centos ./production.sh admin.opencrowbar.com`
1. To monitor the logs inside the container, use `tail -f /var/log/crowbar/production.log`
1. You'll need to put the Admin container on a network the VMs can access
1. `brctl addif docker0 eth1`
1. You'll need to create some nodes in VMs (or Containers) ...
1. Boot the nodes so Crowbar can discover and manage them

###To create a pull request
1. make your change and commit it: `git commit -a -m "helpful info"`
1. get the latest code from origin: `git fetch`
1. sync your code into the trunk: `git rebase`
1. you may have to merge changes using `git add [file]= and =git rebase --continue--`
1. push your change to your personal repo in a branch: `git push personal master:[my-pull-request-branch]`
1. from your Github fork UI, create a pull request from my-pull-request-branch
1. Rails console in container: ''
12 changes: 4 additions & 8 deletions rails/app/controllers/nodes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,15 @@ def create
:alive,
:available,
:bootenv))
unless hint.empty?
@node.hint = hint
@node.save!
n = Node.create! params

# deal w/ hint shortcuts (these are hardcoded but MUST match the imported Attrib list)
hint = JSON.parse(params[:hint] || "{}")
hint["network-admin"] = {"v4addr"=>params["ip"]} if params.has_key? :ip
hint["deployer-client"] = params["mac"] if params.has_key? :mac
if hint != {}
n.hint = hint
n.save!
unless hint.empty?
@node.hint = hint
@node.save!
end

render api_show @node
end

Expand Down
5 changes: 2 additions & 3 deletions rails/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
# since you don't have to restart the webserver when you make code changes.
Crowbar::Application.configure do
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true

# Show full error reports and disable caching
#config.action_controller.consider_all_requests_local = true
#config.action_view.debug_rjs = true
Expand All @@ -33,7 +32,7 @@
config.eager_load = false
# Enable threaded mode
# config.threadsafe! unless $rails_rake_task
config.log_level = :info
config.log_level = :debug
config.paths['log'] = "log/#{Rails.env}.log"

CROWBAR_VERSION = "v2.0-dev"
Expand Down
7 changes: 5 additions & 2 deletions rails/config/initializers/api_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2012, Dell
# Copyright 2012-4 Dell
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,4 +15,7 @@
#

require Rails.root.join('lib/api_helper.rb')
require Rails.root.join('lib/ip.rb')

unless File.exists?("../chef/cookbooks/barclamp/libraries")
require Rails.root.join('lib/ip.rb')
end
2 changes: 1 addition & 1 deletion rails/config/navigation.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013, Dell
# Copyright 2013-4, Dell
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down

0 comments on commit cffc2b2

Please sign in to comment.