Import QEMU upstream snapshot d2e570c
Upstream: https://gitlab.com/qemu-project/qemu.git Upstream-Commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
This commit is contained in:
commit
cf256aa081
11315 files changed
+3598369
No files matched your search
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Author: Alex Bennée <[email protected]>
|
||||
#
|
||||
# Summerise the state of code coverage with gcovr and tweak the output
|
||||
# to be more sane on CI runner. As we expect to be executed on a
|
||||
# throw away CI instance we do spam temp files all over the shop. You
|
||||
# most likely don't want to execute this script but just call gcovr
|
||||
# directly. See also "make coverage-report"
|
||||
#
|
||||
# This code is licensed under the GPL version 2 or later. See
|
||||
# the COPYING file in the top-level directory.
|
||||
|
||||
# first generate the coverage report
|
||||
gcovr -p -o raw-report.txt
|
||||
|
||||
# strip the full-path and line markers
|
||||
sed s@$PWD\/@@ raw-report.txt | sed s/[0-9]\*[,-]//g > simplified.txt
|
||||
|
||||
# reflow lines that got split
|
||||
awk '/.[ch]$/ { printf("%s", $0); next } 1' simplified.txt > rejoined.txt
|
||||
|
||||
# columnify
|
||||
column -t rejoined.txt > final.txt
|
||||
|
||||
# and dump, stripping out 0% coverage
|
||||
grep -v "0%" final.txt
|
||||
@@ -0,0 +1,29 @@
|
||||
# Copyright (c) 2024 Linaro Ltd
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# gitlab-ci-section: This is a shell script fragment which defines
|
||||
# functions section_start and section_end which will emit marker lines
|
||||
# that GitLab will interpret as the beginning or end of a "collapsible
|
||||
# section" in a CI job log. See
|
||||
# https://docs.gitlab.com/ee/ci/yaml/script.html#expand-and-collapse-job-log-sections
|
||||
#
|
||||
# This is intended to be sourced in the before_script section of
|
||||
# a CI config; the section_start and section_end functions will
|
||||
# then be available for use in the before_script and script sections.
|
||||
|
||||
# Section names are [-_.A-Za-z0-9] and the section_start pairs with
|
||||
# a section_end with the same section name.
|
||||
# The description can be any printable text without newlines; this is
|
||||
# what will appear in the log.
|
||||
|
||||
# Usage:
|
||||
# section_start section_name "Description of the section"
|
||||
section_start () {
|
||||
printf "section_start:%s:%s\r\e[0K%s\n" "$(date +%s)" "$1" "$2"
|
||||
}
|
||||
|
||||
# Usage:
|
||||
# section_end section_name
|
||||
section_end () {
|
||||
printf "section_end:%s:%s\r\e[0K\n" "$(date +%s)" "$1"
|
||||
}
|
||||
Executable
+117
@@ -0,0 +1,117 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# A script to analyse failures in the gitlab pipelines. It requires an
|
||||
# API key from gitlab with the following permissions:
|
||||
# - api
|
||||
# - read_repository
|
||||
# - read_user
|
||||
#
|
||||
|
||||
import argparse
|
||||
import gitlab
|
||||
import os
|
||||
|
||||
#
|
||||
# Arguments
|
||||
#
|
||||
class NoneForEmptyStringAction(argparse.Action):
|
||||
def __call__(self, parser, namespace, value, option_string=None):
|
||||
if value == '':
|
||||
setattr(namespace, self.dest, None)
|
||||
else:
|
||||
setattr(namespace, self.dest, value)
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description="Analyse failed GitLab CI runs.")
|
||||
|
||||
parser.add_argument("--gitlab",
|
||||
default="https://gitlab.com",
|
||||
help="GitLab instance URL (default: https://gitlab.com).")
|
||||
parser.add_argument("--id", default=11167699,
|
||||
type=int,
|
||||
help="GitLab project id (default: 11167699 for qemu-project/qemu)")
|
||||
parser.add_argument("--token",
|
||||
default=os.getenv("GITLAB_TOKEN"),
|
||||
help="Your personal access token with 'api' scope.")
|
||||
parser.add_argument("--branch",
|
||||
type=str,
|
||||
default="staging",
|
||||
action=NoneForEmptyStringAction,
|
||||
help="The name of the branch (default: 'staging')")
|
||||
parser.add_argument("--status",
|
||||
type=str,
|
||||
action=NoneForEmptyStringAction,
|
||||
default="failed",
|
||||
help="Filter by branch status (default: 'failed')")
|
||||
parser.add_argument("--count", type=int,
|
||||
default=3,
|
||||
help="The number of failed runs to fetch.")
|
||||
parser.add_argument("--skip-jobs",
|
||||
default=False,
|
||||
action='store_true',
|
||||
help="Skip dumping the job info")
|
||||
parser.add_argument("--pipeline", type=int,
|
||||
nargs="+",
|
||||
default=None,
|
||||
help="Explicit pipeline ID(s) to fetch.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = parser.parse_args()
|
||||
|
||||
gl = gitlab.Gitlab(url=args.gitlab, private_token=args.token)
|
||||
project = gl.projects.get(args.id)
|
||||
|
||||
|
||||
pipelines_to_process = []
|
||||
|
||||
# Use explicit pipeline IDs if provided, otherwise fetch a list
|
||||
if args.pipeline:
|
||||
args.count = len(args.pipeline)
|
||||
for p_id in args.pipeline:
|
||||
pipelines_to_process.append(project.pipelines.get(p_id))
|
||||
else:
|
||||
# Use an iterator to fetch the pipelines
|
||||
pipe_iter = project.pipelines.list(iterator=True,
|
||||
status=args.status,
|
||||
ref=args.branch)
|
||||
# Check each failed pipeline
|
||||
pipelines_to_process = [next(pipe_iter) for _ in range(args.count)]
|
||||
|
||||
# Check each pipeline
|
||||
for p in pipelines_to_process:
|
||||
|
||||
jobs = p.jobs.list(get_all=True)
|
||||
failed_jobs = [j for j in jobs if j.status == "failed"]
|
||||
skipped_jobs = [j for j in jobs if j.status == "skipped"]
|
||||
manual_jobs = [j for j in jobs if j.status == "manual"]
|
||||
|
||||
trs = p.test_report_summary.get()
|
||||
total = trs.total["count"]
|
||||
skipped = trs.total["skipped"]
|
||||
failed = trs.total["failed"]
|
||||
|
||||
print(f"{p.status} pipeline {p.id}, total jobs {len(jobs)}, "
|
||||
f"skipped {len(skipped_jobs)}, "
|
||||
f"failed {len(failed_jobs)}, ",
|
||||
f"{total} tests, "
|
||||
f"{skipped} skipped tests, "
|
||||
f"{failed} failed tests")
|
||||
|
||||
if not args.skip_jobs:
|
||||
for j in failed_jobs:
|
||||
print(f" Failed job {j.id}, {j.name}, {j.web_url}")
|
||||
|
||||
# It seems we can only extract failing tests from the full
|
||||
# test report, maybe there is some way to filter it.
|
||||
|
||||
if failed > 0:
|
||||
ftr = p.test_report.get()
|
||||
failed_suites = [s for s in ftr.test_suites if
|
||||
s["failed_count"] > 0]
|
||||
for fs in failed_suites:
|
||||
name = fs["name"]
|
||||
tests = fs["test_cases"]
|
||||
failed_tests = [t for t in tests if t["status"] == 'failed']
|
||||
for t in failed_tests:
|
||||
print(f" Failed test {t["classname"]}, {name}, {t["name"]}")
|
||||
@@ -0,0 +1,30 @@
|
||||
gitlabUrl: "https://gitlab.com/"
|
||||
runnerRegistrationToken: ""
|
||||
rbac:
|
||||
create: true
|
||||
concurrent: 200
|
||||
runners:
|
||||
privileged: true
|
||||
config: |
|
||||
[[runners]]
|
||||
limit = 100
|
||||
environment = [
|
||||
"DOCKER_HOST=tcp://docker:2376",
|
||||
"DOCKER_TLS_CERTDIR=/certs",
|
||||
"DOCKER_TLS_VERIFY=1",
|
||||
"DOCKER_CERT_PATH=/certs/client"
|
||||
]
|
||||
[runners.kubernetes]
|
||||
poll_timeout = 1200
|
||||
image = "ubuntu:20.04"
|
||||
cpu_request = "0.5"
|
||||
service_cpu_request = "0.5"
|
||||
helper_cpu_request = "0.25"
|
||||
cpu_request_overwrite_max_allowed = "7"
|
||||
memory_request_overwrite_max_allowed = "30Gi"
|
||||
[[runners.kubernetes.volumes.empty_dir]]
|
||||
name = "docker-certs"
|
||||
mount_path = "/certs/client"
|
||||
medium = "Memory"
|
||||
[runners.kubernetes.node_selector]
|
||||
agentpool = "jobs"
|
||||
Executable
+195
@@ -0,0 +1,195 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (c) 2019-2020 Red Hat, Inc.
|
||||
#
|
||||
# Author:
|
||||
# Cleber Rosa <[email protected]>
|
||||
#
|
||||
# This work is licensed under the terms of the GNU GPL, version 2 or
|
||||
# later. See the COPYING file in the top-level directory.
|
||||
|
||||
"""
|
||||
Checks the GitLab pipeline status for a given commit ID
|
||||
"""
|
||||
|
||||
# pylint: disable=C0103
|
||||
|
||||
import argparse
|
||||
import http.client
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
import sys
|
||||
|
||||
|
||||
class CommunicationFailure(Exception):
|
||||
"""Failed to communicate to gitlab.com APIs."""
|
||||
|
||||
|
||||
class NoPipelineFound(Exception):
|
||||
"""Communication is successful but pipeline is not found."""
|
||||
|
||||
|
||||
def get_local_branch_commit(branch):
|
||||
"""
|
||||
Returns the commit sha1 for the *local* branch named "staging"
|
||||
"""
|
||||
result = subprocess.run(['git', 'rev-parse', branch],
|
||||
stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.DEVNULL,
|
||||
cwd=os.path.dirname(__file__),
|
||||
universal_newlines=True).stdout.strip()
|
||||
if result == branch:
|
||||
raise ValueError("There's no local branch named '%s'" % branch)
|
||||
if len(result) != 40:
|
||||
raise ValueError("Branch '%s' HEAD doesn't look like a sha1" % branch)
|
||||
return result
|
||||
|
||||
|
||||
def get_json_http_response(url):
|
||||
"""
|
||||
Returns the JSON content of an HTTP GET request to gitlab.com
|
||||
"""
|
||||
connection = http.client.HTTPSConnection('gitlab.com')
|
||||
connection.request('GET', url=url)
|
||||
response = connection.getresponse()
|
||||
if response.code != http.HTTPStatus.OK:
|
||||
msg = "Received unsuccessful response: %s (%s)" % (response.code,
|
||||
response.reason)
|
||||
raise CommunicationFailure(msg)
|
||||
return json.loads(response.read())
|
||||
|
||||
|
||||
def get_pipeline_status(project_id, commit_sha1):
|
||||
"""
|
||||
Returns the JSON content of the pipeline status API response
|
||||
"""
|
||||
url = '/api/v4/projects/{}/pipelines?sha={}'.format(project_id,
|
||||
commit_sha1)
|
||||
json_response = get_json_http_response(url)
|
||||
|
||||
# As far as I can tell, there should be only one pipeline for the same
|
||||
# project + commit. If this assumption is false, we can add further
|
||||
# filters to the url, such as username, and order_by.
|
||||
if not json_response:
|
||||
msg = "No pipeline found for project %s and commit %s" % (project_id,
|
||||
commit_sha1)
|
||||
raise NoPipelineFound(msg)
|
||||
return json_response[0]
|
||||
|
||||
|
||||
def wait_on_pipeline_success(timeout, interval,
|
||||
project_id, commit_sha):
|
||||
"""
|
||||
Waits for the pipeline to finish within the given timeout
|
||||
"""
|
||||
start = time.time()
|
||||
while True:
|
||||
if time.time() >= (start + timeout):
|
||||
msg = ("Timeout (-t/--timeout) of %i seconds reached, "
|
||||
"won't wait any longer for the pipeline to complete")
|
||||
msg %= timeout
|
||||
print(msg)
|
||||
return False
|
||||
|
||||
try:
|
||||
status = get_pipeline_status(project_id, commit_sha)
|
||||
except NoPipelineFound:
|
||||
print('Pipeline has not been found, it may not have been created yet.')
|
||||
time.sleep(1)
|
||||
continue
|
||||
|
||||
pipeline_status = status['status']
|
||||
status_to_wait = ('created', 'waiting_for_resource', 'preparing',
|
||||
'pending', 'running')
|
||||
if pipeline_status in status_to_wait:
|
||||
print('%s...' % pipeline_status)
|
||||
time.sleep(interval)
|
||||
continue
|
||||
|
||||
if pipeline_status == 'success':
|
||||
return True
|
||||
|
||||
msg = "Pipeline failed, check: %s" % status['web_url']
|
||||
print(msg)
|
||||
return False
|
||||
|
||||
|
||||
def create_parser():
|
||||
parser = argparse.ArgumentParser(
|
||||
prog='pipeline-status',
|
||||
description='check or wait on a pipeline status')
|
||||
|
||||
parser.add_argument('-t', '--timeout', type=int, default=7200,
|
||||
help=('Amount of time (in seconds) to wait for the '
|
||||
'pipeline to complete. Defaults to '
|
||||
'%(default)s'))
|
||||
parser.add_argument('-i', '--interval', type=int, default=60,
|
||||
help=('Amount of time (in seconds) to wait between '
|
||||
'checks of the pipeline status. Defaults '
|
||||
'to %(default)s'))
|
||||
parser.add_argument('-w', '--wait', action='store_true', default=False,
|
||||
help=('Whether to wait, instead of checking only once '
|
||||
'the status of a pipeline'))
|
||||
parser.add_argument('-p', '--project-id', type=int, default=11167699,
|
||||
help=('The GitLab project ID. Defaults to the project '
|
||||
'for https://gitlab.com/qemu-project/qemu, that '
|
||||
'is, "%(default)s"'))
|
||||
parser.add_argument('-b', '--branch', type=str, default="staging",
|
||||
help=('Specify the branch to check. '
|
||||
'Use HEAD for your current branch. '
|
||||
'Otherwise looks at "%(default)s"'))
|
||||
parser.add_argument('-c', '--commit',
|
||||
default=None,
|
||||
help=('Look for a pipeline associated with the given '
|
||||
'commit. If one is not explicitly given, the '
|
||||
'commit associated with the default branch '
|
||||
'is used.'))
|
||||
parser.add_argument('--verbose', action='store_true', default=False,
|
||||
help=('A minimal verbosity level that prints the '
|
||||
'overall result of the check/wait'))
|
||||
return parser
|
||||
|
||||
def main():
|
||||
"""
|
||||
Script entry point
|
||||
"""
|
||||
parser = create_parser()
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.commit:
|
||||
args.commit = get_local_branch_commit(args.branch)
|
||||
|
||||
success = False
|
||||
try:
|
||||
if args.wait:
|
||||
success = wait_on_pipeline_success(
|
||||
args.timeout,
|
||||
args.interval,
|
||||
args.project_id,
|
||||
args.commit)
|
||||
else:
|
||||
status = get_pipeline_status(args.project_id,
|
||||
args.commit)
|
||||
success = status['status'] == 'success'
|
||||
except Exception as error: # pylint: disable=W0703
|
||||
if args.verbose:
|
||||
print("ERROR: %s" % error.args[0])
|
||||
except KeyboardInterrupt:
|
||||
if args.verbose:
|
||||
print("Exiting on user's request")
|
||||
|
||||
if success:
|
||||
if args.verbose:
|
||||
print('success')
|
||||
sys.exit(0)
|
||||
else:
|
||||
if args.verbose:
|
||||
print('failure')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,2 @@
|
||||
inventory
|
||||
vars.yml
|
||||
@@ -0,0 +1,56 @@
|
||||
# Copyright (c) 2021 Red Hat, Inc.
|
||||
#
|
||||
# Author:
|
||||
# Cleber Rosa <[email protected]>
|
||||
#
|
||||
# This work is licensed under the terms of the GNU GPL, version 2 or
|
||||
# later. See the COPYING file in the top-level directory.
|
||||
#
|
||||
# This is an ansible playbook file. Run it to set up systems with the
|
||||
# environment needed to build QEMU.
|
||||
---
|
||||
- name: Installation of basic packages to build QEMU
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Check for suitable ansible version
|
||||
delegate_to: localhost
|
||||
assert:
|
||||
that:
|
||||
- '((ansible_version.major == 2) and (ansible_version.minor >= 8)) or (ansible_version.major >= 3)'
|
||||
msg: "Unsuitable ansible version, please use version 2.8.0 or later"
|
||||
|
||||
- name: Update apt cache / upgrade packages via apt
|
||||
apt:
|
||||
update_cache: yes
|
||||
upgrade: yes
|
||||
when:
|
||||
- ansible_facts['distribution'] in ['Ubuntu', 'Debian']
|
||||
|
||||
# the package lists are updated by "make lcitool-refresh"
|
||||
- name: Define package list file path for Ubuntu
|
||||
set_fact:
|
||||
package_file: "ubuntu/ubuntu-2404-{{ ansible_facts['architecture'] }}.yaml"
|
||||
when:
|
||||
- ansible_facts['distribution'] == 'Ubuntu'
|
||||
- ansible_facts['distribution_version'] == '24.04'
|
||||
|
||||
- name: Define package list file path for Debian
|
||||
set_fact:
|
||||
package_file: "debian/debian-{{ ansible_facts['distribution_major_version'] }}-{{ ansible_facts['architecture'] }}.yaml"
|
||||
when:
|
||||
- ansible_facts['distribution'] == 'Debian'
|
||||
|
||||
- name: Include package lists based on OS and architecture
|
||||
include_vars:
|
||||
file: "{{ package_file }}"
|
||||
when:
|
||||
- package_file is exists
|
||||
|
||||
- name: Install packages for QEMU on Ubuntu/Debian
|
||||
package:
|
||||
name: "{{ packages }}"
|
||||
when:
|
||||
- package_file is exists
|
||||
- packages is defined
|
||||
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
# THIS FILE WAS AUTO-GENERATED
|
||||
#
|
||||
# $ lcitool variables --host-arch ppc64le debian-13 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
packages:
|
||||
- bash
|
||||
- bc
|
||||
- bindgen
|
||||
- bison
|
||||
- bsdextrautils
|
||||
- bzip2
|
||||
- ca-certificates
|
||||
- ccache
|
||||
- clang
|
||||
- coreutils
|
||||
- dbus
|
||||
- debianutils
|
||||
- diffutils
|
||||
- exuberant-ctags
|
||||
- findutils
|
||||
- flex
|
||||
- gcc
|
||||
- gcovr
|
||||
- gettext
|
||||
- git
|
||||
- hostname
|
||||
- libaio-dev
|
||||
- libasan8
|
||||
- libasound2-dev
|
||||
- libattr1-dev
|
||||
- libbpf-dev
|
||||
- libbrlapi-dev
|
||||
- libbz2-dev
|
||||
- libc6-dev
|
||||
- libcacard-dev
|
||||
- libcap-ng-dev
|
||||
- libcapstone-dev
|
||||
- libcbor-dev
|
||||
- libclang-rt-dev
|
||||
- libcmocka-dev
|
||||
- libcurl4-gnutls-dev
|
||||
- libdaxctl-dev
|
||||
- libdrm-dev
|
||||
- libepoxy-dev
|
||||
- libfdt-dev
|
||||
- libffi-dev
|
||||
- libfuse3-dev
|
||||
- libgbm-dev
|
||||
- libgcrypt20-dev
|
||||
- libglib2.0-dev
|
||||
- libgnutls28-dev
|
||||
- libgtk-3-dev
|
||||
- libgtk-vnc-2.0-dev
|
||||
- libibverbs-dev
|
||||
- libiscsi-dev
|
||||
- libjemalloc-dev
|
||||
- libjpeg62-turbo-dev
|
||||
- libjson-c-dev
|
||||
- liblttng-ust-dev
|
||||
- liblzo2-dev
|
||||
- libncursesw5-dev
|
||||
- libnfs-dev
|
||||
- libnuma-dev
|
||||
- libpam0g-dev
|
||||
- libpcre2-dev
|
||||
- libpipewire-0.3-dev
|
||||
- libpixman-1-dev
|
||||
- libpng-dev
|
||||
- libpulse-dev
|
||||
- librbd-dev
|
||||
- librdmacm-dev
|
||||
- libsasl2-dev
|
||||
- libsdl2-dev
|
||||
- libsdl2-image-dev
|
||||
- libseccomp-dev
|
||||
- libselinux1-dev
|
||||
- libslirp-dev
|
||||
- libsnappy-dev
|
||||
- libsndio-dev
|
||||
- libspice-protocol-dev
|
||||
- libspice-server-dev
|
||||
- libssh-dev
|
||||
- libstd-rust-dev
|
||||
- libsystemd-dev
|
||||
- libtasn1-6-dev
|
||||
- libubsan1
|
||||
- libudev-dev
|
||||
- liburing-dev
|
||||
- libusb-1.0-0-dev
|
||||
- libusbredirhost-dev
|
||||
- libvdeplug-dev
|
||||
- libvirglrenderer-dev
|
||||
- libvte-2.91-dev
|
||||
- libxdp-dev
|
||||
- libzstd-dev
|
||||
- llvm
|
||||
- locales
|
||||
- make
|
||||
- mtools
|
||||
- multipath-tools
|
||||
- nettle-dev
|
||||
- ninja-build
|
||||
- openssh-client
|
||||
- pkgconf
|
||||
- python3
|
||||
- python3-pip
|
||||
- python3-setuptools
|
||||
- python3-sphinx
|
||||
- python3-sphinx-rtd-theme
|
||||
- python3-tomli
|
||||
- python3-venv
|
||||
- python3-wheel
|
||||
- rpm2cpio
|
||||
- rustc
|
||||
- sed
|
||||
- socat
|
||||
- sparse
|
||||
- swtpm
|
||||
- systemtap-sdt-dev
|
||||
- tar
|
||||
- tesseract-ocr
|
||||
- tesseract-ocr-eng
|
||||
- vulkan-tools
|
||||
- xorriso
|
||||
- zlib1g-dev
|
||||
- zstd
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
# Copyright (c) 2021 Red Hat, Inc.
|
||||
#
|
||||
# Author:
|
||||
# Cleber Rosa <[email protected]>
|
||||
#
|
||||
# This work is licensed under the terms of the GNU GPL, version 2 or
|
||||
# later. See the COPYING file in the top-level directory.
|
||||
#
|
||||
# This is an ansible playbook file. Run it to set up systems with the
|
||||
# gitlab-runner agent.
|
||||
---
|
||||
- name: Installation of gitlab-runner
|
||||
hosts: all
|
||||
vars_files:
|
||||
- vars.yml
|
||||
tasks:
|
||||
- debug:
|
||||
msg: 'Checking for a valid GitLab registration token'
|
||||
failed_when: "gitlab_runner_authentication_token == 'PLEASE_PROVIDE_A_VALID_TOKEN'"
|
||||
|
||||
- name: Create a group for the gitlab-runner service
|
||||
group:
|
||||
name: gitlab-runner
|
||||
|
||||
- name: Create a user for the gitlab-runner service
|
||||
user:
|
||||
user: gitlab-runner
|
||||
group: gitlab-runner
|
||||
groups: kvm
|
||||
comment: GitLab Runner
|
||||
home: /home/gitlab-runner
|
||||
shell: /bin/bash
|
||||
|
||||
- name: Remove the .bash_logout file when on Ubuntu systems
|
||||
file:
|
||||
path: /home/gitlab-runner/.bash_logout
|
||||
state: absent
|
||||
when: "ansible_facts['distribution'] == 'Ubuntu'"
|
||||
|
||||
- name: Set the Operating System for gitlab-runner
|
||||
set_fact:
|
||||
gitlab_runner_os: "{{ ansible_facts[\"system\"]|lower }}"
|
||||
- debug:
|
||||
msg: gitlab-runner OS is {{ gitlab_runner_os }}
|
||||
|
||||
- name: Set the architecture for gitlab-runner
|
||||
set_fact:
|
||||
gitlab_runner_arch: "{{ ansible_to_gitlab_arch[ansible_facts[\"architecture\"]] }}"
|
||||
- debug:
|
||||
msg: gitlab-runner arch is {{ gitlab_runner_arch }}
|
||||
|
||||
# Debian/Ubuntu setup
|
||||
- name: Get gitlab-runner repo setup script (DEB)
|
||||
get_url:
|
||||
dest: "/root/"
|
||||
url: "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh"
|
||||
mode: 0755
|
||||
when:
|
||||
- ansible_facts['distribution'] in ['Ubuntu', 'Debian']
|
||||
|
||||
- name: Run gitlab-runner repo setup script (DEB)
|
||||
shell: "/root/script.deb.sh"
|
||||
when:
|
||||
- ansible_facts['distribution'] in ['Ubuntu', 'Debian']
|
||||
|
||||
- name: Install gitlab-runner (DEB)
|
||||
ansible.builtin.apt:
|
||||
name: gitlab-runner
|
||||
update_cache: yes
|
||||
state: present
|
||||
when:
|
||||
- ansible_facts['distribution'] in ['Ubuntu', 'Debian']
|
||||
|
||||
# RPM setup
|
||||
- name: Get gitlab-runner repo setup script (RPM)
|
||||
get_url:
|
||||
dest: "/root/"
|
||||
url: "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh"
|
||||
mode: 0755
|
||||
when:
|
||||
- ansible_facts['distribution'] == 'CentOS'
|
||||
|
||||
- name: Run gitlab-runner repo setup script (RPM)
|
||||
shell: "/root/script.rpm.sh"
|
||||
when:
|
||||
- ansible_facts['distribution'] == 'CentOS'
|
||||
|
||||
- name: Install gitlab-runner (RPM)
|
||||
yum:
|
||||
name: gitlab-runner
|
||||
update_cache: yes
|
||||
state: present
|
||||
when:
|
||||
- ansible_facts['distribution'] == 'CentOS'
|
||||
|
||||
# Register Runners
|
||||
- name: Register the gitlab-runner
|
||||
command: "/usr/bin/gitlab-runner register --non-interactive --url {{ gitlab_runner_server_url }} --token {{ gitlab_runner_authentication_token }} --executor shell"
|
||||
|
||||
- name: Install the gitlab-runner service using its own functionality
|
||||
command: "/usr/bin/gitlab-runner install --user gitlab-runner --working-directory /home/gitlab-runner"
|
||||
register: gitlab_runner_install_service_result
|
||||
failed_when: "gitlab_runner_install_service_result.rc != 0 and \"already exists\" not in gitlab_runner_install_service_result.stderr"
|
||||
|
||||
- name: Enable the gitlab-runner service
|
||||
service:
|
||||
name: gitlab-runner
|
||||
state: started
|
||||
enabled: yes
|
||||
@@ -0,0 +1 @@
|
||||
localhost
|
||||
@@ -0,0 +1,130 @@
|
||||
# THIS FILE WAS AUTO-GENERATED
|
||||
#
|
||||
# $ lcitool variables --host-arch aarch64 ubuntu-2404 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
packages:
|
||||
- bash
|
||||
- bc
|
||||
- bindgen
|
||||
- bison
|
||||
- bsdextrautils
|
||||
- bzip2
|
||||
- ca-certificates
|
||||
- ccache
|
||||
- clang
|
||||
- coreutils
|
||||
- dbus
|
||||
- debianutils
|
||||
- diffutils
|
||||
- exuberant-ctags
|
||||
- findutils
|
||||
- flex
|
||||
- gcc
|
||||
- gcovr
|
||||
- gettext
|
||||
- git
|
||||
- hostname
|
||||
- libaio-dev
|
||||
- libasan8
|
||||
- libasound2-dev
|
||||
- libattr1-dev
|
||||
- libbpf-dev
|
||||
- libbrlapi-dev
|
||||
- libbz2-dev
|
||||
- libc6-dev
|
||||
- libcacard-dev
|
||||
- libcap-ng-dev
|
||||
- libcapstone-dev
|
||||
- libcbor-dev
|
||||
- libclang-rt-dev
|
||||
- libcmocka-dev
|
||||
- libcurl4-gnutls-dev
|
||||
- libdaxctl-dev
|
||||
- libdrm-dev
|
||||
- libepoxy-dev
|
||||
- libfdt-dev
|
||||
- libffi-dev
|
||||
- libfuse3-dev
|
||||
- libgbm-dev
|
||||
- libgcrypt20-dev
|
||||
- libglib2.0-dev
|
||||
- libgnutls28-dev
|
||||
- libgtk-3-dev
|
||||
- libgtk-vnc-2.0-dev
|
||||
- libibverbs-dev
|
||||
- libiscsi-dev
|
||||
- libjemalloc-dev
|
||||
- libjpeg-turbo8-dev
|
||||
- libjson-c-dev
|
||||
- liblttng-ust-dev
|
||||
- liblzo2-dev
|
||||
- libncursesw5-dev
|
||||
- libnfs-dev
|
||||
- libnuma-dev
|
||||
- libpam0g-dev
|
||||
- libpcre2-dev
|
||||
- libpipewire-0.3-dev
|
||||
- libpixman-1-dev
|
||||
- libpng-dev
|
||||
- libpulse-dev
|
||||
- librbd-dev
|
||||
- librdmacm-dev
|
||||
- libsasl2-dev
|
||||
- libsdl2-dev
|
||||
- libsdl2-image-dev
|
||||
- libseccomp-dev
|
||||
- libselinux1-dev
|
||||
- libslirp-dev
|
||||
- libsnappy-dev
|
||||
- libsndio-dev
|
||||
- libspice-protocol-dev
|
||||
- libspice-server-dev
|
||||
- libssh-dev
|
||||
- libstd-rust-dev
|
||||
- libsystemd-dev
|
||||
- libtasn1-6-dev
|
||||
- libubsan1
|
||||
- libudev-dev
|
||||
- liburing-dev
|
||||
- libusb-1.0-0-dev
|
||||
- libusbredirhost-dev
|
||||
- libvdeplug-dev
|
||||
- libvirglrenderer-dev
|
||||
- libvte-2.91-dev
|
||||
- libxdp-dev
|
||||
- libxen-dev
|
||||
- libzstd-dev
|
||||
- llvm
|
||||
- locales
|
||||
- make
|
||||
- mtools
|
||||
- multipath-tools
|
||||
- nettle-dev
|
||||
- ninja-build
|
||||
- openssh-client
|
||||
- pkgconf
|
||||
- python3
|
||||
- python3-pip
|
||||
- python3-setuptools
|
||||
- python3-sphinx
|
||||
- python3-sphinx-rtd-theme
|
||||
- python3-tomli
|
||||
- python3-venv
|
||||
- python3-wheel
|
||||
- rpm2cpio
|
||||
- rustc-1.83
|
||||
- sed
|
||||
- socat
|
||||
- sparse
|
||||
- swtpm
|
||||
- systemtap-sdt-dev
|
||||
- tar
|
||||
- tesseract-ocr
|
||||
- tesseract-ocr-eng
|
||||
- vulkan-tools
|
||||
- xorriso
|
||||
- zlib1g-dev
|
||||
- zstd
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
# THIS FILE WAS AUTO-GENERATED
|
||||
#
|
||||
# $ lcitool variables --host-arch s390x ubuntu-2404 qemu
|
||||
#
|
||||
# https://gitlab.com/libvirt/libvirt-ci
|
||||
|
||||
packages:
|
||||
- bash
|
||||
- bc
|
||||
- bindgen
|
||||
- bison
|
||||
- bsdextrautils
|
||||
- bzip2
|
||||
- ca-certificates
|
||||
- ccache
|
||||
- clang
|
||||
- coreutils
|
||||
- dbus
|
||||
- debianutils
|
||||
- diffutils
|
||||
- exuberant-ctags
|
||||
- findutils
|
||||
- flex
|
||||
- gcc
|
||||
- gcovr
|
||||
- gettext
|
||||
- git
|
||||
- hostname
|
||||
- libaio-dev
|
||||
- libasan8
|
||||
- libasound2-dev
|
||||
- libattr1-dev
|
||||
- libbpf-dev
|
||||
- libbrlapi-dev
|
||||
- libbz2-dev
|
||||
- libc6-dev
|
||||
- libcacard-dev
|
||||
- libcap-ng-dev
|
||||
- libcapstone-dev
|
||||
- libcbor-dev
|
||||
- libclang-rt-dev
|
||||
- libcmocka-dev
|
||||
- libcurl4-gnutls-dev
|
||||
- libdaxctl-dev
|
||||
- libdrm-dev
|
||||
- libepoxy-dev
|
||||
- libfdt-dev
|
||||
- libffi-dev
|
||||
- libfuse3-dev
|
||||
- libgbm-dev
|
||||
- libgcrypt20-dev
|
||||
- libglib2.0-dev
|
||||
- libgnutls28-dev
|
||||
- libgtk-3-dev
|
||||
- libgtk-vnc-2.0-dev
|
||||
- libibverbs-dev
|
||||
- libiscsi-dev
|
||||
- libjemalloc-dev
|
||||
- libjpeg-turbo8-dev
|
||||
- libjson-c-dev
|
||||
- liblttng-ust-dev
|
||||
- liblzo2-dev
|
||||
- libncursesw5-dev
|
||||
- libnfs-dev
|
||||
- libnuma-dev
|
||||
- libpam0g-dev
|
||||
- libpcre2-dev
|
||||
- libpipewire-0.3-dev
|
||||
- libpixman-1-dev
|
||||
- libpng-dev
|
||||
- libpulse-dev
|
||||
- librbd-dev
|
||||
- librdmacm-dev
|
||||
- libsasl2-dev
|
||||
- libsdl2-dev
|
||||
- libsdl2-image-dev
|
||||
- libseccomp-dev
|
||||
- libselinux1-dev
|
||||
- libslirp-dev
|
||||
- libsnappy-dev
|
||||
- libsndio-dev
|
||||
- libspice-protocol-dev
|
||||
- libssh-dev
|
||||
- libstd-rust-dev
|
||||
- libsystemd-dev
|
||||
- libtasn1-6-dev
|
||||
- libubsan1
|
||||
- libudev-dev
|
||||
- liburing-dev
|
||||
- libusb-1.0-0-dev
|
||||
- libusbredirhost-dev
|
||||
- libvdeplug-dev
|
||||
- libvirglrenderer-dev
|
||||
- libvte-2.91-dev
|
||||
- libxdp-dev
|
||||
- libzstd-dev
|
||||
- llvm
|
||||
- locales
|
||||
- make
|
||||
- mtools
|
||||
- multipath-tools
|
||||
- nettle-dev
|
||||
- ninja-build
|
||||
- openssh-client
|
||||
- pkgconf
|
||||
- python3
|
||||
- python3-pip
|
||||
- python3-setuptools
|
||||
- python3-sphinx
|
||||
- python3-sphinx-rtd-theme
|
||||
- python3-tomli
|
||||
- python3-venv
|
||||
- python3-wheel
|
||||
- rpm2cpio
|
||||
- rustc-1.83
|
||||
- sed
|
||||
- socat
|
||||
- sparse
|
||||
- swtpm
|
||||
- systemtap-sdt-dev
|
||||
- tar
|
||||
- tesseract-ocr
|
||||
- tesseract-ocr-eng
|
||||
- vulkan-tools
|
||||
- xorriso
|
||||
- zlib1g-dev
|
||||
- zstd
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# The URL of the gitlab server to use, usually https://gitlab.com unless you're
|
||||
# using a private GitLab instance
|
||||
gitlab_runner_server_url: https://gitlab.com
|
||||
# A mapping of the ansible to gitlab architecture nomenclature
|
||||
ansible_to_gitlab_arch:
|
||||
x86_64: amd64
|
||||
aarch64: arm64
|
||||
s390x: s390x
|
||||
# A unique token made obtained from GitLab for each runner
|
||||
# see: https://gitlab.com/PROJECT/REPO/-/runners/new
|
||||
gitlab_runner_authentication_token: PLEASE_PROVIDE_A_VALID_TOKEN
|
||||
Reference in new issue
Block a user