summaryrefslogtreecommitdiffstats
path: root/src/job/runnable.rs
AgeCommit message (Collapse)Author
2020-12-08Implement checking of allowed environment variablesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-08Move aggregation of environment variables to helper functionMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-08Use EnvironmentVariableName type for names of ENV variablesMatthias Beyer
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>
2020-12-07Deny macro_use from external crateMatthias Beyer
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>
2020-12-04Add strict script interpolationMatthias Beyer
This patch adds strict script interpolation, which means that the script interpolation will result in an error if a variable is referenced that does not exist. Before this patch, referencing an absent variable did result in an empty string, possibly resulting in an error at runtime. This feature is on by default. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Allow multiple sources per packageMatthias Beyer
This patch implements multiple (unnamed) sources per package. This means that a package can have an array of sources. What was adapted to allow multiple sources per package: * Downloads are made in parallel now * The cache structure was changed to /<package>-<version>/<hash>.source * The UI was changed to contain the full `Package` struct (as JSON object) in a UI format string Tests were adapted. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-16Pass package environment and package variables (as environment variables) to ↵Matthias Beyer
container Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-14Rewrite to use tokio::sync::RwLockMatthias Beyer
This patch rewrites the codebase to not use std::sync::RwLock, but tokio::sync::RwLock. tokios RwLock is an async RwLock, which is what we want in an async-await context. The more I use tokio, the more I understand what you should do and what you shouldn't do. Some parts of this patch are a rewrite, for example, JobSet::into_runables() was completely rewritten. That was necessary because the function used inside is `Runnable::build_from_job()`, which uses an RwLock internally, thus, gets `async` in this patch. Because of this, `JobSet::into_runables()` needed a complete rewrite as well. Because it is way more difficult than transforming the function to return an iterator of futures, this patch simply rewrites it to return a `Result<Vec<RunnableJob>>` instead. Internally, tokio jobs are submitted via the `futures::stream::FuturesUnordered<_>` now. This is not the most performant implementation for the problem at hand, but it is a reasonable simple one. Optimization could happen here, of course. Also, the implementation of resource preparation inside `RunnableJob::build_from_job()` got a rewrite using the same technique. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Copy package source to container before running buildMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-08Remove unused imports, sort importsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-07Add runtime-dependencies in runnable jobMatthias Beyer
This patch adds the runtime dependencies into the runnable job. These might be required to execute tests for a package inside the container. Because of this we also copy them to the container. The patch also generalizes the preparing mechansim into a helper function and makes use of some nice iterator chaining to be more readable. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-06Add getter for RunnableJob::uuidMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-05Change MergedStore to take Release/StagingStore via Arc<>Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-04Implement artifact findingMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-26Add job related typesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>