evermax / dockerfiles

A set of dockerfiles for development
0 stars 2 forks source link

Is an update possible? #1

Closed DaTebe closed 8 years ago

DaTebe commented 8 years ago

Hi,

I've tried to update your docker image. But I'm facing some errors. Maybe you can help me?

First of all I got this: /workspace/start.sh: line 7: /workspace/env/bin/uwsgi: No such file or directory Do you have any idea what the problem is?

evermax commented 8 years ago

Hi, I made some modification on the ADL_LRS repo, as you can see in the Dockerfile, it uses github.com/evermax/ADL_LRS and not adlnet/ADL_LRS. I added some dependencies in the requirements.txt.

I had a lot of issues because of Django 1.4 but I saw that they moved to 1.9, it is probably going to be easier!

I am sorry I didn't had to time to look into it this weekend.

----- Mail original ----- De: "DaTebe" notifications@github.com À: "evermax/dockerfiles" dockerfiles@noreply.github.com Envoyé: Mercredi 8 Juin 2016 01:48:44 Objet: [evermax/dockerfiles] Is an update possible? (#1)

Hi,

I've tried to update your docker image. But I'm facing some errors. Maybe you can help me?

First of all I got this: /workspace/start.sh: line 7: /workspace/env/bin/uwsgi: No such file or directory Do you have any idea what the problem is?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .

DaTebe commented 8 years ago

Hi, thanks for your reply.

I tried to change the git repo and updated the dockerfile to install what is listed in the ADL LRS install guide. Also updated the settings.py. By now I had no success in dockerizing the newest ADL LRS.

Everything I use in my development environment is dockerized and for some strange reasons I can not connect from the inside of a container to my host where the ADL LRS is running.

evermax commented 8 years ago

For some reasons I had to put an nginx server because it think the Django server is only listening to localhost. Did you do it as well? Did you look at the diff between my fork and the official repo? Do you have any errors?

I'll have a look at it after work, see if I can get it to work on my end.

----- Mail original ----- De: "DaTebe" notifications@github.com À: "evermax/dockerfiles" dockerfiles@noreply.github.com Cc: "Maxime Lasserre" maxlasserre@free.fr, "Comment" comment@noreply.github.com Envoyé: Mercredi 8 Juin 2016 10:00:03 Objet: Re: [evermax/dockerfiles] Is an update possible? (#1)

Hi, thanks for your reply.

I tried to change the git repo and updated the dockerfile to install what is listed in the ADL LRS install guide. Also updated the settings.py . By now I had no success in dockerizing the newest ADL LRS.

Everything I use in my development environment is dockerized and for some strange reasons I can not connect from the inside of a container to my host where the ADL LRS is running.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub , or mute the thread .

DaTebe commented 8 years ago

Hi, Basically I just used your Repo and tried to change all files. I don't have a specific error. With every change I made a new error appeared.

Thanks for your help! I really appreciate your effort!

evermax commented 8 years ago

Ok I managed to make it work somehow. I'll push my changes and you can tell me it if works for you!

evermax commented 8 years ago

You can find the changes to the docker files here: https://github.com/evermax/dockerfiles/commit/d115578495e6986a1be632e714fd1c9118cffdc4

I also made some changes to the LRS project here: https://github.com/evermax/ADL_LRS/commit/0a9c9d6e12f16bfdc86522757dfd8f073180c879

DaTebe commented 8 years ago

Hi thank you for your update. I tested it and run in a 502 Bad Gateway error.

That is what docker is giving me as additional information:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/fabric/main.py", line 745, in main
    *args, **kwargs
  File "/usr/local/lib/python2.7/site-packages/fabric/tasks.py", line 427, in execute
    results['<local-only>'] = task.run(*args, **new_kwargs)
  File "/usr/local/lib/python2.7/site-packages/fabric/tasks.py", line 174, in run
    return self.wrapped(*args, **kwargs)
  File "/workspace/ADL_LRS/fabfile.py", line 36, in setup_lrs
    adldir = settings.MEDIA_ROOT
  File "/workspace/ADL_LRS/../env/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/workspace/ADL_LRS/../env/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/workspace/ADL_LRS/../env/lib/python2.7/site-packages/django/conf/__init__.py", line 135, in __init__
    logging_config_func(self.LOGGING)
  File "/usr/local/lib/python2.7/logging/config.py", line 794, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/local/lib/python2.7/logging/config.py", line 576, in configure
    '%r: %s' % (name, e))
ValueError: Unable to configure handler 'celery_handler': [Errno 2] No such file or directory: '/workspace/logs/celery/celery_tasks.log'
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/workspace/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/workspace/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/workspace/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command
    app_name = get_commands()[subcommand]
  File "/workspace/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands
    apps = settings.INSTALLED_APPS
  File "/workspace/env/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/workspace/env/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/workspace/env/lib/python2.7/site-packages/django/conf/__init__.py", line 135, in __init__
    logging_config_func(self.LOGGING)
  File "/usr/local/lib/python2.7/logging/config.py", line 794, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/local/lib/python2.7/logging/config.py", line 576, in configure
    '%r: %s' % (name, e))
