Skip to content
This repository was archived by the owner on Jan 19, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d1eef6b
Laid initial scaffolding for new Nulecule base.
rtnpro Sep 18, 2015
7bae26c
Added code to load config for a Nulecule app and it's internal compon…
rtnpro Sep 18, 2015
92e9cd9
Added an interface to interact with Docker
rtnpro Sep 23, 2015
57e1bb0
Allow loading config of an external app using DockerHandler.
rtnpro Sep 26, 2015
f8e57c1
Pull Docker image only when it's not present. #248
rtnpro Sep 29, 2015
d172671
Filter docker images using Python rather than 'grep'. #248
rtnpro Sep 29, 2015
21d87ce
Implement 'unpack' verb for a Nulecule app.
rtnpro Oct 1, 2015
530e013
Improve loading config data for a nested nulecule graph.
rtnpro Oct 2, 2015
4094122
Render artifact files of a nested nulecule app.
rtnpro Oct 6, 2015
ea23fd4
Integrated 'run' feature in NuleculeManager.
rtnpro Oct 6, 2015
0209712
Added 'stop' feature in NuleculeManager.
rtnpro Oct 6, 2015
4a66611
Re-structure nulecule package.
rtnpro Oct 7, 2015
d00ed54
Allow explicitly specifying unpack path in NuleculeManager.
rtnpro Oct 8, 2015
d50fe71
Integrate atomicapp install command with NuleculeManager.
rtnpro Oct 10, 2015
49c2417
Integrate atomicapp run command with NuleculeManager.
rtnpro Oct 11, 2015
f733026
Integrated atomicapp stop command with NuleculeManager.
rtnpro Oct 11, 2015
24678f9
Added scaffolding for unittests for NuleculeManager.
rtnpro Oct 11, 2015
3c549b7
Move arguments for answers to "run" command alone. #310
rtnpro Oct 12, 2015
9588d35
Added missing nulecule/exceptions.py file.
rtnpro Oct 12, 2015
e0ea9bc
Moved initializing instance variables used by NuleculeBase to itself.
rtnpro Oct 13, 2015
f66970d
Miscellaneous fixes based on code review
rtnpro Oct 13, 2015
f147596
Streamlined install flow
rtnpro Oct 13, 2015
2d646b9
Fix run flow
rtnpro Oct 14, 2015
9462c3f
Write collected config data to answers.conf.sample during install.
rtnpro Oct 14, 2015
3c97642
Fix loading config data during run.
rtnpro Oct 14, 2015
586cda8
Ensure provider and namespace info are present in generated answers f…
rtnpro Oct 14, 2015
e9c0a50
NuleculeManager can now run application directly from an image.
rtnpro Oct 14, 2015
a896514
Don't overload Nulecule.load_from_path to copy directory to target path.
rtnpro Oct 14, 2015
be535b0
Removed unused imports in nulecule/main.py.
rtnpro Oct 14, 2015
f6201d1
Move definitions of Nulecule and NuleculeComponent to nulecule/base.py
rtnpro Oct 14, 2015
404af83
Remove deprecated atomicap/{install,run,nulecule_base}.py files.
rtnpro Oct 14, 2015
fc5e557
Repalace dangling shutil with distutils.
rtnpro Oct 15, 2015
70303d2
Enable skip_asking option during loading config
rtnpro Oct 15, 2015
788a9dd
Fixed imports for distutils.dir_util
rtnpro Oct 15, 2015
54bf04c
Don't try to stop a NuleculeComponent multiple times.
rtnpro Oct 15, 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
63 changes: 44 additions & 19 deletions atomicapp/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
along with Atomic App. If not, see <http://www.gnu.org/licenses/>.
"""

from atomicapp.run import Run
from atomicapp.install import Install
import os
import sys

Expand All @@ -33,35 +31,46 @@
ANSWERS_FILE, __ATOMICAPPVERSION__, \
__NULECULESPECVERSION__, ANSWERS_FILE_SAMPLE_FORMAT, \
LOCK_FILE
from atomicapp.nulecule import NuleculeManager
from atomicapp.nulecule.exceptions import NuleculeException
from atomicapp.utils import Utils

logger = logging.getLogger(__name__)


def cli_install(args):
install = Install(**vars(args))

if install.install() is not None:
try:
NuleculeManager.do_install(**vars(args))
sys.exit(True)
else:
except NuleculeException as e:
logger.error(e)
sys.exit(False)
except Exception as e:
logger.error(e, exc_info=True)
sys.exit(False)


def cli_run(args):
ae = Run(**vars(args))

if ae.run() is not None:
try:
NuleculeManager.do_run(**vars(args))
sys.exit(True)
else:
except NuleculeException as e:
logger.error(e)
sys.exit(False)
except Exception as e:
logger.error(e, exc_info=True)
sys.exit(False)


def cli_stop(args):
stop = Run(stop=True, **vars(args))

if stop.run() is not None:
try:
NuleculeManager.do_stop(**vars(args))
sys.exit(True)
else:
except NuleculeException as e:
logger.error(e)
sys.exit(False)
except Exception as e:
logger.error(e, exc_info=True)
sys.exit(False)


Expand Down Expand Up @@ -111,24 +120,25 @@ def set_arguments(self):
"Don't actually call provider. The commands that should be "
"run will be sent to stdout but not run."))

self.parser.add_argument(
subparsers = self.parser.add_subparsers(dest="action")

parser_run = subparsers.add_parser("run")

parser_run.add_argument(
"-a",
"--answers",
dest="answers",
default=os.path.join(os.getcwd(), ANSWERS_FILE),
help="Path to %s" % ANSWERS_FILE)

self.parser.add_argument(
parser_run.add_argument(
"--answers-format",
dest="answers_format",
default=ANSWERS_FILE_SAMPLE_FORMAT,
help=(
"The format for the answers.conf.sample file.Default is "
"'ini', Valid formats are 'ini', 'json', 'xml', 'yaml'."))

subparsers = self.parser.add_subparsers(dest="action")

parser_run = subparsers.add_parser("run")
parser_run.add_argument(
"--write-answers",
dest="answers_output",
Expand All @@ -154,6 +164,21 @@ def set_arguments(self):

parser_install = subparsers.add_parser("install")

parser_install.add_argument(
"-a",
"--answers",
dest="answers",
default=os.path.join(os.getcwd(), ANSWERS_FILE),
help="Path to %s" % ANSWERS_FILE)

parser_install.add_argument(
"--answers-format",
dest="answers_format",
default=ANSWERS_FILE_SAMPLE_FORMAT,
help=(
"The format for the answers.conf.sample file.Default is "
"'ini', Valid formats are 'ini', 'json', 'xml', 'yaml'."))

parser_install.add_argument(
"--no-deps",
dest="nodeps",
Expand Down
2 changes: 2 additions & 0 deletions atomicapp/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
EXTERNAL_APP_DIR = "external"
GLOBAL_CONF = "general"
APP_ENT_PATH = "application-entity"
CACHE_DIR = "/var/lib/atomicapp"

PARAMS_KEY = "params"
MAIN_FILE = "Nulecule"
ANSWERS_FILE = "answers.conf"
ANSWERS_RUNTIME_FILE = "answers.conf.gen"
ANSWERS_FILE_SAMPLE = "answers.conf.sample"
ANSWERS_FILE_SAMPLE_FORMAT = 'ini'
WORKDIR = ".workdir"
Expand Down
218 changes: 0 additions & 218 deletions atomicapp/install.py

This file was deleted.

4 changes: 4 additions & 0 deletions atomicapp/nulecule/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from __future__ import absolute_import
from .main import NuleculeManager

__all__ = ['NuleculeManager']
Loading