Skip to content

Add new package citus for work item 47499297 #13653

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

Open
wants to merge 14 commits into
base: 3.0-dev
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions LICENSES-AND-NOTICES/SPECS/data/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,7 @@
"cert-manager",
"cf-cli",
"check-restart",
"citus",
"clamav",
"cloud-hypervisor-cvm",
"cloud-provider-kubevirt",
Expand Down
5 changes: 5 additions & 0 deletions SPECS/citus/citus.signatures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"Signatures": {
"citus-13.0.3.tar.gz": "0815c5139e1b3fa2ce95e35095761c3de159a64b67a0d0da8e42d9844c52e122"
}
}
86 changes: 86 additions & 0 deletions SPECS/citus/citus.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
Summary: PostgreSQL-based distributed RDBMS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we didn't start with the .spec available upstream?

https://github.com/citusdata/packaging/blob/all-citus/citus.spec

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did use the same spec and fixed it for azure linux.

Name: citus
Conflicts: %{name}
Copy link
Contributor

@kgodara912 kgodara912 May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if we can put version number (something like < %{Version}) if the package conflicts with itself..

Version: 13.0.3
Release: 1%{?dist}
License: AGPLv3
Vendor: Microsoft Corporation
Distribution: Azure Linux
Source0: https://github.com/citusdata/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
%if 0%{?with_check}
Patch0: disable_unwanted_tests.patch
%endif
URL: https://github.com/citusdata/%{name}
BuildRequires: postgresql-devel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many spec files put make and gcc in BuildRequires, do we need to put here explicitly for some environments to make this spec file work in those environments?

BuildRequires: libcurl-devel
BuildRequires: lz4-devel
BuildRequires: pkgconfig(icu-i18n)
BuildRequires: pkgconfig(icu-uc)
%if 0%{?with_check}
BuildRequires: shadow-utils
%endif
Requires: postgresql
Provides: %{name}

%description
Citus horizontally scales PostgreSQL across commodity servers
using sharding and replication. Its query engine parallelizes
incoming SQL queries across these servers to enable real-time
responses on large datasets.

Citus extends the underlying database rather than forking it,
which gives developers and enterprises the power and familiarity
of a traditional relational database. As an extension, Citus
supports new PostgreSQL releases, allowing users to benefit from
new features while maintaining compatibility with existing
PostgreSQL tools. Note that Citus supports many (but not all) SQL
commands.

%prep
%autosetup -p1 -n %{name}-%{version}

%build
currentgccver="$(gcc -dumpversion)"
requiredgccver="4.8.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we put it as requiredmingccver for better communication?

if [ "$(printf '%s\n' "$requiredgccver" "$currentgccver" | sort -V | head -n1)" != "$requiredgccver" ]; then
echo ERROR: At least GCC version "$requiredgccver" is needed to build with security flags
exit 1
fi
%configure PG_CONFIG=%{_bindir}/pg_config --with-extra-version="%{?conf_extra_version}" --with-security-flags CC=$(command -v gcc)
make %{?_smp_mflags}

%install
%make_install
# Install documentation with a better name:
%{__mkdir} -p %{buildroot}%{_docdir}/postgresql/extension
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any difference between this and below mkdir? If not, then we can make them uniform.

%{__cp} README.md %{buildroot}%{_docdir}/postgresql/extension/README-%{name}.md
%{__cp} NOTICE %{buildroot}%{_docdir}/postgresql/extension/NOTICE-%{name}

%check
%if 0%{?with_check}
mkdir -p /run/postgresql
useradd -s /usr/bin/sh test
usermod -a -G root test
chmod -R g+w %{_includedir}/postgresql
chmod -R g+w %{_libdir}/postgresql
chmod -R g+w %{_datadir}/postgresql
chmod -R g+w /run/postgresql
chown -R test .
su test -s /bin/sh -c 'make check'
%endif

