]> git.corax.cc Git - foundry/log
foundry
4 years agodistbot: Distribute packages upon receipt of sign messages
Matthias Kruk [Sat, 27 Nov 2021 17:15:31 +0000 (02:15 +0900)]
distbot: Distribute packages upon receipt of sign messages

Distbots only distribute packages if they have been explicitly
instructed to do so by a dist request message. This makes it
necessary to have a central process in the build system that sends
such messages.
This commit modifies distbot to distribute packages upon receipt of
sign messages, eliminating the need to have a central orchestrator
in the build system.

4 years agoinclude/msg/dist: Remove context field
Matthias Kruk [Sat, 27 Nov 2021 17:03:54 +0000 (02:03 +0900)]
include/msg/dist: Remove context field

Dist messages carry a field for a context identifier. However, since
dist messages do not reference files associated with a context, the
context field is not necessary.
This commit removes the context field from dist type messages.

4 years agoinclude/msg/dist: Add information about sources to dist message
Matthias Kruk [Sat, 27 Nov 2021 16:38:39 +0000 (01:38 +0900)]
include/msg/dist: Add information about sources to dist message

Dist messages do not carry any information about the sources used
to build the artifacts, making it needlessly complicated to trace
the build/distribution.
This commit adds fields for the repository, branch, and commit that
the artifacts were built from. Further, this commit renames the
field for the package repository to "distribution" so it won't be
confused with the source repository.

4 years agosignbot: Sign packages automatically upon receipt of build messages
Matthias Kruk [Sat, 27 Nov 2021 15:49:10 +0000 (00:49 +0900)]
signbot: Sign packages automatically upon receipt of build messages

Signbots will only sign packages upon receipt of a sign request
message, making it necessary to have a central process in the build
system that sends such messages.
This commit modifies signbot to sign packages upon receipt of build
messages, eliminating the need for a centralized build orchestrator
in the build system.

4 years agoinclude/msg/sign: Add repository, branch, and ref to sign messages
Matthias Kruk [Fri, 26 Nov 2021 14:26:24 +0000 (23:26 +0900)]
include/msg/sign: Add repository, branch, and ref to sign messages

Sign messages do not contain information about the sources that the
artifacts were built from.
This commit adds the repository, branch, and ref fields for tracking
the sources that signed artifacts were built from.

4 years agowatchbot: Rename option "topic" to "publish-to"
Matthias Kruk [Fri, 26 Nov 2021 12:38:08 +0000 (21:38 +0900)]
watchbot: Rename option "topic" to "publish-to"

To make the usage of options more uniform across all foundry bots,
bots must read the name of the topic for outgoing messages from the
"publish-to" option.
This commit renames the "topic" option of watchbot to "publish-to".

4 years agobuildbot: Build from commit messages instead of build requests
Matthias Kruk [Fri, 26 Nov 2021 11:55:37 +0000 (20:55 +0900)]
buildbot: Build from commit messages instead of build requests

Buildbot currently expects to receive explicit build orders in the
form of build requests. This makes it necessary to have a central
instance in the build system that sends such build requests.
This commit modifies buildbot to treat commit messages on certain
branches as build triggers, allowing buildbot to act autonomously.

4 years agowatchbot: Rename "commit" to "ref"
Matthias Kruk [Fri, 26 Nov 2021 11:48:09 +0000 (20:48 +0900)]
watchbot: Rename "commit" to "ref"

The name of the "commit" member of commit messages has been changed
to "ref", but watchbot still used the old terminology.
This commit modifies watchbot to use the term "ref" instead of
"commit".

4 years agoinclude/msg/commit: Rename "commit" field to "ref"
Matthias Kruk [Fri, 26 Nov 2021 11:41:58 +0000 (20:41 +0900)]
include/msg/commit: Rename "commit" field to "ref"

The field that stores the source-level version in the commit message
is named "commit", which is different from the terminology used by
git and other development tools.
This commit renames the "commit" field of commit messages to "ref".
Related functions are also renamed accordingly.

4 years agoinclude/msg/build: Add ref field
Matthias Kruk [Fri, 26 Nov 2021 11:36:21 +0000 (20:36 +0900)]
include/msg/build: Add ref field

Build messages don't carry a field that identifies the version of the
built software at the source-code level.
This commit adds the "ref" field to the build message specification and
implementation.

4 years agobuildbot: Receive build orders from a pubsub channel
Matthias Kruk [Fri, 26 Nov 2021 10:41:30 +0000 (19:41 +0900)]
buildbot: Receive build orders from a pubsub channel

The current buildbot implementation expects to receive build orders
addressed directly to it, requiring a central orchestrator in the
build system.
This commit makes buildbot receive build orders from a pubsub channel,
as a first step towards a completely distributed build system made of
independent processes.

4 years agodispatchbot: Send signrequest when a build succeeds
Matthias Kruk [Sun, 26 Sep 2021 06:55:39 +0000 (15:55 +0900)]
dispatchbot: Send signrequest when a build succeeds

Because handling of build notifications is not completely implemented
in dispatchbot, no sign requests are emitted when a build has succeeded.
This commit amends the dispatchbot implementation to correctly handle
build notifications, and to send sign requests whenever a successful
build has been observed.

4 years agodispatchbot: Send build requests when a merge was detected
Matthias Kruk [Thu, 9 Sep 2021 22:17:22 +0000 (07:17 +0900)]
dispatchbot: Send build requests when a merge was detected

Dispatchbot does not correctly handle merge messages, causing it to
fail to emit a build request when a merge has occurred.
This commit changes the way dispatchbot handles merge messages, so
that a build request is emitted whenever a merge was detected on a
"master" or "stable" branch.

4 years agopublish_test: Add script for publishing test results
Matthias Kruk [Thu, 9 Sep 2021 22:02:02 +0000 (07:02 +0900)]
publish_test: Add script for publishing test results

There is currently no way to manually publish a test message, making
it necessary to run a test on a testbot instance in order to test the
behavior of dispatchbot.
This commit adds a script that allows the caller to publish a test
message without the need to run a testbot instance.

4 years agodispatchbot: Send a merge request if a test was successful
Matthias Kruk [Thu, 9 Sep 2021 21:59:20 +0000 (06:59 +0900)]
dispatchbot: Send a merge request if a test was successful

Dispatchbot does not correctly implement sending of merge request
messages when a successful test on a testing branch was detected.
This commit modifies dispatchbot so that it emits a merge request
whenever a successful test was published on the "testing" branch
of a repository.

4 years agodispatchbot: Create a new context for test requests
Matthias Kruk [Fri, 3 Sep 2021 13:00:54 +0000 (22:00 +0900)]
dispatchbot: Create a new context for test requests

