From 16125d5010a1d73f71d2f1fe0f5756204b1b3c44 Mon Sep 17 00:00:00 2001 From: Nadezhda Fedorova Date: Wed, 6 Nov 2024 16:23:04 +0300 Subject: [PATCH] add new arches to configs and build script --- cloud_build/cloud_build.py | 29 ++++++-- .../{cb-aarch64.yaml => cb-ve-aarch64.yaml} | 23 +++---- configs/cb-ve-other.yaml | 14 ++-- configs/cb-ve-x86.yaml | 10 ++- configs/cb-vm-aarch64.yaml | 68 +++++++++++++++++++ configs/container-aarch64.yaml | 32 --------- configs/container-x86.yaml | 34 ---------- 7 files changed, 110 insertions(+), 100 deletions(-) rename configs/{cb-aarch64.yaml => cb-ve-aarch64.yaml} (83%) create mode 100644 configs/cb-vm-aarch64.yaml delete mode 100644 configs/container-aarch64.yaml delete mode 100644 configs/container-x86.yaml diff --git a/cloud_build/cloud_build.py b/cloud_build/cloud_build.py index 40441d8..5bfbc7e 100755 --- a/cloud_build/cloud_build.py +++ b/cloud_build/cloud_build.py @@ -238,6 +238,9 @@ class CB: self._repository_url = cfg.get('repository_url', 'copy:///space/ALT/{branch}') + self._other_repo_url = cfg.get('other_repo_url', + 'http://ftp.altlinux.org/pub/distributions/ALTLinux/ports/{arch}') + self._image_repo = cfg.get('image_repo') self.patch_mp_prog = get_overrided('patch_mp_prog') @@ -315,6 +318,14 @@ class CB: self._repository_url) return url.format(branch=branch, arch=arch) + def other_repo_url(self, branch: str, arch: str) -> str: + url = self._branches[branch]['arches'][arch].get('repository_url') + if url is None: + url = self._branches[branch].get('repository_url', + self._repository_url) + return url.format(branch=branch, arch=arch) + + def image_repo(self, branch: str, arch: str) -> str: url = self._branches[branch]['arches'][arch].get('image_repo') if url is None: @@ -394,13 +405,17 @@ Dir::Etc::preferencesparts "/var/empty"; with open(f'{apt_dir}/sources.list.{branch}.{arch}', 'w') as f: sources_list = f'rpm {repo} {arch} classic\n' - if arch == 'x86_64': - sources_list += f'rpm {repo} {arch}-i586 classic\n' - if arch not in self.bad_arches: - sources_list += f'rpm {repo} noarch classic\n' - for task in self.tasks.get(branch.lower(), []): - tr = 'http://git.altlinux.org' - sources_list += f'rpm {tr} repo/{task}/{arch} task\n' + if arch in ['loongarch64', 'riscv64']: + sources_list = f'rpm {repo} {branch}/{arch} classic\n' + sources_list += f'rpm {repo} {branch}/noarch classic\n' + else: + if arch == 'x86_64': + sources_list += f'rpm {repo} {arch}-i586 classic\n' + if arch not in self.bad_arches: + sources_list += f'rpm {repo} noarch classic\n' + for task in self.tasks.get(branch.lower(), []): + tr = 'http://git.altlinux.org' + sources_list += f'rpm {tr} repo/{task}/{arch} task\n' f.write(sources_list) def escape_branch(self, branch: str) -> str: diff --git a/configs/cb-aarch64.yaml b/configs/cb-ve-aarch64.yaml similarity index 83% rename from configs/cb-aarch64.yaml rename to configs/cb-ve-aarch64.yaml index 0ce22b8..bed99c0 100644 --- a/configs/cb-aarch64.yaml +++ b/configs/cb-ve-aarch64.yaml @@ -8,6 +8,12 @@ rebuild_after: days: 5 images: + rootfs-minimal: + target: ve/docker + kinds: + - tar.xz + tests: + - method: docker rootfs-systemd: target: ve/systemd-networkd kinds: @@ -37,19 +43,6 @@ images: - method: lxd scripts: - securetty - cloud: - target: vm/cloud-systemd - kinds: - - qcow2c - scripts: - - machine_id - packages: - - update-kernel - - apt-scripts - - systemd-settings-disable-kill-user-processes - rename: - regex: '(.*)\.qcow2c$' - to: '\1.qcow2' branches: Sisyphus: @@ -59,11 +52,11 @@ branches: p10: arches: aarch64: - branding: alt-starterkit + branding: alt-container p11: arches: aarch64: - branding: alt-starterkit + branding: alt-container scripts: machine_id: diff --git a/configs/cb-ve-other.yaml b/configs/cb-ve-other.yaml index ebf1f14..7b1d0ee 100644 --- a/configs/cb-ve-other.yaml +++ b/configs/cb-ve-other.yaml @@ -1,6 +1,6 @@ --- -remote: 'cloud@172.16.0.2:/home/cloud/images/{branch}/{arch}' -repository_url: copy:///space/ALT/{branch} +remote: '/home/builder/images/{branch}/{arch}' +repository_url: http://ftp.altlinux.org/pub/distributions/ALTLinux/ports/{arch} try_build_all: True log_level: debug @@ -41,18 +41,12 @@ images: scripts: - securetty - netsharedpath - exclude_branches: - - c8 branches: Sisyphus: arches: - ppc64le: - p10: - arches: - ppc64le: - armh: - branding: alt-starterkit + loongarch64: + riscv64: scripts: securetty: diff --git a/configs/cb-ve-x86.yaml b/configs/cb-ve-x86.yaml index 29fa0a3..a4c2bc4 100644 --- a/configs/cb-ve-x86.yaml +++ b/configs/cb-ve-x86.yaml @@ -8,6 +8,12 @@ rebuild_after: days: 5 images: + rootfs-minimal: + target: ve/docker + kinds: + - tar.xz + tests: + - method: docker rootfs-systemd: target: ve/systemd-networkd kinds: @@ -45,12 +51,12 @@ branches: arches: i586: x86_64: - branding: alt-starterkit + branding: alt-container p11: arches: i586: x86_64: - branding: alt-starterkit + branding: alt-container scripts: securetty: diff --git a/configs/cb-vm-aarch64.yaml b/configs/cb-vm-aarch64.yaml new file mode 100644 index 0000000..570902a --- /dev/null +++ b/configs/cb-vm-aarch64.yaml @@ -0,0 +1,68 @@ +--- +remote: 'builder@cloud-builder.office.basealt.ru:/home/builder/images/{branch}/{arch}' +repository_url: http://mirror.yandex.ru/altlinux/{branch}/branch +try_build_all: True +log_level: debug + +rebuild_after: + days: 5 + +images: + cloud: + target: vm/cloud-systemd + kinds: + - qcow2c + scripts: + - machine_id + packages: + - update-kernel + - apt-scripts + - systemd-settings-disable-kill-user-processes + rename: + regex: '(.*)\.qcow2c$' + to: '\1.qcow2' + +branches: + Sisyphus: + arches: + aarch64: + repository_url: http://ftp.altlinux.org/pub/distributions/ALTLinux/{branch} + p10: + arches: + aarch64: + branding: alt-starterkit + p11: + arches: + aarch64: + branding: alt-starterkit + +scripts: + machine_id: + contents: | + #!/bin/sh -exu + + etc_machine_id=/etc/machine-id + dbus_machine_id=/var/lib/dbus/machine-id + + rm -f "$etc_machine_id" "$dbus_machine_id" + touch "$etc_machine_id" + global: no + number: 90 + securetty: + contents: | + #!/bin/sh + + echo pts/0 >> /etc/securetty + echo pts/1 >> /etc/securetty + global: no + number: 1 + apt_sources: + contents: | + #!/bin/sh + + repo_source=/etc/apt/sources.list.d/altsp.list + [ -s "$repo_source" ] || exit 0 + sed -i -E 's/^\s*#(rpm.*http)/\1/' "$repo_source" + global: no + number: 80 +... diff --git a/configs/container-aarch64.yaml b/configs/container-aarch64.yaml deleted file mode 100644 index 57cd254..0000000 --- a/configs/container-aarch64.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -remote: 'builder@cloud-builder.office.basealt.ru:/home/builder/images/{branch}/{arch}' -repository_url: http://mirror.yandex.ru/altlinux/{branch}/branch -try_build_all: True -log_level: debug - -rebuild_after: - days: 5 - -images: - rootfs-minimal: - target: ve/docker - kinds: - - tar.xz - tests: - - method: docker - -branches: - Sisyphus: - arches: - aarch64: - repository_url: http://ftp.altlinux.org/pub/distributions/ALTLinux/{branch} - p10: - arches: - aarch64: - branding: alt-container - p11: - arches: - aarch64: - branding: alt-container - -... diff --git a/configs/container-x86.yaml b/configs/container-x86.yaml deleted file mode 100644 index 06f015f..0000000 --- a/configs/container-x86.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -remote: '/home/builder/images/{branch}/{arch}' -repository_url: copy:///space/ALT/{branch} -try_build_all: True -log_level: debug - -rebuild_after: - days: 5 - -images: - rootfs-minimal: - target: ve/docker - kinds: - - tar.xz - tests: - - method: docker - -branches: - Sisyphus: - arches: - i586: - x86_64: - p10: - arches: - i586: - x86_64: - branding: alt-container - p11: - arches: - i586: - x86_64: - branding: alt-container - -...