Colin Watson has proposed merging ~cjwatson/launchpad:rename-bfj-behaviour-slave into launchpad:master with ~cjwatson/launchpad:rename-slave-status as a prerequisite.
Commit message: Rename "slave" in BuildFarmJobBehaviour to "worker" Requested reviews: Launchpad code reviewers (launchpad-reviewers) For more details, see: https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/414041 -- Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:rename-bfj-behaviour-slave into launchpad:master.
diff --git a/lib/lp/buildmaster/builderproxy.py b/lib/lp/buildmaster/builderproxy.py index a224adf..a22ca85 100644 --- a/lib/lp/buildmaster/builderproxy.py +++ b/lib/lp/buildmaster/builderproxy.py @@ -70,7 +70,7 @@ class BuilderProxyMixin: auth_string = '{}:{}'.format(admin_username, secret).strip() auth_header = b'Basic ' + base64.b64encode(auth_string.encode('ASCII')) - token = yield self._slave.process_pool.doWork( + token = yield self._worker.process_pool.doWork( RequestProxyTokenCommand, url=url, auth_header=auth_header, proxy_username=proxy_username) diff --git a/lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt b/lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt index 0218b5f..26528be 100644 --- a/lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt +++ b/lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt @@ -17,7 +17,7 @@ Creating a new behaviour A new behaviour should implement the `IBuildFarmJobBehaviour` interface and extend BuildFarmJobBehaviourBase. A new behaviour will only be required -to define one method - dispatchBuildToSlave() - to correctly implement +to define one method - dispatchBuildToWorker() - to correctly implement the interface, but will usually want to customise the other properties and methods as well. @@ -31,7 +31,7 @@ methods as well. ... class MyNewBuildBehaviour(BuildFarmJobBehaviourBase): ... """A custom build behaviour for building blah.""" ... - ... def dispatchBuildToSlave(self, logger): + ... def dispatchBuildToWorker(self, logger): ... print("Did something special to dispatch MySpecialBuild.") For this documentation, we'll also need a dummy new build farm job. diff --git a/lib/lp/buildmaster/interactor.py b/lib/lp/buildmaster/interactor.py index 4d3e08e..3aaae63 100644 --- a/lib/lp/buildmaster/interactor.py +++ b/lib/lp/buildmaster/interactor.py @@ -487,7 +487,7 @@ class BuilderInteractor: builder.setCleanStatus(BuilderCleanStatus.DIRTY) transaction.commit() - yield behaviour.dispatchBuildToSlave(logger) + yield behaviour.dispatchBuildToWorker(logger) @classmethod @defer.inlineCallbacks diff --git a/lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py b/lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py index a3a2416..2d0eed4 100644 --- a/lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py +++ b/lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py @@ -31,8 +31,8 @@ class IBuildFarmJobBehaviour(Interface): pocket = Attribute("The `PackagePublishingPocket` to build against.") - def setBuilder(builder, slave): - """Sets the associated builder and slave for this instance.""" + def setBuilder(builder, worker): + """Sets the associated builder and worker for this instance.""" def determineFilesToSend(): """Work out which files to send to the builder. @@ -63,7 +63,7 @@ class IBuildFarmJobBehaviour(Interface): """ def composeBuildRequest(logger): - """Compose parameters for a slave build request. + """Compose parameters for a worker build request. :param logger: A logger to be used to log diagnostic information. :return: A tuple of ( @@ -73,8 +73,8 @@ class IBuildFarmJobBehaviour(Interface): or a Deferred resulting in the same. """ - def dispatchBuildToSlave(logger): - """Dispatch a specific build to the slave. + def dispatchBuildToWorker(logger): + """Dispatch a specific build to the worker. :param logger: A logger to be used to log diagnostic information. """ @@ -89,7 +89,7 @@ class IBuildFarmJobBehaviour(Interface): """Check that we are allowed to collect this successful build.""" def handleStatus(bq, status, worker_status): - """Update the build from a WAITING slave result. + """Update the build from a WAITING worker result. :param bq: The `BuildQueue` currently being processed. :param status: The tail of the BuildStatus (eg. OK or PACKAGEFAIL). diff --git a/lib/lp/buildmaster/model/buildfarmjobbehaviour.py b/lib/lp/buildmaster/model/buildfarmjobbehaviour.py index 3ed2e91..0315b52 100644 --- a/lib/lp/buildmaster/model/buildfarmjobbehaviour.py +++ b/lib/lp/buildmaster/model/buildfarmjobbehaviour.py @@ -38,7 +38,7 @@ from lp.services.utils import sanitise_urls from lp.services.webapp import canonical_url -SLAVE_LOG_FILENAME = 'buildlog' +WORKER_LOG_FILENAME = 'buildlog' class BuildFarmJobBehaviourBase: @@ -78,10 +78,10 @@ class BuildFarmJobBehaviourBase: else: return PackagePublishingPocket.RELEASE - def setBuilder(self, builder, slave): + def setBuilder(self, builder, worker): """The builder should be set once and not changed.""" self._builder = builder - self._slave = slave + self._worker = worker def determineFilesToSend(self): """The default behaviour is to send no files.""" @@ -114,7 +114,7 @@ class BuildFarmJobBehaviourBase: pass @defer.inlineCallbacks - def dispatchBuildToSlave(self, logger): + def dispatchBuildToWorker(self, logger): """See `IBuildFarmJobBehaviour`.""" cookie = self.build.build_cookie logger.info( @@ -139,11 +139,11 @@ class BuildFarmJobBehaviourBase: filename_to_sha1 = OrderedDict() dl = [] - dl.append(self._slave.sendFileToWorker( + dl.append(self._worker.sendFileToWorker( logger=logger, url=chroot.http_url, sha1=chroot.content.sha1)) for filename, params in files.items(): filename_to_sha1[filename] = params['sha1'] - dl.append(self._slave.sendFileToWorker(logger=logger, **params)) + dl.append(self._worker.sendFileToWorker(logger=logger, **params)) yield defer.gatherResults(dl) combined_args = { @@ -154,7 +154,7 @@ class BuildFarmJobBehaviourBase: % (cookie, self.build.title, self._builder.url, sanitise_urls(repr(combined_args)))) - (status, info) = yield self._slave.build( + (status, info) = yield self._worker.build( cookie, builder_type, chroot.content.sha1, filename_to_sha1, args) # Update stats @@ -179,11 +179,11 @@ class BuildFarmJobBehaviourBase: timestamp = now.strftime("%Y%m%d-%H%M%S") return '%s-%s' % (timestamp, build_cookie) - def transferSlaveFileToLibrarian(self, file_sha1, filename, private): - """Transfer a file from the slave to the librarian. + def transferWorkerFileToLibrarian(self, file_sha1, filename, private): + """Transfer a file from the worker to the librarian. :param file_sha1: The file's sha1, which is how the file is addressed - in the slave XMLRPC protocol. Specially, the file_sha1 'buildlog' + in the worker XMLRPC protocol. Specially, the file_sha1 'buildlog' will cause the build log to be retrieved and gzipped. :param filename: The name of the file to be given to the librarian file alias. @@ -222,7 +222,7 @@ class BuildFarmJobBehaviourBase: return library_file.id - d = self._slave.getFile(file_sha1, out_file_name) + d = self._worker.getFile(file_sha1, out_file_name) d.addCallback(got_file, filename, out_file_name) return d @@ -230,16 +230,16 @@ class BuildFarmJobBehaviourBase: """Return the preferred file name for this job's log.""" return 'buildlog.txt' - def getLogFromSlave(self, queue_item): + def getLogFromWorker(self, queue_item): """Return a Deferred which fires when the log is in the librarian.""" - d = self.transferSlaveFileToLibrarian( - SLAVE_LOG_FILENAME, self.getLogFileName(), self.build.is_private) + d = self.transferWorkerFileToLibrarian( + WORKER_LOG_FILENAME, self.getLogFileName(), self.build.is_private) return d @defer.inlineCallbacks - def storeLogFromSlave(self, build_queue=None): + def storeLogFromWorker(self, build_queue=None): """See `IBuildFarmJob`.""" - lfa_id = yield self.getLogFromSlave( + lfa_id = yield self.getLogFromWorker( build_queue or self.build.buildqueue_record) self.build.setLog(lfa_id) transaction.commit() @@ -284,7 +284,7 @@ class BuildFarmJobBehaviourBase: self.build.buildqueue_record.builder.name, status)) build_status = None if status == 'OK': - yield self.storeLogFromSlave() + yield self.storeLogFromWorker() # handleSuccess will sometimes perform write operations # outside the database transaction, so a failure between # here and the commit can cause duplicated results. For @@ -294,7 +294,7 @@ class BuildFarmJobBehaviourBase: elif status in fail_status_map: # XXX wgrant: The builder should be set long before here, but # currently isn't. - yield self.storeLogFromSlave() + yield self.storeLogFromWorker() build_status = fail_status_map[status] else: raise BuildDaemonError( @@ -320,7 +320,7 @@ class BuildFarmJobBehaviourBase: filenames_to_download = [] for filename, sha1 in filemap.items(): logger.info("Grabbing file: %s (%s)" % ( - filename, self._slave.getURL(sha1))) + filename, self._worker.getURL(sha1))) out_file_name = os.path.join(upload_path, filename) # If the evaluated output file name is not within our # upload path, then we don't try to copy this or any @@ -329,7 +329,7 @@ class BuildFarmJobBehaviourBase: raise BuildDaemonError( "Build returned a file named '%s'." % filename) filenames_to_download.append((sha1, out_file_name)) - yield self._slave.getFiles(filenames_to_download, logger=logger) + yield self._worker.getFiles(filenames_to_download, logger=logger) @defer.inlineCallbacks def handleSuccess(self, worker_status, logger): diff --git a/lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py b/lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py index b3f7d0a..ad05908 100644 --- a/lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py +++ b/lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py @@ -155,7 +155,7 @@ class TestBuildFarmJobBehaviourBase(TestCaseWithFactory): self.assertIs(False, behaviour.extraBuildArgs()["fast_cleanup"]) -class TestDispatchBuildToSlave(StatsMixin, TestCase): +class TestDispatchBuildToWorker(StatsMixin, TestCase): layer = ZopelessLayer run_tests_with = AsynchronousDeferredRunTest @@ -174,8 +174,8 @@ class TestDispatchBuildToSlave(StatsMixin, TestCase): {'some': 'arg', 'archives': ['http://admin:sekrit@blah/']})) return behaviour - def assertDispatched(self, slave, logger, chroot_filename, image_type): - # The slave's been asked to cache the chroot and both source + def assertDispatched(self, worker, logger, chroot_filename, image_type): + # The worker's been asked to cache the chroot and both source # files, and then to start the build. expected_calls = [ ('ensurepresent', @@ -188,7 +188,7 @@ class TestDispatchBuildToSlave(StatsMixin, TestCase): {'archives': ['http://admin:sekrit@blah/'], 'image_type': image_type, 'some': 'arg'})] - self.assertEqual(expected_calls, slave.call_log) + self.assertEqual(expected_calls, worker.call_log) # And details have been logged, including the build arguments # with credentials redacted. @@ -206,19 +206,19 @@ class TestDispatchBuildToSlave(StatsMixin, TestCase): "http://fake:0000: BuildStatus.BUILDING PACKAGEBUILD-1\n") @defer.inlineCallbacks - def test_dispatchBuildToSlave(self): + def test_dispatchBuildToWorker(self): behaviour = self.makeBehaviour(FakeDistroArchSeries()) builder = MockBuilder() worker = OkWorker() logger = BufferLogger() behaviour.setBuilder(builder, worker) - yield behaviour.dispatchBuildToSlave(logger) + yield behaviour.dispatchBuildToWorker(logger) self.assertDispatched( worker, logger, 'chroot-fooix-bar-y86.tar.gz', 'chroot') @defer.inlineCallbacks - def test_dispatchBuildToSlave_with_other_image_available(self): + def test_dispatchBuildToWorker_with_other_image_available(self): # If a base image is available but isn't in the behaviour's image # types, it isn't used. das = FakeDistroArchSeries() @@ -228,13 +228,13 @@ class TestDispatchBuildToSlave(StatsMixin, TestCase): worker = OkWorker() logger = BufferLogger() behaviour.setBuilder(builder, worker) - yield behaviour.dispatchBuildToSlave(logger) + yield behaviour.dispatchBuildToWorker(logger) self.assertDispatched( worker, logger, 'chroot-fooix-bar-y86.tar.gz', 'chroot') @defer.inlineCallbacks - def test_dispatchBuildToSlave_lxd(self): + def test_dispatchBuildToWorker_lxd(self): das = FakeDistroArchSeries() das.images[BuildBaseImageType.LXD] = 'lxd-fooix-bar-y86.tar.gz' behaviour = self.makeBehaviour(das) @@ -244,13 +244,13 @@ class TestDispatchBuildToSlave(StatsMixin, TestCase): worker = OkWorker() logger = BufferLogger() behaviour.setBuilder(builder, worker) - yield behaviour.dispatchBuildToSlave(logger) + yield behaviour.dispatchBuildToWorker(logger) self.assertDispatched( worker, logger, 'lxd-fooix-bar-y86.tar.gz', 'lxd') @defer.inlineCallbacks - def test_dispatchBuildToSlave_fallback(self): + def test_dispatchBuildToWorker_fallback(self): behaviour = self.makeBehaviour(FakeDistroArchSeries()) behaviour.image_types = [ BuildBaseImageType.LXD, BuildBaseImageType.CHROOT] @@ -258,20 +258,20 @@ class TestDispatchBuildToSlave(StatsMixin, TestCase): worker = OkWorker() logger = BufferLogger() behaviour.setBuilder(builder, worker) - yield behaviour.dispatchBuildToSlave(logger) + yield behaviour.dispatchBuildToWorker(logger) self.assertDispatched( worker, logger, 'chroot-fooix-bar-y86.tar.gz', 'chroot') @defer.inlineCallbacks - def test_dispatchBuildToSlave_stats(self): + def test_dispatchBuildToWorker_stats(self): self.setUpStats() behaviour = self.makeBehaviour(FakeDistroArchSeries()) builder = MockBuilder() worker = OkWorker() logger = BufferLogger() behaviour.setBuilder(builder, worker) - yield behaviour.dispatchBuildToSlave(logger) + yield behaviour.dispatchBuildToWorker(logger) self.assertEqual(1, self.stats_client.incr.call_count) self.assertEqual( self.stats_client.incr.call_args_list[0][0], diff --git a/lib/lp/buildmaster/tests/test_interactor.py b/lib/lp/buildmaster/tests/test_interactor.py index ba5fb6e..fc102be 100644 --- a/lib/lp/buildmaster/tests/test_interactor.py +++ b/lib/lp/buildmaster/tests/test_interactor.py @@ -373,7 +373,7 @@ class TestBuilderInteractorDB(TestCaseWithFactory): behaviour = BuilderInteractor.getBuildBehaviour(bq, builder, worker) self.assertIsInstance(behaviour, BinaryPackageBuildBehaviour) self.assertEqual(behaviour._builder, builder) - self.assertEqual(behaviour._slave, worker) + self.assertEqual(behaviour._worker, worker) def _setupBuilder(self): processor = self.factory.makeProcessor(name="i386") diff --git a/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py b/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py index e0b5cca..86d645c 100644 --- a/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py +++ b/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py @@ -419,7 +419,7 @@ class TestAsyncCharmRecipeBuildBehaviour( yield job.composeBuildRequest(None) @defer.inlineCallbacks - def test_dispatchBuildToSlave_prefers_lxd(self): + def test_dispatchBuildToWorker_prefers_lxd(self): self.pushConfig("builddmaster", builder_proxy_host=None) job = self.makeJob() builder = MockBuilder() @@ -432,7 +432,7 @@ class TestAsyncCharmRecipeBuildBehaviour( lxd_lfa = self.factory.makeLibraryFileAlias(db_only=True) job.build.distro_arch_series.addOrUpdateChroot( lxd_lfa, image_type=BuildBaseImageType.LXD) - yield job.dispatchBuildToSlave(DevNullLogger()) + yield job.dispatchBuildToWorker(DevNullLogger()) self.assertEqual( ("ensurepresent", lxd_lfa.http_url, "", ""), worker.call_log[0]) self.assertEqual(1, self.stats_client.incr.call_count) @@ -442,7 +442,7 @@ class TestAsyncCharmRecipeBuildBehaviour( "job_type=CHARMRECIPEBUILD".format(builder.name),)) @defer.inlineCallbacks - def test_dispatchBuildToSlave_falls_back_to_chroot(self): + def test_dispatchBuildToWorker_falls_back_to_chroot(self): self.pushConfig("builddmaster", builder_proxy_host=None) job = self.makeJob() builder = MockBuilder() @@ -452,7 +452,7 @@ class TestAsyncCharmRecipeBuildBehaviour( chroot_lfa = self.factory.makeLibraryFileAlias(db_only=True) job.build.distro_arch_series.addOrUpdateChroot( chroot_lfa, image_type=BuildBaseImageType.CHROOT) - yield job.dispatchBuildToSlave(DevNullLogger()) + yield job.dispatchBuildToWorker(DevNullLogger()) self.assertEqual( ("ensurepresent", chroot_lfa.http_url, "", ""), worker.call_log[0]) diff --git a/lib/lp/oci/model/ocirecipebuildbehaviour.py b/lib/lp/oci/model/ocirecipebuildbehaviour.py index 0532204..14cf0ed 100644 --- a/lib/lp/oci/model/ocirecipebuildbehaviour.py +++ b/lib/lp/oci/model/ocirecipebuildbehaviour.py @@ -3,7 +3,7 @@ """An `IBuildFarmJobBehaviour` for `OCIRecipeBuild`. -Dispatches OCI image build jobs to build-farm slaves. +Dispatches OCI image build jobs to build-farm workers. """ __all__ = [ @@ -123,7 +123,7 @@ class OCIRecipeBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase): @defer.inlineCallbacks def extraBuildArgs(self, logger=None): """ - Return the extra arguments required by the slave for the given build. + Return the extra arguments required by the worker for the given build. """ build = self.build args = yield super().extraBuildArgs(logger=logger) @@ -183,7 +183,7 @@ class OCIRecipeBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase): file_hash = filemap[name] file_path = os.path.join(upload_path, name) self._ensureFilePath(name, file_path, upload_path) - yield self._slave.getFile(file_hash, file_path) + yield self._worker.getFile(file_hash, file_path) with open(file_path) as file_fp: return json.load(file_fp) @@ -240,7 +240,7 @@ class OCIRecipeBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase): files_to_download = [ self._convertToRetrievableFile(upload_path, filename, filemap) for filename in files] - yield self._slave.getFiles(files_to_download, logger=logger) + yield self._worker.getFiles(files_to_download, logger=logger) def verifySuccessfulBuild(self): """See `IBuildFarmJobBehaviour`.""" diff --git a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py index ded5db8..7804583 100644 --- a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py +++ b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py @@ -585,7 +585,7 @@ class TestAsyncOCIRecipeBuildBehaviour( yield job.composeBuildRequest(None) @defer.inlineCallbacks - def test_dispatchBuildToSlave_prefers_lxd(self): + def test_dispatchBuildToWorker_prefers_lxd(self): self.pushConfig("builddmaster", builder_proxy_host=None) [ref] = self.factory.makeGitRefs() job = self.makeJob(git_ref=ref, allow_internet=False) @@ -599,7 +599,7 @@ class TestAsyncOCIRecipeBuildBehaviour( lxd_lfa = self.factory.makeLibraryFileAlias(db_only=True) job.build.distro_arch_series.addOrUpdateChroot( lxd_lfa, image_type=BuildBaseImageType.LXD) - yield job.dispatchBuildToSlave(DevNullLogger()) + yield job.dispatchBuildToWorker(DevNullLogger()) self.assertEqual( ('ensurepresent', lxd_lfa.http_url, '', ''), worker.call_log[0]) self.assertEqual(1, self.stats_client.incr.call_count) @@ -610,7 +610,7 @@ class TestAsyncOCIRecipeBuildBehaviour( builder.name),)) @defer.inlineCallbacks - def test_dispatchBuildToSlave_falls_back_to_chroot(self): + def test_dispatchBuildToWorker_falls_back_to_chroot(self): self.pushConfig("builddmaster", builder_proxy_host=None) [ref] = self.factory.makeGitRefs() job = self.makeJob(git_ref=ref, allow_internet=False) @@ -621,12 +621,12 @@ class TestAsyncOCIRecipeBuildBehaviour( chroot_lfa = self.factory.makeLibraryFileAlias(db_only=True) job.build.distro_arch_series.addOrUpdateChroot( chroot_lfa, image_type=BuildBaseImageType.CHROOT) - yield job.dispatchBuildToSlave(DevNullLogger()) + yield job.dispatchBuildToWorker(DevNullLogger()) self.assertEqual( ('ensurepresent', chroot_lfa.http_url, '', ''), worker.call_log[0]) @defer.inlineCallbacks - def test_dispatchBuildToSlave_oci_feature_flag_enabled(self): + def test_dispatchBuildToWorker_oci_feature_flag_enabled(self): self.pushConfig("builddmaster", builder_proxy_host=None) [ref] = self.factory.makeGitRefs() @@ -655,7 +655,7 @@ class TestAsyncOCIRecipeBuildBehaviour( lxd_lfa = self.factory.makeLibraryFileAlias(db_only=True) job.build.distro_arch_series.addOrUpdateChroot( lxd_lfa, image_type=BuildBaseImageType.LXD) - yield job.dispatchBuildToSlave(DevNullLogger()) + yield job.dispatchBuildToWorker(DevNullLogger()) self.assertEqual(distroseries.name, job.build.distro_arch_series.distroseries.name) self.assertEqual( diff --git a/lib/lp/snappy/tests/test_snapbuildbehaviour.py b/lib/lp/snappy/tests/test_snapbuildbehaviour.py index 14cd8e5..6836941 100644 --- a/lib/lp/snappy/tests/test_snapbuildbehaviour.py +++ b/lib/lp/snappy/tests/test_snapbuildbehaviour.py @@ -967,7 +967,7 @@ class TestAsyncSnapBuildBehaviour(StatsMixin, TestSnapBuildBehaviourBase): yield job.composeBuildRequest(None) @defer.inlineCallbacks - def test_dispatchBuildToSlave_prefers_lxd(self): + def test_dispatchBuildToWorker_prefers_lxd(self): job = self.makeJob(allow_internet=False) builder = MockBuilder() builder.processor = job.build.processor @@ -979,7 +979,7 @@ class TestAsyncSnapBuildBehaviour(StatsMixin, TestSnapBuildBehaviourBase): lxd_lfa = self.factory.makeLibraryFileAlias(db_only=True) job.build.distro_arch_series.addOrUpdateChroot( lxd_lfa, image_type=BuildBaseImageType.LXD) - yield job.dispatchBuildToSlave(DevNullLogger()) + yield job.dispatchBuildToWorker(DevNullLogger()) self.assertEqual( ('ensurepresent', lxd_lfa.http_url, '', ''), worker.call_log[0]) self.assertEqual(1, self.stats_client.incr.call_count) @@ -989,7 +989,7 @@ class TestAsyncSnapBuildBehaviour(StatsMixin, TestSnapBuildBehaviourBase): builder.name),)) @defer.inlineCallbacks - def test_dispatchBuildToSlave_falls_back_to_chroot(self): + def test_dispatchBuildToWorker_falls_back_to_chroot(self): job = self.makeJob(allow_internet=False) builder = MockBuilder() builder.processor = job.build.processor @@ -998,7 +998,7 @@ class TestAsyncSnapBuildBehaviour(StatsMixin, TestSnapBuildBehaviourBase): chroot_lfa = self.factory.makeLibraryFileAlias(db_only=True) job.build.distro_arch_series.addOrUpdateChroot( chroot_lfa, image_type=BuildBaseImageType.CHROOT) - yield job.dispatchBuildToSlave(DevNullLogger()) + yield job.dispatchBuildToWorker(DevNullLogger()) self.assertEqual( ('ensurepresent', chroot_lfa.http_url, '', ''), worker.call_log[0]) diff --git a/lib/lp/soyuz/model/distroarchseries.py b/lib/lp/soyuz/model/distroarchseries.py index 32e6525..5acaffb 100644 --- a/lib/lp/soyuz/model/distroarchseries.py +++ b/lib/lp/soyuz/model/distroarchseries.py @@ -245,7 +245,7 @@ class DistroArchSeries(SQLBase): # This is disallowed partly because files that act as base # images for other builds (including public ones) ought to be # public on principle, and partly because - # BuildFarmJobBehaviourBase.dispatchBuildToSlave doesn't + # BuildFarmJobBehaviourBase.dispatchBuildToWorker doesn't # currently support sending a token that would allow builders to # fetch private URLs. If we ever need to change this (perhaps # for the sake of short-lived security fixes in base images?), diff --git a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py index 8935403..89f8474 100644 --- a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py +++ b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py @@ -693,7 +693,7 @@ class TestBinaryBuildPackageBehaviourBuildCollection(TestCaseWithFactory): behaviour = IBuildFarmJobBehaviour(self.build) behaviour.setBuilder(self.builder, worker) - d = behaviour.getLogFromSlave(self.build.buildqueue_record) + d = behaviour.getLogFromWorker(self.build.buildqueue_record) return d.addCallback(got_log) def test_private_build_log_storage(self): diff --git a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py index 4ca994c..73680d7 100644 --- a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py +++ b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py @@ -277,7 +277,7 @@ class TestAsyncLiveFSBuildBehaviour(TestLiveFSBuildBehaviourBase): build_request) @defer.inlineCallbacks - def test_dispatchBuildToSlave_prefers_lxd(self): + def test_dispatchBuildToWorker_prefers_lxd(self): job = self.makeJob() builder = MockBuilder() builder.processor = job.build.processor @@ -289,12 +289,12 @@ class TestAsyncLiveFSBuildBehaviour(TestLiveFSBuildBehaviourBase): lxd_lfa = self.factory.makeLibraryFileAlias(db_only=True) job.build.distro_arch_series.addOrUpdateChroot( lxd_lfa, image_type=BuildBaseImageType.LXD) - yield job.dispatchBuildToSlave(DevNullLogger()) + yield job.dispatchBuildToWorker(DevNullLogger()) self.assertEqual( ('ensurepresent', lxd_lfa.http_url, '', ''), worker.call_log[0]) @defer.inlineCallbacks - def test_dispatchBuildToSlave_falls_back_to_chroot(self): + def test_dispatchBuildToWorker_falls_back_to_chroot(self): job = self.makeJob() builder = MockBuilder() builder.processor = job.build.processor @@ -303,7 +303,7 @@ class TestAsyncLiveFSBuildBehaviour(TestLiveFSBuildBehaviourBase): chroot_lfa = self.factory.makeLibraryFileAlias(db_only=True) job.build.distro_arch_series.addOrUpdateChroot( chroot_lfa, image_type=BuildBaseImageType.CHROOT) - yield job.dispatchBuildToSlave(DevNullLogger()) + yield job.dispatchBuildToWorker(DevNullLogger()) self.assertEqual( ('ensurepresent', chroot_lfa.http_url, '', ''), worker.call_log[0]) diff --git a/lib/lp/translations/model/translationtemplatesbuildbehaviour.py b/lib/lp/translations/model/translationtemplatesbuildbehaviour.py index e04890b..96e3a74 100644 --- a/lib/lp/translations/model/translationtemplatesbuildbehaviour.py +++ b/lib/lp/translations/model/translationtemplatesbuildbehaviour.py @@ -3,7 +3,7 @@ """An `IBuildFarmJobBehaviour` for `TranslationTemplatesBuild`. -Dispatches translation template build jobs to build-farm slaves. +Dispatches translation template build jobs to build-farm workers. """ __all__ = [ @@ -37,11 +37,11 @@ from lp.translations.model.approver import TranslationBuildApprover @implementer(IBuildFarmJobBehaviour) class TranslationTemplatesBuildBehaviour(BuildFarmJobBehaviourBase): - """Dispatches `TranslationTemplateBuildJob`s to slaves.""" + """Dispatches `TranslationTemplateBuildJob`s to workers.""" builder_type = "translation-templates" - # Filename for the tarball of templates that the slave builds. + # Filename for the tarball of templates that the worker builds. templates_tarball_path = 'translation-templates.tar.gz' unsafe_chars = '[^a-zA-Z0-9_+-]' @@ -74,19 +74,19 @@ class TranslationTemplatesBuildBehaviour(BuildFarmJobBehaviourBase): return args def _readTarball(self, buildqueue, filemap, logger): - """Read tarball with generated translation templates from slave.""" + """Read tarball with generated translation templates from worker.""" if filemap is None: logger.error("Slave returned no filemap.") return defer.succeed(None) - slave_filename = filemap.get(self.templates_tarball_path) - if slave_filename is None: - logger.error("Did not find templates tarball in slave output.") + worker_filename = filemap.get(self.templates_tarball_path) + if worker_filename is None: + logger.error("Did not find templates tarball in worker output.") return defer.succeed(None) fd, fname = tempfile.mkstemp() os.close(fd) - d = self._slave.getFile(slave_filename, fname) + d = self._worker.getFile(worker_filename, fname) return d.addCallback(lambda ignored: fname) def _uploadTarball(self, branch, tarball, logger): diff --git a/lib/lp/translations/tests/test_translationtemplatesbuildbehaviour.py b/lib/lp/translations/tests/test_translationtemplatesbuildbehaviour.py index fc1a712..0e446ec 100644 --- a/lib/lp/translations/tests/test_translationtemplatesbuildbehaviour.py +++ b/lib/lp/translations/tests/test_translationtemplatesbuildbehaviour.py @@ -137,8 +137,8 @@ class TestTranslationTemplatesBuildBehaviour( behaviour = self.makeBehaviour() buildqueue = FakeBuildQueue(behaviour) path = behaviour.templates_tarball_path - # Poke the file we're expecting into the mock slave. - behaviour._slave.valid_files[path] = '' + # Poke the file we're expecting into the mock worker. + behaviour._worker.valid_files[path] = '' def got_tarball(filename): tarball = open(filename, 'r') @@ -159,16 +159,16 @@ class TestTranslationTemplatesBuildBehaviour( behaviour._uploadTarball = FakeMethod() queue_item = behaviour.build.queueBuild() queue_item.markAsBuilding(self.factory.makeBuilder()) - slave = behaviour._slave + worker = behaviour._worker - d = slave.status() + d = worker.status() def got_status(status): return ( behaviour.handleStatus( queue_item, BuilderInteractor.extractBuildStatus(status), status), - slave.call_log) + worker.call_log) def build_updated(ignored): self.assertEqual(BuildStatus.FULLYBUILT, behaviour.build.status) @@ -187,9 +187,9 @@ class TestTranslationTemplatesBuildBehaviour( behaviour._uploadTarball = FakeMethod() queue_item = behaviour.build.queueBuild() queue_item.markAsBuilding(self.factory.makeBuilder()) - slave = behaviour._slave + worker = behaviour._worker - d = slave.status() + d = worker.status() def got_status(status): del status['filemap'] @@ -216,9 +216,9 @@ class TestTranslationTemplatesBuildBehaviour( behaviour._uploadTarball = FakeMethod() queue_item = behaviour.build.queueBuild() queue_item.markAsBuilding(self.factory.makeBuilder()) - slave = behaviour._slave + worker = behaviour._worker - d = slave.status() + d = worker.status() def got_status(status): del status['filemap'] @@ -243,7 +243,7 @@ class TestTranslationTemplatesBuildBehaviour( branch=branch, filemap={'translation-templates.tar.gz': 'foo'}) queue_item = behaviour.build.queueBuild() queue_item.markAsBuilding(self.factory.makeBuilder()) - slave = behaviour._slave + worker = behaviour._worker def fake_getFile(sum, path): dummy_tar = os.path.join( @@ -253,8 +253,8 @@ class TestTranslationTemplatesBuildBehaviour( copy_and_close(tar_file, f) return defer.succeed(None) - slave.getFile = fake_getFile - d = slave.status() + worker.getFile = fake_getFile + d = worker.status() def got_status(status): return behaviour.handleStatus(
_______________________________________________ Mailing list: https://launchpad.net/~launchpad-reviewers Post to : launchpad-reviewers@lists.launchpad.net Unsubscribe : https://launchpad.net/~launchpad-reviewers More help : https://help.launchpad.net/ListHelp