projectatomic / nulecule

[UNMAINTAINED] Specification describing a container-based application
209 stars 46 forks source link

projectatomic/helloapache example is failing #152

Closed LalatenduMohanty closed 9 years ago

LalatenduMohanty commented 9 years ago

I tried to run the helloapache example from dockerhub on latest CentOS7 box, it failed to run. CC @ggallen

Here are the steps I followed

[vagrant@localhost ~]$ kubectl get nodes
NAME        LABELS                             STATUS
127.0.0.1   kubernetes.io/hostname=127.0.0.1   Ready
[vagrant@localhost ~]$ atomic run projectatomic/helloapache
/usr/bin/docker pull projectatomic/helloapache
latest: Pulling from docker.io/projectatomic/helloapache
f1b10cd84249: Pull complete
c852f6d61e65: Pull complete
7322fbe74aa5: Pull complete
00b732e9ad70: Pull complete
54fa122efced: Pull complete
b6c62bd7b7bb: Pull complete
c2c2d3f8fe0a: Pull complete
01b6c9c5d908: Pull complete
a2fe7177d65a: Pull complete
616b6e613571: Pull complete
0b6b10d60c35: Pull complete
ae71f37e66d3: Pull complete
5cd578686f9d: Pull complete
f6c7e1e80ccd: Pull complete
d0abd9728a48: Pull complete
72930c585f3e: Pull complete
aa99af784907: Pull complete
a7b22197203f: Already exists
Digest: sha256:98bcea47bea3cfa3057b824716f02b94fd133c1d0062b4f18cf59706177ef92c
Status: Downloaded newer image for docker.io/projectatomic/helloapache:latest
docker run -it --rm  --privileged -v /home/vagrant:/atomicapp -v /run:/run -v /:/host --net=host --name helloapache -e NAME=helloapache -e IMAGE=projectatomic/helloapache projectatomic/helloapache -v  run  /atom
icapp
2015-08-21 11:30:51,447 - atomicapp.install - INFO - App name is projectatomic/helloapache, will be populated to /atomicapp
2015-08-21 11:30:51,447 - atomicapp.utils - INFO - atomicapp.status.info.message=Loading app projectatomic/helloapache .
2015-08-21 11:30:51,447 - atomicapp.utils - INFO - atomicapp.status.answer.message={"general": {"namespace": "default", "provider": "kubernetes"}}
2015-08-21 11:30:51,447 - atomicapp.nulecule_base - DEBUG - {'namespace': 'default', 'provider': 'kubernetes'}
2015-08-21 11:30:51,499 - atomicapp.nulecule_base - DEBUG - Output of docker images cmd:
2015-08-21 11:30:51,499 - atomicapp.utils - INFO - atomicapp.status.info.message=Pulling image projectatomic/helloapache ...
latest: Pulling from docker.io/projectatomic/helloapache
f1b10cd84249: Already exists
c852f6d61e65: Already exists
7322fbe74aa5: Already exists
00b732e9ad70: Already exists
54fa122efced: Already exists
b6c62bd7b7bb: Already exists
c2c2d3f8fe0a: Already exists
01b6c9c5d908: Already exists
a2fe7177d65a: Already exists
616b6e613571: Already exists
0b6b10d60c35: Already exists
ae71f37e66d3: Already exists
5cd578686f9d: Already exists
f6c7e1e80ccd: Already exists
d0abd9728a48: Already exists
72930c585f3e: Already exists
aa99af784907: Already exists
a7b22197203f: Already exists
Digest: sha256:98bcea47bea3cfa3057b824716f02b94fd133c1d0062b4f18cf59706177ef92c
Status: Image is up to date for docker.io/projectatomic/helloapache:latest
2015-08-21 11:30:52,291 - atomicapp.nulecule_base - DEBUG - {'namespace': 'default', 'provider': 'kubernetes'}
2015-08-21 11:30:52,292 - atomicapp.install - DEBUG - Creating a container with name helloapache-WJiMlh
2015-08-21 11:30:52,292 - atomicapp.install - DEBUG - /usr/bin/docker run --name helloapache-WJiMlh --entrypoint /bin/true projectatomic/helloapache
2015-08-21 11:30:53,120 - atomicapp.utils - INFO - Using temporary directory /tmp/nulecule-cjiCCa
2015-08-21 11:30:53,120 - atomicapp.install - DEBUG - ['/usr/bin/docker', 'cp', 'helloapache-WJiMlh:/application-entity', '/tmp/nulecule-cjiCCa']
2015-08-21 11:30:53,247 - atomicapp.install - DEBUG - Application entity data copied to /tmp/nulecule-cjiCCa
2015-08-21 11:30:53,248 - atomicapp.utils - INFO - atomicapp.status.info.message=Copied app successfully.
helloapache-WJiMlh
2015-08-21 11:30:53,300 - atomicapp.install - INFO - Copying app helloapache
2015-08-21 11:30:53,311 - atomicapp.nulecule_base - DEBUG - Setting app id to helloapache-app
2015-08-21 11:30:53,312 - atomicapp.install - DEBUG - App ID: helloapache-app
2015-08-21 11:30:53,312 - atomicapp.nulecule_base - DEBUG - Version check successful: specversion == 0.0.2
2015-08-21 11:30:53,312 - atomicapp.utils - INFO - atomicapp.status.info.message=Checking all artifacts
2015-08-21 11:30:53,312 - atomicapp.nulecule_base - DEBUG - Provider: docker
2015-08-21 11:30:53,312 - atomicapp.utils - INFO - atomicapp.status.info.message=Artifact file://artifacts/docker/hello-apache-pod_run: OK.
2015-08-21 11:30:53,312 - atomicapp.nulecule_base - DEBUG - Provider: kubernetes
2015-08-21 11:30:53,312 - atomicapp.utils - INFO - atomicapp.status.info.message=Artifact file://artifacts/kubernetes/hello-apache-pod.json: OK.
2015-08-21 11:30:53,312 - atomicapp.utils - INFO - atomicapp.status.info.message=All artifacts OK.
2015-08-21 11:30:53,312 - atomicapp.nulecule_base - INFO - Artifacts for helloapache-app present for these providers: docker, kubernetes
2015-08-21 11:30:53,312 - atomicapp.utils - INFO - atomicapp.status.info.message=Loading Nulecule file.
2015-08-21 11:30:53,312 - atomicapp.install - INFO - Installing dependencies for helloapache-app
2015-08-21 11:30:53,312 - atomicapp.utils - DEBUG - {u'artifacts': {u'docker': [u'file://artifacts/docker/hello-apache-pod_run'], u'kubernetes': [u'file://artifacts/kubernetes/hello-apache-pod.json']}, u'params': [{u'default': u'centos/httpd', u'name': u'image', u'description': u'The webserver image'}, {u'default': 80, u'name': u'hostport', u'description': u'The host TCP port as the external endpoint'}], u'name': u'helloapache-app'}
2015-08-21 11:30:53,313 - atomicapp.install - DEBUG - Component helloapache-app is part of the app
2015-08-21 11:30:53,313 - atomicapp.install - DEBUG - Values: {u'helloapache-app': {u'image': u'centos/httpd', u'hostport': 80}}
2015-08-21 11:30:53,313 - atomicapp.utils - INFO - atomicapp.status.info.message=All dependencies installed successfully.
2015-08-21 11:30:53,313 - atomicapp.install - DEBUG - {u'helloapache-app': {u'image': u'centos/httpd', u'hostport': 80}}
2015-08-21 11:30:53,313 - atomicapp.nulecule_base - DEBUG - Data given {u'helloapache-app': {u'image': u'centos/httpd', u'hostport': 80}}
2015-08-21 11:30:53,313 - atomicapp.install - DEBUG - {u'helloapache-app': {u'image': u'centos/httpd', u'hostport': 80}, 'general': {'namespace': 'default', 'provider': 'kubernetes'}}
2015-08-21 11:30:53,313 - atomicapp.nulecule_base - INFO - Writing answers file template to /atomicapp/answers.conf.sample
2015-08-21 11:30:53,313 - atomicapp.nulecule_base - DEBUG - writing {u'helloapache-app': {u'image': u'centos/httpd', u'hostport': 80}, 'general': {'namespace': 'default', 'provider': 'kubernetes'}} to /atomicapp/answers.conf.sample with format ini
2015-08-21 11:30:53,314 - atomicapp.utils - INFO - atomicapp.status.answer.message={"helloapache-app": {"image": "centos/httpd", "hostport": 80}, "general": {"namespace": "default", "provider": "kubernetes"}}
2015-08-21 11:30:53,314 - atomicapp.utils - INFO - atomicapp.status.info.message=Install Successful.
2015-08-21 11:30:53,314 - atomicapp.utils - INFO - atomicapp.status.info.message=Install Successful.
2015-08-21 11:30:53,314 - atomicapp.utils - DEBUG - Using working directory /atomicapp/.workdir
2015-08-21 11:30:53,314 - atomicapp.plugin - DEBUG - Loading providers from /usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/providers
2015-08-21 11:30:53,322 - atomicapp.nulecule_base - DEBUG - Setting app id to helloapache-app
2015-08-21 11:30:53,322 - atomicapp.nulecule_base - DEBUG - Version check successful: specversion == 0.0.2
2015-08-21 11:30:53,322 - atomicapp.nulecule_base - DEBUG - Provider: docker
2015-08-21 11:30:53,322 - atomicapp.utils - INFO - atomicapp.status.info.message=Artifact file://artifacts/docker/hello-apache-pod_run: OK.
2015-08-21 11:30:53,322 - atomicapp.nulecule_base - DEBUG - Provider: kubernetes
2015-08-21 11:30:53,323 - atomicapp.utils - INFO - atomicapp.status.info.message=Artifact file://artifacts/kubernetes/hello-apache-pod.json: OK.
2015-08-21 11:30:53,323 - atomicapp.utils - INFO - atomicapp.status.info.message=All artifacts OK.
2015-08-21 11:30:53,323 - atomicapp.nulecule_base - INFO - Artifacts for helloapache-app present for these providers: docker, kubernetes
2015-08-21 11:30:53,323 - atomicapp.utils - DEBUG - {u'artifacts': {u'docker': [u'file://artifacts/docker/hello-apache-pod_run'], u'kubernetes': [u'file://artifacts/kubernetes/hello-apache-pod.json']}, u'params': [{u'default': u'centos/httpd', u'name': u'image', u'description': u'The webserver image'}, {u'default': 80, u'name': u'hostport', u'description': u'The host TCP port as the external endpoint'}], u'name': u'helloapache-app'}
2015-08-21 11:30:53,323 - atomicapp.run - DEBUG - Processing component 'helloapache-app' and graph item '{u'artifacts': {u'docker': [u'file://artifacts/docker/hello-apache-pod_run'], u'kubernetes': [u'file://artifacts/kubernetes/hello-apache-pod.json']}, u'params': [{u'default': u'centos/httpd', u'name': u'image', u'description': u'The webserver image'}, {u'default': 80, u'name': u'hostport', u'description': u'The host TCP port as the external endpoint'}], u'name': u'helloapache-app'}'
2015-08-21 11:30:53,323 - atomicapp.plugin - DEBUG - Found provider <class 'kubernetes.KubernetesProvider'>
2015-08-21 11:30:53,323 - atomicapp.nulecule_base - DEBUG - Param provider already in general with value kubernetes
2015-08-21 11:30:53,323 - atomicapp.nulecule_base - DEBUG - Param namespace already in general with value default
2015-08-21 11:30:53,323 - atomicapp.utils - INFO - atomicapp.status.info.message=Deploying component helloapache-app ...
2015-08-21 11:30:53,323 - atomicapp.run - INFO - Using provider kubernetes for component helloapache-app
2015-08-21 11:30:53,323 - atomicapp.run - DEBUG - Templating artifact /atomicapp/artifacts/kubernetes/hello-apache-pod.json
2015-08-21 11:30:53,324 - atomicapp.nulecule_base - DEBUG - Param provider already in general with value kubernetes
2015-08-21 11:30:53,324 - atomicapp.nulecule_base - DEBUG - Param namespace already in general with value default
2015-08-21 11:30:53,324 - atomicapp.run - DEBUG - Config: {u'image': u'centos/httpd', 'provider': 'kubernetes', 'namespace': 'default', u'hostport': 80}
2015-08-21 11:30:53,324 - atomicapp.run - DEBUG - {u'image': u'centos/httpd', 'provider': 'kubernetes', 'namespace': 'default', u'hostport': 80}
2015-08-21 11:30:53,324 - atomicapp.plugin - DEBUG - Writing artifact to /atomicapp/.workdir/helloapache-app/artifacts/kubernetes/hello-apache-pod.json
2015-08-21 11:30:53,324 - kubernetes - DEBUG - Given config: {u'image': u'centos/httpd', 'provider': 'kubernetes', 'namespace': 'default', u'hostport': 80}
2015-08-21 11:30:53,324 - kubernetes - INFO - Using namespace default
2015-08-21 11:30:53,324 - kubernetes - INFO - trying kubectl at /host/usr/bin/kubectl
2015-08-21 11:30:53,325 - kubernetes - INFO - found kubectl at /host/usr/bin/kubectl
2015-08-21 11:30:53,325 - kubernetes - INFO - Deploying to Kubernetes
2015-08-21 11:30:53,325 - kubernetes - DEBUG - /atomicapp/.workdir/helloapache-app/artifacts/kubernetes/hello-apache-pod.json
2015-08-21 11:30:53,341 - kubernetes - DEBUG - stdout =
2015-08-21 11:30:53,341 - kubernetes - DEBUG - stderr = error: could not read an encoded object from /atomicapp/.workdir/helloapache-app/artifacts/kubernetes/hello-apache-pod.json: API version "v1beta3" in "/atomicapp/.workdir/helloapache-app/artifacts/kubernetes/hello-apache-pod.json" isn't supported, only supports API versions ["v1"]
error: no objects passed to create

2015-08-21 11:30:53,341 - atomicapp.utils - INFO - atomicapp.status.error.message=cmd failed: /host/usr/bin/kubectl create -f /atomicapp/.workdir/helloapache-app/artifacts/kubernetes/hello-apache-pod.json --namespace=default
Traceback (most recent call last):
  File "/usr/bin/atomicapp", line 9, in <module>
    load_entry_point('atomicapp==0.1.9', 'console_scripts', 'atomicapp')()
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/cli/main.py", line 227, in main
    cli.run()
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/cli/main.py", line 203, in run
    args.func(args)
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/cli/main.py", line 54, in cli_run
    if ae.run() is not None:
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/run.py", line 230, in run
    self._dispatchGraph()
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/run.py", line 125, in _dispatchGraph
    self._processComponent(component, graph_item)
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/run.py", line 213, in _processComponent
    provider.deploy()  
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/providers/kubernetes.py", line 137, in deploy
    self._callK8s(k8s_file)
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/providers/kubernetes.py", line 101, in _callK8s
    raise Exception(str(stderr))
Exception: error: could not read an encoded object from /atomicapp/.workdir/helloapache-app/artifacts/kubernetes/hello-apache-pod.json: API version "v1beta3" in "/atomicapp/.workdir/helloapache-app/artifacts/kubernetes/hello-apache-pod.json" isn't supported, only supports API versions ["v1"]
error: no objects passed to create

