A base module can set xmd.mbs.default_modules_url, which contains a
URL to a list of modules in the format of name:stream separated by
new lines. When a module buildrequires this base module, the list
of default modules are added as buildrequires of the module automatically
unless there are conflicting streams or the default module is not
in the MBS database.
When NUM_CONCURRENT_BUILDS is 0, then multi-threading is disabled
when submitting builds to Koji. This is not acceptable, so this
commit makes the number of threads configurable.
Most of the issues are caused by the use of SQLAlchemy database session. Some
inline comments describe the issues in detail.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
There was a race condition, when 2 builds where build in the same time.
There was an issue that after one has finished the other reused the new build
for reuse and not the one it started with.
Ticket-ID: FACTORY-3862
Signed-off-by: Martin Curlej <mcurlej@redhat.com>
* Add docstring
* Call dict.setdefault to simplify the code a little which constructs the map
from package name to built RPMs' NVRs.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
For example, contrib/run-unittests.sh /src/tests/test_utils ...
Please note that the path starts from /src, which is the root directory of
code inside container.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This is useful for running run-unittests.sh in Jenkins. When set --no-tty, -i
and -t are not added to docker-run command.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This patch introduces a new environment variable in order to allow running
tests with different database backend. This is useful particularly for running
tests inside container. With this change, it is possible run tests in following
combinations:
* Python 2 and SQLite
* Python 3 and SQLite
* Python 2 and PostgreSQL
* Python 3 and PostgreSQL
Package python-psycopg2 is installed in both Dockerfile-tests and
Dockerfile-tests-py3 in case of running tests with PostgreSQL.
A new script contrib/run-unittests.sh is added to make it easy to run tests. An
example:
contrib/run-unittests.sh --py3 --with-pgsql
that runs tests with Python 3 and PostgreSQL.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This commit fixes issue with following situation:
Module `foo` has been built with `buildrequires: platform: [f28]`
and `requires: platform: []`. It can therefore be used as a buildrequirement
on any platform stream. But if you want to build module `app` which
buildrequires `foo` on `platform:f30`, the MBS won't pull-in the `foo`
module build, because MBS currently limits the modules by the platform
they have been built for.
This commit adds new config option to allow including modules built
against any platform stream.
To do this, we need to use the same database session in import_mmd as in
ModuleBuild.get_buildrequired_base_modules, otherwise, the returned
ModuleBuild objects are in a detached state.
This fixes module builds which sets the `buildopts` for something else
than the RPM whitelist.
Before this commit, when `buildopts` was set, the RPM whitelist was
always taken from the buildopts even if it was not defined there.
This resulted in empty `rpm_whitelist` and therefore no pkglist set
in Koji tag.
In this commit, MBS uses whitelist from `buildopts` only if it is
really set by the module maintainer.
Recommend using podman instead of docker because:
* one can spin up containers without sudo with podman;
* docker in Fedora has a really old version, and probably will be
depercated at some point.
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>