Giter Site home page Giter Site logo

atomicapp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atomicapp's Issues

Changing $image answer does not re-pull

I believe, that if I change the "answer" for an image param in the nulecule, atomicapp does not get the "new" image it uses the one it pulled based on install.

check for min version of docker

when using the docker provider, a minimum version of docker is required on the host, we should check for that and not install if host.docker-version < atomicapp-run.docker-version

non-executable-script constants.py 0644L /usr/bin/env

Hi,

there are some *.py files that has '#!/usr/bin/env python' as the first line but are not executable. They should be make executable or the line removed. List:

atomicapp/constants.py
atomicapp/generator/core.py
atomicapp/params.py
atomicapp/utils.py
atomicapp/plugin.py
atomicapp/cli/main.py
atomicapp/generator/api.py
atomicapp/install.py
atomicapp/create.py
atomicapp/run.py

Cheers
Jan

make providers configurable

As a deployer,
I want to configure a provider to use a provider specific configuration file
so that I can deploy remotely to a kubernetes or openshift cluster.

Proposal: usage of LABELs in Application's Dockerfile

To give a little more meaning to the dockerfile and make the meta data available to atomic tool (and other tools like devassistant) I would like to propose the following LABELs

LABEL io.projectatomic.nulecule.specversion 0.0.2 - this indicates, that the Dockerfile belongs to a Atomicapp, compatible with Nulecule Spec 0.0.2, inferred from that, we know that this docker container is an atomicapp.

docker tries to pull even if image is available locally

containerapp.py tries to pull the image in question in anyway, even if the image is locally available

[tester@rhel7server-mongodb-developer containerapp]$ sudo containerapp --dry-run install nulecule/mongodb-24-rhel7
Namespace(APP='nulecule/mongodb-24-rhel7', action='install', answers='/home/tester/Source/mongoDB-nulecule/containerapp/answers.conf', dryrun=True, func=<function cli_install at 0x13771b8>, quiet=False, recursive=True, target_path=None, update=False, verbose=False)
2015-04-21 15:43:03,782 - containerapp.install - INFO - App name is nulecule/mongodb-24-rhel7, will be populated to None
Trying to pull repository docker-registry.usersys.redhat.com/nulecule/mongodb-24-rhel7 ... not found
Trying to pull repository docker.io/nulecule/mongodb-24-rhel7 ... not found
FATA[0004] Error: image nulecule/mongodb-24-rhel7:latest not found 
Traceback (most recent call last):
  File "/bin/containerapp", line 9, in <module>
    load_entry_point('containerapp==0.1', 'console_scripts', 'containerapp')()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 101, in main
    cli.run()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 83, in run
    args.func(args)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 18, in cli_install
    install.install()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/install.py", line 84, in install
    self.utils.pullApp(self.params.app)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/utils.py", line 96, in pullApp
    raise Exception("Couldn't pull %s" % image)
Exception: Couldn't pull nulecule/mongodb-24-rhel7
[tester@rhel7server-mongodb-developer containerapp]$ sudo docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
nulecule/mongodb-24-rhel7    latest              d90f89ba589a        About an hour ago   451.8 MB
openshift/mongodb-24-rhel7   latest              4eed528d5ae1        3 hours ago         504 MB
rhel7                        7.1-4               10acc31def5d        10 weeks ago        154.1 MB
rhel7                        latest              10acc31def5d        10 weeks ago        154.1 MB
docker.io/kubernetes/pause   latest              6c4579af347b        9 months ago        239.8 kB
[tester@rhel7server-mongodb-developer containerapp]$ sudo docker tag d90f89ba589a docker-registry.usersys.redhat.com/nulecule/mongodb-24-rhel7
[tester@rhel7server-mongodb-developer containerapp]$ sudo docker push d90f89ba589a
FATA[0000] You cannot push a "root" repository. Please rename your repository to <user>/<repo> (ex: <user>/docker.io/d90f89ba589a) 
[tester@rhel7server-mongodb-developer containerapp]$ sudo containerapp --dry-run install nulecule/mongodb-24-rhel7
Namespace(APP='nulecule/mongodb-24-rhel7', action='install', answers='/home/tester/Source/mongoDB-nulecule/containerapp/answers.conf', dryrun=True, func=<function cli_install at 0xc401b8>, quiet=False, recursive=True, target_path=None, update=False, verbose=False)
2015-04-21 15:43:45,366 - containerapp.install - INFO - App name is nulecule/mongodb-24-rhel7, will be populated to None
Trying to pull repository docker-registry.usersys.redhat.com/nulecule/mongodb-24-rhel7 ... not found
Trying to pull repository docker.io/nulecule/mongodb-24-rhel7 ... not found
FATA[0002] Error: image nulecule/mongodb-24-rhel7:latest not found 
Traceback (most recent call last):
  File "/bin/containerapp", line 9, in <module>
    load_entry_point('containerapp==0.1', 'console_scripts', 'containerapp')()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 101, in main
    cli.run()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 83, in run
    args.func(args)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 18, in cli_install
    install.install()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/install.py", line 84, in install
    self.utils.pullApp(self.params.app)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/utils.py", line 96, in pullApp
    raise Exception("Couldn't pull %s" % image)
Exception: Couldn't pull nulecule/mongodb-24-rhel7
[tester@rhel7server-mongodb-developer containerapp]$ sudo docker push d90f89ba589a
FATA[0000] You cannot push a "root" repository. Please rename your repository to <user>/<repo> (ex: <user>/docker.io/d90f89ba589a) 
[tester@rhel7server-mongodb-developer containerapp]$ sudo docker push docker-registry.usersys.redhat.com/nulecule/mongodb-24-rhel7
The push refers to a repository [docker-registry.usersys.redhat.com/nulecule/mongodb-24-rhel7] (len: 1)
Sending image list
Pushing repository docker-registry.usersys.redhat.com/nulecule/mongodb-24-rhel7 (1 tags)
Image 10acc31def5d already pushed, skipping
9e3ab6f17775: Image successfully pushed 
25c72db89025: Image successfully pushed 
e10cc8504a94: Image successfully pushed 
7b8da24b9444: Image successfully pushed 
91866a38a99b: Image successfully pushed 
36d2a7c3b424: Image successfully pushed 
6d1255a6b23c: Image successfully pushed 
9750fbae5f2e: Image successfully pushed 
56a9345eb35a: Image successfully pushed 
91d63297c20e: Image successfully pushed 
85790c0a5ef4: Image successfully pushed 
08873fb74bc0: Image successfully pushed 
d90f89ba589a: Image successfully pushed 
Pushing tag for rev [d90f89ba589a] on {http://docker-registry.usersys.redhat.com/v1/repositories/nulecule/mongodb-24-rhel7/tags/latest}
[tester@rhel7server-mongodb-developer containerapp]$ sudo containerapp --dry-run install nulecule/mongodb-24-rhel7
[sudo] password for tester: 
Namespace(APP='nulecule/mongodb-24-rhel7', action='install', answers='/home/tester/Source/mongoDB-nulecule/containerapp/answers.conf', dryrun=True, func=<function cli_install at 0x1c8e1b8>, quiet=False, recursive=True, target_path=None, update=False, verbose=False)
2015-04-21 16:23:38,131 - containerapp.install - INFO - App name is nulecule/mongodb-24-rhel7, will be populated to None
Trying to pull repository docker-registry.usersys.redhat.com/nulecule/mongodb-24-rhel7 ...
d90f89ba589a: Download complete 
10acc31def5d: Download complete 
9e3ab6f17775: Download complete 
25c72db89025: Download complete 
e10cc8504a94: Download complete 
7b8da24b9444: Download complete 
91866a38a99b: Download complete 
36d2a7c3b424: Download complete 
6d1255a6b23c: Download complete 
9750fbae5f2e: Download complete 
56a9345eb35a: Download complete 
91d63297c20e: Download complete 
85790c0a5ef4: Download complete 
08873fb74bc0: Download complete 
Status: Image is up to date for docker-registry.usersys.redhat.com/nulecule/mongodb-24-rhel7:latest
e4a17ad77006c53d5f4d053a75f4eedfb792b94f0956aae644c30a381bcb8522
2015-04-21 16:23:41,933 - containerapp.utils - INFO - Using temporary directory /tmp/appent-mongodb-24-rhel73ilo6l
FATA[0000] Error response from daemon: Could not find the file /application-entity in container mongodb-24-rhel7 
mongodb-24-rhel7
Traceback (most recent call last):
  File "/bin/containerapp", line 9, in <module>
    load_entry_point('containerapp==0.1', 'console_scripts', 'containerapp')()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 101, in main
    cli.run()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 83, in run
    args.func(args)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 18, in cli_install
    install.install()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/install.py", line 88, in install
    self.params.loadMainfile(mainfile_path)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/params.py", line 70, in loadMainfile
    raise Exception("%s not found: %s" % (MAIN_FILE, path))
Exception: nulecule not found: /tmp/appent-mongodb-24-rhel73ilo6l/application-entity/nulecule
[tester@rhel7server-mongodb-developer containerapp]$

atomic install from local docker image does not work

while atomic install of a locally build atomicapp, I see the following problems:

$ sudo atomic install goern/mongodb-24-centos7-atomicapp
docker run --rm -it --privileged -v /run:/run -v :/atomicapp -v /:/host -v /answers.conf:/application-entity/answers.conf -e IMAGE=goern/mongodb-24-centos7-atomicapp -e NAME=mongodb-24-centos7-atomicapp --name mongodb-24-centos7-atomicapp goern/mongodb-24-centos7-atomicapp atomicapp -v install --path /atomicapp /application-entity
Unable to find image 'goern/mongodb-24-centos7-atomicapp:latest' locally
Trying to pull repository docker-registry.usersys.redhat.com/goern/mongodb-24-centos7-atomicapp ... not found
Trying to pull repository docker.io/goern/mongodb-24-centos7-atomicapp ... not found
FATA[0004] Error: image goern/mongodb-24-centos7-atomicapp:latest not found 

[tester]$ grep -i registry /etc/sysconfig/docker
ADD_REGISTRY='--add-registry docker-registry.usersys.redhat.com'
INSECURE_REGISTRY='--insecure-registry docker-registry.usersys.redhat.com'
[tester]$ sudo docker images 
REPOSITORY                           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
goern/mongodb-24-centos7-atomicapp   latest              d9149119ed71        About an hour ago   267.3 MB
rhel7                                latest              10acc31def5d        3 months ago        154.1 MB
rhel7                                7.1-4               10acc31def5d        3 months ago        154.1 MB 

Simplify CLI

We're running into some issues when running as a container such as how to pass in an optional conf file and how to pass in params like interactive --ask.

The install behavior is not intuitive. It should be optional in a container context. My understanding is it pulls in remote sources (if there are any) and moves the files to a new directory. I suggest we default to current working directory ${PWD} and leave things there, adding an external directory during install for remote sources. Options would be --source <src_dir> and --destination <dst_dir>. No strong opinion on option names; whatever makes sense.

In a container context bindmount options are simplified as -v ${PWD}:/atomicapp. The answerfile.conf will appear there (if present). If /atomicapp doesn't have a Nulecule file then copy contents of cp /application-entity/* /atomicapp/ -r. We won't want to do this in a non-container context.

Support provider context

Application context and namespacing is a key feature of providers such as kubernetes. Here's how I think it should work.

Definition

Default namespace is defined in the nulecule file in the metadata section.

metadata:
  kubernetes:
    context: mycluster
    namespace: mycoolapp
...

At deployment the default context and namespace maybe overridden using a general parameter.

[general]
provider=kubernetes
context=aweiteka-cluster
namespace=mycoolerapp
...

Provider implementation

If provided the provider plugin should create resources with the context and/or namespace options.

kubectl create -f mycoolapp-pod.json --context=aweiteka-cluster --namespace=mycoolapp

The context and namespace must exist for the above create command to succeed. It appears to be safe to do this even if values exist.

kubectl config set-context aweiteka-cluster --namespace=mycoolapp

Additional information about namespace context.

Configuration file

It appears ~/.kube/.kubeconfig file does not exist by default and causes set-context calls to fail. Merely touching this file resolves the failure.

$ kubectl config set-context myapp --namespace=mycoolapp
open /home/vagrant/.kube/.kubeconfig: no such file or directory
$ sudo kubectl config set-context myapp --namespace=mycoolapp
open /root/.kube/.kubeconfig: no such file or directory
$ mkdir /home/vagrant/.kube/
$ touch /home/vagrant/.kube/.kubeconfig

Viewing and set the context namespace

$ kubectl config view
apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []
$ kubectl config set-context myapp --namespace=mycoolapp
$ kubectl config view
apiVersion: v1
clusters: []
contexts:
- context:
    cluster: ""
    namespace: mycoolapp
    user: ""
  name: myapp
current-context: ""
kind: Config
preferences: {}
users: []

[provider-openshift] figure out how to get openshift credentials inside the atomicapp

given a openshift provider, we need to have credentials to talk to the openshift environment, these need to be accessible to the atomicapp container that is trying to install ...

Use Case:
As a deployment guy who wants to deploy a "container-app compliant" application,
I want to be able to 'atomic install atomicapp-mongodb'
so that a mongoDB pod is up and running on my OpenShift Enterprise 3 environment

RFE: given a collection of OpenShift templates (or Kubernetes JSON files) apply them all in service order first

Note this might already be fixed - just adding it as a note to be sure its done...

If you have N OpenShift templates and/or Kubernetes JSON files, we'll need to process all the OpenShift templates first (e.g. via osc process command line tool). Then we're left with an ordered list of Kubernetes JSON files.

We need to then iterate through all these JSON files and apply the Services first; to generate the constant service portalIP addresses. Then in the second phase, we do everything but the Services (i.e. Pods and Replication Controllers) which by this time should have all the environment variables setup correctly to point to all the services.

If you don't provision things in a 2 phase approach; its possible to get cycles (Pod A uses service B and Pod B uses service A) and one of the pods doesn't get the IP address of the service.

graph.component.params seems to be required, must be optional

$ containerapp --dry-run run .
/home/tester/Source/mongoDB-atomicapp/answers.conf
2015-04-22 17:28:59,930 - containerapp.utils - INFO - Artifacts for mongodb present for these providers: openshift
2015-04-22 17:28:59,931 - containerapp.utils - INFO - Using temporary directory /tmp/appent-nulecule-mongoDB-24-rhel724_4vQ
Traceback (most recent call last):
  File "/usr/bin/containerapp", line 9, in <module>
    load_entry_point('containerapp==0.1', 'console_scripts', 'containerapp')()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 101, in main
    cli.run()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 83, in run
    args.func(args)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 35, in cli_run
    ae.run()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/run.py", line 125, in run
    self._dispatchGraph()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/run.py", line 69, in _dispatchGraph
    self._processComponent(component, graph_item)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/run.py", line 99, in _processComponent
    data = self._applyTemplate(data, component)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/run.py", line 73, in _applyTemplate
    config = self.params.get(component)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/params.py", line 94, in get
    params = self._mergeParamsComponent(component)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/params.py", line 114, in _mergeParamsComponent
    for name, p in self.mainfile_data["graph"][component]["params"].iteritems())
KeyError: 'params'

I run this on https://github.com/goern/mongoDB-atomicapp

Inconsistent dry-run behavior

Currently, there are several different behaviors of dry-run. When dry-run is enabled, some of them print a message to stdout by print function, some of them output a message by logger, and some of them do not output anything.

When dry-run is enabled, each time encounter dry-run option, a message should be outputted.

IMO, logger.info is a good way to output such a dry-run message, which is prefixed with "DRY-RUN: " that is useful to separate dry-run message from normal log messages.

CI workflow

We need automated testing so PRs go through some validation before review -> merge.

Aside from the usual suspects I noticed this service can provide some help: https://landscape.io/

Global params for nulecule

So, I have a nulecule that has a mariadb and a drupal, they both need a couple of the same params (e.g. db_user). Currently, my nulecule looks like this (trimmed some for brevity):

    specversion: 0.0.1-alpha
    id: drupal-app
    metadata:
       name: Drupal App
       appversion: 0.0.1
       description: This is a Drupal Atomicapp
    graph:
       drupal:
          params:
             db_user:
                description: database user
          artifacts:
             kubernetes:
                - file://graph/k8s/drupal-pod.json
                - file://graph/k8s/drupal-service.json
       mariadb-app:
          source: docker://localhost:5000/mariadb-app
          params:
             db_user:
                description: database user

