Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPU 9 -> 10: Initial preparation: upgrade paths and leapp packages def #1169

Merged
merged 18 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,29 @@ jobs:
fail-fast: false
matrix:
scenarios:
# 9to10
- name: Run unit tests for el9toel10 and common repositories on python 3.12
python: python3.12
repos: 'el9toel10,common'
container: ubi9
- name: Run unit tests for el9toel10 and common repositories on python 3.9
python: python3.9
repos: 'el9toel10,common'
container: ubi9
# 8to9
- name: Run unit tests for el8toel9 and common repositories on python 3.9
python: python3.9
repos: 'el8toel9,common'
container: ubi9
- name: Run unit tests for el8toel9 and common repositories on python 3.6
python: python3.6
repos: 'el8toel9,common'
container: ubi8
# 7to8
- name: Run unit tests for el7toel8 and common repositories on python 3.6
python: python3.6
repos: 'el7toel8,common'
container: ubi8
- name: Run unit tests for el8toel9 and common repositories on python 3.6
python: python3.6
repos: 'el8toel9,common'
container: ubi8
- name: Run unit tests for el7toel8 and common repositories on python 2.7
python: python2.7
repos: 'el7toel8,common'
Expand Down
3 changes: 3 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
targets:
- epel-7-x86_64
- epel-8-x86_64
- epel-9-x86_64
actions:
create-archive:
- bash -c "rm -f packaging/deps-pkgs.tar.gz"
Expand All @@ -54,6 +55,7 @@ jobs:
targets:
- epel-7-x86_64
- epel-8-x86_64
- epel-9-x86_64
actions:
create-archive:
- bash -c "rm -f packaging/deps-pkgs.tar.gz"
Expand All @@ -73,6 +75,7 @@ jobs:
targets:
- epel-7-x86_64
- epel-8-x86_64
- epel-9-x86_64
actions:
create-archive:
- bash -c "rm -f packaging/deps-pkgs.tar.gz"
Expand Down
45 changes: 34 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ help:
@echo " packaging"
@echo " srpm create the SRPM"
@echo " build_container create the RPM in container"
@echo " - set BUILD_CONTAINER to el7 or el8"
@echo " - set BUILD_CONTAINER to el7, el8 or el9"
@echo " - don't run more than one build at the same time"
@echo " since containers operate on the same files!"
@echo " copr_build create the COPR build using the COPR TOKEN"
Expand Down Expand Up @@ -164,7 +164,7 @@ help:
@echo " PR=7 SUFFIX='my_additional_suffix' make <target>"
@echo " MR=6 COPR_CONFIG='path/to/the/config/copr/file' make <target>"
@echo " ACTOR=<actor> TEST_LIBS=y make test"
@echo " BUILD_CONTAINER=rhel7 make build_container"
@echo " BUILD_CONTAINER=el7 make build_container"
@echo " TEST_CONTAINER=f34 make test_container"
@echo " CONTAINER_TOOL=docker TEST_CONTAINER=rhel7 make test_container_no_lint"
@echo ""
Expand All @@ -189,8 +189,9 @@ source: prepare
@git archive --prefix "$(PKGNAME)-$(VERSION)/" -o "packaging/sources/$(PKGNAME)-$(VERSION).tar.gz" HEAD
@echo "--- PREPARE DEPS PKGS ---"
mkdir -p packaging/tmp/
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) _build_subpkg
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) DIST_VERSION=$$(($(DIST_VERSION) + 1)) _build_subpkg
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) DIST_VERSION=7 _build_subpkg
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) DIST_VERSION=8 _build_subpkg
@__TIMESTAMP=$(TIMESTAMP) $(MAKE) DIST_VERSION=9 _build_subpkg
@tar -czf packaging/sources/deps-pkgs.tar.gz -C packaging/RPMS/noarch `ls -1 packaging/RPMS/noarch | grep -o "[^/]*rpm$$"`
@rm -f packaging/RPMS/noarch/*.rpm

Expand Down Expand Up @@ -257,12 +258,15 @@ build_container:
el8) \
CONT_FILE="utils/container-builds/Containerfile.ubi8"; \
;; \
el9) \
CONT_FILE="utils/container-builds/Containerfile.ubi9"; \
;; \
"") \
echo "BUILD_CONTAINER must be set"; \
exit 1; \
;; \
*) \
echo "Available containers are el7, el8"; \
echo "Available containers are el7, el8, el9"; \
exit 1; \
;; \
esac && \
Expand Down Expand Up @@ -304,12 +308,20 @@ install-deps:
$(VENVNAME)/bin/pip install -I "git+https://github.com/oamg/leapp.git@refs/pull/$(REQ_LEAPP_PR)/head"; \
fi
$(_PYTHON_VENV) utils/install_actor_deps.py --actor=$(ACTOR) --repos="$(TEST_PATHS)"

install-deps-fedora:
@# Check the necessary rpms are installed for py3 (and py2 below)
if ! rpm -q git findutils python3-virtualenv gcc; then \
if ! dnf install -y git findutils python3-virtualenv gcc; then \
if ! rpm -q git findutils gcc; then \
if ! dnf install -y git findutils gcc; then \
echo 'Please install the following rpms via the command: ' \
'sudo dnf install -y git findutils python3-virtualenv gcc'; \
'sudo dnf install -y git findutils gcc'; \
exit 1; \
fi; \
fi
if ! command -v virtualenv; then \
if ! (dnf install -y python3-virtualenv || pip install virtualenv); then \
echo 'Please install the following packages via the command: ' \
'sudo dnf install -y python3-virtualenv or pip install virtualenv'; \
exit 1; \
fi; \
fi
Expand Down Expand Up @@ -389,11 +401,14 @@ _test_container_ipu:
el8toel9) \
export REPOSITORIES="common,el8toel9"; \
;; \
el9toel10) \
export REPOSITORIES="common,el9toel10"; \
;; \
"") \
echo "TEST_CONT_IPU must be set"; exit 1; \
;; \
*) \
echo "Only supported TEST_CONT_IPUs are el7toel8, el8toel9"; exit 1; \
echo "Only supported TEST_CONT_IPUs are el7toel8, el8toel9, el9toel10"; exit 1; \
;; \
esac && \
$(_CONTAINER_TOOL) exec -w /repocopy $$_CONT_NAME make clean && \
Expand Down Expand Up @@ -428,6 +443,10 @@ test_container:
export CONT_FILE="utils/container-tests/Containerfile.rhel8"; \
export _VENV="python3.6"; \
;; \
rhel9) \
export CONT_FILE="utils/container-tests/Containerfile.rhel9"; \
export _VENV="python3.9"; \
;; \
*) \
echo "Error: Available containers are: f34, rhel7, rhel8"; exit 1; \
;; \
Expand All @@ -449,6 +468,10 @@ test_container:
;; \
python3.9) \
TEST_CONT_IPU=el8toel9 $(MAKE) _test_container_ipu; \
TEST_CONT_IPU=el9toel10 $(MAKE) _test_container_ipu; \
;; \
python3.12) \
TEST_CONT_IPU=el9toel10 $(MAKE) _test_container_ipu; \
;; \
*) \
TEST_CONT_IPU=el8toel9 $(MAKE) _test_container_ipu; \
Expand All @@ -473,7 +496,7 @@ test_container_all_no_lint:
# clean all testing and building containers and their images
clean_containers:
@for i in "leapp-repo-tests-f34" "leapp-repo-tests-rhel7" "leapp-repo-tests-rhel8" \
"leapp-repo-build-el7" "leapp-repo-build-el8"; do \
"leapp-repo-tests-rhel9" "leapp-repo-build-el7" "leapp-repo-build-el8"; do \
$(_CONTAINER_TOOL) kill "$$i-cont" || :; \
$(_CONTAINER_TOOL) rm "$$i-cont" || :; \
$(_CONTAINER_TOOL) rmi "$$i" || :; \
Expand All @@ -484,7 +507,7 @@ fast_lint:
FILES_TO_LINT="$$(git diff --name-only $(MASTER_BRANCH) --diff-filter AMR | grep '\.py$$')"; \
if [[ -n "$$FILES_TO_LINT" ]]; then \
pylint -j 0 $$FILES_TO_LINT $(PYLINT_ARGS) && \
flake8 $$FILES_TO_LINT $(FLAKE8_ARG); \
flake8 $$FILES_TO_LINT $(FLAKE8_ARGS); \
LINT_EXIT_CODE="$$?"; \
if [[ "$$LINT_EXIT_CODE" != "0" ]]; then \
exit $$LINT_EXIT_CODE; \
Expand Down
2 changes: 1 addition & 1 deletion commands/command_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def check_version(version):
"""
if not re.match(VERSION_REGEX, version):
raise CommandError('Unexpected format of target version: {}'.format(version))
return version.split('.')[0]
return version.split('.')


def get_major_version(version):
Expand Down
Loading