Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai3
docker
chaperone-base
Commits
b38415d0
Commit
b38415d0
authored
Aug 17, 2020
by
ale
Browse files
Merge branch 'buster' into 'master'
Switch base image to buster See merge request
!1
parents
3e8ccf07
20e48482
Pipeline
#7490
passed with stages
in 1 minute and 59 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
b38415d0
FROM
bitnami/minideb:
stretch
FROM
bitnami/minideb:
buster
COPY
build.sh /tmp/build.sh
COPY
python37_compat.patch /tmp/python37_compat.patch
COPY
chaperone.conf /etc/chaperone.d/chaperone.conf
COPY
deb_autistici_org.gpg /etc/apt/trusted.gpg.d/
...
...
build.sh
View file @
b38415d0
...
...
@@ -5,7 +5,7 @@
# Packages that are only used to build the container. These will be
# removed once we're done.
BUILD_PACKAGES
=
"python3-dev"
BUILD_PACKAGES
=
"python3-dev
patch
"
# Packages required to serve the website and run the services.
# We have to keep the python3 packages around in order to run
...
...
@@ -42,6 +42,11 @@ pip3 install chaperone \
||
die
"could not install chaperone"
rm
-fr
/root/.cache/pip
# https://github.com/garywiz/chaperone/pull/27.patch
# async and await are reserved keywords starting with python 3.7
patch
-d
/usr/local/lib/
$(
py3versions
-d
)
/dist-packages
\
-p1
< /tmp/python37_compat.patch
# Users of this base image should provide their own Chaperone config.
#cp /tmp/conf/chaperone.conf /etc/chaperone.d/chaperone.conf
...
...
python37_compat.patch
0 → 100644
View file @
b38415d0
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/commands.py chaperone/chaperone/cproc/commands.py
--- chaperone.orig/chaperone/cproc/commands.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/commands.py 2020-08-16 19:01:47.787607120 +0100
@@ -224,11 +224,11 @@
def data_received(self, data):
if self.interactive:
- asyncio.async(self._command_task(data.decode(), True))
+ asyncio.ensure_future(self._command_task(data.decode(), True))
else:
commands = data.decode().split("\n")
for c in commands:
- asyncio.async(self._command_task(c))
+ asyncio.ensure_future(self._command_task(c))
class _InteractiveServer(Server):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/process_manager.py chaperone/chaperone/cproc/process_manager.py
--- chaperone.orig/chaperone/cproc/process_manager.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/process_manager.py 2020-08-16 19:01:47.787607120 +0100
@@ -229,7 +229,7 @@
warn("Request made to kill system." + ((force and " (forced)") or ""))
self._killing_system = True
- self._kill_future = asyncio.async(self._kill_system_co())
+ self._kill_future = asyncio.ensure_future(self._kill_system_co())
def _cancel_pending(self):
"Cancel any pending activated tasks"
@@ -289,7 +289,7 @@
self._pending.discard(future)
def activate(self, cr):
- future = asyncio.async(cr)
+ future = asyncio.ensure_future(cr)
future.add_done_callback(self.activate_result)
self._pending.add(future)
return future
@@ -341,7 +341,7 @@
to tailor the environment and start up other services as needed.
"""
- initfuture = asyncio.async(self._start_system_services())
+ initfuture = asyncio.ensure_future(self._start_system_services())
initfuture.add_done_callback(lambda f: self._system_started(startup_coro, f))
self.loop.run_forever()
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/pt/cron.py chaperone/chaperone/cproc/pt/cron.py
--- chaperone.orig/chaperone/cproc/pt/cron.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/pt/cron.py 2020-08-16 19:01:47.787607120 +0100
@@ -93,7 +93,7 @@
# We have a successful start. Monitor this service.
- self._fut_monitor = asyncio.async(self._monitor_service())
+ self._fut_monitor = asyncio.ensure_future(self._monitor_service())
self.add_pending(self._fut_monitor)
@asyncio.coroutine
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/pt/inetd.py chaperone/chaperone/cproc/pt/inetd.py
--- chaperone.orig/chaperone/cproc/pt/inetd.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/pt/inetd.py 2020-08-16 19:01:47.787607120 +0100
@@ -17,7 +17,7 @@
self._fd = sock.detach()
sock.close()
- future = asyncio.async(self.start_socket_process(self._fd))
+ future = asyncio.ensure_future(self.start_socket_process(self._fd))
future.add_done_callback(self._done)
self.process.counter += 1
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/pt/notify.py chaperone/chaperone/cproc/pt/notify.py
--- chaperone.orig/chaperone/cproc/pt/notify.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/pt/notify.py 2020-08-16 19:01:47.787607120 +0100
@@ -63,7 +63,7 @@
yield from self.do_startup_pause()
- self._fut_monitor = asyncio.async(self._monitor_service())
+ self._fut_monitor = asyncio.ensure_future(self._monitor_service())
self.add_pending(self._fut_monitor)
if self._ready_event:
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/pt/simple.py chaperone/chaperone/cproc/pt/simple.py
--- chaperone.orig/chaperone/cproc/pt/simple.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/pt/simple.py 2020-08-16 19:01:47.787607120 +0100
@@ -21,7 +21,7 @@
# We have a successful start. Monitor this service.
- self._fut_monitor = asyncio.async(self._monitor_service())
+ self._fut_monitor = asyncio.ensure_future(self._monitor_service())
self.add_pending(self._fut_monitor)
@asyncio.coroutine
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/subproc.py chaperone/chaperone/cproc/subproc.py
--- chaperone.orig/chaperone/cproc/subproc.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/subproc.py 2020-08-16 19:01:47.787607120 +0100
@@ -478,12 +478,12 @@
self.pid = proc.pid
if service.stdout == 'log':
- self.add_pending(asyncio.async(_process_logger(proc.stdout, 'stdout', self)))
+ self.add_pending(asyncio.ensure_future(_process_logger(proc.stdout, 'stdout', self)))
if service.stderr == 'log':
- self.add_pending(asyncio.async(_process_logger(proc.stderr, 'stderr', self)))
+ self.add_pending(asyncio.ensure_future(_process_logger(proc.stderr, 'stderr', self)))
if service.exit_kills and not self.defer_exit_kills:
- self.add_pending(asyncio.async(self._wait_kill_on_exit()))
+ self.add_pending(asyncio.ensure_future(self._wait_kill_on_exit()))
yield from self.process_started_co()
@@ -574,7 +574,7 @@
if code.normal_exit or self.kill_signal == code.signal:
return
- asyncio.async(self._abnormal_exit(code))
+ asyncio.ensure_future(self._abnormal_exit(code))
@asyncio.coroutine
def _abnormal_exit(self, code):
@@ -602,7 +602,7 @@
if controller.system_alive:
yield from self.reset()
#yield from self.start()
- f = asyncio.async(self.start()) # queue it since we will just return here
+ f = asyncio.ensure_future(self.start()) # queue it since we will just return here
f.add_done_callback(self._restart_callback)
return
@@ -621,7 +621,7 @@
self.logdebug("{0} restart succeeded", self.name)
else:
self.logwarn("{0} restart failed: {1}", self.name, ex)
- asyncio.async(self._abnormal_exit(self._proc and self._proc.returncode))
+ asyncio.ensure_future(self._abnormal_exit(self._proc and self._proc.returncode))
def _kill_system(self):
self.family.controller.kill_system()
@@ -887,7 +887,7 @@
yield from s.reset(dependents=True, enable=enable, restarts_ok=True)
if not wait:
- asyncio.async(self._queued_start(slist, service_names))
+ asyncio.ensure_future(self._queued_start(slist, service_names))
else:
yield from self.run(slist)
@@ -909,7 +909,7 @@
", ".join([s.shortname for s in slist if not s.stoppable]))
if not wait:
- asyncio.async(self._queued_stop(slist, service_names, disable))
+ asyncio.ensure_future(self._queued_stop(slist, service_names, disable))
else:
for s in slist:
yield from s.stop()
@@ -936,7 +936,7 @@
raise Exception("can't reset services which are running: " + ", ".join([s.shortname for s in running]))
if not wait:
- asyncio.async(self._queued_reset(slist, service_names))
+ asyncio.ensure_future(self._queued_reset(slist, service_names))
else:
for s in slist:
yield from s.reset(restarts_ok = True)
diff '--exclude=.git' -urN chaperone.orig/chaperone/cutil/notify.py chaperone/chaperone/cutil/notify.py
--- chaperone.orig/chaperone/cutil/notify.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cutil/notify.py 2020-08-16 19:01:47.787607120 +0100
@@ -153,7 +153,7 @@
self._sent.add(name)
if self._client:
debug("queueing '{0}={1}' to notify socket '{2}'".format(name, val, self._client.socket_name))
- asyncio.async(self._do_send("{0}={1}".format(name, val)))
+ asyncio.ensure_future(self._do_send("{0}={1}".format(name, val)))
@asyncio.coroutine
def _do_send(self, msg):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cutil/syslog_handlers.py chaperone/chaperone/cutil/syslog_handlers.py
--- chaperone.orig/chaperone/cutil/syslog_handlers.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cutil/syslog_handlers.py 2020-08-16 19:01:47.787607120 +0100
@@ -133,7 +133,7 @@
def __init__(self, config):
super().__init__(config)
- self._pending = asyncio.async(self.setup_handler())
+ self._pending = asyncio.ensure_future(self.setup_handler())
def write(self, data):
if self._protocol:
diff '--exclude=.git' -urN chaperone.orig/chaperone/exec/sdnotify_exec.py chaperone/chaperone/exec/sdnotify_exec.py
--- chaperone.orig/chaperone/exec/sdnotify_exec.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/exec/sdnotify_exec.py 2020-08-16 19:01:47.787607120 +0100
@@ -175,7 +175,7 @@
yield from self.parent_client.send("{0}={1}".format(name, value))
def send_to_proxy(self, name, value):
- asyncio.async(self._do_proxy_send(name, value))
+ asyncio.ensure_future(self._do_proxy_send(name, value))
def notify_received(self, which, name, value):
self.send_to_proxy(name, value)
@@ -217,7 +217,7 @@
proc = yield from create
if self.timeout:
- asyncio.async(self._notify_timeout())
+ asyncio.ensure_future(self._notify_timeout())
exitcode = yield from proc.wait()
if not self.exitcode: # may have arrived from ERRNO
@@ -248,7 +248,7 @@
options = docopt(__doc__, options_first=True, version=VERSION_MESSAGE)
mainclass = SDNotifyExec(options)
- asyncio.async(mainclass.run())
+ asyncio.ensure_future(mainclass.run())
loop.run_forever()
loop.close()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment