From: Michael Tremer Date: Fri, 2 Jun 2023 11:25:52 +0000 (+0000) Subject: builders: Drop sync with AWS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46f006100920e24d5e61ba90920477bb62af9c77;p=pbs.git builders: Drop sync with AWS This does nothing apart from logging things. Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/builders.py b/src/buildservice/builders.py index 9860376d..52944ba7 100644 --- a/src/buildservice/builders.py +++ b/src/buildservice/builders.py @@ -103,19 +103,6 @@ class Builders(base.Object): yield builder - async def sync(self, *args, **kwargs): - """ - Synchronize any state with AWS - """ - log.info("Syncing state with AWS") - - # Sync all builders - async with asyncio.TaskGroup() as tasks: - for builder in self: - tasks.create_task( - builder.sync(), - ) - async def autoscale(self, wait=False): """ This method performs two tasks: @@ -598,21 +585,6 @@ class Builder(base.DataObject): if self.instance_id: return self.backend.aws.ec2.Instance(self.instance_id) - async def sync(self): - log.info("Syncing AWS state for %s" % self) - - if not self.instance: - log.debug("%s does not have an instance ID" % self) - return - - # This callback is being executed in a separate thread - # because boto3 is not thread-safe - def callback(): - log.debug("%s is currently in state: %s" % (self, self.instance.state)) - - # Launch in a separate thread - await asyncio.to_thread(callback) - async def is_running(self): """ Returns True if this builder is currently running diff --git a/src/web/__init__.py b/src/web/__init__.py index f9435396..6be6c04e 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -239,7 +239,6 @@ class Application(tornado.web.Application): # Launch some initial tasks self.backend.run_task(self.backend.users.generate_vapid_keys) - self.backend.run_task(self.backend.builders.sync) self.backend.run_task(self.backend.builders.autoscale) # Regularly check the mirrors