Commit graph

33 commits

Author SHA1 Message Date
Sanne Raymaekers
4629a31f22 templates/packer: use python3.10 on fedora
Ansible on fedora 40 seems broken, the default python 3.12 interpreter
doesn't work, 3.10 works but then the dnf module breaks.

Use 3.10 and stop using the dnf module.
2024-05-31 13:55:58 +02:00
Sanne Raymaekers
a96f1b6d31 templates/packer: switch to fedora-40
Fedora 38 is EOL, and packit no longer builds rpms for it.

The current python3.12 + ansible 2.12 combination which is the default
on fedora 40 doesn't work, so switch to python3.9.
2024-05-29 19:36:31 +02:00
Sanne Raymaekers
13aae7d532 templates/packer: invert tag logic
With the rpmcopy or rpmrepo_osbuild tags, the `Install worker rpm` stage
got skipped on RHEL and CI. Invert the tag logic and use `--tags`
instead of `--skip-tags`.
2024-05-21 09:40:11 +02:00
Sanne Raymaekers
a1476bdfb1 tools/appsre-build-worker-packer: stop writing bogus files 2024-05-07 13:57:48 +02:00
Sanne Raymaekers
616db61105 tools/build-worker-packer: skip rpmcopr for RHEL and on CI
Also skip both rpmrepo tasks on RHEL.
2024-05-07 13:57:48 +02:00
Tomáš Hozza
0c0a758600 Packer: default to RHEL-9.3 Schutzfile config for rhel-9
This is necessary to get the proper osbuild SHA to install the latest
required osbuild version into the image.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Sanne Raymaekers
c7aad1b17d tools/app-sre-build-worker-packer: split out the CI script
To add the fedora workers built from AppSRE's infrastructure, we need a
combination that wasn't possible with the current matrix based on the CI
environment (jenkins vs gitlab).
2024-01-23 00:18:51 +01:00
Sanne Raymaekers
ca8a05bd3a templates/packer: subscribe packer machines
To avoid a mismatch between the RPMs (which are build using CDN content)
and the packer instances (RHUI, which might be older).
2023-03-03 13:00:05 +01:00
Sanne Raymaekers
0096ff3689 Revert "Packer: workaround missing authselect-compat-1.2.5-2.el9_1 in RHUI repos"
This reverts commit 0a4a75e19e.
2023-03-01 20:05:38 +01:00
Tomáš Hozza
0a4a75e19e Packer: workaround missing authselect-compat-1.2.5-2.el9_1 in RHUI repos
`authselect-compat-1.2.5-2.el9_1` package is currently missing in AWS
RHUI el9 AppStream repositories, which makes `dnf upgrade` fail on
RHEL-9.1. This is a RHUI-specific issue, since the package is available
in CDN repos.

In order to workaround the issue for now, `authselect-compat` needs to
be removed as part of the upgrade in order for it to succeed. Use
`--allowerasing` instead of just removing the issue, because this will
ensure that `authselect-compat` will be upgraded just fine, once the
issue is resolved.

Fix the issue in the CI script that builds the image using Packer, as
well as the Ansible playbook used by Packer to build the image.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-24 15:40:02 +01:00
Ondřej Budai
422281698a packer: add a workaround for broken podman from 9.1
Podman doesn't work when installed from 9.1 repositories on 9.0 image.

I found that upgrading the whole system helps. Sadly, that requires removing
python-unversioned-command for some reason.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-11-16 22:31:43 +01:00
Diaa Sami
420097ae63 tools/appsre: remove leftover code from before 2022-10-04 16:26:08 +02:00
Diaa Sami
06fbd926ae app-sre: Update AMIs to rhel-9.0 2022-09-27 10:47:32 +02:00
Diaa Sami
ec0a1944b4 appsre-ansible: support aarch64
make ansible playbooks arch-agnostic
extract embedded bash script into separate file with parameters
update packer template to support aarch64
Convert parts of bash script to python code that can start multi-arch instances to build RPMS
2022-09-05 12:08:57 +02:00
Ondřej Budai
767283b2d9 packer: use 8.6 as a base for RHEL images
Let's stay updated!

Also, let's remove 8.4 and 8.5 from Schutzfile, I strongly believe that it's
not used anywhere.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-07-05 11:54:12 +02:00
Ondřej Budai
72de1b3bbe packer: don't save the AMIs on PRs
This should save us a ton of resources as we don't use AMIs from PRs.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-11 09:06:43 +01:00
Ondřej Budai
ad15179faf packer: build Fedora images
The decision logic which jobs to run is quite confusing but that's how we
roll for now:

Jenkins builds RHEL images only on main
Schutzbot builds RHEL images only in PRs
Schutzbot builds Fedora images on both PRs and on main

To achieve this, the commit re-enables running Packer on main on Schutzbot.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-11 09:06:43 +01:00
Ondřej Budai
ec070612ff packer: remove RHEL and x86_64-specific bits
Arch was easy.

For passing the repository distribution and osbuild_commit (it can be
different for each distro), I decided to go in the way of ansible
inventory directories. It adds a bit of structure but I think it's
the most clean solution.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-11 09:06:43 +01:00
Ondřej Budai
e45578d3b0 packer: remove the ami_id variable
We want to build multiple images at once so they have to be defined elsewhere.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-11 09:06:43 +01:00
Sanne Raymaekers
a173a3513d tools/appsre-build-worker-packer: Run on subscribed 8.5 machine 2022-02-09 16:54:22 +01:00
sanne
6b716a4bbc tools/appsre-build-worker-packer: Fix branch parsing on jenkins 2022-01-19 12:48:14 +01:00
sanne
a6f40f807d tools/appsre-build-worker-packer: Run entire workflow in container
Avoids the issue with artifacts that jenkins can't clean up.
2022-01-13 15:05:52 +01:00
sanne
e8b790e8d4 tools/appsre-build-worker-packer: Disable ansible debug output 2022-01-12 19:47:45 +01:00
sanne
6b43594840 tools/appsre-build-worker-packer: Ansible rpmbuild debug output 2022-01-12 17:33:50 +01:00
sanne
e6fd492372 tools/appsre-build-worker-packer: Prevent ssh from timing out 2022-01-12 17:33:50 +01:00
sanne
93ec151c60 tools/appsre-build-worker-packer: Verbose ssh check 2022-01-12 12:33:04 +01:00
sanne
8c514308e7 tools/appsre-build-worker-packer: Correct user in ssh check 2022-01-12 12:13:41 +01:00
sanne
01163a1384 tools/appsre-build-worker-packer: Use ssh instead of ssh-keyscan
`ssh-keyscan` on appsre's infra has a bug where it doesn't exit 1 in
case of failure.
2022-01-12 12:02:58 +01:00
sanne
3c729be3c5 tools/appsre-build-worker-packer: Add image_users variable
packer will share the ami with those users.
2022-01-11 14:30:19 +01:00
sanne
2420504e1d tools/appsre-build-worker-packer: Use WORKSPACE variable
Docker doesn't accept "." as a mountpoint, use the WORKSPACE variable on
jenkins and default to PWD.
2022-01-11 14:30:19 +01:00
sanne
204bf9e176 tools/appsre-build-worker-packer: Don't fast-fail cleanup 2022-01-07 11:42:16 +01:00
sanne
4970e4d788 tools/appsre-build-worker-packer: Use CI_COMMIT_SHA
CI is also defined on appsres infra, and is also true. Use CI_COMMIT_SHA
instead to determine if we're running from a PR or not.
2022-01-07 10:35:34 +01:00
sanne
71da979c81 tools: AppSRE packer build 2022-01-05 22:13:55 +01:00