ValueError: Unable to configure handler 'celery_handler': [Errno 2] No such file or directory: '/workspace/logs/celery/celery_tasks.log'
Restarting nginx: nginx.
*** Starting uWSGI 1.9.17.1 (64bit) on [Thu Jun  9 07:00:14 2016] ***
compiled with version: 4.9.2 on 09 June 2016 06:57:00
os: Linux-4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46 UTC 2016
nodename: 256f32e57ae0
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /workspace/ADL_LRS
detected binary path: /workspace/env/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
your processes number limit is 1048576
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
*** starting uWSGI Emperor ***
Python version: 2.7.11 (default, May 24 2016, 20:30:35)  [GCC 4.9.2]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x2165260
your mercy for graceful operations on workers is 60 seconds
*** Operational MODE: no-workers ***
spawned uWSGI master process (pid: 32)
*** has_emperor mode detected (fd: 6) ***
[uWSGI] getting INI configuration from lrs_uwsgi.ini
[emperor] vassal lrs_uwsgi.ini is now loyal
[emperor] vassal lrs_uwsgi.ini is now loyal
[emperor] vassal lrs_uwsgi.ini is now loyal
[emperor] vassal lrs_uwsgi.ini is now loyal
evermax commented 8 years ago

Interesting I didn't get that when building it. Might be something I changed before pushing it. But the issue seems to be that there is no directory log/celery so I guess by creating it it should solve the issue. I'll look into that after work!

evermax commented 8 years ago

That is very interesting, I don't manage to reproduce it locally. Did you pull the latest version of dirichlet/lrs ?

DaTebe commented 8 years ago

Hi thanks for your patience. I tried the following thing:

docker pull dirichlet/lrs and run the image. And also downloaded a copy of your repo, created the busybox and did a docker-compose build and docker-compose up -d.

evermax commented 8 years ago

I am trying to understand why it doesn't work. Can you change to switch to the following configuration for docker compose:

version: '2'
services:
  lrs:
      image: dirichlet/lrs
      ports:
          - "8080:8080"
      links:
          - postgres
          - rabbitmq
      env_file:
          - lrs.env
          - psql.env
          - rabbitmq.env

  postgres:
      image: postgres
      env_file: psql.env
      volumes:
          - psql_data:/var/lib/postgresql/data/pgdata

  rabbitmq:
      image: rabbitmq:3.6
      env_file: rabbitmq.env
      privileged: true

volumes:
  psql_data:
    driver: local

Did you also filled the .env files?

DaTebe commented 8 years ago

Hi, I'll try your docker compose file when I'm at home!

Thanks

EDIT:

Now it works! Many Thanks for your work!

evermax commented 8 years ago

Cool, I don't really know what happens. I will change the docker file to this one to avoid any further issue. If you have any other problem, do not hesitate to let me know!