The function that is responsible for sending test requests in
dispatchbot calls `false' (as a placeholder) where a new foundry
context should be created, preventing the function from sending a
test request.
This commit changes dispatchbot so that it creates a new context
before sending a test request.

4 years agodist: Add test script for distbot
Matthias Kruk [Sun, 15 Aug 2021 05:48:29 +0000 (14:48 +0900)]
dist: Add test script for distbot

To make sure distbot is working correctly, this commit adds a script
that may be used to inject distrequest messages into the build system.
This script may also be used to manually distribute packages via
distbot.

4 years agodistbot: Use messaging-based IPC instead of raw queues
Matthias Kruk [Sun, 15 Aug 2021 05:46:36 +0000 (14:46 +0900)]
distbot: Use messaging-based IPC instead of raw queues

Distbot is the last remaining component that does not use messaging-
based IPC, making it incompatible with the rest of the build system.
This commit modifies distbot to use messaging-based IPC using the ipc
and foundry/msg modules.

4 years agosignbot: Add Debian package signer daemon and test script
Matthias Kruk [Sat, 14 Aug 2021 07:23:11 +0000 (16:23 +0900)]
signbot: Add Debian package signer daemon and test script

This commit adds signbot, a daemon for automatic signing of Debian
packages. This commit further adds a script that can be used to
manually inject contexts with artifacts into the build system to
test the functionality of signbot (or manually sign packages).

4 years agobuildbot: Avoid dpkg-buildpackage placing results in ".."
Matthias Kruk [Wed, 11 Aug 2021 06:58:34 +0000 (15:58 +0900)]
buildbot: Avoid dpkg-buildpackage placing results in ".."

There is no commandline option to tell dpkg-buildpackage to place the
build artifacts in a directory other than "..". Since buildbot clones
the sources directly into a temporary directory, this causes the build
artifacts to be written to a path outside the temporary directory.
This commit modifies buildbot to clone the sources into a subdirectory
of the temporary directory so that no build artifacts will be placed
outside of the temporary build directory.

4 years agobuild: Add script to enqueue builds with buildbot
Matthias Kruk [Wed, 11 Aug 2021 05:17:20 +0000 (14:17 +0900)]
build: Add script to enqueue builds with buildbot

This commit adds a script that enqueues a build in the queue of the
buildbots and waits for the corresponding build status message.

4 years agobuildbot: Use foundry messages for IPC
Matthias Kruk [Wed, 11 Aug 2021 05:15:08 +0000 (14:15 +0900)]
buildbot: Use foundry messages for IPC

Buildbot is still using raw queues for communication with the other
parts of foundry, making it incompatible with newer components.
This commit modifies buildbot to use message-based IPC.

4 years agotest: Don't create contexts without a name
Matthias Kruk [Sun, 8 Aug 2021 06:59:23 +0000 (15:59 +0900)]
test: Don't create contexts without a name

The testbot test script does not pass the name of the project to
foundry_context_new(), causing the created contexts to have no name.
This commit fixes test.sh so that the name of the repository is
passed as the project name to foundry_context_new().

4 years agomerge: Add script to perform merges with mergebot
Matthias Kruk [Sun, 8 Aug 2021 06:56:46 +0000 (15:56 +0900)]
merge: Add script to perform merges with mergebot

This commit adds a simple script that may be used to test mergebot.
The script sends a mergerequest message to mergebot according to the
parameters passed on the commandline, and awaits a merge message in
response.

4 years agomergebot: Fix message handling and publish a merge notifications
Matthias Kruk [Sun, 8 Aug 2021 06:53:40 +0000 (15:53 +0900)]
mergebot: Fix message handling and publish a merge notifications

Mergebot does not correctly handle incoming messages, causing it to
discard perfectly fine merge requests. Further, it does not publish
notifications when a merge has been completed.
This commit fixes mergebot so that it handles incoming messages
correctly and publishes a merge message for each merge it has
attempted.

4 years agoinclude/msg/merge: Remove log property
Matthias Kruk [Sun, 8 Aug 2021 02:32:16 +0000 (11:32 +0900)]
include/msg/merge: Remove log property

The log property was removed from the message definition of merge
messages, but the foundry/msg/merge module provides means to set and
get the value of this property.
This commit removes the log argument from foundry_msg_merge_new() and
the foundry_msg_merge_get_log() method, so that the log property
cannot be accessed anymore.

4 years agoinclude/context: Make foundry_context_get_logs() search the right path
Matthias Kruk [Sun, 8 Aug 2021 02:24:41 +0000 (11:24 +0900)]
include/context: Make foundry_context_get_logs() search the right path

The log path in foundry_context_get_logs() is incorrect, causing the
method to search for logfiles in an incorrect directory.
This commit changes the log directory in foundry_context_get_logs() so
that logs from the correct directory are returned.

4 years agoinclude/context: Add method to log directly to a context
Matthias Kruk [Sun, 8 Aug 2021 02:20:08 +0000 (11:20 +0900)]
include/context: Add method to log directly to a context

When logging messages to a context, a process needs to write messages
to a logfile and then add the logfile to a context. This makes the
control flow rather complicated because temporary files need to be
created, written to, and removed correctly when errors occur.
This commit adds the foundry_context_log() method that allows the
caller to append messages directly to a logfile.

4 years agotest: Add script to perform tests using testbot
Matthias Kruk [Sun, 1 Aug 2021 21:58:12 +0000 (06:58 +0900)]
test: Add script to perform tests using testbot

This commit adds a simple script that creates a new foundry context
and enqueues a test request for execution by a testbot.

4 years agotestbot: Remove remaining "commit" references
Matthias Kruk [Sun, 1 Aug 2021 07:39:27 +0000 (16:39 +0900)]
testbot: Remove remaining "commit" references

Testbots receive testrequest messages and send test messages, neither
of which have a commit property. Therefore, testbots should have no
notion of commits.
This commit removes all remaining references to commits from the
testbot implementation.

4 years agoinclude/msg: Remove "commit" property from message modules
Matthias Kruk [Sun, 1 Aug 2021 07:35:26 +0000 (16:35 +0900)]
include/msg: Remove "commit" property from message modules

The "commit" property has been removed from all but the message
specification of "commit" messages, so it must be removed from
modules that are used for constructing messages and accessing the
properties of messages.
This commit removes handling of the "commit" property from all
messages that this property has been removed from.

4 years agospec: Remove commit property from all message types (except commit)
Matthias Kruk [Sun, 1 Aug 2021 07:27:32 +0000 (16:27 +0900)]
spec: Remove commit property from all message types (except commit)

Handling of the commit property makes the components of foundry more
complex without adding tangible value. Therefore it should be removed
and added again in case that it really becomes necessary.
This commit removes the commit property from all message types but
commit messages.

4 years agotestbot: Remove handling of "commit" and "logs" message properties
Matthias Kruk [Sun, 1 Aug 2021 07:01:18 +0000 (16:01 +0900)]
testbot: Remove handling of "commit" and "logs" message properties

The "commit" message property has been made optional, and the "logs"
property has been removed, making it necessary to change the way
testbots handle IPC messages.
This commit modifies testbot so that the "commit" property will be
ignored, and that testbots will not attempt to include testlogs
in sent messages.

4 years agotestbot: Change default topic to "tests"
Matthias Kruk [Sun, 1 Aug 2021 06:21:19 +0000 (15:21 +0900)]
testbot: Change default topic to "tests"

The default topic that testbot publishes test messages under is set
to "merges", which is not correct.
This commit changes the default topic for test results to "tests".

4 years agotestbot: Add dependency on inst
Matthias Kruk [Sun, 1 Aug 2021 06:19:24 +0000 (15:19 +0900)]
testbot: Add dependency on inst

Testbot calls functions from the inst module but it does not include
the module upon startup, making it impossible to start the bot.
This commit makes testbot include the "inst" module before entering
the main() function.

4 years agoinclude/msg: Remove log-related functions from test and build modules
Matthias Kruk [Sun, 1 Aug 2021 05:44:31 +0000 (14:44 +0900)]
include/msg: Remove log-related functions from test and build modules

The "logs" property has been removed from the specification of the
test and build messages, so the functions in the respective modules
that access these properties must be removed as well.
This commit removes the foundry_msg_build_get_logs() and
foundry_msg_test_get_logs() functions and removes the logs parameter
from the foundry_msg_test_new() and foundry_msg_build_new() functions.

4 years agospec: Remove "logs" property from test and build messages
Matthias Kruk [Sun, 1 Aug 2021 05:07:56 +0000 (14:07 +0900)]
spec: Remove "logs" property from test and build messages

The test and build messages have a required property that the sender
must use to send the names of generated logfiles. However, since
processes will generally register log messages with the context, it
is not necessary to send the names of logfiles in an IPC message.
This commit removes the "logs" property from the specification of the
test and build messages.

4 years agodispatchbot: Send buildrequest upon receipt of a merge notification
Matthias Kruk [Sun, 1 Aug 2021 04:41:49 +0000 (13:41 +0900)]
dispatchbot: Send buildrequest upon receipt of a merge notification

When a merge into the master/stable branch of a repository has taken
place, foundry should trigger a build from the updated source code.
This commit modifies dispatchbot to watch the "merges" topic and send
a buildrequest to the buildbots whenever a merge to a master or stable
branch has been performed.

4 years agospec: Make commit field optional
Matthias Kruk [Sun, 1 Aug 2021 04:37:31 +0000 (13:37 +0900)]
spec: Make commit field optional

The buildrequest and testrequest messages carry a commit property that
is used to specify the exact commit that should be tested. However, it
is not always desirable or possible to specify the exact commit, so
the property should be optional.
This commit removes the property from the list of required properties,
allowing senders to omit the property.

4 years agotestbot: Add bot for testing source trees
Matthias Kruk [Sun, 25 Jul 2021 05:36:26 +0000 (14:36 +0900)]
testbot: Add bot for testing source trees

This commit adds testbot, a bot that listens for testrequest messages,
performs tests on the source tree specified in the request, and publishes
the result under the topic configured on the commandline.

4 years agofoundry: Remove the need to explicitly configure process names
Matthias Kruk [Sun, 25 Jul 2021 05:08:19 +0000 (14:08 +0900)]
foundry: Remove the need to explicitly configure process names

Foundry requires the process configurations to specify a process
name that is equal to the name of the configuration, otherwise
running processes are not correctly detected. Since the user is not
free to specify any name they want, it does not make sense to
require the user to configure the process name at all.
This commit changes the foundry implementation so that the name of
the config domain is used as the process name, doing away with the
need to explicitly configure the process name.

4 years agoinclude/context: Move files when adding them to a context
Matthias Kruk [Sun, 25 Jul 2021 04:31:16 +0000 (13:31 +0900)]
include/context: Move files when adding them to a context

When adding files (or logs) to a context, the files are placed in a
context-specific directory using cp. This causes copies of the files
to be left behind in the working directories of the generating
processes, requiring additional cleanup if the copies are not needed
anymore. However, in the majority of cases, the copy is not needed.

This commit modifies the foundry_context_add_file() and
foundry_context_add_log() functions so that mv is used to place the
files in the context's directory, doing away with the need to clean
up the working directories of the generating processes.

4 years agowatchbot: Add --name parameter to facilitate process identification
Matthias Kruk [Sat, 24 Jul 2021 07:13:48 +0000 (16:13 +0900)]
watchbot: Add --name parameter to facilitate process identification

The build system management script needs a way to identify individual
processes to make sure all configured processes are running.
This commit adds the --name parameter to watchbot, which is intended
to make the process identifiable as it shows up in the list output by
the --list parameter.

4 years agofoundry: Implement process and endpoint monitoring
Matthias Kruk [Sat, 24 Jul 2021 07:09:31 +0000 (16:09 +0900)]
foundry: Implement process and endpoint monitoring

To ensure proper operation of the build system, the management script
must make sure that the individual processes of foundry are running,
and that the IPC endpoints that are used for messaging are existing.
This commit adds a process watchdog to foundry.sh which ensures that
all processes are running as configured.
Further, this commit adds code to ensure that IPC endpoints are
existing, and periodically logs the contents of the IPC endpoints'
queues to a file so the messages sent between components of the
buildsystem can be monitored by an administrator.

4 years agosmelter: Rename mangement component to foundry.sh
Matthias Kruk [Sat, 24 Jul 2021 04:18:17 +0000 (13:18 +0900)]
smelter: Rename mangement component to foundry.sh

The component that starts and manages the buildsystem is called smelter,
however as it serves a very central purpose, it should be called foundry.
This commit renames the script from smelter.sh to foundry.sh.

4 years agodispatchbot: Include inst module
Matthias Kruk [Thu, 22 Jul 2021 03:07:09 +0000 (12:07 +0900)]
dispatchbot: Include inst module

Dispatchbot uses functions that are implemented by the inst module,
but it does not include the inst module at startup.
This commit modifies dispatchbot to include the inst module.

4 years agosmelter: Add build system management script
Matthias Kruk [Fri, 23 Jul 2021 01:59:49 +0000 (10:59 +0900)]
smelter: Add build system management script

This commit adds smelter, a script for managing the individual
components of the foundry build system.
Once complete, smelter will act as a process watchdog and monitor
the state of the various IPC endpoints and pubsub topics that are
used by the buildsystem.

4 years agowatchbot: Don't include foundry/msg/commit directly
Matthias Kruk [Mon, 19 Jul 2021 23:29:14 +0000 (08:29 +0900)]
watchbot: Don't include foundry/msg/commit directly

Watchbot includes the commit submodule of foundry/msg directly, which
causes some of the methods not to work correctly.
This commit changes watchbot to include foundry/msg instead of
foundry/msg/commit.

4 years agowatchbot: Rewrite watchbot to use new message format via pubsub
Matthias Kruk [Sun, 18 Jul 2021 21:54:45 +0000 (06:54 +0900)]
watchbot: Rewrite watchbot to use new message format via pubsub

The current watchbot implementation does not use the new message
format. Furthermore, it sends messages to a single queue, making it
hard to receive notifications in multiple processes.
This commit rewrites watchbot to use the new foundry message
definitions on top of toolbox/ipc's pubsub implementation.

4 years agoinclude/msg/*: Change name of "tid" field to "context"
Matthias Kruk [Sun, 18 Jul 2021 00:50:14 +0000 (09:50 +0900)]
include/msg/*: Change name of "tid" field to "context"

The "tid" field was renamed to "context" in the specifications of all
message types, but the implementations still refer to the old name.
This commit changes the implementations of all message types to use
the correct field name.

4 years agospec/*: Rename "tid" field to "context"
Matthias Kruk [Sun, 18 Jul 2021 00:37:20 +0000 (09:37 +0900)]
spec/*: Rename "tid" field to "context"

The object that is used to corellate parts of a build transaction has
been renamed from transaction to context, and therefore the name
"transaction identifier" is not correct anymore.
This commit updates all message specifications so that the field that
stores the context identifier is called "context".

4 years agospec/commit: Remove timestamp field from commit messages
Matthias Kruk [Sun, 18 Jul 2021 00:31:04 +0000 (09:31 +0900)]
spec/commit: Remove timestamp field from commit messages

The commit message specification contains a timestamp flag that is
currently not implemented. Furthermore, the timestamp can also be
acquired from the enclosing ipc_msg, so it is not necessary to
duplicate the field in the higher layers.
This commit removes the timestamp field from the message specification.

4 years agoinclude/context: Add module to keep track of build/test contexts
Matthias Kruk [Sun, 18 Jul 2021 00:13:54 +0000 (09:13 +0900)]
include/context: Add module to keep track of build/test contexts

This commit adds the context module, which implements a set of functions
to track the state of a transaction across the buildsystem. This module
will be used to store the logs and artifacts associated with a context in
a central location, identified by the context identifier which is stored
in several of the IPC messages.

4 years agomergebot: Add bot for merging branches of a repository
Matthias Kruk [Tue, 13 Jul 2021 23:01:35 +0000 (08:01 +0900)]
mergebot: Add bot for merging branches of a repository

This commit adds mergebot. Mergebot accepts merge request messages
and will attempt to merge the one branch into another. Currently,
this only works for merges that can be realised by fast-forwarding
the target branch.

4 years agodispatchbot: Add bot for issuing orders to other bots
Matthias Kruk [Tue, 13 Jul 2021 22:56:42 +0000 (07:56 +0900)]
dispatchbot: Add bot for issuing orders to other bots

This commit adds dispatchbot. Dispatchbot subscribes to all relevant
topics (such as "commit", "test", etc.) and emits orders to other bots
depending on the messages that it has seen.

4 years agoinclude/msg/*: Place all foundry messages in a base message
Matthias Kruk [Sun, 11 Jul 2021 06:32:19 +0000 (15:32 +0900)]
include/msg/*: Place all foundry messages in a base message

To make foundry messages easily distinguishable, they should each be
placed in a base message that contains a property for the message type.
This commit modifies the modules for all of the foundry message types
so that they are enclosed in a base message.

4 years agoinclude/msg: Add foundry base message type
Matthias Kruk [Sun, 11 Jul 2021 06:31:53 +0000 (15:31 +0900)]
include/msg: Add foundry base message type

Because the current foundry implementation transmits all message types
directly on top of the ipc layer, distinguishing message types is not
trivial.
This commit solves adds a base message type for foundry messages,
including an attribute that contains the message type, making it
making it possible for message types to be easily distinguished.

4 years agoinclude/msg: Add modules for foundry IPC message handling
Matthias Kruk [Sun, 4 Jul 2021 09:10:52 +0000 (18:10 +0900)]
include/msg: Add modules for foundry IPC message handling

This commit adds modules providing a convenient interface to
generate and parse any of the message types that are used for
IPC between foundry components.

4 years agospec: Add JSON Schemas for foundry IPC messages
Matthias Kruk [Sun, 4 Jul 2021 09:09:41 +0000 (18:09 +0900)]
spec: Add JSON Schemas for foundry IPC messages

To make foundry more flexible and scalable, the next release will
implement a messaging-based IPC approach using JSON objects.
This commit adds JSON schemas for all message types that will be
used by foundry.

4 years agobuildbot,distbot: Implement handling of build ids
Matthias Kruk [Sun, 25 Apr 2021 07:12:20 +0000 (16:12 +0900)]
buildbot,distbot: Implement handling of build ids

To make the progress of a build trackable, build ids are necessary.
This commit makes buildbot and distbot handle the build ids that are
assigned by the watchbots, and print them along with log output so
that printed messages can be associated with a specific build.

4 years agowatchbot: Assign a buildid when a new build job is enqueued
Matthias Kruk [Sun, 25 Apr 2021 04:16:45 +0000 (13:16 +0900)]
watchbot: Assign a buildid when a new build job is enqueued

When a repository change is detected, watchbot only places the path
and branch name in the queue. To track a build through the entire
build system, a build id should be assigned as well.
This commit modifies watchbot to also place a build id in the queue.

4 years agodistbot: Check more thoroughly if the specified repository exists
Matthias Kruk [Sun, 25 Apr 2021 03:53:25 +0000 (12:53 +0900)]
distbot: Check more thoroughly if the specified repository exists

Distbot assumes that the repository has been initialized if the
directory exists. This means that the repository won't be initialized
if an empty directory was passed to distbot.
This commit makes distbot check the specified repository a little more
thoroughly, to make sure empty directories will be initialized, too.

4 years agobuildbot: Use dpkg-buildpackage -k instead of --sign-key
Matthias Kruk [Sun, 25 Apr 2021 03:48:50 +0000 (12:48 +0900)]
buildbot: Use dpkg-buildpackage -k instead of --sign-key

Older versions of dpkg-buildpackage don't understand the --sign-key
option. With such versions, the -k option has to be used instead.
This commit changes buildbot to pass the key to dpkg-buildpackage
using the -k option.

4 years ago{watch,build,dist}bot: Make all bots use similar commandline options
Matthias Kruk [Sat, 24 Apr 2021 13:35:48 +0000 (22:35 +0900)]
{watch,build,dist}bot: Make all bots use similar commandline options

Watchbot, buildbot, and distbot do not use the same options for inputs
and outputs such as queues or directories. This commit changes the
understood commandline arguments so that the same options have the same
meaning.
Further, this commit updates the three bots to use the opt module in a
way thats compatible with toolbox > 0.3.

4 years agodistbot: Accept packages from a queue instead of a watch directory
Matthias Kruk [Fri, 16 Apr 2021 00:56:42 +0000 (09:56 +0900)]
distbot: Accept packages from a queue instead of a watch directory

Distbot currently monitors a watch directory and adds packages that
have been placed in this directory to the repository. This can be
greatly simplified by using queue instead.
This commit changes distbot to accept new packages from a queue. It
further simplifies the distbot code by using the inst module for
managing running instances.

4 years agobuildbot: Allow multiple instances to run at a time
Matthias Kruk [Thu, 15 Apr 2021 23:52:35 +0000 (08:52 +0900)]
buildbot: Allow multiple instances to run at a time

Buildbot is implemented as a singleton, even though this is neither
necessary nor desirable. In order to allow parallel builds, migrate
buildbot to use the inst module to manage running instances.

4 years agowatchbot: Implement multiple-instance support
Matthias Kruk [Thu, 15 Apr 2021 21:50:03 +0000 (06:50 +0900)]
watchbot: Implement multiple-instance support

Watchbot currently allows only one instance to run at a time. However,
it might be desirable to have multiple watchbots running simultaneously,
watching one or more repositories at a time.
This commit implements support for multiple instances using the new inst
module.

4 years agobuildbot,distbot,watchbot: Adapt to latest toolbox version
Matthias Kruk [Thu, 15 Apr 2021 21:29:14 +0000 (06:29 +0900)]
buildbot,distbot,watchbot: Adapt to latest toolbox version

The latest toolbox implements the --verbose and --shush options inside
the opt module, so it's no longer necessary to implement them explicitly.
This commit removes the --verbose and --shush options from all bots.

4 years agobuildbot: Pick up tasks from a queue and place built packages in another queue
Matthias Kruk [Thu, 15 Apr 2021 01:19:19 +0000 (10:19 +0900)]
buildbot: Pick up tasks from a queue and place built packages in another queue

This commit modifies buildbot to pick up tasks from a queue and place built debian
packages in another queue. This allows for very straightforward parallelization of
builds, once the start/stop mechanism has been changed.

4 years agodistbot: Add script to automate debian repository housekeeping
Matthias Kruk [Wed, 14 Apr 2021 00:15:44 +0000 (09:15 +0900)]
distbot: Add script to automate debian repository housekeeping

This commit adds a script that automatically adds debian packages that
have been placed in a queue directory to a debian package repository.

4 years agobuildbot: Add script to automatically perform builds on git repositories
Matthias Kruk [Wed, 14 Apr 2021 00:12:59 +0000 (09:12 +0900)]
buildbot: Add script to automatically perform builds on git repositories

This commit adds a script that can be used to watch a git repository for
changes and automatically perform a task if a change has been detected.

4 years agowatchbot: Add repository monitoring script
Matthias Kruk [Wed, 14 Apr 2021 00:08:25 +0000 (09:08 +0900)]
watchbot: Add repository monitoring script

This commit adds a script that can be used to monitor local repositories
for changes, and add them to a work queue when they need to be rebuilt.