copr: drop old configuration for aarch64 hypervisor

This is not used nowadays (we have no aarch64 machine ATM), but even if
we had one we would use the roles/copr/hypervisor role instead.
This commit is contained in:
Pavel Raiskup 2022-02-03 09:43:46 +01:00
parent 00cd33b3c2
commit 022cbd9589
8 changed files with 0 additions and 203 deletions

View file

@ -1001,10 +1001,6 @@ copr_db_stg
[copr_db_stg]
copr-db-stg.aws.fedoraproject.org
# [copr_hypervisors_aarch64]
# virthost-aarch64-os01.fedorainfracloud.org
# virthost-aarch64-os02.fedorainfracloud.org
[debuginfod]
debuginfod01.iad2.fedoraproject.org

View file

@ -1,11 +0,0 @@
- name: provision aarch64 box
hosts: copr_hypervisors_aarch64
gather_facts: false
user: copr
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- /srv/private/ansible/vars.yml
roles:
- copr_hypervisor_aarch64

View file

@ -1,24 +0,0 @@
[infrastructure-tags]
name=Fedora Infrastructure tag $releasever - $basearch
baseurl=https://kojipkgs.fedoraproject.org/repos-dist/f$releasever-infra/latest/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://infrastructure.fedoraproject.org/repo/infra/RPM-GPG-KEY-INFRA-TAGS
[infrastructure-tags-stg]
name=Fedora Infrastructure staging tag $releasever - $basearch
baseurl=https://kojipkgs.fedoraproject.org/repos-dist/f$releasever-infra-stg/latest/$basearch/
enabled=0
gpgcheck=1
gpgkey=https://infrastructure.fedoraproject.org/repo/infra/RPM-GPG-KEY-INFRA-TAGS
# [group_copr-copr]
# name=Copr repo for copr owned by @copr
# baseurl=https://copr-be.cloud.fedoraproject.org/results/@copr/copr/fedora-$releasever-x86_64/
# type=rpm-md
# skip_if_unavailable=False
# gpgcheck=1
# gpgkey=https://copr-be.cloud.fedoraproject.org/results/@copr/copr/pubkey.gpg
# repo_gpgcheck=0
# enabled=0
# enabled_metadata=1

View file

@ -1,14 +0,0 @@
#! /bin/sh
set -e
for name in \
builder-repositories.repo \
download \
prepare-disk \
promote-disk \
upload-disk; \
do
curl https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/roles/copr_hypervisor_aarch64/files/"$name" \
> "$name"
done

View file

@ -1,48 +0,0 @@
#! /bin/sh -x
set -e
sourcedir=$(dirname "$(readlink -f "$0")")
src_img=$1
dst_img=/tmp/newdisk.qcow2
cp "$src_img" "$dst_img"
# We could be using 'virt-resize --expand /dev/sda2' instead, but we are
# running too old hypervisor to handle Fedora images:
# e2fsck: Get a newer version of e2fsck!
guestfish -a "$dst_img" <<EOF
run
mount /dev/sda2 /
write /etc/rc.d/rc.local "#! /bin/sh\n"
write-append /etc/rc.d/rc.local "set -e\n"
write-append /etc/rc.d/rc.local "mkdir -p /config\n"
write-append /etc/rc.d/rc.local "mount /dev/disk/by-label/copr_config /config\n"
write-append /etc/rc.d/rc.local "sh -x /config/pre-network-script.sh\n"
write-append /etc/rc.d/rc.local "mkswap /dev/vdc && swapon /dev/vdc\n"
chmod 0755 /etc/rc.d/rc.local
EOF
install_packages=copr-builder
install() { install_packages="$install_packages,$1" ; }
install cloud-utils-growpart # growpart called in pre-network-script.sh
install qemu-guest-agent # allow VM inspect from the outside
install crudini # allow us to disable fastestmirror
# - updates-modular is broken ATM, but we don't need it now
# - for some reason, on aarch64 builders, the repo metadata download tends to
# run amazingly slow (~300kB/s), while having fastestmirror turned ON the
# metadata download is 10x faster
virt-customize -a "$dst_img" \
--run-command 'dnf config-manager --set-disabled updates-modular' \
--copy-in "$sourcedir/builder-repositories.repo":/etc/yum.repos.d \
--update \
--install "$install_packages" \
--uninstall cloud-init \
--run-command 'crudini --set /etc/dnf/dnf.conf main fastestmirror True' \
--ssh-inject root:string:"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeTO0ddXuhDZYM9HyM0a47aeV2yIVWhTpddrQ7/RAIs99XyrsicQLABzmdMBfiZnP0FnHBF/e+2xEkT8hHJpX6bX81jjvs2bb8KP18Nh8vaXI3QospWrRygpu1tjzqZT0Llh4ZVFscum8TrMw4VWXclzdDw6x7csCBjSttqq8F3iTJtQ9XM9/5tCAAOzGBKJrsGKV1CNIrfUo5CSzY+IUVIr8XJ93IB2ZQVASK34T/49egmrWlNB32fqAbDMC+XNmobgn6gO33Yq5Ly7Dk4kqTUx2TEaqDkZfhsVu0YcwV81bmqsltRvpj6bIXrEoMeav7nbuqKcPLTxWEY/2icePF copr-backend" \
--selinux-relabel

