Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor into plugins #24

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
c27b746
Refactor for plugins
Apr 9, 2015
7017e59
Add debug plugins
Apr 11, 2015
6f5a308
Add debug plugins
Apr 11, 2015
11b5a2c
Moar debug plugins
Apr 11, 2015
aeb3651
Merge remote-tracking branch 'origin/plugins' into plugins
Apr 11, 2015
0967c0a
Fix test
Apr 11, 2015
782870d
Moar debuggers
Apr 13, 2015
51686b8
Version bump to 1.0.0
Apr 13, 2015
51f537a
Merge branch 'master' into plugins
May 7, 2015
4e43d02
Finish porting custom repo
May 8, 2015
d5afe6e
Fix provision
viglesiasce May 11, 2015
6f10d9c
First pass at docs
viglesiasce May 12, 2015
f35146d
Added eucalyptus_sosreport.py; updated debuggerplugin.py and setup.py
hspencer77 May 12, 2015
388bb40
Adding repo validation
May 12, 2015
7e1ff92
Use set instantiation that is compatible with Python 2.6
viglesiasce May 12, 2015
5bf77e6
repos validation
May 12, 2015
4f45142
repos validation
May 12, 2015
0ec9fda
updating debuggerplugin.py to have get_command tasks
hspencer77 May 12, 2015
27db135
Repos validation update
May 12, 2015
1bdde76
repos and storage validation
May 13, 2015
e734101
storage validation modifications
May 13, 2015
82f1e82
Updated eucalyptus-sosreport.py to run jobs in parallel. Downloads to…
hspencer77 May 13, 2015
a4b34e9
Storage validation update
May 13, 2015
88f122d
Storage validation update
May 13, 2015
6107d58
storage validation modifications
May 14, 2015
b7e3317
Changed function names get_command_* to get_file_*; moved tasks assoc…
hspencer77 May 14, 2015
371bdf9
Storage validation update
May 14, 2015
04370ef
Updated eucalyptus_sosreport.py to download sosreports from nodes to …
hspencer77 May 14, 2015
f144017
Updated README.md
hspencer77 May 14, 2015
3d7d2f0
Update README.md
hspencer77 May 14, 2015
5f2d3f2
Updated README.md; corrected list display
hspencer77 May 14, 2015
8d49807
Updated README.md; corrected list display, version 2
hspencer77 May 14, 2015
bcf172b
Updated README.md; corrected list display, version 3
hspencer77 May 14, 2015
1eed6e2
Updated README.md; corrected list display, version 4
hspencer77 May 14, 2015
9f482f1
Updated README.md; corrected list display, version 5; corrected links
hspencer77 May 14, 2015
145f6cb
Storage validation update
May 15, 2015
bb2aa71
Storage validation update
May 15, 2015
d1fbf5f
Storage validation update
May 15, 2015
015bf4b
envrionment update
May 15, 2015
87452fb
Minimized error message output when get_file_on_host fails
hspencer77 May 18, 2015
ae63d4f
Fix single line comments in debuggerplugin.py
hspencer77 May 18, 2015
12a0084
Merge pull request #37 from hspencer77/deploy-sosreports-addition
viglesiasce May 18, 2015
3a7b123
Doc: add Quick Start and ToC
viglesiasce May 18, 2015
56aad52
Merge remote-tracking branch 'origin/plugins' into plugins
viglesiasce May 18, 2015
8846d78
prepare spec file for use in jenkins/rpmfab/mock builds
mbacchi May 19, 2015
e04e15c
move version figuring to setup.py
mbacchi May 19, 2015
ad14fb9
update source to use rpmfab macro
mbacchi May 19, 2015
fbb2650
Doc: Start plugin documentation
viglesiasce May 20, 2015
b48acbd
update setup macro in RPM spec file
mbacchi May 20, 2015
e8227a2
add BuildRequires entries
mbacchi May 20, 2015
4d16b5d
correct capitalization of PyYAML
mbacchi May 20, 2015
1da9fe9
additional RPM dependencies, add config.yml, use RPM files syntax
mbacchi May 21, 2015
eed5b2c
forgot to tar config.yml before trying to package it in the RPM
mbacchi May 21, 2015
270dba4
Adding yml structure validation and repos updates
May 21, 2015
87576f2
Setup update
May 21, 2015
99939d9
Adding structure validation and repos updates
May 21, 2015
fd64610
Updated error handling
May 21, 2015
7d7e8eb
Adding structure validation and repos updates
May 21, 2015
48e185e
Adding structure validation and repos updates
May 22, 2015
b416182
Removing .idea files
May 22, 2015
869c8bb
Changing environment file to default
May 22, 2015
2701327
ship and install examples directory
mbacchi May 22, 2015
05318bf
Changing structre options
May 22, 2015
4756326
Merge pull request #39 from ccassler/plugins
viglesiasce May 22, 2015
1fff9ec
correct placement of config.yml in /etc/euca-deploy
mbacchi May 22, 2015
6a88eb0
Merge remote branch mbacchi:'origin/master' into plugins
mbacchi May 22, 2015
f3def4d
Merge pull request #40 from mbacchi/plugins
viglesiasce May 22, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include MANIFEST.in
include README.md
include euca-deploy.spec
include etc/config.yml
include examples/*
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ Provisions the rest of the system or update the configuration of an existing sys
euca-deploy provision -p <root-ssh-password-for-deployment-systems>

### Debug
#### Not yet implemented!!!
This step will grab all necessary information from a system in order to provide artifacts for use in debugging a problem.


This step will grab all necessary information from a system in order to provide artifacts for use in debugging a problem. In addition, this step will do the following:
* Confirm/install [sosreports](https://github.com/sosreport/sos) and [eucalyptus sosreports plugin](https://github.com/eucalyptus/eucalyptus-sosreport-plugins) on each node
* Run sosreports on each node
* Copy the sosreport back to the local client
```
euca-deploy debug -p <root-ssh-password-for-deployment-systems>
```

63 changes: 48 additions & 15 deletions bin/euca-deploy
Original file line number Diff line number Diff line change
@@ -1,30 +1,63 @@
#!/usr/bin/python -u
#!/usr/bin/env python -u
import argparse
import fabric

from fabric.colors import yellow
from stevedore import driver, extension
from eucadeploy.componentdeployer import ComponentDeployer

if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('operation', choices=['prepare',
default_repo = 'https://github.com/eucalyptus/eucalyptus-cookbook'
parser.add_argument('operation', choices=['validate',
'prepare',
'bootstrap',
'provision',
'debug',
'uninstall'])
parser.add_argument('-c', '--config', default='etc/config.yml')
parser.add_argument('-e', '--environment', default='etc/environment.yml')
parser.add_argument('-p', '--password', default='foobar')
parser.add_argument('-b', '--branch', default='euca-4.1')
parser.add_argument('--cookbook-repo', default='https://github.com/eucalyptus/eucalyptus-cookbook')
parser.add_argument('--cookbook-repo',
default=default_repo)
parser.add_argument('-d', '--driver', default="chef")
parser.add_argument('--debug', action='store_true', default=False)
args = parser.parse_args()
component_deployer = ComponentDeployer(args.password,
args.environment,
args.config,
args.debug,
args.branch,
args.cookbook_repo)
try:
function = getattr(component_deployer, args.operation)

component_deployer = ComponentDeployer(args.environment)
if args.operation == 'validate':
mgr = extension.ExtensionManager(
namespace='eucadeploy.validator',
invoke_args=(component_deployer,),
invoke_on_load=True,
propagate_map_exceptions=True
)
results = mgr.map_method(args.operation)
elif args.operation == 'debug':
mgr = extension.ExtensionManager(
namespace='eucadeploy.debugger',
invoke_args=(component_deployer,),
invoke_on_load=True,
propagate_map_exceptions=False
)
results = mgr.map_method(args.operation)
total_failures = 0
total_passed = 0
for passed, failed in results:
total_passed += passed
total_failures += failed
print yellow('Total passed: ' + str(total_passed))
print yellow('Total failed: ' + str(total_failures))
exit(total_failures)
else:
mgr = driver.DriverManager(
namespace='eucadeploy.deployer',
name=args.driver,
invoke_on_load=True,
invoke_args=(args.password,
args.environment,
args.config,
args.debug,
args.branch),
)
function = getattr(mgr.driver, args.operation)
function()
finally:
fabric.network.disconnect_all()
192 changes: 192 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"

clean:
rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/euca-deploy.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/euca-deploy.qhc"

applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/euca-deploy"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/euca-deploy"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."

xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
Loading