%files
%defattr(-,root,root,-)
%doc CHANGELOG.md
%license LICENSE
%{_includedir}/*
%{_libdir}/*
%{_datadir}/*
%doc %{_docdir}/postgresql/extension/README-%{name}.md
%doc %{_docdir}/postgresql/extension/NOTICE-%{name}

%changelog
* Mon Apr 29 2025 Sandeep Karambelkar <skarambelkar@microsoft.com> - 13.0.3-1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was Tue

- Original version for Azure Linux
- Based on the spec file of citus packaging
- License verified
53 changes: 53 additions & 0 deletions SPECS/citus/disable_unwanted_tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From 8f06aadb8edd71022565a6f70a05466082abfcb9 Mon Sep 17 00:00:00 2001
From: Sandeep Karambelkar <skarambelkar@microsoft.com>
Date: Thu, 1 May 2025 12:56:59 +0000
Subject: [PATCH] Disable unwanted tests

---
src/test/regress/Makefile | 2 +-
src/test/regress/isolation_schedule | 2 --
src/test/regress/pg_regress_multi.pl | 1 -
3 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/test/regress/Makefile b/src/test/regress/Makefile
index 4bdc7a1..6d4ef46 100644
--- a/src/test/regress/Makefile
+++ b/src/test/regress/Makefile
@@ -45,7 +45,7 @@ vanilla_diffs_file = $(citus_abs_srcdir)/pg_vanilla_outputs/$(MAJORVERSION)/regr
# intermediate, for muscle memory backward compatibility.
check: check-full check-enterprise-full
# check-full triggers all tests that ought to be run routinely
-check-full: check-multi check-multi-mx check-multi-1 check-operations check-follower-cluster check-isolation check-failure check-split check-vanilla check-columnar check-columnar-isolation check-pg-upgrade check-arbitrary-configs check-citus-upgrade check-citus-upgrade-mixed check-citus-upgrade-local check-citus-upgrade-mixed-local check-pytest check-query-generator
+check-full: check-multi check-operations check-isolation check-split
# check-enterprise-full triggers all enterprise specific tests
check-enterprise-full: check-enterprise check-enterprise-isolation check-enterprise-failure check-enterprise-isolation-logicalrep-1 check-enterprise-isolation-logicalrep-2 check-enterprise-isolation-logicalrep-3

diff --git a/src/test/regress/isolation_schedule b/src/test/regress/isolation_schedule
index d8cc77c..12ae688 100644
--- a/src/test/regress/isolation_schedule
+++ b/src/test/regress/isolation_schedule
@@ -82,9 +82,7 @@ test: isolation_citus_schema_distribute_undistribute

# Rebalancer
test: isolation_blocking_move_single_shard_commands
-test: isolation_blocking_move_multi_shard_commands
test: isolation_blocking_move_single_shard_commands_on_mx
-test: isolation_blocking_move_multi_shard_commands_on_mx
test: isolation_shard_rebalancer
test: isolation_rebalancer_deferred_drop
test: isolation_shard_rebalancer_progress
diff --git a/src/test/regress/pg_regress_multi.pl b/src/test/regress/pg_regress_multi.pl
index 66016f7..54cea92 100755
--- a/src/test/regress/pg_regress_multi.pl
+++ b/src/test/regress/pg_regress_multi.pl
@@ -115,7 +115,6 @@ GetOptions(
'valgrind-log-file=s' => \$valgrindLogFile,
'pg_ctl-timeout=s' => \$pgCtlTimeout,
'connection-timeout=s' => \$connectionTimeout,
- 'mitmproxy' => \$useMitmproxy,
'conninfo=s' => \$conninfo,
'worker-1-public-hostname=s' => \$publicWorker1Host,
'worker-2-public-hostname=s' => \$publicWorker2Host,
--
2.45.3

10 changes: 10 additions & 0 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,16 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "citus",
"version": "13.0.3",
"downloadUrl": "https://github.com/citusdata/citus/archive/v13.0.3.tar.gz"
}
}
},
{
"component": {
"type": "other",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
"^/usr/share/doc/tar-[0-9\\.]+/tar\\.html/GNU-Free-Documentation-License\\.html$"
]
},
{
"PackageName": "citus",
"IgnoredFilesRegexList": [
"^/usr/share/doc/postgresql/extension/NOTICE-.*"
]
},
{
"_comment1": "OpenSSL has multiple structs, constants and procedures that have the word 'NOTICE' in them, like 'NOTICEREF_free'.",
"_comment2": "These man pages are for those items, not actual license notices.",
Expand Down
Loading