View file

@ -1,26 +0,0 @@
#! /bin/sh -x
die() { echo >&2 "$*" ; exit 1 ; }
volume_promoted=$1
volume=copr-builder
# the only pool where we can work with qcow2 images (which is effective,
# compared to raw images)
pool=images
new_volume=copr-builder-$(date +"%Y%m%d_%H%M%S")
connections='
qemu:///system
qemu+ssh://copr@virthost-aarch64-os02.fedorainfracloud.org/system
'
test -n "$volume" || die "first argument (volume) required"
for connection in $connections; do
virsh --connect="$connection" vol-delete "$volume" --pool "$pool"
virsh --connect="$connection" vol-clone "$volume_promoted" "$volume" --pool "$pool"
done
echo "copr-builder == $volume_promoted now"

View file

@ -1,27 +0,0 @@
#! /bin/sh -x
die() { echo >&2 "$*" ; exit 1 ; }
image=$1
# the only pool where we can work with qcow2 images (which is effective,
# compared to raw images)
pool=images
new_volume=copr-builder-$(date +"%Y%m%d_%H%M%S")
connections='
qemu:///system
qemu+ssh://copr@virthost-aarch64-os02.fedorainfracloud.org/system
'
export VIRSH_DEFAULT_CONNECT_URI=
test -n "$image" || die "first argument (image) required"
test -f "$image" || die "image $image not found"
for connection in $connections; do
virsh --connect="$connection" vol-create-as --pool "$pool" "$new_volume" 1M
virsh --connect="$connection" vol-upload --pool "$pool" "$new_volume" --sparse "$image"
done
echo "uploaded images $new_volume"

View file

@ -1,49 +0,0 @@
## Note that this is mostly for documentation purposes; nobody executed
## this playbook so far (all was setup manually, and I wouldn't probably
## have rights to do execute this)
- name: assure that copr-be can ssh there as copr@...
authorized_key: user=copr key="{{ item }}"
with_file:
- "provision/files/buildsys.pub"
# todo: generate it's own key
- name: make sure hostA can ssh to hostB
copy:
src: "{{ private }}/files/copr/buildsys.priv"
dest: /home/copr/.ssh/id_rsa
owner: copr
group: copr
mode: 0600
- name: "check that 'images' pool exists"
shell: virsh --connect=qemu:///system pool-list
register: images_pool_check
changed_when:
- images_pool_check.rc == 0
- '" images " not in images_pool_check.stdout'
failed_when:
- images_pool_check.rc != 0
- name: "create 'images' pool"
shell: \
virsh --connect=qemu:///system pool-define-as --name images --target /var/lib/libvirt/images --type dir --help
virsh --connect=qemu:///system pool-autostart images
virsh --connect=qemu:///system pool-start images
when: images_pool_check.changed
- name: create directory image management
file:
path=/home/copr/vm-manage
owner=copr
group=copr
state=directory
- name: copy the helper scripts
copy:
src={{ item }}
dest=/home/copr/vm-manage/{{ item }}
with_items:
- builder-repositories.repo
- prepare-disk
- upload-disk