Build dependencies during building Docker image #707

Merged
merged 5 commits into from Jan 6, 2016

Conversation

Projects
None yet
2 participants
@ryotarai
Contributor

ryotarai commented Dec 15, 2015

Currently, make deps is required before docker build and node and npm must be installed in build server for make deps. After merging this PR, make deps will run in a Docker container during building an image.

In addition, bower and grunt-cli are development dependencies and they should not be installed system-globally, so I added them into devDependencies and run them via npm run.

@ryotarai

This comment has been minimized.

Show comment
Hide comment
@ryotarai

ryotarai Dec 15, 2015

Contributor

I'm sorry this PR is broken... I'll fix it.

Contributor

ryotarai commented Dec 15, 2015

I'm sorry this PR is broken... I'll fix it.

@ryotarai

This comment has been minimized.

Show comment
Hide comment
@ryotarai

ryotarai Dec 15, 2015

Contributor

I'm sorry this PR is broken... I'll fix it.

Fixed. Please review.

Contributor

ryotarai commented Dec 15, 2015

I'm sorry this PR is broken... I'll fix it.

Fixed. Please review.

@arikfr

This comment has been minimized.

Show comment
Hide comment
@arikfr

arikfr Dec 15, 2015

Member

Thanks! I wanted to avoid having to install Node.JS on the server, but I guess it's not a big deal and it will simplify the usage of the docker image.

Why did you need to run supervisord as root?

Member

arikfr commented Dec 15, 2015

Thanks! I wanted to avoid having to install Node.JS on the server, but I guess it's not a big deal and it will simplify the usage of the docker image.

Why did you need to run supervisord as root?

@ryotarai

This comment has been minimized.

Show comment
Hide comment
@ryotarai

ryotarai Dec 15, 2015

Contributor

I wanted to avoid having to install Node.JS on the server, but I guess it's not a big deal and it will simplify the usage of the docker image.

I agree avoiding to make node.js installed is better. I uninstalled node.js and tried to reduce image size with these commits 15f9a06 and ec41077

Why did you need to run supervisord as root?

When running supervisord as redash user, the following error occurs.

2015-12-15 13:00:00,658 INFO RPC interface 'supervisor' initialized
2015-12-15 13:00:00,659 CRIT Server 'inet_http_server' running without any HTTP authentication checking
2015-12-15 13:00:00,660 INFO supervisord started with pid 1
Traceback (most recent call last):
  File "/usr/local/bin/supervisord", line 9, in <module>
    load_entry_point('supervisor==3.1.2', 'console_scripts', 'supervisord')()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 366, in main
    go(options)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 376, in go
    d.main()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 83, in main
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 100, in run
    self.runforever()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 254, in runforever
    [ group.transition() for group  in pgroups ]
  File "/usr/local/lib/python2.7/dist-packages/supervisor/process.py", line 706, in transition
    proc.transition()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/process.py", line 550, in transition
    self.spawn()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/process.py", line 219, in spawn
    self.dispatchers, self.pipes = self.config.make_dispatchers(self)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/options.py", line 1690, in make_dispatchers
    dispatchers[stdout_fd] = POutputDispatcher(proc, etype, stdout_fd)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/dispatchers.py", line 98, in __init__
    backups=backups)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/options.py", line 452, in getLogger
    backups, stdout)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/loggers.py", line 344, in getLogger
    handlers.append(FileHandler(filename))
  File "/usr/local/lib/python2.7/dist-packages/supervisor/loggers.py", line 98, in __init__
    self.stream = open(filename, mode)
IOError: [Errno 13] Permission denied: '/dev/stdout'

If I should rebase commits into one commit, please tell me that.

Contributor

ryotarai commented Dec 15, 2015

I wanted to avoid having to install Node.JS on the server, but I guess it's not a big deal and it will simplify the usage of the docker image.

I agree avoiding to make node.js installed is better. I uninstalled node.js and tried to reduce image size with these commits 15f9a06 and ec41077

Why did you need to run supervisord as root?

When running supervisord as redash user, the following error occurs.

2015-12-15 13:00:00,658 INFO RPC interface 'supervisor' initialized
2015-12-15 13:00:00,659 CRIT Server 'inet_http_server' running without any HTTP authentication checking
2015-12-15 13:00:00,660 INFO supervisord started with pid 1
Traceback (most recent call last):
  File "/usr/local/bin/supervisord", line 9, in <module>
    load_entry_point('supervisor==3.1.2', 'console_scripts', 'supervisord')()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 366, in main
    go(options)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 376, in go
    d.main()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 83, in main
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 100, in run
    self.runforever()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/supervisord.py", line 254, in runforever
    [ group.transition() for group  in pgroups ]
  File "/usr/local/lib/python2.7/dist-packages/supervisor/process.py", line 706, in transition
    proc.transition()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/process.py", line 550, in transition
    self.spawn()
  File "/usr/local/lib/python2.7/dist-packages/supervisor/process.py", line 219, in spawn
    self.dispatchers, self.pipes = self.config.make_dispatchers(self)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/options.py", line 1690, in make_dispatchers
    dispatchers[stdout_fd] = POutputDispatcher(proc, etype, stdout_fd)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/dispatchers.py", line 98, in __init__
    backups=backups)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/options.py", line 452, in getLogger
    backups, stdout)
  File "/usr/local/lib/python2.7/dist-packages/supervisor/loggers.py", line 344, in getLogger
    handlers.append(FileHandler(filename))
  File "/usr/local/lib/python2.7/dist-packages/supervisor/loggers.py", line 98, in __init__
    self.stream = open(filename, mode)
IOError: [Errno 13] Permission denied: '/dev/stdout'

If I should rebase commits into one commit, please tell me that.

arikfr added a commit that referenced this pull request Jan 6, 2016

Merge pull request #707 from ryotarai/bower-in-dockerfile
Build dependencies during building Docker image

@arikfr arikfr merged commit 55f8069 into getredash:master Jan 6, 2016

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
@arikfr

This comment has been minimized.

Show comment
Hide comment
@arikfr

arikfr Jan 6, 2016

Member

Merged. Thanks 👍
Sorry it took so long.

Member

arikfr commented Jan 6, 2016

Merged. Thanks 👍
Sorry it took so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment