projectatomic / nulecule

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

wordpress-centos7-atomicapp: missing environment vars #162

Open dustymabe opened 9 years ago

dustymabe commented 9 years ago

Not sure what is wrong with this example but the wordpress container in the kubernetes pod just keeps restarting and the logs from one of them is:

$ docker logs 919ecd18cdae
error: missing WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP environment variables
  Did you forget to --link some_mysql_container:mysql or set an external db
  with -e WORDPRESS_DB_HOST=hostname:port?

One issue I see is that we are pulling from goern/wordpress for this. Might be a good thing to create something official and pull from that.

goern commented 9 years ago

I propose that we create one uber-example to be hosted in the Nulecule Specification and move all the rest to a library, like CentOS-Dockerfile, Fedora-Dockerfiles

Über-Example

User Story As a cool blogger, I want to host a WordPress that scales, so that I can receive many many hits.

Architecture

A frontend nginx ephemeral reverse proxy will provide scale out capabilities: as more hits the blog receives, we increase the number ob nginx proxies. These proxies are place in front of a WordPress blog, CSS is contained in myWordPress image. There will be one WordPress 'application server'. Data is stored in a cluster of MySQL Master/Slaves. The database layer will use replication to increase data availability.

Objectives

  1. all images are maintained by Atomic App team and based on CentOS7
  2. nginx layer will demonstrate how to elastic scale applications after they got deployed by Atomic App.
  3. myWordPress will show how to customize an image
  4. MySQL layer will show reuse of OpenShift provided CentOS7 images (aka nuleculizing existing app)
  5. MySQL layer will be scalable by the platform
  6. we scope that a Nulecule Specification compliant Application packaging is not intended to manage the 'after deployment lifecycle' nor 'updating an application'
  7. demonstrate multi platform/provider capabilities of Atomic App, prio target list: OpenShift, Kubernetes, Docker
dustymabe commented 9 years ago

@goern I don't disagree but do we want this particular example to live on (maybe in another location)? If so then we would need to fix this issue.

LalatenduMohanty commented 9 years ago

I don't think these example Dockerfiles should land in CentOS-Dockerfiles and/or Fedora-Dockerfiles. Because these are not typical Dockerfiles but specific to Nulecule and Atomic App.

If we really want a new home, then we should create a separate github repo under projectatomic and some interested folks can maintain this.

The good think about having separate repo is that we can open it (i.e. have separate directory structures) for Dockerfiles based on different Linux/GNU distributions.

vpavlin commented 9 years ago

Both these approaches makes sense - Fedora/CentOS-Docekrfiles lets us to introduce these examples to wider audience as they are already know and used.

New repostory would make it easier for people to find Nulecules specifically...

I am more inclined to moving the examples to *-Dockerfiles repositories.

bexelbie commented 9 years ago

I like the idea of an uber example, in the Nulecule repo. We should get one more and a helloapache example we are all happy with.

strzibny commented 8 years ago

For me this fails as well but with:

$ atomic run goern/wordpress-centos7-atomicapp
latest: Pulling from docker.io/goern/wordpress-centos7-atomicapp
f1b10cd84249: Pull complete 
c852f6d61e65: Pull complete 
7322fbe74aa5: Pull complete 
b9e8df520b94: Pull complete 
36873d767517: Pull complete 
a71d35ab23d4: Pull complete 
300fdceaf673: Pull complete 
358243682dfa: Pull complete 
06697d00bbd3: Pull complete 
96925fa4ee9e: Pull complete 
ed0a83cfde70: Pull complete 
276001559a51: Pull complete 
593794fa9ab7: Pull complete 
d258dd3252f0: Pull complete 
aeea42f054c6: Pull complete 
db828900997a: Pull complete 
269c050a3679: Pull complete 
61d57499d93b: Pull complete 
85ff2c89082f: Pull complete 
fa0008880a33: Pull complete 
0ee2bbd13a03: Pull complete 
f527a9625025: Pull complete 
fb197f13360d: Already exists 
Digest: sha256:5df7e2d75a115016c601690e372811471fef85bbcec3b77bd147738e2ddc1a32
Status: Downloaded newer image for docker.io/goern/wordpress-centos7-atomicapp:latest
docker run -it --rm --privileged --net=host -v /home/vagrant:/atomicapp -v /run:/run -v /:/host --name wordpress-centos7-atomicapp -e NAME=wordpress-centos7-atomicapp -e IMAGE=goern/wordpress-centos7-atomicapp goern/wordpress-centos7-atomicapp -v run /atomicapp
docker run -it --rm --privileged --net=host -v /home/vagrant:/atomicapp -v /run:/run -v /:/host --name wordpress-centos7-atomicapp -e NAME=wordpress-centos7-atomicapp -e IMAGE=goern/wordpress-centos7-atomicapp goern/wordpress-centos7-atomicapp -v run /atomicapp
2015-11-02 10:54:29,043 - atomicapp.install - INFO - App name is goern/wordpress-centos7-atomicapp, will be populated to /atomicapp
2015-11-02 10:54:29,043 - atomicapp.nulecule_base - DEBUG - {'namespace': 'default', 'provider': 'kubernetes'}
2015-11-02 10:54:29,124 - atomicapp.nulecule_base - DEBUG - Output of docker images cmd: 
latest: Pulling from docker.io/goern/wordpress-centos7-atomicapp
f1b10cd84249: Already exists 
c852f6d61e65: Already exists 
7322fbe74aa5: Already exists 
b9e8df520b94: Already exists 
36873d767517: Already exists 
a71d35ab23d4: Already exists 
300fdceaf673: Already exists 
358243682dfa: Already exists 
06697d00bbd3: Already exists 
96925fa4ee9e: Already exists 
ed0a83cfde70: Already exists 
276001559a51: Already exists 
593794fa9ab7: Already exists 
d258dd3252f0: Already exists 
aeea42f054c6: Already exists 
db828900997a: Already exists 
269c050a3679: Already exists 
61d57499d93b: Already exists 
85ff2c89082f: Already exists 
fa0008880a33: Already exists 
0ee2bbd13a03: Already exists 
f527a9625025: Already exists 
fb197f13360d: Already exists 
Digest: sha256:5df7e2d75a115016c601690e372811471fef85bbcec3b77bd147738e2ddc1a32
Status: Image is up to date for docker.io/goern/wordpress-centos7-atomicapp:latest
2015-11-02 10:54:31,476 - atomicapp.nulecule_base - DEBUG - {'namespace': 'default', 'provider': 'kubernetes'}
2015-11-02 10:54:31,477 - atomicapp.install - DEBUG - Creating a container with name wordpress-centos7-atomicapp-XGpuoK
a857780b571b29cd7c3fd0dd456238bdc4feff6d393da921c6b59258ade8347b
2015-11-02 10:54:32,073 - atomicapp.utils - INFO - Using temporary directory /tmp/nulecule-bFqQOD
2015-11-02 10:54:32,073 - atomicapp.install - DEBUG - ['docker', 'cp', 'wordpress-centos7-atomicapp-XGpuoK:/application-entity', '/tmp/nulecule-bFqQOD']
FATA[0000] Error response from daemon: Could not find the file /application-entity in container wordpress-centos7-atomicapp-XGpuoK 
wordpress-centos7-atomicapp-XGpuoK
2015-11-02 10:54:32,286 - atomicapp.install - DEBUG - Nulecule path for pulled image: /tmp/nulecule-bFqQOD/application-entity/Nulecule
Traceback (most recent call last):
  File "/usr/bin/atomicapp", line 9, in <module>
    load_entry_point('atomicapp==0.1', 'console_scripts', 'atomicapp')()
  File "/usr/lib/python2.7/site-packages/atomicapp/cli/main.py", line 89, in main
    cli.run()
  File "/usr/lib/python2.7/site-packages/atomicapp/cli/main.py", line 70, in run
    args.func(args)
  File "/usr/lib/python2.7/site-packages/atomicapp/cli/main.py", line 20, in cli_run
    ae = Run(**vars(args))
  File "/usr/lib/python2.7/site-packages/atomicapp/run.py", line 64, in __init__
    install.install()
  File "/usr/lib/python2.7/site-packages/atomicapp/install.py", line 98, in install
    self.nulecule_base.loadMainfile(mainfile_path)
  File "/usr/lib/python2.7/site-packages/atomicapp/nulecule_base.py", line 88, in loadMainfile
    raise Exception("%s not found: %s" % (MAIN_FILE, path))
Exception: Nulecule not found: /tmp/nulecule-bFqQOD/application-entity/Nulecule

Why does it complain about Nulecule not being found?

Btw. I am using ADB.

goern commented 8 years ago

Here is another approach to solve this issue, https://trello.com/c/nBiEJxic