But, I think I want some way to do this:

    specversion: 0.0.1-alpha
    id: drupal-app
    metadata:
       name: Drupal App
       appversion: 0.0.1
       description: This is a Drupal Atomicapp
    params:
        db_user:
            description: database user
    graph:
       drupal:
          artifacts:
             kubernetes:
                - file://graph/k8s/drupal-pod.json
                - file://graph/k8s/drupal-service.json
       mariadb-app:
          source: docker://localhost:5000/mariadb-app`

and have the param pass through to both. However, this also raises the issue of "namespacing the param".

AWS provider

As a deployment guy
I want to use an AWS provider
so that my docker containers get startet on AWS (either using kube on AWS or some native AWS)

Implement JSON r/o Web API for atomicapp

As a computer program,
I want to query the current state of atomicapp run via HTTP/JSON
so that I can reuse that information.

While atomicapp is running, a web api shall be exposed via port 80/tcp, there shall be no authentication or encryption.
This api shall provide

  1. the nulecule file itself
  2. a global state information
  3. all params and there values

after the execution of atomicapp has finished, the web api shall accept one final request and than terminat atomicapp (so that the container will stop).

The global state information provided by the web api will be feed from a global structure inside atomicapp, this structure will be updated by any method that would like to 'publish' a state information (like 'we are pulling docker images', or 'installation failed').