[1] https://hub.docker.com/r/projectatomic/helloapache/

LalatenduMohanty commented 9 years ago

Kubernetes version

[vagrant@localhost ~]$ sudo rpm -qa | grep kube
kubernetes-node-1.0.0-0.8.gitb2dafda.el7.x86_64
kubernetes-master-1.0.0-0.8.gitb2dafda.el7.x86_64
kubernetes-1.0.0-0.8.gitb2dafda.el7.x86_64

Docker version

[vagrant@localhost ~]$ sudo rpm -qa | grep docker
docker-selinux-1.7.1-108.el7.centos.x86_64
docker-python-1.4.0-108.el7.centos.x86_64
docker-registry-0.9.1-7.el7.x86_64
docker-1.7.1-108.el7.centos.x86_64

CentOS version

vagrant@localhost ~]$ cat /etc/centos-release
CentOS Linux release 7.1.1503 (Core) 
[vagrant@localhost ~]$ uname -a
Linux localhost.localdomain 3.10.0-229.11.1.el7.x86_64 #1 SMP Thu Aug 6 01:06:18 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
ggallen commented 9 years ago

How does this issue get assigned and prioritized?

LalatenduMohanty commented 9 years ago

@ggallen I could run this example now. Can you please do a retry?

LalatenduMohanty commented 9 years ago

