Age | Commit message (Collapse) | Author |
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This reverts commit ab04d88ae84c33f3577870c10378f0166adf27bc.
Having a progress bar for establishing the database connection was just too much
noise visually.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
|
|
This piece of code actually did nothing except trace!()-printing. Thus, remove
it.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch makes sure all database functions are executed as transactions, so
that we do not accidentially end up in a data race if two butido instances are
executing these functions at the same time.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This change fixes a bug where two submits that differed only in an
environment variable where considered equal:
butido build pkg
butido build pkg -E FOO=1
the second build reused the artifacts from the first one, which is a
bug.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Tested-by: Matthias Beyer <mail@beyermatthias.de>
|
|
We have to manually implement Debug here, because otherwise we would
print the database password in the debug output, which is CLEARLY a bad
idea.
Hence, change the debug!() call in the establish_connection() function
to (debug-)print `self` and hand-implement the `Debug` trait.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This refactors the parsing of the `DbConnectionConfig` object and the
establishing of the connection to be member functions of the type, rather than
free functions. Way more idomatic.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This is actually an antipattern, because one should rather implement `ToString`
(or rather `Display`).
But because our type is nothing that would be displayed anyways, remove it
entirely.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch refactors the database connection setup code to involve less copying
of data in memory.
It also changes the configuration value type of the database port and the
database connection timeout setting to be `u16` instead of `String`, which is
another improvement.
Because the `DbConnectionConfig` type no longer holds owned values, it must be
annotated with a lifetime. Usages were adapted.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch adds support for a database connection timeout, giving the user the
option to configure one, but hardcoding a default timeout to 30 seconds.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch rewrites the endpoint configuration format to be a map.
The problem here is, that a list of endpoints cannot easily be used with layered
configuration, where a part of the configuration lives in the XDG config home of
the user and the rest lives in the repository.
With this patch, the endpoints are configured with a map instead of an array,
which makes it less complicated to overwrite.
The name of an endpoint is now the key in the map.
A type `EndpointName` was introduced to take advantage of strong typing. Thus,
the patch touches a bit more code to adapt to the new type in use.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch adds the ability to have more than one release store.
With this patch, a user can (has to) configure release store names in the
configuration file, and can then specify one of the configured names to release
the artifacts to.
This way, different release "channels" can be served, for example a stable
channel and a rolling release channel (although "channel" is not in our wording).
The code was adapted to be able to fetch releases from multiple release
directories, in the crate::db::find_artifact implementation, so that re-using
artifacts works across all release directories.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch changes the behaviour if the staging directory is re-used.
If the staging directory is re-used, we take the submit UUID from there instead
of generating a new one.
This way, database entries are added to the already existing submit instead of
added to a new one, but the artifacts are put into the staging store of the
reused one.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch changes the code so that the MergedStores object is known in the
endpoints and job execution code.
This is necessary, because the jobs must be able to load artifacts from the
release store as well, for example if a library was released in another submit
and we can reuse it because the script for that library didn't change.
For that, the interface of StoreRoot::join() was changed
- -> Result<FullArtifactPath<'a>>
+ -> Result<Option<FullArtifactPath<'a>>>
whereas it returns an Ok(None) if the artifact requested does not exist.
This was necessary to try-joining a path on the store root of the staging store,
and if there is no such file continue with try-joining the path on the release
store.
The calling code got a bit more complex with that change, though.
Next, the MergedStores got a `derive(Clone)` because clone()ing it is cheap
(two `Arc`s) and necessary to pass it easily to the jobs.
Each instance of the code where the staging store was consulted was changed to
consult the the release store as well.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch fixes a bug in the crate::db::find_artifacts() implementation, which
caused the function to fail if the filesystem object was removed.
For example, if a package X was built and released, but then removed on the
filesystem, this function would try to find that object but fail and cause
butido to stop.
Because that's not what we want, this function does not fail anymore but simply
ignore the not-found object and return nothing for it.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This fixes the query, because it must start from the packages table and filter
for package namd and version, and then join the other tables.
The dependency filtering was removed because it was too complex at this points.
Also, the release finding was changed so that the Release object is retrieved
later in the process of artifact selection.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
exists
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch implements the find-artifact subcommand, which is the basis for
artifact finding.
Right now we have the problem that finding artifacts after the fact is non-trivial.
What we can do, though, is search for them in the database using the same inputs
as the ones that created the artifact.
That means that if we want to find an artifact or multiple artifacts for a
package P in version V, we have to search the database for jobs that built that
package in that version, with the same script and the same variables
(environment, used container image, etc).
So if a package was built with the same script, the same environment variables
and on an image that is, for example, not in the denylist of the package,
chances are good that the artifacts produced by the job for the package are the
ones we search for.
In the `crate::command::find_artifact()` function, results are sorted before
they are printed, so that we preferrably print results with a release date.
Env filtering is also implemented, so a user has to provide the appropriate
additional environment variables, as they were submitted for the `buid` command
when the artifact was built.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This removes the "tree" column from the "submits" table.
This is because we do not store the build-tree in the database anymore.
We don't actually need this feature and we can always re-build the tree
from an old commit in the repository.
Thus, this is not required anymore.
Also, it is less easy to do as soon as the internal implementation
changes from a "tree" structure to a "DAG" structure.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
|
|
Make sure the inner_join() in the "submits" command implementation joins on the
jobs table, not on the packages table.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch updates the implementation for the dedicated release table.
First of all, it updates the model types and adds the new
`crate::db::models::Release` type for representing releases in the
database (which are just pointers to the released artifact).
The `db artifacts` command is updated by using a LEFT JOIN with the
"releases" table.
The `release` command is updated as well, though the change was a bit
more complex.
First of all, a LEFT OUTER JOIN was added which is essentially the same
as the filter for un-released artifacts from before the change.
Then, a `.select()` call was added, so we don't load all the objects we
don't need anyways.
This reduces overhead not only with the database querying but also in
the code here, as we do not allocate objects from the database we
destruct right away.
The updating of the artifact object in the database was changed to
generate a new release object in the "releases" table, of course.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch alters the database so that artifact entries in the db are
unique by path and job they belong to.
The `db::models::Artifact` implementation was updated to select the
newly created Artifact object by path and by job id.
The uniqueness constraint on the `path` column in the `artifacts` table
was dropped.
Uncool: We did not generate the constraint name explicitely. That's
unfortunate as we have to gamble here that the constraint name is always
guaranteed to be the same ("artifacts_path_key").
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This makes the typing a bit more helpful by using a type for the name of
environment variables.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This is the first step towards strong path typing for distinction
between artifact pathes.
It adds a type for Store root pathes and a type for artifact pathes.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Diesel is an exception here, because the generated src/schema.rs file
does not automatically contain the necessary imports.
All imports were added where necessary.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|