aboutsummaryrefslogtreecommitdiff
path: root/containers
AgeCommit message (Collapse)AuthorFilesLines
2025-09-03Run blackMarc-André Lureau2-20/+31
It's a bit massive diff, but why isn't the project enforcing formatting? It makes working with editors and tools much easier then. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-04-23containers: cirrus-run: Pull 'cirrus-run' from our forkPeter Krempa1-1/+1
The upstream for 'cirrus-run' didn't yet accept our patches. Rather than pulling from a private repo we now have a fork of upstream containing our patches. Update to pull from it. Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2024-10-22cirrus-run: Avoid hard job failure when CI credits run outPeter Krempa1-1/+3
Recently the libvirt project started to run out of CI credits on cirrus towards the end of the month. As this is annoying we'd prefer if the job is allowed to fail in such case. This patch (temporarily) switches to 'cirrus-run' version with patches allowing detection of CI credit failure, which also returns a different error code allowing us to allow return code '3' to be considered an allowed failure. Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2024-06-17containers: fix go-fmt job on failureDaniel P. Berrangé1-2/+4
When the go-fmt job was changed to use Alpine, it was seemingly missed that the diffstat command isn't available by default. Instead of depending on an external package, however, we can just let git generate a diffstat if we change the way the job works slightly. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-05-23go-fmt: Bump Golang version to 1.22Michal Privoznik1-1/+1
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2024-05-23cargo-fmt: Bump Rust version to 1.78Michal Privoznik1-1/+1
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2024-04-19containers: introduce 'cirrus-vars' commandDaniel P. Berrangé2-0/+21
The gitlab CI config file has to pass various variables into the cirrus CI config file to control the build process. This is done by a giant sed command in the cirrus build template. This is inflexible since the set of substitutions is hardcoded. This new 'cirrus-vars' command can replace any variable @NAME@ with the corresponding value from the $NAME environment variable. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-03-05List installed packages on Alpine onlyMichal Privoznik1-1/+1
After a container is done installing necessary packages, the list of all installed packages is collected into packages.txt file which is then printed out. And this works everywhere but Alpine. Because there 'apk list' is run which prints ALL available packages. We need to pass '--installed' to limit listing only to the installed ones [1]. 1: https://man.archlinux.org/man/apk-list.8.en Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2023-02-22containers: publish to 'latest' tag instead of 'master'Daniel P. Berrangé5-5/+5
Historically we use the CI_COMMIT_REF_SLUG for the docker tag, which is the branch name. This meant that when testing container builds from non-default tags/branches we didn't pollute the primary published content. When we switched to use merge requests for triggering CI in: commit 7a7402d259db6e75b2a6fbb1523b42a2d18fabfa Author: Daniel P. Berrangé <berrange@redhat.com> Date: Thu Feb 10 17:43:56 2022 +0000 gitlab: switch to trigger jobs against the merge request by default we stopped publishing containers for anything except a push to the default branch. As such there's no reason to use CI_COMMIT_REF_SLUG, we can just use a fixed tag name. The docker default is to use ':latest', so adopt that instead of ':master'. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-01-17containers: add a standard container for python 'flake8' toolDaniel P. Berrangé3-0/+51
The 'flake8' tool provides opinionated code style checks of python code. This adds a minimal container for running 'flake8' as a CI job. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-01-17containers: add a standard container for python 'black' toolDaniel P. Berrangé3-0/+49
The 'black' tool provides opinionated formatting of python code. This adds a minimal container for running 'black' as a CI job. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-09-09check-dco: improve logic for finding default branchDaniel P. Berrangé1-1/+14
The previous commit to dynamically detect the default branch name (instead of assuming 'master') only worked if the fork repo used the same default branch name as upstream. This is only likely to be the case for forks created after the upstream branch rename, and even then developers might change their fork's default branch name. Fortunately 'git remote show' prints info including the default branch name: $ git remote show check-dco * remote check-dco Fetch URL: https://gitlab.com/libosinfo/osinfo-db.git Push URL: https://gitlab.com/libosinfo/osinfo-db.git HEAD branch: main Remote branch: main new (next fetch will store in remotes/check-dco) Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-09-07check-dco: ensure we delete git remote on failureDaniel P. Berrangé1-11/+12
While CI jobs run in a throwaway git repo checkout, developers testing this script do not and so benefit from cleanup on failure. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-09-07check-dco: don't assume default branch is 'master'Daniel P. Berrangé1-2/+3
Use 'CI_DEFAULT_BRANCH' to identify the branch in case the project has switched to using 'main' as the branch name. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-20clang-format: Tweak YAML snippetAndrea Bolognani1-1/+2
To match what 'lcitool manifest' would generate. This highlights the fact that the job can be kicked off immediately, without waiting for builds to complete. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-20gitlab: Actually implement clang-format jobAndrea Bolognani1-1/+9
The functionality was wired up, but the actual implementation was missing. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-13containers: Drop cargo-clippyAndrea Bolognani3-41/+0
Reverts: 40edc2e88a49173288bbd1a9e1237d27358a884c Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-13lcitool: Drop cargo-clippy gitlab jobAndrea Bolognani1-10/+2
Turns out that this is not really usable in its current form. First of all, running clippy requires building the project, and so having a separate job for it running in a fresh container means that you're wasting a lot of CPU cycles. More importantly, projects like libvirt-rust need a number of extra packages such as the native library, pkg-config, libclang and so on to be available in addition to the Rust compiler and clippy, which makes providing a one-size-fits-all container pretty much impossible. Reverts: 22b83c9516047fd2fa6f640d928efc3348799916 Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-07cargo-clippy: Capture stderrAndrea Bolognani1-1/+1
That's where clippy actually produces most of its interesting output. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-04lcitool: Add cargo-clippy gitlab jobAndrea Bolognani1-2/+10
This complements the existing cargo-fmt job. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-04containers: Add cargo-clippyAndrea Bolognani3-0/+41
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-04cargo-fmt: Document manifest settingAndrea Bolognani1-2/+10
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-04cargo-fmt: Tweak YAML snippetAndrea Bolognani1-1/+2
To match what 'lcitool manifest' would generate. This highlights the fact that the job can be kicked off immediately, without waiting for builds to complete. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-04cargo-fmt: Rename output fileAndrea Bolognani2-6/+4
The output produced by the tool is not actually in patch format, so the file extension is inaccurate and calling diffstat on it doesn't make sense either. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-04cargo-fmt: Bump Rust version to 1.59Andrea Bolognani1-1/+1
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-01-19containers: update to cirrus-run 1.0.1Daniel P. Berrangé1-1/+1
This contains updates for the API breakage in Cirrus CI https://github.com/sio/cirrus-run/issues/9 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-09containers: update cirrus-run image to version 0.5.0Daniel P. Berrangé1-1/+1
The version 0.4.0 included several fixes to cope with intermittant API errors and improve retries and logging, and 0.5.0 included retries for internal server errors. This ought to improve reliability of Cirrus CI jobs Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-24containers: handle checking DCO on merge requestsDaniel P. Berrangé1-12/+26
When the check-dco script is triggered from a merge request pipeline, rather than a branch push pipeline, there might be a merge commit present. This will not have a SoB line present and thus will fail the DCO check, despite all the real commits having valid SoB. We cannot just check all commits from the ancestor. We need to use the explicit ancestor and head from the merge request, which will exclude the merge commit. This also has the benefit that we no longer need to add an extra remote for the upstream repository in the merge request scenario, since we are no longer trying to guess the common ancestor. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-07-27containers: create a shim around docker:dindDaniel P. Berrangé2-0/+1584
The current docker:dind container has broken default seccomp filter that results in clone3 being blocked, which in turn breaks Fedora 35 rawhide. This creates a thin shim that provides a custom seccomp profile that is simply a copy of the default docker profile from https://raw.githubusercontent.com/docker/labs/master/security/seccomp/seccomp-profiles/default.json Although this profile doesn't list clone3, it somehow results in clone3 getting configured for ENOSYS instead of EPERM, which makes everything work again. Individual projects can then use this new wrapper image by applying the diff services: - - docker:dind + - name: registry.gitlab.com/libvirt/libvirt-ci/docker-dind:master + alias: docker Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-08containers: introduce an image for clang-formatDaniel P. Berrangé3-0/+51
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19containers: Convert the Docker sanity checker images to AlpineErik Skultety4-20/+7
Alpine is a much smaller image and for the sake of consistency we can pull <language>:<major>.<minor>-alpine for all of our sanity checker scripts. Signed-off-by: Erik Skultety <eskultet@redhat.com>
2021-02-10containers: cargo-fmt: Don't use verbose mode with cargo-fmtErik Skultety1-1/+1
Even with correct formatting we end up with a non-empty patch file thanks to the verbose mode which we're actually not interested in anyway. Signed-off-by: Erik Skultety <eskultet@redhat.com>
2020-09-04cirrus-run: Install 0.3.0 from PyPiAndrea Bolognani1-9/+2
Now that 0.3.0 has been released and uploaded to PyPi, we no longer need to install from git to get all the features we want. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-08-10check-dco: Use GPL-2.0-or-laterAndrea Bolognani1-1/+1
This is consistent with the rest of the code in the repository. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-08-10Use SPDX license identifiersAndrea Bolognani1-13/+1
This cuts down on the amount of boilerplate while conveying the exact same amount of information. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-08-10cirrus-run: Pick up latest changesAndrea Bolognani1-0/+1
As long as we keep building cirrus-run from git to help the upstream author validate his changes, we better use specific commits to maintain reproducibility between forks and also as a way to trigger a container rebuild. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-08-04cirrus-run: Build from gitAndrea Bolognani1-2/+8
This is a temporary measure to help validate some recent changes in cirrus-run. Once a new release is made, we'll switch back to installing from PyPi. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-06-09containers: Add cirrus-run containerAndrea Bolognani1-0/+4
This tool can be used to trigger Cirrus CI jobs from outside of Cirrus CI itself, and we're going to use it to add FreeBSD and macOS support to our GitLab CI configurations by delegating them. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-05-13containers: add a standard container for running cargo fmtDaniel P. Berrangé3-0/+52
The "cargo fmt" code style checking tool is something we wish to run on all Rust code, so it is useful to have a common container that can be used by all relevant projects. Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-13containers: add a standard container for running go fmtDaniel P. Berrangé3-0/+53
The "go fmt" code style checking tool is something we wish to run on all Go code, so it is useful to have a common container that can be used by all relevant projects. Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-01check-dco: Support namespaces other than libvirtAndrea Bolognani1-1/+5
This will allow us to reuse the same container image to perform DCO checking for libosinfo repositories. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-01check-dco: Change remote nameAndrea Bolognani1-4/+4
Make it match the name of the script. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-01check-dco: Fix script name in top commentAndrea Bolognani1-1/+1
It refers to an old name for the script. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-01containers: New top-level directoryAndrea Bolognani2-0/+105
Let's keep the repository structure tidy. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>