Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update documentation & misc fixes #63

Merged
merged 36 commits into from

2 participants

@zehicle
Owner

This pull requests has several important components
1) tweaks to fix docker admin running on Ubuntu in a VM on Windows
2) documentation updates
3) small code cleanups related to BDD testing
4) fix to nav menu in development mode
5) minor cleanups in configuration to help with development mode

BDD not passing 100% yet, but soon.

Rob Hirschfeld added some commits
Rob Hirschfeld WIP working on DHCP hint
BDD tests 100%
f7d44c4
Rob Hirschfeld allow production to stop before final step 29699f6
Rob Hirschfeld move dev log back to rails/log for dev mode 085973a
Rob Hirschfeld ignore the new readme file index cd614ba
Rob Hirschfeld fix attrib for hint to pull from right place a939651
Rob Hirschfeld move hint-admin-mac to right location and map 7f0b017
Rob Hirschfeld fix typo b32a42f
Rob Hirschfeld fix map in BDD test 64bd432
Rob Hirschfeld match log location for dev a73fa21
Rob Hirschfeld queue status monitoring for BDD + docs 39f0a44
Rob Hirschfeld tweak names for version 970984c
Rob Hirschfeld cleanups for docker admin cffc2b2
Rob Hirschfeld add copyright db4f117
Rob Hirschfeld add copyrights 44ddc83
Rob Hirschfeld recognicile w/ docker install instructions aaae0c0
Rob Hirschfeld consolidate docs daadf03
Rob Hirschfeld docker admin working and documentation e06a15e
Rob Hirschfeld WIP working on DHCP hint
BDD tests 100%
06ce0d5
Rob Hirschfeld allow production to stop before final step ce3d09c
Rob Hirschfeld move dev log back to rails/log for dev mode b3b8f0d
Rob Hirschfeld ignore the new readme file index eb08786
Rob Hirschfeld fix attrib for hint to pull from right place 534fad4
Rob Hirschfeld move hint-admin-mac to right location and map 069e7a0
Rob Hirschfeld fix typo 9201b52
Rob Hirschfeld fix map in BDD test 00cf5af
Rob Hirschfeld match log location for dev 575d05a
Rob Hirschfeld queue status monitoring for BDD + docs 8e2d0cb
Rob Hirschfeld tweak names for version dbc5c20
Rob Hirschfeld cleanups for docker admin 44d2225
Rob Hirschfeld add copyright 9c3d96f
Rob Hirschfeld add copyrights b79c5bf
Rob Hirschfeld recognicile w/ docker install instructions bf19c8d
Rob Hirschfeld consolidate docs a212021
Rob Hirschfeld docker admin working and documentation 735d598
Rob Hirschfeld complete the instructions for the boot slaves in virtual box fc51dfb
Rob Hirschfeld merge resolve b1d61a9
@cloudsleuth

+2 - Merging. Good set of patches. Thanks.

@cloudsleuth cloudsleuth merged commit f19e50d into opencrowbar:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2014
  1. WIP working on DHCP hint

    Rob Hirschfeld authored
    BDD tests 100%
  2. allow production to stop before final step

    Rob Hirschfeld authored
  3. move dev log back to rails/log for dev mode

    Rob Hirschfeld authored
  4. ignore the new readme file index

    Rob Hirschfeld authored
  5. fix attrib for hint to pull from right place

    Rob Hirschfeld authored
  6. move hint-admin-mac to right location and map

    Rob Hirschfeld authored
  7. fix typo

    Rob Hirschfeld authored
  8. fix map in BDD test

    Rob Hirschfeld authored
  9. match log location for dev

    Rob Hirschfeld authored
  10. queue status monitoring for BDD + docs

    Rob Hirschfeld authored
  11. tweak names for version

    Rob Hirschfeld authored
Commits on Feb 28, 2014
  1. cleanups for docker admin

    Rob Hirschfeld authored
  2. add copyright

    Rob Hirschfeld authored
  3. add copyrights

    Rob Hirschfeld authored
  4. recognicile w/ docker install instructions

    Rob Hirschfeld authored
  5. consolidate docs

    Rob Hirschfeld authored
Commits on Mar 1, 2014
  1. docker admin working and documentation

    Rob Hirschfeld authored
  2. WIP working on DHCP hint

    Rob Hirschfeld authored
    BDD tests 100%
  3. allow production to stop before final step

    Rob Hirschfeld authored
  4. move dev log back to rails/log for dev mode

    Rob Hirschfeld authored
  5. ignore the new readme file index

    Rob Hirschfeld authored
  6. fix attrib for hint to pull from right place

    Rob Hirschfeld authored
  7. move hint-admin-mac to right location and map

    Rob Hirschfeld authored
  8. fix typo

    Rob Hirschfeld authored
  9. fix map in BDD test

    Rob Hirschfeld authored
  10. match log location for dev

    Rob Hirschfeld authored
  11. queue status monitoring for BDD + docs

    Rob Hirschfeld authored
  12. tweak names for version

    Rob Hirschfeld authored
  13. cleanups for docker admin

    Rob Hirschfeld authored
  14. add copyright

    Rob Hirschfeld authored
  15. add copyrights

    Rob Hirschfeld authored
  16. recognicile w/ docker install instructions

    Rob Hirschfeld authored
  17. consolidate docs

    Rob Hirschfeld authored
  18. docker admin working and documentation

    Rob Hirschfeld authored
  19. merge resolve

    Rob Hirschfeld authored
This page is out of date. Refresh to see the latest.
Showing with 647 additions and 204 deletions.
  1. +2 −0  .gitignore
  2. +8 −1 BDD/crowbar.erl
  3. +1 −1  BDD/dev.erl
  4. +2 −2 BDD/features/network_role.feature
  5. +2 −2 BDD/features/node.feature
  6. +1 −1  BDD/support.erl
  7. +20 −11 README.md
  8. +5 −0 barclamps/deployer.yml
  9. +1 −1  barclamps/network.yml
  10. +0 −4 barclamps/provisioner.yml
  11. +14 −0 bootstrap/cookbooks/crowbar-bootstrap/recipes/default.rb
  12. +14 −0 chef/cookbooks/kernel-panic/recipes/default.rb
  13. +114 −0 doc/README.md
  14. +1 −1  doc/development-guides/README.md
  15. +21 −28 doc/development-guides/api/status.md
  16. +24 −0 doc/development-guides/contributing.md
  17. +42 −0 doc/development-guides/dev-systems/README.md
  18. +2 −71 doc/development-guides/dev-systems/dev-ubuntu-12.04.03.md
  19. +99 −49 doc/development-guides/dev-systems/docker/docker-admin.md
  20. +186 −0 doc/development-guides/ui/role.md
  21. +30 −9 production.sh
  22. +1 −0  rails/app/controllers/barclamp_provisioner/dhcps_controller.rb
  23. +6 −5 rails/app/controllers/nodes_controller.rb
  24. +7 −0 rails/app/controllers/support_controller.rb
  25. +1 −1  rails/app/models/attrib.rb
  26. +2 −1  rails/app/models/barclamp_provisioner/dhcp_database.rb
  27. +2 −2 rails/app/models/doc.rb
  28. +1 −1  rails/app/models/nav.rb
  29. +4 −3 rails/app/views/layouts/application.html.haml
  30. +16 −1 rails/config/application.rb
  31. +6 −4 rails/config/environments/development.rb
  32. +1 −1  rails/config/environments/production.rb
  33. +5 −2 rails/config/initializers/api_helpers.rb
  34. +3 −2 rails/config/navigation.rb
  35. +3 −0  rails/config/routes.rb
