From 6181b3ac481465247ef0544e34e35a36c9e81347 Mon Sep 17 00:00:00 2001 From: Shubham Minglani Date: Mon, 22 Feb 2016 18:16:38 +0530 Subject: [PATCH 1/5] Remove extra whitespaces from logging output. --- atomicapp/nulecule/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomicapp/nulecule/main.py b/atomicapp/nulecule/main.py index 79a5a723..1ce88b8d 100644 --- a/atomicapp/nulecule/main.py +++ b/atomicapp/nulecule/main.py @@ -89,7 +89,7 @@ def __init__(self, app_spec, destination=None, self.app_path = Utils.getNewAppCacheDir(self.image) logger.debug("NuleculeManager init app_path: %s", self.app_path) - logger.debug("NuleculeManager init image: %s", self.image) + logger.debug("NuleculeManager init image: %s", self.image) # Create the app_path if it doesn't exist yet if not os.path.isdir(self.app_path): From 0b9b5807a4ab61bafae4a5b837be0e2cbce868c0 Mon Sep 17 00:00:00 2001 From: Charlie Drage Date: Thu, 18 Feb 2016 11:19:55 -0500 Subject: [PATCH 2/5] Fail if unable to find artifact --- atomicapp/nulecule/base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/atomicapp/nulecule/base.py b/atomicapp/nulecule/base.py index fbac1ec2..7184e3db 100644 --- a/atomicapp/nulecule/base.py +++ b/atomicapp/nulecule/base.py @@ -548,6 +548,8 @@ def _get_artifact_paths_for_path(self, path): immediate children, i.e., we do not deal with nested artifact directories at this moment. + If a file or directory is not found, raise an exception. + Args: path (str): Local path @@ -558,9 +560,14 @@ def _get_artifact_paths_for_path(self, path): if os.path.isfile(path): artifact_paths.append(path) elif os.path.isdir(path): + if os.listdir(path) == []: + raise NuleculeException("Artifact directory %s is empty" % path) for dir_child in os.listdir(path): dir_child_path = os.path.join(path, dir_child) if dir_child.startswith('.') or os.path.isdir(dir_child_path): continue artifact_paths.append(dir_child_path) + else: + raise NuleculeException("Unable to find artifact %s" % path) + return artifact_paths From b3060ad1e62eadd905f83be0b33c22a45c365110 Mon Sep 17 00:00:00 2001 From: Charlie Drage Date: Wed, 10 Feb 2016 09:14:29 -0500 Subject: [PATCH 3/5] Change order of getting context --- atomicapp/nulecule/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atomicapp/nulecule/base.py b/atomicapp/nulecule/base.py index fbac1ec2..469bf7e1 100644 --- a/atomicapp/nulecule/base.py +++ b/atomicapp/nulecule/base.py @@ -380,14 +380,15 @@ def render(self, provider_key=None, dryrun=False): if self._app: self._app.render(provider_key=provider_key, dryrun=dryrun) return + if self.artifacts is None: raise NuleculeException( "No artifacts specified in the Nulecule file") - context = self.get_context() if provider_key and provider_key not in self.artifacts: raise NuleculeException( "Data for provider \"%s\" are not part of this app" % provider_key) + context = self.get_context() for provider in self.artifacts: if provider_key and provider != provider_key: continue From 71d8cb7b3d355e08e95a2639708d5a8316d5a897 Mon Sep 17 00:00:00 2001 From: Charlie Drage Date: Tue, 23 Feb 2016 11:14:14 -0500 Subject: [PATCH 4/5] Update readme --- README.md | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index a9ccc516..79585f2e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # Atomic App -Atomic App is a reference implementation of the [Nulecule Specification](http://www.projectatomic.io/docs/nulecule/). It can be used to bootstrap container applications and to install and run them. Atomic App is designed to be run in a container context. Examples using this tool may be found in the [Nulecule examples directory](https://github.com/projectatomic/nulecule/tree/master/examples). +Atomic App is a reference implementation of the [Nulecule specification](https://github.com/projectatomic/nulecule). It can be used to bootstrap packaged container environments and then run them. Atomic App is designed to be ran within a container. + +Examples of this tool may be found within the [Nulecule library repo](https://github.com/projectatomic/nulecule/tree/master/examples). ## Getting Started -Atomic App is packaged as a container. End-users typically do not install the software from source. Instead use the atomicapp container as the `FROM` line in a Dockerfile and package your application on top. For example: +Atomic App itself is packaged as a container. End-users typically do not install the software from source. Instead use the `atomicapp` container as the `FROM` line in a Dockerfile and package your application on top. For example: ``` -FROM projectatomic/atomicapp:0.4.2 +FROM projectatomic/atomicapp MAINTAINER Your Name @@ -15,17 +17,17 @@ ADD /Nulecule /Dockerfile README.md /application-entity/ ADD /artifacts /application-entity/artifacts ``` -For more information see the [Atomic App getting started guide](http://www.projectatomic.io/docs/atomicapp/). +For more information see the [Nulecule getting started guide](https://github.com/projectatomic/nulecule/blob/master/docs/getting-started.md). ## Developers First of all, clone the github repository: `git clone https://github.com/projectatomic/atomicapp`. -### Install this project +### Installing Atomic App locally Simply run ``` -pip install . +make install ``` If you want to do some changes to the code, I suggest to do: @@ -36,36 +38,35 @@ export PYTHONPATH=`pwd`:$PYTHONPATH alias atomicapp="python `pwd`/atomicapp/cli/main.py" ``` -### Build +### Building for containerized execution ``` docker build -t [TAG] . ``` -Just a call to Docker to package up the application and tag the resulting image. +Use 'docker build' to package up the application and tag the resulting image. -### Install and Run +### Fetch and run ``` -atomicapp [--dry-run] [-a answers.conf] install|run [--recursive] [--update] [--destination DST_PATH] APP|PATH +atomicapp [--dry-run] [-v] [-a answers.conf] fetch|run|stop|genanswers [--provider docker] [--destination DST_PATH] APP|PATH ``` -Pulls the application and it's dependencies. If the last argument is +Pulls the application and its dependencies. If the last argument is existing path, it looks for `Nulecule` file there instead of pulling anything. -* `--recursive yes|no` Pull whole dependency tree -* `--update` Overwrite any existing files +* `--provider docker` Use the Docker provider within the Atomic App * `--destination DST_PATH` Unpack the application into given directory instead of current directory -* `APP` Name of the image containing the application (f.e. `vpavlin/wp-app`) -* `PATH` Path to a directory with installed (i.e. result of `atomicapp install ...`) app +* `APP` Name of the image containing the application (ex. `projectatomic/apache-centos7-atomicapp`) +* `PATH` Path to a directory with installed (ex. result of `atomicapp fetch...`) app -Action `run` performs `install` prior its own tasks are executed if `APP` is given. When `run` is selected, providers' code is invoked and containers are deployed. +Action `run` performs `fetch` prior to its own tasks if an `APP` is provided. Otherwise, it will use its respective `PATH`. When `run` is selected, providers' code is invoked and containers are deployed. ## Providers -Providers represent various deployment targets. They can be added by placing a file called `provider_name.py` in `providers/`. This file needs to implement the interface explained in (providers/README.md). For a detailed description of all providers available see the [Provider description](docs/providers.md). +Providers represent various deployment targets. They can be added by placing the artifact within the respective in `provider/` folder. For example, placing `deploy_pod.yml` within `providers/kubernetes/`. For a detailed description of all providers available see [docs/providers.md](docs/providers.md). ## Dependencies -Please see [REQUIREMENTS](https://github.com/projectatomic/atomicapp/blob/master/docs/requirements.md) for current Atomic App dependencies. +See [REQUIREMENTS](https://github.com/projectatomic/atomicapp/blob/master/docs/requirements.md) for current Atomic App dependencies. ##Communication channels @@ -82,7 +83,7 @@ Please see [REQUIREMENTS](https://github.com/projectatomic/atomicapp/blob/master # Copyright -Copyright (C) 2015 Red Hat Inc. +Copyright (C) 2016 Red Hat Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by From 5b946258bbf4f251d200a203eacb767cb621fd58 Mon Sep 17 00:00:00 2001 From: Charlie Drage Date: Tue, 1 Mar 2016 11:11:10 -0500 Subject: [PATCH 5/5] 0.4.3 Release --- CHANGELOG.md | 47 +++++++++++++++++++++++++++++++ Dockerfile | 2 +- Dockerfiles.git/Dockerfile.centos | 2 +- Dockerfiles.git/Dockerfile.debian | 2 +- Dockerfiles.git/Dockerfile.fedora | 2 +- atomicapp/constants.py | 2 +- setup.py | 2 +- 7 files changed, 53 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6a6ec83..e62064ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,50 @@ +## Atomic App 0.4.3 (03-01-2016) + +You'll now see pretty colors with logging / output! + +With this release, we've refactored our logging formatter making it easier to decipher between information, debug, warning and errors. + +You are now able to specify what logging format you'd like to output via the command line: + +``` + --logtype {cockpit,color,nocolor,none} + Override the default logging output. The options are: + nocolor: we will only log to stdout; color: log to + stdout with color; cockpit: used with cockpit + integration; none: atomicapp will disable any logging. + If nothing is set and logging to file then 'nocolor' + by default. If nothing is set and logging to tty then + 'color' by default. +``` + +The main features are: + + - A new logging mechanism that outputs color-coordinated logging messages + - Added CLI commands for color, nocolor, cockpit and 'none' output + +UI: + + - Failure on finding no artifacts + +Other: + + - Readme updates / typo fixes + +``` +Charlie Drage (3): + Fail if unable to find artifact + Change order of getting context + Update readme + +Dusty Mabe (4): + logging: Add in Atomic App Logging class + logging: add cockpit logging output + tests: fix test to look for output in stdout vs stderr + +Shubham Minglani (1): + Remove extra whitespaces from logging output. +``` + ## Atomic App 0.4.2 (02-18-2016) As we start to get closer to a 1.0.0 release, we continue to focus on tests and user interaction. This weeks release focus on both as well as a minor feature. diff --git a/Dockerfile b/Dockerfile index 43714e23..896e5e2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM centos:7 MAINTAINER Red Hat, Inc. -ENV ATOMICAPPVERSION="0.4.2" +ENV ATOMICAPPVERSION="0.4.3" LABEL io.projectatomic.nulecule.atomicappversion=${ATOMICAPPVERSION} \ io.openshift.generate.job=true \ diff --git a/Dockerfiles.git/Dockerfile.centos b/Dockerfiles.git/Dockerfile.centos index 43714e23..896e5e2e 100644 --- a/Dockerfiles.git/Dockerfile.centos +++ b/Dockerfiles.git/Dockerfile.centos @@ -2,7 +2,7 @@ FROM centos:7 MAINTAINER Red Hat, Inc. -ENV ATOMICAPPVERSION="0.4.2" +ENV ATOMICAPPVERSION="0.4.3" LABEL io.projectatomic.nulecule.atomicappversion=${ATOMICAPPVERSION} \ io.openshift.generate.job=true \ diff --git a/Dockerfiles.git/Dockerfile.debian b/Dockerfiles.git/Dockerfile.debian index 2d159f1a..719bd5f0 100644 --- a/Dockerfiles.git/Dockerfile.debian +++ b/Dockerfiles.git/Dockerfile.debian @@ -2,7 +2,7 @@ FROM debian:jessie MAINTAINER Red Hat, Inc. -ENV ATOMICAPPVERSION="0.4.2" +ENV ATOMICAPPVERSION="0.4.3" LABEL io.projectatomic.nulecule.atomicappversion=${ATOMICAPPVERSION} \ RUN="docker run -it --rm \${OPT1} --privileged -v \${PWD}:/atomicapp -v /run:/run -v /:/host --net=host --name \${NAME} -e NAME=\${NAME} -e IMAGE=\${IMAGE} \${IMAGE} \${OPT2} run \${OPT3}" \ diff --git a/Dockerfiles.git/Dockerfile.fedora b/Dockerfiles.git/Dockerfile.fedora index cd49acc0..8fc2e6a1 100644 --- a/Dockerfiles.git/Dockerfile.fedora +++ b/Dockerfiles.git/Dockerfile.fedora @@ -2,7 +2,7 @@ FROM fedora:23 MAINTAINER Red Hat, Inc. -ENV ATOMICAPPVERSION="0.4.2" +ENV ATOMICAPPVERSION="0.4.3" LABEL io.projectatomic.nulecule.atomicappversion=${ATOMICAPPVERSION} \ io.openshift.generate.job=true \ diff --git a/atomicapp/constants.py b/atomicapp/constants.py index ab2a89cd..2c2a6d38 100644 --- a/atomicapp/constants.py +++ b/atomicapp/constants.py @@ -23,7 +23,7 @@ 2) LABEL io.projectatomic.nulecule.specversion in app Dockefile """ -__ATOMICAPPVERSION__ = '0.4.2' +__ATOMICAPPVERSION__ = '0.4.3' __NULECULESPECVERSION__ = '0.0.2' EXTERNAL_APP_DIR = "external" diff --git a/setup.py b/setup.py index 09ea0bb1..b4a99405 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ def _install_requirements(): setup( name='atomicapp', - version='0.4.2', + version='0.4.3', description='A tool to install and run Nulecule apps', author='Red Hat, Inc.', author_email='container-tools@redhat.com',