@ggallen I think ur patch addressed the issue https://github.com/projectatomic/nulecule/commit/75760063c61024dda908fb0bf36b1e74057e77ec

ggallen commented 9 years ago

This still fails for me:

[root@atomic helloapache]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.advancedhosters.com
 * extras: mirror.solarvps.com
 * updates: mirror.linux.duke.edu
No packages marked for update
[root@atomic helloapache]# git pull
Already up-to-date.
[root@atomic helloapache]# atomic run projectatomic/atomicapp
docker run -it --rm  --privileged -v /root/nulecule/examples/helloapache:/atomicapp -v /run:/run -v /:/host --net=host --name atomicapp -e NAME=atomicapp -e IMAGE=projectatomic/atomicapp projectatomic/atomicapp -v  run  /atomicapp
Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
2015-08-25 11:21:27,149 - atomicapp.install - INFO - App name is projectatomic/atomicapp, will be populated to /atomicapp
2015-08-25 11:21:27,149 - atomicapp.utils - INFO - atomicapp.status.info.message=Loading app projectatomic/atomicapp .
2015-08-25 11:21:27,149 - atomicapp.nulecule_base - DEBUG - Path to answers file given, loading /atomicapp/answers.conf
2015-08-25 11:21:27,150 - atomicapp.utils - INFO - atomicapp.status.answer.message={"general": {"provider": "docker"}}
2015-08-25 11:21:27,150 - atomicapp.nulecule_base - DEBUG - {u'provider': u'docker'}
2015-08-25 11:21:27,245 - atomicapp.nulecule_base - DEBUG - Output of docker images cmd: 
2015-08-25 11:21:27,245 - atomicapp.utils - INFO - atomicapp.status.info.message=Pulling image projectatomic/atomicapp ...
latest: Pulling from docker.io/projectatomic/atomicapp
f1b10cd84249: Already exists 
c852f6d61e65: Already exists 
7322fbe74aa5: Already exists 
20d03cd76939: Already exists 
5b5ab1f14e37: Already exists 
36ee726aed08: Already exists 
967d5b86a102: Already exists 
b0ec2d6dbb23: Already exists 
c2763353b20b: Already exists 
c469bacf9245: Already exists 
f7458ef927e7: Already exists 
fb7e24b7480a: Already exists 
2d6c35766db5: Already exists 
d82b3d951679: Already exists 
Digest: sha256:b8d07454f851195132c6f07d59a4bcc078238dcad97c5f9ed6ed79421f20db9b
Status: Image is up to date for docker.io/projectatomic/atomicapp:latest
2015-08-25 11:21:28,413 - atomicapp.nulecule_base - DEBUG - {u'provider': u'docker'}
2015-08-25 11:21:28,413 - atomicapp.install - DEBUG - Creating a container with name atomicapp-aRncNL
2015-08-25 11:21:28,413 - atomicapp.install - DEBUG - /usr/bin/docker run --name atomicapp-aRncNL --entrypoint /bin/true projectatomic/atomicapp
Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
2015-08-25 11:21:28,825 - atomicapp.utils - INFO - Using temporary directory /tmp/nulecule-bGZkEw
2015-08-25 11:21:28,825 - atomicapp.install - DEBUG - ['/usr/bin/docker', 'cp', 'atomicapp-aRncNL:/application-entity', '/tmp/nulecule-bGZkEw']
Error response from daemon: Could not find the file /application-entity in container atomicapp-aRncNL
2015-08-25 11:21:28,883 - atomicapp.utils - INFO - atomicapp.status.info.message=Copied app successfully.
atomicapp-aRncNL
2015-08-25 11:21:29,585 - atomicapp.utils - INFO - atomicapp.status.info.message=Loading app_id helloapache-app .
Traceback (most recent call last):
  File "/usr/bin/atomicapp", line 9, in <module>
    load_entry_point('atomicapp==0.1.9', 'console_scripts', 'atomicapp')()
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/cli/main.py", line 227, in main
    cli.run()
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/cli/main.py", line 203, in run
    args.func(args)
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/cli/main.py", line 52, in cli_run
    ae = Run(**vars(args))
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/run.py", line 86, in __init__
    install.install()
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/install.py", line 138, in install
    self.nulecule_base.loadMainfile(tmp_mainfile_path)
  File "/usr/lib/python2.7/site-packages/atomicapp-0.1.9-py2.7.egg/atomicapp/nulecule_base.py", line 117, in loadMainfile
    raise Exception("%s not found: %s" % (MAIN_FILE, path))
Exception: Nulecule not found: /tmp/nulecule-bGZkEw/application-entity/Nulecule

[root@atomic helloapache]# 
vpavlin commented 9 years ago

That's a different problem, seems like https://github.com/projectatomic/atomicapp/issues/220

ggallen commented 9 years ago

Sorry, I didn't notice the message had changed. I've seen this one numerous times. I'll look at projectatomic/atomicapp#220.

LalatenduMohanty commented 9 years ago

Closing this issue as it is resolved and for the new issue we have projectatomic/atomicapp#220