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

Add support for building AmazonLinux2023 OS packages #25339

Merged
merged 3 commits into from
Sep 30, 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
1 change: 1 addition & 0 deletions util/packaging/common/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def infer_docker_os(package):
"fc38": "fedora:38",
"fc39": "fedora:39",
"fc40": "fedora:40",
"amzn2023": "amazonlinux:2023",
"ubuntu22": "ubuntu:22.04",
"ubuntu24": "ubuntu:24.04",
"debian11": "debian:bullseye",
Expand Down
25 changes: 25 additions & 0 deletions util/packaging/rpm/amzn2023-gasnet-udp/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM amazonlinux:2023 as build

@@{ARGUMENTS}

@@{INJECT_BEFORE_DEPS}

RUN dnf upgrade -y && \
dnf install -y --allowerasing \
gcc gcc-c++ m4 perl python3 python3-devel bash make gawk git cmake \
which diffutils wget vim sudo \
llvm-devel clang clang-devel \
rpm-build rpm-devel rpmlint coreutils patch rpmdevtools chrpath

@@{USER_CREATION}

@@{GET_CHAPEL}

@@{BUILD_DEFAULT}
@@{BUILD_GASNET_UDP}

@@{INSTALL}

@@{PACKAGE_SETUP}

@@{PACKAGE_BUILD}
49 changes: 49 additions & 0 deletions util/packaging/rpm/amzn2023-gasnet-udp/spec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Name: @@{BASENAME}
Version: @@{CHAPEL_VERSION}
Release: @@{PACKAGE_VERSION}%{?dist}
ExclusiveArch: %{_arch}
Summary: Chapel

License: Apache-2.0
Source0: chapel-%{version}.tar.gz

Requires: bash perl git llvm-devel clang clang-devel python3 python3-devel make

%description
Chapel Programming Language

%global debug_package %{nil}

%prep
%setup -q -n chapel-%{version}

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{_prefix}
mkdir -p %{buildroot}/%{_prefix}/bin
mkdir -p %{buildroot}/%{_prefix}/lib
mkdir -p %{buildroot}/%{_prefix}/share

# Binaries
cp %{_prefix}/bin/chpl %{buildroot}/%{_prefix}/bin/chpl
cp %{_prefix}/bin/chpldoc %{buildroot}/%{_prefix}/bin/chpldoc
cp %{_prefix}/bin/mason %{buildroot}/%{_prefix}/bin/mason
cp %{_prefix}/bin/chplcheck %{buildroot}/%{_prefix}/bin/chplcheck
cp %{_prefix}/bin/chpl-language-server %{buildroot}/%{_prefix}/bin/chpl-language-server
# Libraries
cp -r %{_prefix}/lib/chapel %{buildroot}/%{_prefix}/lib/chapel
# CHPL_HOME
cp -r %{_prefix}/share/chapel %{buildroot}/%{_prefix}/share/chapel

