-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #249 from vespa-engine/toregge/build-test-rpms-for…
…-almalinux-9 Add AlmaLinux 9 versions of rpm build scripts.
- Loading branch information
Showing
9 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dockerfile.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
|
||
FROM almalinux:9 | ||
|
||
# Java requires proper locale for unicode. Set container=docker to allow systemd in container mode. | ||
ENV LANG=C.UTF-8 container=docker | ||
|
||
# Change git reference for a specific version of the vespa.spec file. | ||
# Use a tag or SHA to allow for reproducible builds. | ||
ENV VESPA_SRC_REF="ae3f3a5ad659da2e34490cb6a2dd648745ac8248" | ||
|
||
RUN @@MOUNTS_CMD@@ /bin/sh /include/install-build-dependencies.sh @@VESPADEV_RPM_SOURCE@@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/sh | ||
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
|
||
ALMALINUX_VERSION=9test | ||
|
||
# shellcheck disable=SC2209 | ||
VESPADEV_RPM_SOURCE=test | ||
|
||
case "$1" in | ||
test|external) | ||
VESPADEV_RPM_SOURCE=$1 | ||
shift;; | ||
esac | ||
|
||
case "$VESPADEV_RPM_SOURCE" in | ||
test) rpmbuild/refresh-test-repo;; | ||
esac | ||
|
||
IMG="vespaengine/vespa-build-almalinux-${ALMALINUX_VERSION}:latest" | ||
|
||
WORKDIR=$(cd "$(dirname "$0")" && env pwd) | ||
cd "$WORKDIR" || exit 1 | ||
|
||
# shellcheck disable=SC1091 | ||
. ../../shared/common.sh | ||
|
||
MOUNTS_CMD= | ||
|
||
case "$CONTAINER_ENGINE" in | ||
podman) DOCKERFILE_MOUNTS_CMD= | ||
MOUNTS_CMD="-v $WORKDIR/include:/include -v $WORKDIR/rpmbuild:/work" | ||
;; | ||
docker) DOCKERFILE_MOUNTS_CMD="--mount=type=bind,target=/include/,source=include/,rw --mount=type=bind,target=/work/,source=rpmbuild/,ro" | ||
MOUNTS_CMD="" | ||
;; | ||
esac | ||
|
||
sed -e "s;@@MOUNTS_CMD@@;$DOCKERFILE_MOUNTS_CMD;" -e "s,@@VESPADEV_RPM_SOURCE@@,$VESPADEV_RPM_SOURCE," Dockerfile.test.tmpl > Dockerfile.test | ||
|
||
# shellcheck disable=SC2086 | ||
echo BUILDING: docker build --progress plain $MOUNTS_CMD -t "${IMG}" -f Dockerfile.test "$@" "$WORKDIR" | ||
# shellcheck disable=SC2086 | ||
$CONTAINER_ENGINE build --progress plain $MOUNTS_CMD -t "${IMG}" -f Dockerfile.test "$@" "$WORKDIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh -ex | ||
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
|
||
# shellcheck source=../../../shared-rpmbuild/build-rpm-inner-common.sh | ||
. /shared-work/build-rpm-inner-common.sh | ||
|
||
enable_repos() | ||
{ | ||
dnf -y install \ | ||
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ | ||
https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm | ||
dnf -y install 'dnf-command(config-manager)' | ||
dnf config-manager --set-enabled crb | ||
} | ||
|
||
enable_modules() | ||
{ | ||
dnf -y module enable maven:3.8 | ||
dnf -y module enable ruby:3.1 | ||
} | ||
|
||
enable_cuda_repos() | ||
{ | ||
enable_cuda_repos_helper rhel9 | ||
} | ||
|
||
build_rpm_inner_common "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
|
||
cd "$(cd "$(dirname "$0")" && env pwd)" || exit 1 | ||
|
||
. ../../../shared-rpmbuild/build-rpm-common.sh | ||
|
||
DOCKER_IMAGE=almalinux:9 | ||
CONTAINER_SHORTNAME=a9 | ||
|
||
build_rpm_common "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
|
||
WORKDIR=$(cd "$(dirname "$0")" && env pwd) | ||
cd "$WORKDIR" || exit 1 | ||
|
||
. ../../../shared/common.sh | ||
|
||
|
||
if test -f /usr/bin/createrepo_c | ||
then | ||
mkdir -p "RPMS/$(arch)" | ||
createrepo_c "RPMS/$(arch)" | ||
else | ||
# shellcheck disable=SC2016 | ||
$CONTAINER_ENGINE run --rm -v "$WORKDIR:/work" docker.io/almalinux:9 bash -c 'dnf -y install createrepo_c && mkdir -p /work/RPMS/$(arch) && createrepo_c /work/RPMS/$(arch) && chown -R --ref /work/build-rpm-inner.sh /work/RPMS' | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
|
||
# To be run inside a docker container | ||
dnf install -y 'dnf-command(config-manager)' | ||
dnf config-manager --add-repo=/work/vespa-test.repo | ||
dnf config-manager --enable vespa-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
[vespa-test] | ||
name=vespa-test | ||
baseurl=file:///work/RPMS/$basearch | ||
enabled=0 | ||
gpgcheck=0 | ||
|