Skip to content

Commit 5db8f36

Browse files
authored
Merge pull request #8701 from romayalon/romy-rpm-build-and-install-test-and-action
NC | RPM build and install github action
2 parents e31e047 + 3eca5c4 commit 5db8f36

4 files changed

+97
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Manual RPM Build and Install Test Dispatch
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branch:
6+
description: 'Branch to RPM Build and Install From'
7+
required: true
8+
centos_ver:
9+
type: choice
10+
description: 'Centos Base image (options: 8/9) - Optional, default is 9'
11+
default: '9'
12+
options:
13+
- '8'
14+
- '9'
15+
16+
# Currently the only supported arch is linux/amd64 (x86_64)
17+
jobs:
18+
manual-build-rpm-and-install:
19+
uses: ./.github/workflows/rpm-build-and-install-test-base.yaml
20+
with:
21+
branch: ${{ github.event.inputs.branch }}
22+
centos_ver: ${{ github.event.inputs.centos_ver }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Nightly RPM Build and Install Test
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
6+
# Currently the only supported arch is linux/amd64 (x86_64)
7+
jobs:
8+
call-master-rpm-build-and-install-test-centos9:
9+
uses: ./.github/workflows/rpm-build-and-install-test-base.yaml
10+
secrets: inherit
11+
with:
12+
branch: 'master'
13+
centos_ver: '9'
14+
15+
# call-master-rpm-build-and-install-test-centos8:
16+
# uses: ./.github/workflows/rpm-build-and-install-test-base.yaml
17+
# secrets: inherit
18+
# with:
19+
# branch: 'master'
20+
# centos_ver: '8'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: RPM Build and Install Test Workflow
2+
on:
3+
workflow_call:
4+
inputs:
5+
branch:
6+
type: string
7+
description: 'Branch to Build RPM From'
8+
required: true
9+
centos_ver:
10+
type: string
11+
description: 'Centos Base image (options: 8/9) - Optional, default is 9'
12+
default: '9'
13+
14+
jobs:
15+
rpm-build-and-and-install-test-base:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 90
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ inputs.branch }}
23+
24+
- name: Run Non Containerized RPM Build And Install Test
25+
run: |
26+
make rpm-build-and-install-test BUILD_S3SELECT=0 CENTOS_VER=${{ inputs.centos_ver }} CONTAINER_PLATFORM=linux/amd64
27+

Makefile

+28
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ endif
8484
BUILD_S3SELECT?=1
8585
BUILD_S3SELECT_PARQUET?=0
8686

87+
## RPM VARIABLES
88+
DATE := $(shell date +'%Y%m%d')
89+
NOOBAA_PKG_VERSION := $(shell jq -r '.version' < ./package.json)
90+
RPM_BASE_VERSION := noobaa-core-$(NOOBAA_PKG_VERSION)-${DATE}
91+
ifeq ($(CONTAINER_PLATFORM), linux/amd64)
92+
ARCH_SUFFIX := x86_64
93+
else ifeq ($(CONTAINER_PLATFORM), linux/ppc64le)
94+
ARCH_SUFFIX := ppc64le
95+
endif
96+
RPM_FULL_PATH := $(RPM_BASE_VERSION).el${CENTOS_VER}.$(ARCH_SUFFIX).rpm
97+
install_rpm_and_deps_command := dnf install -y make && rpm -i $(RPM_FULL_PATH) && systemctl enable noobaa --now && systemctl status noobaa && systemctl stop noobaa
98+
8799
###############
88100
# BUILD LOCAL #
89101
###############
@@ -178,6 +190,22 @@ rpm: builder
178190
echo "\033[1;32mRPM for platform \"$(NOOBAA_RPM_TAG)\" is ready in build/rpm.\033[0m";
179191
.PHONY: rpm
180192

193+
assert-rpm-build-and-install-test-platform:
194+
@ if [ "${CONTAINER_PLATFORM}" != "linux/amd64" ]; then \
195+
echo "\n Error: Running rpm-build-and-install-test linux/amd64 is currently the only supported container platform\n"; \
196+
exit 1; \
197+
fi
198+
.PHONY: assert-rpm-build-and-install-test-platform
199+
200+
rpm-build-and-install-test: assert-rpm-build-and-install-test-platform rpm
201+
@echo "Running RHEL linux/amd64 (currently only supported) container..."
202+
$(CONTAINER_ENGINE) run --name noobaa-rpm-build-and-install-test --privileged --user root -dit --platform=linux/amd64 redhat/ubi$(CENTOS_VER)-init
203+
@echo "Copying rpm_full_path=$(RPM_FULL_PATH) to the container..."
204+
$(CONTAINER_ENGINE) cp ./build/rpm/$(RPM_FULL_PATH) noobaa-rpm-build-and-install-test:$(RPM_FULL_PATH)
205+
@echo "Installing RPM and dependencies in the container... $(install_rpm_and_deps_command)"
206+
$(CONTAINER_ENGINE) exec noobaa-rpm-build-and-install-test bash -c "$(install_rpm_and_deps_command)"
207+
.PHONY: rpm-build-and-install-test
208+
181209
###############
182210
# TEST IMAGES #
183211
###############

0 commit comments

Comments
 (0)