%files
%{_prefix}/bin/chpl
%{_prefix}/bin/chpldoc
%{_prefix}/bin/mason
%{_prefix}/bin/chplcheck
%{_prefix}/bin/chpl-language-server
%{_prefix}/lib/chapel/*
%{_prefix}/share/chapel/*

%changelog
25 changes: 25 additions & 0 deletions util/packaging/rpm/amzn2023-ofi-slurm/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM amazonlinux:2023 as build

@@{ARGUMENTS}

@@{INJECT_BEFORE_DEPS}

RUN dnf upgrade -y && \
dnf install -y --allowerasing \
gcc gcc-c++ m4 perl python3 python3-devel bash make gawk git cmake \
which diffutils wget vim sudo \
llvm-devel clang clang-devel \
rpm-build rpm-devel rpmlint coreutils patch rpmdevtools chrpath

@@{USER_CREATION}

@@{GET_CHAPEL}

@@{BUILD_DEFAULT}
@@{BUILD_OFI_SLURM}

@@{INSTALL}

@@{PACKAGE_SETUP}

@@{PACKAGE_BUILD}
49 changes: 49 additions & 0 deletions util/packaging/rpm/amzn2023-ofi-slurm/spec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Name: @@{BASENAME}
Version: @@{CHAPEL_VERSION}
Release: @@{PACKAGE_VERSION}%{?dist}
ExclusiveArch: %{_arch}
Summary: Chapel

License: Apache-2.0
Source0: chapel-%{version}.tar.gz

Requires: bash perl git llvm-devel clang clang-devel python3 python3-devel make pmix-devel slurm-devel

%description
Chapel Programming Language

%global debug_package %{nil}

%prep
%setup -q -n chapel-%{version}

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{_prefix}
mkdir -p %{buildroot}/%{_prefix}/bin
mkdir -p %{buildroot}/%{_prefix}/lib
mkdir -p %{buildroot}/%{_prefix}/share

# Binaries
cp %{_prefix}/bin/chpl %{buildroot}/%{_prefix}/bin/chpl
cp %{_prefix}/bin/chpldoc %{buildroot}/%{_prefix}/bin/chpldoc
cp %{_prefix}/bin/mason %{buildroot}/%{_prefix}/bin/mason
cp %{_prefix}/bin/chplcheck %{buildroot}/%{_prefix}/bin/chplcheck
cp %{_prefix}/bin/chpl-language-server %{buildroot}/%{_prefix}/bin/chpl-language-server
# Libraries
cp -r %{_prefix}/lib/chapel %{buildroot}/%{_prefix}/lib/chapel
# CHPL_HOME
cp -r %{_prefix}/share/chapel %{buildroot}/%{_prefix}/share/chapel

%files
%{_prefix}/bin/chpl
%{_prefix}/bin/chpldoc
%{_prefix}/bin/mason
%{_prefix}/bin/chplcheck
%{_prefix}/bin/chpl-language-server
%{_prefix}/lib/chapel/*
%{_prefix}/share/chapel/*

%changelog
24 changes: 24 additions & 0 deletions util/packaging/rpm/amzn2023/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM amazonlinux:2023 as build

@@{ARGUMENTS}

@@{INJECT_BEFORE_DEPS}

RUN dnf upgrade -y && \
dnf install -y --allowerasing \
gcc gcc-c++ m4 perl python3 python3-devel bash make gawk git cmake \
which diffutils wget vim sudo \
llvm-devel clang clang-devel \
rpm-build rpm-devel rpmlint coreutils patch rpmdevtools chrpath

@@{USER_CREATION}

@@{GET_CHAPEL}

@@{BUILD_DEFAULT}

@@{INSTALL}

@@{PACKAGE_SETUP}

@@{PACKAGE_BUILD}
49 changes: 49 additions & 0 deletions util/packaging/rpm/amzn2023/spec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Name: @@{BASENAME}
Version: @@{CHAPEL_VERSION}
Release: @@{PACKAGE_VERSION}%{?dist}
ExclusiveArch: %{_arch}
Summary: Chapel

License: Apache-2.0
Source0: chapel-%{version}.tar.gz

Requires: bash perl git llvm-devel clang clang-devel python3 python3-devel make

%description
Chapel Programming Language

%global debug_package %{nil}

%prep
%setup -q -n chapel-%{version}

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{_prefix}
mkdir -p %{buildroot}/%{_prefix}/bin
mkdir -p %{buildroot}/%{_prefix}/lib
mkdir -p %{buildroot}/%{_prefix}/share

# Binaries
cp %{_prefix}/bin/chpl %{buildroot}/%{_prefix}/bin/chpl
cp %{_prefix}/bin/chpldoc %{buildroot}/%{_prefix}/bin/chpldoc
cp %{_prefix}/bin/mason %{buildroot}/%{_prefix}/bin/mason
cp %{_prefix}/bin/chplcheck %{buildroot}/%{_prefix}/bin/chplcheck
cp %{_prefix}/bin/chpl-language-server %{buildroot}/%{_prefix}/bin/chpl-language-server
# Libraries
cp -r %{_prefix}/lib/chapel %{buildroot}/%{_prefix}/lib/chapel
# CHPL_HOME
cp -r %{_prefix}/share/chapel %{buildroot}/%{_prefix}/share/chapel

%files
%{_prefix}/bin/chpl
%{_prefix}/bin/chpldoc
%{_prefix}/bin/mason
%{_prefix}/bin/chplcheck
%{_prefix}/bin/chpl-language-server
%{_prefix}/lib/chapel/*
%{_prefix}/share/chapel/*

%changelog
2 changes: 1 addition & 1 deletion util/packaging/rpm/common/fill_docker_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class MyTemplate(Template):
COPY --chown=user ./rpm/common/rpmlintrc /home/user/.rpmlintrc
RUN rpmdev-setuptree && \\
cp chapel-$CHAPEL_VERSION.tar.gz $(rpm --eval '%{_sourcedir}') && \\
ignore_unused=$([[ "$(rpm --eval '%{?dist}')" == ".el9" ]] && echo "" || echo "--ignore-unused-rpmlintrc") && \\
ignore_unused=$([[ "$(rpm --eval '%{dist_name}')" == "Fedora Linux" ]] && echo "--ignore-unused-rpmlintrc") || echo "" && \\
rpmlint $ignore_unused --file .rpmlintrc $BASENAME.spec && \\
unset ignore_unused && \\
spectool -g -R $BASENAME.spec
Expand Down
2 changes: 1 addition & 1 deletion util/packaging/rpm/test/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM @@{OS_BASE_IMAGE}

@@{TEST_ENV}

RUN dnf upgrade -y && dnf install -y --allowerasing sudo vim which
RUN dnf upgrade -y && dnf install -y --allowerasing sudo vim which shadow-utils

@@{USER_CREATION}

Expand Down