running container-app.py ootb errors on plugin manager.

Hi mister pavlin... Finally hacking on an implementation. But when I ran container-app.py, it complained about the imports. Is there some special pythonic way of running this that im missing ? Thanks !

[jay@rhbd atomicapp-run]$ ./containerapp.py
Traceback (most recent call last):
  File "./containerapp.py", line 3, in <module>
    import run
  File "/home/jay/Development/PROJECT_Atomicapp/atomicapp-run/run.py", line 14, in <module>
    from yapsy.PluginManager import PluginManager
ImportError: No module named yapsy.PluginManager

Provide a way to list locally available providers

atomicapp doesn't currently provide a way to easily check which providers are at least nominally available locally. A command like atomicapp list-providers could help indicate which provides are installed and have their dependencies met (e.g. kubectl CLI for the kubernetes provider).

have a 'download docker images only' mode which is handy when performing an update

if you want to upgrade to a new version of stuff; it can take a while to load new docker images. so its handy to have a 'download docker images only' mode where we iterate through all the kubernetes json (after OpenShift templates are expanded), find all the docker images and do a pull first.

Then if you need to delete pods/RCs, the rollover time is gonna be quite quick since the images are already locally fetched

RFE: automatically create router object [provider] [openshift]

Atomicapp should automatically creating OpenShift routes for all services given a configurable domain. e.g. service “foo” gets a route created at “foo.example.com” if the answers file has a DOMAIN=“example.com”.

OpenShift routes are completely generic so there is no need to have to developer put an artifact in the Atomicapp for that.

We need to think about the integration of TLS.

atomicapp requires a answers.conf

If no answers.conf is present, atomicapp-run will create a directory called answers.conf and fail:

[goern@rh-t540p-goern-example-com helloapache]$  atomic install vpavlin/helloapache
Trying to pull repository docker.io/vpavlin/helloapache ...
83aacabfd9f5: Download complete 
6941bfcbbfca: Download complete 
41459f052977: Download complete 
fd44297e2ddb: Download complete 
f286a6c39e45: Download complete 
73846768f6ac: Download complete 
d7b655f6e4dc: Download complete 
961b449b9e1f: Download complete 
feb44a40d082: Download complete 
428afc87436e: Download complete 
43ef39ac5dd4: Download complete 
6abeba4661b1: Download complete 
415af7349a3b: Download complete 
7cfb02a1dff2: Download complete 
2d78fd7e9055: Download complete 
68b2249a53e9: Download complete 
0cb0fa313806: Download complete 
8cd6de2d9613: Download complete 
e185893ced68: Download complete 
Status: Downloaded newer image for docker.io/vpavlin/helloapache:latest
docker run --rm -it --privileged -v /run:/run -v ${PWD}:/atomicapp -v /:/host -v ${PWD}/answers.conf:/application-entity/answers.conf -e IMAGE=vpavlin/helloapache -e NAME=helloapache --name helloapache vpavlin/helloapache containerapp -v install --path /atomicapp /application-entity
2015-05-07 11:19:22,500 - containerapp.install - INFO - App path is /application-entity, will be populated to /atomicapp
2015-05-07 11:19:22,503 - containerapp.params - DEBUG - Setting app id to helloapache-app
2015-05-07 11:19:22,503 - containerapp.utils - DEBUG - Setting path to /application-entity
2015-05-07 11:19:22,503 - containerapp.params - DEBUG - Path to answers file given, loading /application-entity/answers.conf
Traceback (most recent call last):
  File "/usr/bin/containerapp", line 9, in <module>
    load_entry_point('containerapp==0.1', 'console_scripts', 'containerapp')()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 100, in main
    cli.run()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 82, in run
    args.func(args)
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/cli/main.py", line 18, in cli_install
    install.install()
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/install.py", line 75, in install
    if not self.params.loadAnswers(self.answers_file):
  File "/usr/lib/python2.7/site-packages/containerapp-0.1-py2.7.egg/containerapp/params.py", line 103, in loadAnswers
    data = anymarkup.parse_file(data)
  File "build/bdist.linux-x86_64/egg/anymarkup/__init__.py", line 103, in parse_file
anymarkup.AnyMarkupError: AnyMarkupError: caught <type 'exceptions.IOError'>: [Errno 21] Is a directory: '/application-entity/answers.conf'

[goern@rh-t540p-goern-example-com helloapache]$ ls
answers.conf
[goern@rh-t540p-goern-example-com helloapache]$ cat answers.conf
cat: answers.conf/: Is a directory
[goern@rh-t540p-goern-example-com helloapache]$ rm answers.conf -rf
[goern@rh-t540p-goern-example-com helloapache]$ vi answers.conf 
[goern@rh-t540p-goern-example-com helloapache]$ atomic install vpavlin/helloapache
docker run --rm -it --privileged -v /run:/run -v ${PWD}:/atomicapp -v /:/host -v ${PWD}/answers.conf:/application-entity/answers.conf -e IMAGE=vpavlin/helloapache -e NAME=helloapache --name helloapache vpavlin/helloapache containerapp -v install --path /atomicapp /application-entity
2015-05-07 11:20:15,870 - containerapp.install - INFO - App path is /application-entity, will be populated to /atomicapp
2015-05-07 11:20:15,873 - containerapp.params - DEBUG - Setting app id to helloapache-app
2015-05-07 11:20:15,873 - containerapp.utils - DEBUG - Setting path to /application-entity
2015-05-07 11:20:15,873 - containerapp.params - DEBUG - Path to answers file given, loading /application-entity/answers.conf
2015-05-07 11:20:15,874 - containerapp.install - INFO - Copying content of directory /application-entity to /atomicapp
2015-05-07 11:20:15,874 - containerapp.install - INFO - Copying app helloapache
2015-05-07 11:20:15,896 - containerapp.utils - DEBUG - Provider: kubernetes
2015-05-07 11:20:15,896 - containerapp.utils - DEBUG - Artifact file://graph/k8s/hello-apache-pod.json: OK
2015-05-07 11:20:15,896 - containerapp.utils - INFO - Artifacts for helloapache-app present for these providers: kubernetes
2015-05-07 11:20:15,896 - containerapp.install - INFO - Component data exist in /atomicapp/graph/helloapache, skipping population...
2015-05-07 11:20:15,896 - containerapp.utils - DEBUG - {u'artifacts': {u'kubernetes': [u'file://graph/k8s/hello-apache-pod.json']}, u'params': {u'image': {u'default': u'fedora/apache', u'description': u'The webserver image'}}}
2015-05-07 11:20:15,896 - containerapp.install - DEBUG - Component helloapache-app is part of the app
[goern@rh-t540p-goern-example-com helloapache]$ 

logger is undefined an a few places

In the following location the logger seems to be undefined?!

  • atomicapp/cli/main.py Line 95
  • atomicapp/params.py Line 69
  • atomicapp/params.py Line 111
  • atomicapp/plugin.py Line 33

RFE: have different install modes (create, update, update-if-exists, replace)

we've found its useful to have a few different modes when 'installing'. The default 'create' mode would let the user pick which things to install.

The update modes would allow new versions to be updated. e.g. if a few things from version X have been installed, we should be able to get version Y as a docker container and just run 'update' which would then just update all the Services / Pods / Replication Controllers in a given namespace (for matching ids).

Users may want a more fine grained option; of comparing the installer container and the namespace and finding what things have changed; then letting users pick the things to upgrade/install.

In terms of performing the update; as specified in #18 we'd want to do it in 2 passes; Services first; then Pods/ReplicationControllers next.

Finally updates can be done in place in the REST API in kubernetes (think a PUT in REST) or can be done via GET, merge the new config onto the old value and then PUT, or via DELETE and POST.

When versions change in the kubernetes API; doing a merge can be troublesome as things move around in the JSON. So having a 'delete then create' mode for updates will be very useful - especially when moving between versions of kubernetes (e.g. from v1beta3 to v1)

Label all artifacts for kubernetes and openshift

Kubernetes (and through that also openshift) has ability to label pods, services and RCs. If we label all of them with something like nulecule-$app_id, we can use that for stop feature and instead callinf kubectl delete -f for every single artifact, we can just call kubectl delete rc,services,pods -l name=nulecule-$app_id

provide a web console for atomicapp-run for folks who prefer a UI to a CLI

the hawtio folks can help on this one as we've a similar UI already for installing stuff on kubernetes (using fabric8 app zips) which we can probably easily port into a stand alone HTML5 UI we can embed inside atomicapp-run.

To help the web app it'd be nice to expose atomicapp-run as a REST API inside the docker container so the HTML5 console can just invoke that

create an automated build of containerapp docker image on https://registry.hub.docker.com/ so that developers can work on examples without building everything locally

these examples https://github.com/vpavlin/atomicapp-run/tree/master/examples all require a local 'scratch' image to be created first.

Any chance of just setting up an automated build (or CI build on circleci.com or something) of a base docker image on https://github.com/vpavlin/atomicapp-run/tree/master/examples so that folks can just work on a single example container app without having to keep rebuilding all the implementation containers and working direct on the python stuff?

Then to use folks can just do:

cd atomicapp-run/examples/wordpress
docker build -t foo .
docker run foo

e.g. I tried following the python install & shell script stuff on my mac and got this...

sudo python setup.py install
export PYTHONPATH=$PWD/containerapp:$PYTHONPATH
alias containerapp="$PWD/containerapp/cli/main.py"
cd atomicapp-run/examples/wordpress
containerapp build
Traceback (most recent call last):
  File "/java-workspace/atomicapp-run/containerapp/cli/main.py", line 103, in <module>
    main()
  File "/java-workspace/atomicapp-run/containerapp/cli/main.py", line 100, in main
    cli.run()
  File "/java-workspace/atomicapp-run/containerapp/cli/main.py", line 82, in run
    args.func(args)
  File "/java-workspace/atomicapp-run/containerapp/cli/main.py", line 26, in cli_build
    data = json.load(fp)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load
    **kw)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 383, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.