View
2  .gitignore
@@ -10,6 +10,8 @@
/core/rails/coverage/
+/doc/README.md.new
+
/rails/tmp/
/rails/log/
/rails/coverage
View
9 BDD/crowbar.erl
@@ -24,6 +24,7 @@ g(Item) ->
i18n -> "utils/i18n";
version -> "v2";
test_node_path -> "api/test/nodes";
+ queue_status -> "api/status/queue";
cli -> bdd_utils:config(cli, "cd ../bin && ./crowbar");
bootenv -> node:g(bootenv);
natural_key -> name; % for most crowbar objects, this is the natural key. override if not
@@ -105,7 +106,13 @@ wait_for(URL, Match, Times, Sleep) ->
wait_for(URL, Match, Times-1, Sleep)
end.
-worker() -> bdd_clirat:step([], {foo, {0,0}, ["process", "delayed","returns", "delayed_job.([0..9])"]}).
+worker() ->
+ URL = eurl:uri(g(queue_status)),
+ R = eurl:get_http(URL),
+ case R#http.code of
+ 200 -> J = json:parse(R#http.data), list_to_integer(json:value(J,"workers")) > 0;
+ _ -> false
+ end.
% global setup
step(Global, {step_setup, {Scenario, _N}, Test}) ->
View
2  BDD/dev.erl
@@ -33,7 +33,7 @@ pop(ConfigRaw) ->
bdd_utils:config_set(inspect, false),
% make sure background progress
- true = bdd_clirat:step([], {foo, {0,0}, ["process", "delayed","returns", "delayed_job.([0..9])"]}),
+ true = crowbar:worker(),
% safety setup
bdd_crud:delete(node:g(path), crowbar:g(node_name)),
View
4 BDD/features/network_role.feature
@@ -6,7 +6,7 @@ Feature: Network Role
Given there is a {object:node} "bdd-hint-ip2.data.edu" hinted "ip" as "192.168.124.126"
And parameter "node" is "bdd-hint-ip2.data.edu"
And there are no pending Crowbar runs for {o:node} "bdd-hint-ip2.data.edu"
- When REST requests the "network/api/v2/networks/admin/allocations" page with parameter "node"
- Then Array matches "192\.168\.124\.126\/([0-9]{2})"
+ When REST requests the "api/v2/networks/admin/allocations" page with parameter "node"
+ Then Array matches "192.168.124.\\d{1,3}\/\\d{1,2}"
Finally there are no pending Crowbar runs for {o:node} "bdd-hint-ip2.data.edu"
And REST removes the {object:node} "bdd-hint-ip2.data.edu"
View
4 BDD/features/node.feature
@@ -154,7 +154,7 @@ Feature: Nodes
And there is a {object:node} "bdd-hint-ip3.data.edu" hinted
When REST gets the {object:node} "bdd-hint-ip3.data.edu"
Then key "hint" should have json "network-admin:v4addr" with value "192.168.124.124"
- And key "hint" should have json "provisioner-repos:admin_mac" with value "f1:f2:f3:f4:f5:f6"
+ And key "hint" should have json "admin_mac" with value "f1:f2:f3:f4:f5:f6"
Finally REST removes the {object:node} "bdd-hint-ip3.data.edu"
Scenario: Provisioner DHCP database uses hint about MAC address
@@ -166,6 +166,6 @@ Feature: Nodes
And there are no pending Crowbar runs for {o:node} "bdd-hint-ip4.data.edu"
When REST requests the "/api/v2/dhcp/bdd-hint-ip4.data.edu" page
Then Array key "mac_addresses" matches "f6:f5:f4:f3:f2:f1"
- And Array key "v4addr" matches "192\.168\.124\.127\/([0-9]{2})"
+ And Array key "v4addr" matches "192.168.124.\\d{1,3}\/\\d{1,2}"
Finally there are no pending Crowbar runs for {o:node} "bdd-hint-ip4.data.edu"
And REST removes the {object:node} "bdd-hint-ip4.data.edu"
View
2  BDD/support.erl
@@ -30,7 +30,7 @@ step(_Global, {step_given, {_Scenario, _N}, ["I set",user,"setting",Key,"to",Val
eurl:put_post(URI, "{}", put);
step(_Given, {step_when, {_Scenario, _N}, ["I inspect the logs for",Mark]}) ->
- Path = bdd_utils:config(marker_log, "/var/log/crowbar/development.log"),
+ Path = bdd_utils:config(marker_log, "../rails/log/development.log"),
step(_Given, {step_when, {_Scenario, _N}, ["I inspect the",Path,"for",Mark]});
step(_Given, {step_when, {_Scenario, _N}, ["I inspect the",Path,"for",Mark]}) ->
View
31 README.md
@@ -1,20 +1,29 @@
# Welcome to OpenCrowbar
-Welcome to the OpenCrowbar Project - the gateway to a new hardware provisioning experience that delivers the best of software deployment automation and orchestration. OpenCrowbar is a successor of the 3 year-old Crowbar project. It derives much of its functionality from its predecessor, but offers a lot more.
+Welcome to the OpenCrowbar Project - the gateway to a new hardware provisioning experience that delivers the best of software deployment automation and orchestration. OpenCrowbar is a successor of the 3 year-old & still active [Crowbar project](http://githib.com/crowbar). It derives much of its functionality from its predecessor, but offers a lot more.
-The principal motivation for creation of OpenCrowbar is the transition a from bare metal installer into a tool that manages ongoing operations. OpenCrowbar enables upgrade and continuous deployment automation. This capability is important for large scale deployments of evolving complex projects like OpenStack, Hadoop, and Ceph.
+## Getting Started & Documentation
-OpenCrowbar provides the foundation for operations automation. OpenCrowabr is an open reference implementation that can be reliably deployed in large-scale, multi-site datacenters. This effectively productizes best practices in a way that allows cration of consistent and discoverable operating environments. Users benefit with fast time-to-value and we benefit by having consistent installations across the ecosystem.
+Documentation close by and located in under the **/doc** directory of OpenCrowbar and for each workload module.
-## Benefits of OpenCrowbar
-OpenCrowbar reduces the cost of datacenter hardware infrastructure preparation. The immediate benefits of OpenCrowbar are realized in the deployment of complex compute and storage clusters. OpenCrowbar reduces the human resource cost of getting compute platform systems into productive use, automates continuous hardware redeployment, automates hypervisor, operating systems, and application layer software installation and management. All of these add up to significant gains in operational reliability, consistency, and concomitant reduction in defects handling costs.
+Please refer to the [/doc directories](/doc/Index.md) for detailed information. We attempt to define and maintain one sub-directory for each functional element. This structure is intended to be common across all workloads in the [OpenCrowbar project](https://github.com/opencrowbar/)
-## OpenCrowbar Documentation
-OpenCrowbar documentation is located in under the **/doc** directory of OpenCrowbar and for each OpenCrowbar workload module.
+> Please, do NOT add documentation in locations outside of the **/doc** directory trees! If necessary, expand this README to include pointers to important **/doc** information.
-Please refer to the [/doc directories](/doc/Index.md) for detailed information. The OpenCrowbar project attempts to define and maintain one sub-directory for each functional element. This structure is intended to be common across all OpenCrowbar workloads in the [Crowbar project](https://github.com/opencrowbar/)
+We've also made it easy to setup and run Crowbar using our [**Fast-Start with Docker**](/doc/development-guides/dev-systems/docker/Docker-TLDR.md) as a rapid-fire code/test/commit cycle tool. Read the [TL;DR](/doc/development-guides/dev-systems/docker/Docker-TLDR.md) document. For those seeking a detailed *_Good Oil(tm)_* document check [HERE](/doc/development-guides/dev-systems/docker/docker-admin.md)
-> Please, do NOT add documentation in locations outside of the **/doc** directory trees! If necessary, expand this README to include pointers to important **/doc** information.
+## Join Our Community
+
+* [Live Weekly Planning and Design Meetings](http://bit.ly/crowbar-calendar)
+* [Mailing List](http://bit.ly/crowbarlist)
+* #Crowabr IRC channel on Freenode
+
+## Exec Summary
-## Docker Information
-[**Fast-Start with Docker**](/doc/development-guides/dev-systems/docker/Docker-TLDR.md) as a rapid-fire code/test/commit cycle tool check the [TL;DR](/doc/development-guides/dev-systems/docker/Docker-TLDR.md) document. For those seeking a detailed *_Good Oil(tm)_* document check [HERE](/doc/development-guides/dev-systems/docker/docker-admin.md)
+The principal motivation for creation of OpenCrowbar is the transition a from bare metal installer into a tool that manages ongoing operations. OpenCrowbar enables upgrade and continuous deployment automation. This capability is important for large scale deployments of evolving complex projects like OpenStack, Hadoop, and Ceph.
+
+OpenCrowbar provides the foundation for operations automation. OpenCrowabr is an open reference implementation that can be reliably deployed in large-scale, multi-site datacenters. This effectively productizes best practices in a way that allows cration of consistent and discoverable operating environments. Users benefit with fast time-to-value and we benefit by having consistent installations across the ecosystem.
+
+## Benefits of OpenCrowbar
+
+OpenCrowbar reduces the cost of datacenter hardware infrastructure preparation. The immediate benefits of OpenCrowbar are realized in the deployment of complex compute and storage clusters. OpenCrowbar reduces the human resource cost of getting compute platform systems into productive use, automates continuous hardware redeployment, automates hypervisor, operating systems, and application layer software installation and management. All of these add up to significant gains in operational reliability, consistency, and concomitant reduction in defects handling costs.
View
5 barclamps/deployer.yml
@@ -22,4 +22,9 @@ roles:
jig: chef-solo
flags:
- implicit
+ attribs:
+ - name: 'hint-admin-mac'
+ description: 'Hint for Admin MAC address'
+ map: 'admin_mac'
+
View
2  barclamps/network.yml
@@ -25,7 +25,7 @@ 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'
View
4 barclamps/provisioner.yml
@@ -64,10 +64,6 @@ roles:
- provisioner-base-images
flags:
- implicit
- attribs:
- - name: 'hint-admin-mac'
- description: 'Hint for Admin MAC address'
- map: 'admin_mac'
wants-attribs:
- provisioner-package-repos
- name: provisioner-dhcp-server
View
14 bootstrap/cookbooks/crowbar-bootstrap/recipes/default.rb
@@ -3,6 +3,20 @@
# Recipe:: default
#
# Copyright (C) 2014 Dell, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
crowbar_yml = "/opt/opencrowbar/core/crowbar.yml"
unless File.exists?(crowbar_yml)
View
14 chef/cookbooks/kernel-panic/recipes/default.rb
@@ -1,3 +1,17 @@
+# 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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
# if docker, everything is cool. don't worry
return if node[:crowbar_ohai][:in_docker]
View
114 doc/README.md
@@ -0,0 +1,114 @@
+_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. [Development Guide](./development-guides/README.md)
+ 1. [Contributing Code](./development-guides/contributing.md)
+ 1. [ Development Guides Api Run.Md Topics](./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. [ Development Guides Barclamps Crowbar.Md Topics](./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. [ Development Guides Code Contribution Contributing.Md Topics](./development-guides/code-contribution/README.md)
+ 1. [Contributing to OpenCrowbar](./development-guides/code-contribution/contributing.md)
+ 1. [ Development Guides Concepts Concepts.Md Topics](./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. [ Development Guides Database Database.Md Topics](./development-guides/database/README.md)
+ 1. [OpenCrowbar Database (Postgresql 9.3)](./development-guides/database/database.md)
+ 1. [Dev System Configuration](./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. [ Development Guides Doc Format Guides Topic.Md Topics](./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. [ Development Guides Jigs Noop.Md Topics](./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. [ Development Guides Model Run.Md Topics](./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. [ Development Guides Testing Bdd.Md Topics](./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. [ Development Guides Training Videos.Md Topics](./development-guides/training/README.md)
+ 1. [OpenCrowbar Video Library](./development-guides/training/videos.md)
+ 1. [ Development Guides Ui Role.Md Topics](./development-guides/ui/README.md)
+ 1. [Adding Localizations (i18n)](./development-guides/ui/localization.md)
+ 1. [Adding Menu Items](./development-guides/ui/navigation.md)
+ 1. [Barclamp Roles - User Interface Development and Testing](./development-guides/ui/role.md)
+ 1. [Tips & Tricks (UI Developer)](./development-guides/ui/tips_and_tricks.md)
+ 1. [ Development Guides Workflow Knife Config.Md Topics](./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. [ Faq Faq.Md Topics](./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. [ Licenses Crowbar.Md Topics](./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)
View
2  doc/development-guides/README.md
@@ -1,4 +1,4 @@
-# OpenCrowbar Developers' Guide
+# Development Guide
Welcome to the amazing fuzziness of OpenCrowbar!
View
49 doc/development-guides/api/status.md
@@ -1,41 +1,34 @@
### Status APIs
-Status APIs are used to provide lists of objects in optimized formats.
+Status APIs are used to provide lists of objects in optimized formats. They do not have a release contract and should not be used for external APIs that are not tightly integrated to the code base
The general pattern for the Status API calls is:
-> `status/2.0/object/[:id]`
+> `api/status/object/[:id]`
+
+#### Queue Status
+
+Returns JSON for Annealer worker queue
+
+**Input:**
+
+| Verb | URL | Options | Returns | Comments |
+|:------|:-----------------------|--------|--------|:----------------|
+| GET |/api/status/queue |none | Number of Workers and List of Jobs | Used by BDD |
+
+**Output**
+
+ { workers:10, jobs:[] }
+
#### Node Status
-Returns JSON for node status. Includes hash of all nodes to help detect changes.
+Returns JSON for node status for AJAX calls. Includes hash of all nodes to help detect changes.
**Input:**
| Verb | URL | Options | Returns | Comments |
|:------|:-----------------------|--------|--------|:----------------|
-| GET |/status/2.0/node |none |All nodes |Used by Dashboard |
-| GET |/status/2.0/node/[id] |id is the node ID or name. Used by Node details |- |
-
-**Output:**
-
- {
- "state":{"1":null},
- "sum":-1881043387,
- "i18n":{"ready":"Ready"},
- "groups":{
- "0":{"failed":0,"ready":0,"building":0,"pending":0,"unready":1,"name":"all","unknown":0}
- },
- "count":1,
- "status":{"1":"unready"}
- }
-
-Details:
-
-* Format - json
-* i18n - the localized versions of the status strings for display.
-* state - ?
-* groups - ?
-* status - ?
-* count - ?
-* sum - Hashed value of the nodes included to identify state changes for refresh
+| GET |api/status/node |none |All nodes |Used by Dashboard |
+| GET |api/status/node/[id] |id is the node ID or name. Used by Node details |- |
+
View
24 doc/development-guides/contributing.md
@@ -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
View
42 doc/development-guides/dev-systems/README.md
@@ -0,0 +1,42 @@
+# Dev System Configuration
+
+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
+
+> 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)
+ 1. host-only on 192.168.124.x (assumed to be on eth1)
+ 1. Setup an .ssh keypair using `rssh-keygen`
+ 1. Optional Items that we find handy if you are developing on Windows using VMs behind corporate firewalls
+ 1. Squid Proxy (to cache packages)
+ 1. ubuntu: `sudo apt-get install squid squid-common`
+ 1. CNTLM proxy:
+ 1. ubuntu: `sudo apt-get install cntlm`
+ 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
+ 1. ubuntu: `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. `apt-get install git`
+
+###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. get git
+ 1. ubuntu: `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. prep for sledgehammer requirements:
+ 1. ubuntu: `sudo apt-get install rpm rpm2cpio`
+ 1. from core, `tools/build_sledgehammer.sh`
+ 1. warning: this may take multiple attempts to complete to downloads. Keep trying.
+
+###Setup Docker Admin Node
+ 1. follow steps in [docker/docker-admin.md]
+
View
73 doc/development-guides/dev-systems/dev-ubuntu-12.04.03.md
@@ -1,72 +1,3 @@
-#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
-
-###Base OS Installed
- 1. VirtualBox, TWO network interfaces
- 1. bridge external (assumed to be on eth0)
- 1. host-only on 192.168.124.x (assumed to be on eth1)
- 1. Setup an .ssh keypair using `rssh-keygen`
- 1. Optional Items that we find handy if you are developing on Windows using VMs behind corporate firewalls
- 1. CNTLM proxy: `sudo apt-get install cntlm`
- 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. Review [http://docs.docker.io/en/latest/installation/ubuntulinux/]
- * Using the recommended curl script is the easiest way to install docker
- 1. `apt-get install git`
- 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. you'll need to reboot for this setting to take effect
- 1. prep for sledgehammer requirements: =sudo apt-get install rpm rpm2cpio=
-
-###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`
-
-###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. 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
- 1. `docker kill [foo]` if you want to force stop the container from outside (=exit= works otherwise)
- 1. `docker tag [foo]` if you want to save the container for later use (experts only)
-
-###Testing your code
- 1. Dev/Simulator allows you to play with the UI and BDD tests which is good for developers working on the UI/API and Annealer logic
- 1. Start with `tools/docker-admin centos ./development.sh`
- 1. Dev mode creates a special user `developer/Cr0wbar!`
- 1. To monitor the logs inside the container, use `tail -f /var/log/crowbar/development.log`
- 1. Run the BDD system [see BDD test pages]
- 1. `sudo apt-get install erlang`
- 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
+This document content has been moved into [README.md] because it was not operating system specific.
View
148 doc/development-guides/dev-systems/docker/docker-admin.md
@@ -2,9 +2,14 @@
It is possible (and convienent) to run a OpenCrowbar admin node in a
CentOS 6.5 based Docker container. To do so, you need to be running
-in a development environment that can run Docker. Instructions for
-installing Docker on the most common Linux distributions are at
-http://docs.docker.io/en/latest/installation/
+in a development environment that can run Docker.
+
+### Install Docker
+
+Instructions for installing Docker on the most common Linux distributions are at
+[http://docs.docker.io/en/latest/installation/]
+
+> DO NOT TEST docker until you follow the steps below!
### Configure Docker in your development environment
@@ -16,41 +21,48 @@ container exposes.
On Ubuntu, edit `/etc/default/docker` and make the following changes:
-* Uncomment the line that starts with `DOCKER_OPTS`, and make it read
-`DOCKER_OPTS="-s devicemapper"`
-* If you need to have the Docker daemon talk through an http proxy,
-uncomment the line that starts with `export` and change the part after
-`http_proxy` to point at the http proxy you normally use.
+ * Uncomment the line that starts with `DOCKER_OPTS`, and make it read
+ `DOCKER_OPTS="-s devicemapper"`
+ * If you need to have the Docker daemon talk through an http proxy,
+ uncomment the line that starts with `export` and change the part after
+ `http_proxy` to point at the http proxy you normally use.
On CentOS 6.5, edit `/etc/sysconfig/docker`, and make the following
changes:
-* Change the line that starts with `other_args` to read
-`other_args="-s devicemapper"`.
-* Add a line that reads `export http_proxy="http://<your_http_proxy>"`
- if you need to have the Docker daemon talk through an http proxy.
-* If you need a proxy to talk https, add a similar line reading
-`export https_proxy="http://<your_https_proxy>"`
+ * Change the line that starts with `other_args` to read
+ `other_args="-s devicemapper"`.
+ * Add a line that reads `export http_proxy="http://<your_http_proxy>"`
+ if you need to have the Docker daemon talk through an http proxy.
+ * If you need a proxy to talk https, add a similar line reading
+ `export https_proxy="http://<your_https_proxy>"`
On OpenSuSE 13.1, Fedora 20, and other distributions that use systemd
as their init system, perform the following steps:
-1. Copy `/usr/lib/systemd/system/docker.service` to
-`/etc/systemd/system/docker.service`
-2. Edit `/etc/systemd/system/docker.service`, and make the following
-changes:
+ 1. Copy `/usr/lib/systemd/system/docker.service` to
+ `/etc/systemd/system/docker.service`
- * Change the line that starts with `ExecStart=` and append
- ` -s devicemapper` to the end of it.
- * If you need to have the Docker daemon talk through an http proxy,
- add the following line directly under the `[Service]` line:
+ 2. Edit `/etc/systemd/system/docker.service`, and make the following
+ changes:
+
+ * Change the line that starts with `ExecStart=` and append
+ ` -s devicemapper` to the end of it.
+ * If you need to have the Docker daemon talk through an http proxy,
+ add the following line directly under the `[Service]` line:
+
+ `Environment="http_proxy=http://<your_http_proxy>" "https_proxy=http://<your_http_proxy>"`
- `Environment="http_proxy=http://<your_http_proxy>" "https_proxy=http://<your_http_proxy>"`
+ 3. Reload the docker service configuration: `systemctl daemon-reload`
-3. Reload the docker service configuration: `systemctl daemon-reload`
+ After making the above changes. reboot or restart the Docker service (`sudo service docker restart`) for them to
+ take effect.
-After making the above changes. restart the Docker service for them to
-take effect.
+Time saving tips
+
+ * preload the with `docker pull opencrowbar/centos:6.5-4`
+ * test docker, use `docker run -i -t centos /bin/bash`
+ * a caching proxy server (e.g.: Squid) is highly recommended
### The docker-admin command and its environment
@@ -107,29 +119,33 @@ repository:
This will perform the following actions:
-* If needed, pull the latest opencrowbar/centos image from the public
-Docker repository.
-* Spawn the container with all the parameters needed to set up the
-environment as described above. The rest of the actions will take
-place in the spawned container.
-* Ensure that the UID and GIDs of crowbar user inside the container is
- the same as your UID and GID in the development environment.
-* Append your SSH public key to root's authorized_keys file.
-* Run `./bootstrap.sh`, which will ensure that ruby and chef-solo are
-installed, and then run the crowbar-bootstrap cookbook to converge the
-state of the container with our latest specifications.
-* Bring up the OpenCrowbar webserver.
-* Create a default admin network on the `192.168.124.0/24` address
-range.
-* Update the `provisioner-server` role template to use the passed-in
-http proxy, if any.
-* Update the `provisioner-os-install` role template to default to
-`centos-6.5`.
-* Create the admin node record.
-* Extract the addresses that were allocated to the admin node, and
-bind them to eth0.
-* Mark the admin node as alive, and converge the default set of admin
-noderoles.
+ * If needed, pull the latest opencrowbar/centos image from the public
+ Docker repository.
+ * Spawn the container with all the parameters needed to set up the
+ environment as described above. The rest of the actions will take
+ place in the spawned container.
+ * Ensure that the UID and GIDs of crowbar user inside the container is
+ the same as your UID and GID in the development environment.
+ * Append your SSH public key to root's authorized_keys file.
+ * Run `./bootstrap.sh`, which will ensure that ruby and chef-solo are
+ installed, and then run the crowbar-bootstrap cookbook to converge the
+ state of the container with our latest specifications.
+ * Bring up the OpenCrowbar webserver.
+ * Create a default admin network on the `192.168.124.0/24` address
+ range.
+ * Update the `provisioner-server` role template to use the passed-in
+ http proxy, if any.
+ * Update the `provisioner-os-install` role template to default to
+ `centos-6.5`.
+ * Create the admin node record.
+ * Extract the addresses that were allocated to the admin node, and
+ bind them to eth0.
+ * Mark the admin node as alive, and converge the default set of admin
+ noderoles.
+
+Options:
+
+ * --zombie will run all of the admin config except for the final "node alive" step. This is handy if you want to check the system before completes
You should be able to monitor the progress of the admin node
deployment at http://localhost:3000. Once the admin node is finished
@@ -138,7 +154,41 @@ shell inside the container.
### Booting slave VMs from the OpenCrowbar admin node
+#### Bare Metal (the easy way)
If your development environment is running on bare metal (as opposed
to running inside a VM), you can use `tools/kvm-slave &` to spawn a
KVM virtual machine that will boot from the freshly-deployed OpenCrowbar
admin node.
+
+#### Virtual Box (the corporate way)
+
+> this approach expects that you've added an ethernet device (not up'd) to your VM that will be the admin network for slave VMs.
+
+If your development environment is running in VMs then:
+
+<<<<<<< HEAD
+ 1. make sure that your dev VM has an extra eth port connected to a dedicated host only bridge (let's assume eth2)
+ 1. slave the eth2 to the docker bridge, `sudo brctl addif docker0 eth2`
+ 1. turn on eth2 for the bridge, `sudo ip link set eth2 up`
+ 1. create a VM with eth0
+ 1. attached to the dedicated host only bridge
+ 1. make sure it is able to network boot
+ 1. boot the VM - it should PXE boot
+=======
+ 1. slave the eth2 to the docker bridge, `sudo brctl addif docker0 eth2`
+ 2. ...
+>>>>>>> e06a15ed6bf914e6ef0bf44bfb3cfc391ee37427
+
+### Development Admin
+
+ 1. Dev/Simulator allows you to play with the UI and BDD tests which is good for developers working on the UI/API and Annealer logic
+ 1. Start with `tools/docker-admin centos ./development.sh`
+ 1. Dev mode creates a special user `developer/Cr0wbar!`
+ 1. To monitor the logs inside the container, use `tail -f /var/log/crowbar/development.log`
+ 1. Run the BDD system [see BDD test pages]
+ 1. `sudo apt-get install erlang`
+ 1. compile the BDD code
+ 1. update the config file (copy example.config to default.config and update)
+ 1. `erl` then `bdd:test()`
+ 1. Rails console in container: `su -l -c 'cd /opt/opencrowbar/core/rails; bundle exec rails c' crowbar`
+'
View
186 doc/development-guides/ui/role.md
@@ -0,0 +1,186 @@
+## Barclamp Roles - User Interface Development and Testing
+
+When a deployment role is in proposed state the user should be able to modify the role attributes defined for that role.
+
+In all other states the attributes should be displayed as read-only. Please use the Messaging Barclamp as a reference and this guide for developing and testing other custom role user interfaces.
+
+### Development
+
+The steps for building the UI (view) to edit and display node role attributes are as follows
+
+1. Define the attributes for the Role in the Barclamp's crowbar.yml if they are not already present. These definitions will create Attrib objects for the Role in Crowbar.
+
+ Sample attributes:
+```yaml
+roles:
+ - name: messaging-server
+ jig: chef-solo
+ requires:
+ - openstack-base
+ attribs:
+ # name used as id field in haml input tags. Needs to follow this convention: [barclamp]-[role]_rest_of_id
+ - name: 'messaging-openstack_endpoints_mq_host'
+ # Plain English description of attrib
+ description: 'Messaging Host'
+ # map to value in hash: hsh['openstack']['endpoints']['mq']['host'] for example
+ map: 'openstack/endpoints/mq/host'
+ - name: 'messaging-openstack_endpoints_mq_port'
+ description: 'Messaging Port'
+ map: 'openstack/endpoints/mq/port'
+ - name: 'messaging-crowbar_messaging_mq_user'
+ description: 'Messaging User'
+ map: 'crowbar_messaging/mq/user'
+ - name: 'messaging-crowbar_messaging_mq_password'
+ description: 'Messaging Password'
+ map: 'crowbar_messaging/mq/password'
+```
+2. Create the view for the role
+
+ Crowbar expects the view file location and name to follow the convention:
+ ```
+ [barclamp_name]/crowbar_engine/barclamp_[barclamp_name]/app/views/barclamp_[barclamp_name]/node_roles/_[@role.name].html.haml
+ ```
+
+ For the messaging server role the following Rails partial was created:
+ ```
+ messaging/crowbar_engine/barclamp_messaging/app/views/barclamp_messaging/node_roles/_messaging-server.name.html.haml
+ ```
+ The partial is made up of four main components, the form, the validation rules, the validation messages and the read-only view. The template for the overall partial should follow this pattern:
+
+ ```haml
+ - data_nil_empty = (data.nil? || data=={})
+ - if @node_role.proposed? # The node role can be edited in this state, show the form
+ %dl.attribs
+ %dt= t('.[label_key]')
+ %dd= text_field_tag 'data_[@role.name]_[map_to_value]', (data_nil_empty || data["map"]["to"]["value"].nil?) ? template["map"]["to"]["value"] : data["map"]["to"]["value"] , :size => 30
+ ...
+ = hidden_field_tag :dataprefix, "data_"
+
+ :javascript
+ var rules = new Array();
+ // cannot use regular json syntax because you cannot have hyphen in key names and attribs have hyphen, TODO should re-factor attribs to use json friendly key names
+ rules["data_[@role.name]_[map_to_value]"] = new Object({
+ required: true,
+ minlength: 8
+ //...
+ });
+ //...
+ var messages = new Array();
+ messages["data_[@role.name]_[map_to_value]"] = new Object({
+ required: "#{t('.[field_label_required]', size: 8)}"
+ //...
+ });
+ //..
+
+ - else # Not in proposed state, show read-only page.
+ %dl.attribs
+ %dt= t('.[label_key]')
+ %dd= (data_nil_empty) ? template["map"]["to"]["value"] : data["map"]["to"]["value"]
+ ...
+ ```
+ * *IMPORTANT*: The ids used in the form fields *MUST* match the ids used to build the rules and messages javascript arrays.
+
+3. Add localization for all labels and validation messages. This follows the conventions mentioned in the [localization](localization.md) documentation and the general localization pattern for the view above is as follows:
+```
+en:
+ barclamp_[barclamp_name]:
+ node_roles:
+ [role_name]:
+ label_key: Label Value
+ message_key: Message with parameter: %{parameter}
+```
+
+4. Override Role hooks if needed
+
+ If any special actions need to take place prior to sending the data down to the node after the Deployment is committed you can override one of the hooks declared in [Role](https://github.com/crowbar/barclamp-crowbar/blob/master/crowbar_framework/app/models/role.rb).
+
+ For example in the messaging barclamp an encrypted databag needed to be created on the admin node populated with the user and password from the form. The data bag is then copied downstream to the node prior to a chef run.
+
+ Create a class that extends Role and use the following name/location convention:
+ ```
+ class Barclamp[Role::Name} < BarclampChef::Role
+
+ [barclamp_name]/crowbar_engine/barclamp_[barclamp_name]/app/models/barclamp_[barclamp_name]/[role_name].rb
+
+ ```
+ For example, in the messaging barclamp the class used for the server role hook override is:
+ ```
+ class BarclampMessaging::Server < BarclampChef::Role
+
+ messaging/crowbar_engine/barclamp_messaging/app/models/barclamp_messaging/server.rb
+ ```
+ The hook override used in the encrypted data bag use case is the *on_todo* hook which is called when the node role is moved into the to_do state once all, if any, blocking parent roles make it to active state, but before the data is pushed down to the target node, so this hook is ideal for this use case. Sample code from Messaging Barclamp below:
+ ```ruby
+ def on_todo(node_role, *args)
+ nrd= node_role.data
+ if(!nrd.nil? && nrd != {} && !nrd["crowbar_messaging"]["mq"]["user"].nil? \
+ && !nrd["crowbar_messaging"]["mq"]["password"].nil?)
+ messaging_user_id = nrd["crowbar_messaging"]["mq"]["user"]
+ messaging_password = nrd["crowbar_messaging"]["mq"]["password"]
+ store_credential( "messaging", "user", messaging_user_id, messaging_password)
+ end
+ end
+ ```
+
+### Testing
+
+A typical front-to-back testing scenario is outlined below, using the Messaging Barclamp as an example:
+
+1. Start the Admin node, log in and create new Deployment.
+2. Start a new test node, either a VM or actual hardware.
+3. Validate the test node has PXE booted and is the discovered state in the UI
+4. Create a new Deployment and add the single role you are trying to test, messaging-server for example.
+5. Add the newly discovered node to the Deployment
+6. At the intersection of the role and node click the green + icon to expand all the parent roles.
+7. At this point the very last role, from left-to-right, should be the role you are testing with a blue diamond icon at the intersection of the node and role. The blue diamond indicates the node role is in the Proposed state. Click this icon, this will bring you to the Node Role view that contains the functionality you are testing.
+8. Before proceeding copy the ID of the node role you are editing to be used later on. This can be found by looking at the URL of the page. For instance the following http://192.168.124.10:3000/node_roles/84, shows that the node role is 84
+8. Validate the form fields and labels are correct that the form validation is working properly. Validation error messages should be displayed to the right of the field in question. The tester should know what each field's validation rules are supposed to be to validate the rules.
+ 1. Test required fields by clearing them all and attempt to save the node role. You should see required messages for every field in the messaging server role for example as every field is required
+ 2. Validate and field length rules are working correctly, there are on-key-up event handlers on each field and when the length doesn't meet the defined max/min length you should be notified.
+ 3. Validate special case fields like password and email. In messaging there is a custom validator defined that will not allow special characters in the password. If you enter % you should see a validation error message.
+ 4. Enter all required information in the correct format and save the node role. You should see a notification, in the standard global notification section of the page, that the node role has been saved successfully.
+ 5. Navigate through the deployments menu to get back to the deployment node role list page again. Click the blue icon for the role you are testing and validate the information you previously changed repopulates the form.
+ 6. Make additional changes and repeat previous step the validate the additional update was successful. The reason for this is the first time you edited the node role you were overwriting the defaults, creating a new object. This second pass is an update of that object.
+9. Testing of the rendered form is done at this point. It may be worthwhile to validate model data itself is correct prior to committing the deployment. This can be easily done through the Rails console:
+ 1. SSH into the admin node navigate to the crowbar_framework director
+ ```
+ :~$ cd /opt/dell/crowbar_framework
+ ```
+ 2. Start the rails console
+ ```
+ :~$ RAILS_ENV=development bundle exec rails c
+ ```
+ 3. Use the Rails console to retrieve the node role object
+ ```
+ irb(main):001:0> nr = NodeRole.find(84)
+ ```
+ 4. Verify the model matches the changes made in UI
+ ```
+ irb(main):001:0> y nr.data # This prints out a yaml version of the data that was modified in the UI
+ ```
+ It should look something like:
+
+ ```yaml
+ openstack:
+ endpoints:
+ mq:
+ port: 5532
+ host: 127.0.0.1
+ crowbar_messaging:
+ mq:
+ user: the_user
+ password: the_password
+ ```
+
+11. If the information looks correct in the model commit the Deployment in the UI. While the parent node is executing parent roles like installing the operating system etc, you can take a look at the read-only node role view by clicking the grey circle icon (indicating blocked state) at the intersection of the node and role. This will take you to the read-only node role view. Validate the fields and data correct.
+12. When the Deployment is finished and active the last step is to verify the settings set in the UI actually made it to the target node and configured the service correctly. The validation steps will be different for each role. For the Messaging Server role the following should be verified:
+ 1. SSH into the target node and verify that the service is running
+ ```
+ :~$ sudo rabbitmqctl status
+ ```
+ 2. Verify the settings are correct in the RabbitMQ config and environment files
+ ```
+ :~$ sudo less /etc/rabbitmq/rabbitmq.config
+ :~$ sudo less /etc/rabbitmq/rabbitmq-env.conf
+ ```
+13. This completes testing and verification of the entire life-cyle, from the UI to the actual deployed service.
View
39 production.sh
@@ -1,4 +1,18 @@
#!/bin/bash
+# Copyright 2014, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
export RAILS_ENV=production
[[ $1 ]] || {
echo "Must pass the FQDN you want the admin node to have as the first argument!"
@@ -140,12 +154,19 @@ for net in "${nets[@]}"; do
echo "${net%/*} $FQDN" >> /etc/hosts || :
done
-# Mark the node as alive.
-crowbar nodes update "$FQDN" '{"alive": true}'
-#curl -s -f --digest -u $(cat /etc/crowbar.install.key) \
-# -X PUT "http://localhost:3000/api/v2/nodes/$FQDN" \
-# -d 'alive=true'
-# Converge the admin node.
-crowbar converge && exit 0
-echo "Could not converge all noderoles!"
-exit 1
+# flag allows you to stop before final step
+if ! [[ $* = *--zombie* ]]; then
+
+ # Mark the node as alive.
+ crowbar nodes update "$FQDN" '{"alive": true}'
+ #curl -s -f --digest -u $(cat /etc/crowbar.install.key) \
+ # -X PUT "http://localhost:3000/api/v2/nodes/$FQDN" \
+ # -d 'alive=true'
+ echo "Configuration Complete, you can watch annealing from the UI"
+ # Converge the admin node.
+ crowbar converge && exit 0
+ echo "Could not converge all noderoles!"
+ exit 1
+else
+ echo "To complete configuration, mark node alive using: crowbar nodes update 1 '{""alive"": true}'"
+fi
View
1  rails/app/controllers/barclamp_provisioner/dhcps_controller.rb
@@ -18,6 +18,7 @@ class BarclampProvisioner::DhcpsController < ::ApplicationController
def index
# we need to get the database
+ entries = {}
begin
nr = Node.admin.first.node_roles.where(:name => 'provisioner-dhcp-database').first
if params.key? :id
View
11 rails/app/controllers/nodes_controller.rb
@@ -1,4 +1,4 @@
-# Copyright 2013, Dell
+# Copyright 2014, Dell
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -79,10 +79,6 @@ def redeploy
def create
params[:deployment_id] = Deployment.find_key(params[:deployment]).id if params.has_key? :deployment
params[:deployment_id] ||= 1
- # 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["provisioner-repos"] = {"admin_mac"=>params["mac"]} if params.has_key? :mac
params.require(:name)
params.require(:deployment_id)
@node = Node.create!(params.permit(:name,
@@ -94,10 +90,15 @@ def create
:alive,
:available,
:bootenv))
+ # 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
unless hint.empty?
@node.hint = hint
@node.save!
end
+
render api_show @node
end
View
7 rails/app/controllers/support_controller.rb
@@ -159,6 +159,13 @@ def settings
end
end
+ # return the queue status
+ def queue
+ workers = %x[ps axe | grep delayed_job].split("delayed_job").length
+ j = { :workers => workers, :jobs => Delayed::Job.all }
+ render :json=>j
+ end
+
private
def ctime
View
2  rails/app/models/attrib.rb
@@ -62,7 +62,7 @@ def get(from_orig,source=:all)
when :wall then from.wall
when :system then from.sysdata
when :user then from.data
- when :hint then from_orig.hint[role.name]
+ when :hint then from_orig.hint
else raise("#{from} is not a valid source to read noderole data from!")
end
when from.is_a?(Role) then from.template
View
3  rails/app/models/barclamp_provisioner/dhcp_database.rb
@@ -35,7 +35,6 @@ def rerun_my_noderoles node
clients = {}
mac_hint = ::Attrib.find_by(name: "hint-admin-mac")
-
Role.transaction do
Node.all.each do |node|
ints = (node.discovery["ohai"]["network"]["interfaces"] rescue nil)
@@ -56,6 +55,7 @@ def rerun_my_noderoles node
end
end
end
+
# we need to have at least 1 mac (from preload or inets)
next unless mac_list.length > 0
# add this node to the DHCP clients list
@@ -64,6 +64,7 @@ def rerun_my_noderoles node
"v4addr" => node.addresses.reject{|a|a.v6?}.sort.first.to_s,
"bootenv" => node.bootenv
}
+
end
end
# this gets the client list sent to the jig implementing the DHCP database role
View
4 rails/app/models/doc.rb
@@ -37,8 +37,8 @@ def self.root_directory
# creates the table of contents from the files
def self.gen_doc_index
- # determine age of doc index file in seconds (so we don't generate everytime we start)
- index_age = File.new(File.join '..', 'doc', 'README.md').mtime - DateTime.now rescue 0
+ # determine age of doc index file in seconds (so we don't generate every time we start)
+ index_age = File.new(File.join '..', 'doc', 'README.md.new').mtime - DateTime.now rescue 0
if Doc.count == 0 or index_age < -300
# load barclamp docs
Barclamp.order(:id).each { |bc| Doc.discover_docs bc }
View
2  rails/app/models/nav.rb
@@ -18,7 +18,7 @@ class Nav < ActiveRecord::Base
self.primary_key = "item"
belongs_to :parent, :class_name => "Nav", :foreign_key => "parent_item"
- has_many :children, :class_name => "Nav", :foreign_key => "parent_item", :conditions=>(Rails.env.eql?('development') ? [] : ['development=?', false])
+ has_many :children, :class_name => "Nav", :foreign_key => "parent_item"
validates_uniqueness_of :item, :case_sensitive => false, :message => I18n.t("db.notunique", :default=>"Name item must be unique")
View
7 rails/app/views/layouts/application.html.haml
@@ -1,7 +1,7 @@
!!!
%html
%head
- %title= "Crowbar"
+ %title= "OpenCrowbar"
= csrf_meta_tags
= stylesheet_link_tag 'application'
/[if IE]
@@ -26,8 +26,9 @@
= link_to t('user.sign_out'), main_app.destroy_user_session_path(), :method=>'delete' rescue t('error')
)
%nav
- - unless Rails.env.development? and params[:nav].eql? 'false'
- = render_navigation :expand_all => true, :skip_if_empty => true
+ - Rails.logger.info "ZEHICLE 1"
+ = render_navigation :expand_all => true, :skip_if_empty => true
+ - Rails.logger.info "ZEHICLE 2"
- else
%nav
= link_to t('user.sign_in'), main_app.new_user_session_path
View
17 rails/config/application.rb
@@ -1,3 +1,18 @@
+# Copyright 2011-4, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
require File.expand_path('../boot', __FILE__)
require 'rails/all'
@@ -72,7 +87,7 @@ class Application < Rails::Application
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names.
config.time_zone = 'UTC'
- config.paths['log'] = "/var/log/crowbar/#{Rails.env}.log"
+ config.paths['log'] ||= "/var/log/crowbar/#{Rails.env}.log"
config.cache_store = [ :file_store, "/var/cache/crowbar/rails-cache/" ]
config.assets.cache_store = [ :file_store, "/var/cache/crowbar/rails-cache/assets/#{Rails.env}/" ]
View
10 rails/config/environments/development.rb
@@ -1,4 +1,4 @@
-# Copyright 2011, Dell
+# Copyright 2011-4, Dell
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -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
@@ -33,5 +32,8 @@
config.eager_load = false
# Enable threaded mode
# config.threadsafe! unless $rails_rake_task
- config.log_level = :debug
+ config.log_level = :info
+ config.paths['log'] = "log/#{Rails.env}.log"
+
+ CROWBAR_VERSION = "v2.0-dev"
end
View
2  rails/config/environments/production.rb
@@ -48,5 +48,5 @@
# Enable threaded mode
# config.threadsafe! unless $rails_rake_task
- CROWBAR_VERSION = "v2.0-dev"
+ CROWBAR_VERSION = "v2.0-prod"
end
View
7 rails/config/initializers/api_helpers.rb
@@ -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.
@@ -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
View
5 rails/config/navigation.rb
@@ -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.
@@ -14,6 +14,7 @@
SimpleNavigation::Configuration.run do |navigation|
menu = Nav.item('root').first
+Rails.logger.info "ZEHICLE #{Nav.all.count}"
navigation.items do |primary|
menu.children.sort_by{|n| n.order}.each do |item| # Top Nav
if item.item != 'root' and item.path =~ /(.*)_path/
@@ -55,7 +56,7 @@
end
rescue Exception => e
primary.item :menu_error, "#{t 'nav.error'}: #{item.item}", ''
- puts "render error #{e.inspect}" if Rails.env.development?
+ Rails.logger.error "navigation: #{e.inspect}"
end
end
end
View
3  rails/config/routes.rb
@@ -121,6 +121,7 @@
scope 'status' do
get "nodes(/:id)" => "nodes#status", :as => :nodes_status
get "snapshots(/:id)" => "snapshots#status", :as => :snapshots_status
+ get "queue" => "support#queue", :as => :queue_status
end
scope 'test' do
put "nodes(/:id)" => "nodes#test_load_data"
@@ -194,7 +195,9 @@
delete "lock", :controller => "users", :action => "unlock"
put "reset_password", :controller => "users", :action => "reset_password"
end
+
resources :dhcps
+
end # version
end # api
end # id constraints
Something went wrong with that request. Please try again.