projectatomic / atomicapp Goto Github PK
View Code? Open in Web Editor NEW[UNMAINTAINED] This is the reference implementation of the Nulecule container application Specification: Atomic App
[UNMAINTAINED] This is the reference implementation of the Nulecule container application Specification: Atomic App
Needed for all those examples around databases etc ...
Spec v2 is at
https://github.com/projectatomic/nulecule/tree/master/spec/0.0.2#storage-requirements-object
As a developer
I want to get an error when my Nulecule file's spec is younger/greater than the specversion to atomicapp supports
init
is defined in the base class Provider
, that must be implemented in each subclass inherited from Provider
. It should raise NotImplemented error instead of logging a warning message.
$ atomic run helloapache
should fail gracefully if kubectl client is not on host.
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.
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
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
"python setup.py install" doesn't create any installation metadata, so it should almost never be used.
"pip install ." is the equivalent that creates the appropriate installation metadata that allows uninstallation later.
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.
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.
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]$
As a developer and user of the Nulecule Specification
I want to find one single place on the internet
so that I have a lot of rich examples how to use Nulecule and Atomicapp
We should not run twice, at lease when we merge the REST API feature it will break as port 5000 may be bound by another instance of atomicapp.
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
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.
Application context and namespacing is a key feature of providers such as kubernetes. Here's how I think it should work.
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
...
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
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
$ 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: []
As a deployer
I want to call atomic uninstall <some-atomicapp>
so that all components will be stopped and undeployed
What version of Python does atomicapp work with? I just notice that OrderedDict
is used here https://github.com/projectatomic/atomicapp/blob/master/atomicapp/providers/kubernetes.py#L33 . OrderedDict
was introduced since Python 2.7.
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
Lets update the json to be valid, proposed change to spec here projectatomic/nulecule#12
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.
$ 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
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.
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/
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".
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)
During atomic install of mongoDB-atomicapp I get the following error: http://fpaste.org/220791/31372419/
It seems like that the container names collide...
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
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').
esp. implement projectatomic/nulecule@75d2c94
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
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).
If we get atomicapp as aRPM it will be helpful for maintaining its dependency on other packages and we can bake it in images like Vagrant.
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
In create.py
, SCHEMA_URL
is hardcoded to https://raw.githubusercontent.com/projectatomic/nulecule/master/spec/0.0.1-alpha/schema.json . When user does not provide a schema via --schema
from command line, a schema.json
file will be downloaded from that URL. Is this an expected behavior?
There is already a new version 0.0.2 of schema.json
in spec/
, should this URL be changed to that new one?
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.
As a software doing a deployment of an Atomicapp
I want to query the Atomicall via RESTful http
so that I can learn what parameters are available, required and eventually have default values assigned
Source distribution package generated by
python setup.py sdist --format=[format]
does not contains other data files expect Python source files.
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]$
In the following location the logger seems to be undefined?!
I would like to be able to...
answerfile.conf.sample
file appear in my working directoryanswerfile.conf
As a developer
I need to query for the version of atomicapp I am using
so that I know that I need to update
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)
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
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
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
As a deployer
I want to deploy containerized applications into a given namespaces
so that names do not collide.
given the fact that we have a Dockerfile, containing LABELs, we could write a little compiler that generated Nulecule snippets from that Dockerfile
when using Kubernetes / OpenShift we can perform rolling upgrades; where essentially new versions of ReplicationControllers can be used and things can gradually be rolled over from the old version to the new version as folks verify the new version works.
So we should be able to use the correct Kubernetes mechanisms to do rolling upgrades nicely. (Maybe using OpenShift DeploymentConfig?)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.