Merge "Add foreground option"
This commit is contained in:
commit
96ad25036d
10
Dockerfile
10
Dockerfile
@ -60,16 +60,16 @@ COPY --from=builder /usr/local/lib/zuul/ /usr/local/lib/zuul
|
||||
COPY --from=builder /tmp/openshift-install/kubectl /usr/local/bin/kubectl
|
||||
COPY --from=builder /tmp/openshift-install/oc /usr/local/bin/oc
|
||||
|
||||
CMD ["/usr/local/bin/zuul-executor"]
|
||||
CMD ["/usr/local/bin/zuul-executor", "-f"]
|
||||
|
||||
FROM zuul as zuul-fingergw
|
||||
CMD ["/usr/local/bin/zuul-fingergw"]
|
||||
CMD ["/usr/local/bin/zuul-fingergw", "-f"]
|
||||
|
||||
FROM zuul as zuul-merger
|
||||
CMD ["/usr/local/bin/zuul-merger"]
|
||||
CMD ["/usr/local/bin/zuul-merger", "-f"]
|
||||
|
||||
FROM zuul as zuul-scheduler
|
||||
CMD ["/usr/local/bin/zuul-scheduler"]
|
||||
CMD ["/usr/local/bin/zuul-scheduler", "-f"]
|
||||
|
||||
FROM zuul as zuul-web
|
||||
CMD ["/usr/local/bin/zuul-web"]
|
||||
CMD ["/usr/local/bin/zuul-web", "-f"]
|
||||
|
@ -51,7 +51,7 @@ services:
|
||||
- https_proxy
|
||||
- no_proxy=${no_proxy},gerrit
|
||||
- ZUUL_MYSQL_PASSWORD=secret
|
||||
command: "sh -c '/var/playbooks/wait-to-start.sh && zuul-scheduler -d'"
|
||||
command: "sh -c '/var/playbooks/wait-to-start.sh && zuul-scheduler -f'"
|
||||
# FIXME: The scheduler has no ansible anymore so use the executor image.
|
||||
# This needs to be changes such that ansible is not required for startup.
|
||||
image: zuul/zuul-scheduler
|
||||
@ -60,7 +60,7 @@ services:
|
||||
- "./playbooks/:/var/playbooks/:z"
|
||||
- "sshkey:/var/ssh:z"
|
||||
web:
|
||||
command: "sh -c '/var/playbooks/wait-to-start-gearman.sh && zuul-web -d'"
|
||||
command: "sh -c '/var/playbooks/wait-to-start-gearman.sh && zuul-web -f'"
|
||||
depends_on:
|
||||
- scheduler
|
||||
- mysql
|
||||
@ -79,7 +79,6 @@ services:
|
||||
- https_proxy
|
||||
- no_proxy=${no_proxy},gerrit,scheduler
|
||||
- ZUUL_MYSQL_PASSWORD=secret
|
||||
command: "zuul-executor -d"
|
||||
depends_on:
|
||||
- scheduler
|
||||
image: zuul/zuul-executor
|
||||
@ -99,7 +98,6 @@ services:
|
||||
volumes:
|
||||
- "nodessh:/root/.ssh:z"
|
||||
launcher:
|
||||
command: "nodepool-launcher -d"
|
||||
depends_on:
|
||||
- zk
|
||||
image: zuul/nodepool-launcher
|
||||
|
@ -120,6 +120,14 @@ class ZuulApp(object):
|
||||
def parseArguments(self, args=None):
|
||||
parser = self.createParser()
|
||||
self.args = parser.parse_args(args)
|
||||
|
||||
# The arguments debug and foreground both lead to nodaemon mode so
|
||||
# set nodaemon if one of them is set.
|
||||
if ((hasattr(self.args, 'debug') and self.args.debug) or
|
||||
(hasattr(self.args, 'foreground') and self.args.foreground)):
|
||||
self.args.nodaemon = True
|
||||
else:
|
||||
self.args.nodaemon = False
|
||||
return parser
|
||||
|
||||
def readConfig(self):
|
||||
@ -148,12 +156,13 @@ class ZuulApp(object):
|
||||
# config, leave the config set to emit to stdout.
|
||||
if hasattr(self.args, 'nodaemon') and self.args.nodaemon:
|
||||
logging_config = logconfig.ServerLoggingConfig()
|
||||
logging_config.setDebug()
|
||||
else:
|
||||
# Setting a server value updates the defaults to use
|
||||
# WatchedFileHandler on /var/log/zuul/{server}-debug.log
|
||||
# and /var/log/zuul/{server}.log
|
||||
logging_config = logconfig.ServerLoggingConfig(server=section)
|
||||
if hasattr(self.args, 'debug') and self.args.debug:
|
||||
logging_config.setDebug()
|
||||
logging_config.apply()
|
||||
|
||||
def configure_connections(self, source_only=False, include_drivers=None):
|
||||
@ -164,8 +173,10 @@ class ZuulApp(object):
|
||||
class ZuulDaemonApp(ZuulApp, metaclass=abc.ABCMeta):
|
||||
def createParser(self):
|
||||
parser = super(ZuulDaemonApp, self).createParser()
|
||||
parser.add_argument('-d', dest='nodaemon', action='store_true',
|
||||
help='do not run as a daemon')
|
||||
parser.add_argument('-d', dest='debug', action='store_true',
|
||||
help='run in foreground with debug log')
|
||||
parser.add_argument('-f', dest='foreground', action='store_true',
|
||||
help='run in foreground with info log')
|
||||
return parser
|
||||
|
||||
def getPidFile(self):
|
||||
|
Loading…
Reference in New Issue
Block a user