From 7b5f1708d0d1a09038bdbb8581575db979a93d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Posp=C3=AD=C5=A1il?= Date: Fri, 13 Dec 2024 18:45:34 +0100 Subject: [PATCH] pcs-0.12.0~b1-2.el10 - Rebased pcs to the latest sources (see CHANGELOG.md) Resolves: RHEL-7602, RHEL-12709, RHEL-44719 - Rebased HA Cluster Management add-on to the latest sources - Point users from pcs-web-ui to HA Cluster Management add-on Resolves: RHEL-68363 - Revamped and unified tarball version management between pcs and pcs-web-ui - version numbers are needed for untagged releases, as git-version-gen takes the version from a git tag present in official released tarballs. To build an unreleased version of pcs, a commit hash is declared in a macro and .tarball-version is generated from rpm version and the hash. For tagged releases, .tarball-version is not generated but rpm version is used for file names and such. Pcs-web-ui uses a different version than pcs, so the rpm version cannot be used. Instead, pcs-web-ui version always has to be declared in the spec file anyway, so it will now serve as the fallback version for generating the .tarball-version for pcs-web-ui. - Fixed description of cockpit-ha-cluster to mention RHEL web console instead of Cockpit - Putting autosetup and autopatch back for pcs-web-ui - Removed previously deleted gems from sources file that I forgot to remove in the last commit --- .gitignore | 2 + pcs.spec | 75 ++++++++----- show-info-page-instead-of-webui.patch | 146 ++++++++++++++++++++++++++ sources | 8 +- 4 files changed, 199 insertions(+), 32 deletions(-) create mode 100644 show-info-page-instead-of-webui.patch diff --git a/.gitignore b/.gitignore index 23dafa8..64943b4 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,5 @@ /pcs-0.12.0b1.tar.gz /pcs-web-ui-0.1.21.tar.gz /pcs-web-ui-node-modules-0.1.21.tar.xz +/pcs-1353dfbb3af82d77f4de17a3fa4cbde185bb2b2d.tar.gz +/pcs-web-ui-34372d1268f065ed186546f55216aaa2d7e76b54.tar.gz diff --git a/pcs.spec b/pcs.spec index e82a597..2b4738b 100644 --- a/pcs.spec +++ b/pcs.spec @@ -1,6 +1,6 @@ Name: pcs Version: 0.12.0~b1 -Release: 1%{?dist} +Release: 2%{?dist} # https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/ # https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses # GPL-2.0-only: pcs @@ -20,15 +20,30 @@ ExclusiveArch: x86_64 s390x ppc64le aarch64 # Remove a tilde used by RPM to get the correct upstream version %global clean_version %(echo %{version} | sed 's/~//') -# When specifying a commit, use its long hash -%global version_or_commit %{clean_version} -# %%global version_or_commit 5b7d498915e0cc876b29fe9ebd709c061ac754db + +# To build an official pcs release, comment out branch_or_commit +# Use long commit hash or branch name to build an unreleased version +%global branch_or_commit 1353dfbb3af82d77f4de17a3fa4cbde185bb2b2d +%if "x{?branch_or_commit}" == "x" + %global version_or_commit %{clean_version} +%else + %global version_or_commit %{branch_or_commit} +%endif %global pcs_source_name %{name}-%{version_or_commit} -# ui_commit can be determined by hash, tag or branch -%global ui_commit 0.1.21 +# To build an official pcs-web-ui release, comment out ui_branch_or_commit +# Last tagged version, also used as fallback version for untagged tarballs +%global ui_version 0.1.21 +# Use long commit hash or branch name to build an unreleased version +%global ui_branch_or_commit 34372d1268f065ed186546f55216aaa2d7e76b54 +%if "x{?ui_branch_or_commit}" == "x" + %global ui_version_or_commit %{ui_version} +%else + %global ui_version_or_commit %{ui_branch_or_commit} +%endif +%global ui_src_name pcs-web-ui-%{ui_version_or_commit} + %global ui_modules_version 0.1.21 -%global ui_src_name pcs-web-ui-%{ui_commit} %global dacite_version 1.8.1 %global pyagentx_version 0.4.pcs.2 @@ -68,7 +83,9 @@ ExclusiveArch: x86_64 s390x ppc64le aarch64 %global rubygem_cache_dir %{rubygem_bundle_dir}/cache %global cockpit_dir %{_datadir}/cockpit/ -%global ui_appstream_metainfo org.clusterlabs.cockpit_pcs_web_ui.metainfo.xml +%global metainfo_dir %{_datadir}/metainfo +%global ui_metainfo_name org.clusterlabs.cockpit_pcs_web_ui.metainfo.xml +%global ui_metainfo %{metainfo_dir}/%{ui_metainfo_name} %global pkg_pcs_snmp pcs-snmp %global pkg_cockpit_ha_cluster cockpit-ha-cluster @@ -101,13 +118,14 @@ Source73: https://rubygems.org/downloads/rackup-%{version_rubygem_rackup}.gem Source75: https://rubygems.org/downloads/sinatra-%{version_rubygem_sinatra}.gem Source76: https://rubygems.org/downloads/tilt-%{version_rubygem_tilt}.gem -Source100: https://github.com/ClusterLabs/pcs-web-ui/archive/%{ui_commit}/%{ui_src_name}.tar.gz -Source101: https://github.com/ClusterLabs/pcs-web-ui/releases/download/%{ui_commit}/pcs-web-ui-node-modules-%{ui_modules_version}.tar.xz +Source100: https://github.com/ClusterLabs/pcs-web-ui/archive/%{ui_version_or_commit}/%{ui_src_name}.tar.gz +Source101: https://github.com/ClusterLabs/pcs-web-ui/releases/download/%{ui_version_or_commit}/pcs-web-ui-node-modules-%{ui_modules_version}.tar.xz # pcs patches: <= 200 # Patch1: name.patch Patch1: do-not-support-cluster-setup-with-udp-u-transport.patch +Patch2: show-info-page-instead-of-webui.patch # ui patches: >200 # Patch201: name-web-ui.patch @@ -274,7 +292,7 @@ SNMP agent that provides information about pacemaker cluster to the master agent (snmpd). %description -n %{pkg_cockpit_ha_cluster} -Cockpit application for managing Pacemaker based clusters. Uses +RHEL web console add-on for managing Pacemaker based clusters. Uses Pacemaker/Corosync Configuration System (pcs) in the background. @@ -322,21 +340,17 @@ update_times_patch(){ # * http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html # * https://rpm-software-management.github.io/rpm/manual/autosetup.html # patch web-ui sources -# -q limits verbosity of %setup macro. Only tar -xof is executed instead of tar -# -xvvof. This option has to be used as first. -# This option is used to suppress a listing of all node_modules files that is -# too long and exceeds capacity of CI log # -n — Set Name of Build Directory # -T — Do Not Perform Default Archive Unpacking # -b — Unpack The nth Sources Before Changing Directory # -a — Unpack The nth Sources After Changing Directory +# -N — disables automatic patch application, use autopatch to apply patches # # 1. unpack sources (-b 0) # 2. then cd into sources tree (the setup macro itself) # 3. then unpack node_modules into sources tree (-a 1). -%setup -q -T -b 100 -a 101 -n %{ui_src_name} -# patching is handled by applying the individual patches -# %%patch -P201 +%autosetup -T -b 100 -a 101 -N -n %{ui_src_name} +%autopatch -p1 -m 201 # update_times_patch %%{PATCH201} @@ -345,6 +359,7 @@ update_times_patch(){ %autopatch -p1 -M 200 # update_times_patch %%{PATCH1} update_times_patch %{PATCH1} +update_times_patch %{PATCH2} # generate .tarball-version if building from an untagged commit, not a released version # autogen uses git-version-gen which uses .tarball-version for generating version number @@ -352,6 +367,10 @@ update_times_patch %{PATCH1} echo "%{clean_version}+$(echo "%{version_or_commit}" | head -c 8)" > %{_builddir}/%{pcs_source_name}/.tarball-version %endif +%if "x%{?ui_branch_or_commit}" != "x" + echo "%{ui_version}+$(echo "%{ui_branch_or_commit}" | head -c 8)" > %{_builddir}/%{ui_src_name}/.tarball-version +%endif + # prepare dirs/files necessary for building python bundles # ----------------------------------------------------- # 1) rubygems sources @@ -399,7 +418,8 @@ cd ../%{ui_src_name} ./autogen.sh %{configure} \ --disable-standalone \ - --with-cockpit-dir=%{cockpit_dir} + --with-cockpit-dir=%{cockpit_dir} \ + --with-metainfo-dir=%{metainfo_dir} make all @@ -411,10 +431,6 @@ pwd # Install cockpit pcs-web-ui cd ../%{ui_src_name} %make_install -# Workaround - metainfo should be installed by make install -mkdir -p %{buildroot}%{_datadir}/metainfo -cp -r %{_builddir}/%{ui_src_name}/packages/app/%{ui_appstream_metainfo} \ - %{buildroot}%{_datadir}/metainfo/ # Install pcs @@ -488,7 +504,7 @@ rm -fv %{buildroot}/%{_libdir}/pcsd/vendor/bundle/gems/tilt-*/bin/tilt %check # Run validation of cockpit metainfo -appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{ui_appstream_metainfo} +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{ui_metainfo_name} # In the building environment LC_CTYPE is set to C which causes tests to fail # due to python prints a warning about it to stderr. The following environment @@ -613,7 +629,7 @@ run_all_tests %exclude %{_libdir}/pcs/pcs_snmp_agent %exclude %{_libdir}/pcs/%{pcs_bundled_dir}/packages/pyagentx* %exclude %{_datadir}/cockpit -%exclude %{_datadir}/metainfo/%{ui_appstream_metainfo} +%exclude %{ui_metainfo} %files -n %{pkg_pcs_snmp} %{_libdir}/pcs/pcs_snmp_agent @@ -630,10 +646,17 @@ run_all_tests %files -n %{pkg_cockpit_ha_cluster} %{cockpit_dir} -%{_datadir}/metainfo/%{ui_appstream_metainfo} +%{ui_metainfo} %changelog +* Thu Dec 12 2024 Michal Pospíšil - 0.12.0~b1-2 +- Rebased pcs to the latest sources (see CHANGELOG.md) + Resolves: RHEL-7602, RHEL-12709, RHEL-44719 +- Rebased HA Cluster Management add-on to the latest sources +- Point users from pcs-web-ui to HA Cluster Management add-on + Resolves: RHEL-68363 + * Wed Nov 13 2024 Michal Pospíšil - 0.12.0~b1-1 - Rebased to the latest sources (see CHANGELOG.md) Resolves: RHEL-21047, RHEL-33386, RHEL-38483, RHEL-44432, RHEL-48220, RHEL-49520, RHEL-49521, RHEL-49524, RHEL-49527, RHEL-55723, RHEL-61747, RHEL-61889, RHEL-62719 diff --git a/show-info-page-instead-of-webui.patch b/show-info-page-instead-of-webui.patch new file mode 100644 index 0000000..0181646 --- /dev/null +++ b/show-info-page-instead-of-webui.patch @@ -0,0 +1,146 @@ +From 6e7fa90fc265063b65e3192ed513d0a52b000a2c Mon Sep 17 00:00:00 2001 +From: Ivan Devat +Date: Tue, 5 Nov 2024 16:35:02 +0100 +Subject: [PATCH] show info page instead of webui + +--- + pcs/Makefile.am | 1 + + pcs/daemon/app/webui_info_handler.py | 31 ++++++++++++++++++++++++++++ + pcs/daemon/run.py | 4 +++- + pcs_test/smoke.sh.in | 4 ++-- + pcsd/public/ui_instructions.html | 26 ++++++++--------------- + 5 files changed, 46 insertions(+), 20 deletions(-) + create mode 100644 pcs/daemon/app/webui_info_handler.py + +diff --git a/pcs/Makefile.am b/pcs/Makefile.am +index 28244dd7..4d4401fa 100644 +--- a/pcs/Makefile.am ++++ b/pcs/Makefile.am +@@ -206,6 +206,7 @@ EXTRA_DIST = \ + daemon/app/webui/core.py \ + daemon/app/webui/session.py \ + daemon/app/webui/sinatra_ui.py \ ++ daemon/app/webui_info_handler.py \ + daemon/async_tasks/__init__.py \ + daemon/async_tasks/scheduler.py \ + daemon/async_tasks/task.py \ +diff --git a/pcs/daemon/app/webui_info_handler.py b/pcs/daemon/app/webui_info_handler.py +new file mode 100644 +index 00000000..3ab8275b +--- /dev/null ++++ b/pcs/daemon/app/webui_info_handler.py +@@ -0,0 +1,31 @@ ++from pcs.daemon.app.common import ( ++ BaseHandler, ++ RoutesType, ++) ++ ++ ++class _WebuiInfoHandler(BaseHandler): ++ __path = None ++ ++ def initialize(self, path): ++ self.__path = path ++ ++ def get(self): ++ self.set_status(404) ++ self.render(self.__path) ++ ++ ++def get_routes(path: str) -> RoutesType: ++ return [ ++ # The following two rules can be compressed into one: r"/(ui/?)?". ++ # However, the content of the parentheses used here should be captured ++ # and passed in to the handler’s get method as an argument. ++ # Unfortunately, it seems that tornado version 6.4.1 don't pass this ++ # argument (unlike version 6.3.3). Maybe it's a bug (it needs further ++ # inspection). These rules are a safe way to avoid surprises. ++ # Moreover, the captured parameter is irrelevant to the functionality ++ # of the handler. ++ (r"/", _WebuiInfoHandler, dict(path=path)), ++ (r"/ui/?", _WebuiInfoHandler, dict(path=path)), ++ (r"/ui/.*", _WebuiInfoHandler, dict(path=path)), ++ ] +diff --git a/pcs/daemon/run.py b/pcs/daemon/run.py +index b555bc18..10e394eb 100644 +--- a/pcs/daemon/run.py ++++ b/pcs/daemon/run.py +@@ -35,6 +35,7 @@ from pcs.daemon.app import capabilities as capabilities_app + from pcs.daemon.app import ( + sinatra_remote, + sinatra_ui, ++ webui_info_handler, + ) + + try: +@@ -141,7 +142,8 @@ def configure_app( + # Even with disabled (standalone) webui the following routes must be + # provided because they can be used via unix socket from cockpit. + routes.extend( +- sinatra_ui.get_routes(auth_provider, ruby_pcsd_wrapper) ++ webui_info_handler.get_routes(webui_fallback) ++ + sinatra_ui.get_routes(auth_provider, ruby_pcsd_wrapper) + ) + + return Application( +diff --git a/pcs_test/smoke.sh.in b/pcs_test/smoke.sh.in +index fdfe8be2..a9bb8344 100755 +--- a/pcs_test/smoke.sh.in ++++ b/pcs_test/smoke.sh.in +@@ -71,10 +71,10 @@ if [ "$webui_http_code_response" = "200" ]; then + curl --insecure --cookie ${cookie_file} --header "X-Requested-With: XMLHttpRequest" --data "hidden[hidden_input]=&config[stonith-enabled]=false" https://localhost:2224/managec/${cluster_name}/update_cluster_settings > "${output_file}" + cat "${output_file}"; echo "" + [ "$(cat ${output_file})" = "Update Successful" ] +-elif [ "$webui_http_code_response" = "401" ]; then ++elif [ "$webui_http_code_response" = "404" ]; then + curl --insecure https://localhost:2224/ui/ > "${output_file}" + cat "${output_file}"; echo "" +- [ "$(cat "${output_file}")" = '{"notauthorized":"true"}' ] ++ grep "HA cluster management has been moved" "${output_file}" + else + echo "Unexpected response from https://localhost:2224/ui/ - http code: '${webui_http_code_response}'" + exit 1 +diff --git a/pcsd/public/ui_instructions.html b/pcsd/public/ui_instructions.html +index a120ed3d..5f9214d0 100644 +--- a/pcsd/public/ui_instructions.html ++++ b/pcsd/public/ui_instructions.html +@@ -1,27 +1,19 @@ + + + +- Pcs WebUI instructions ++ HA cluster management has been moved + + + +-

Pcs WebUI instructions

++

HA cluster management has been moved

+

+- WebUI is not a part of pcs repository but it has its own +- repository. +-

+-

+- You can clone WebUI repository +- and build the web application into pcs by: +-

+-

+-    $ npm install
+-    $ npm run build
+-    $ mv ./build [/path/to/]pcs/pcsd/public/ui
+-  
+-

+- For more details, see instructions in +- README.md. ++ Since RHEL 10.0, pcsd web UI is no longer available. Management of high ++ availability clusters has been moved to an add-on for the RHEL web console. ++ The HA Cluster Management add-on can be installed from the cockpit-ha-cluster ++ RPM package or from the RHEL web console. To learn more, please visit: ++ ++ https://access.redhat.com/solutions/7099451 ++ +

+ + +-- +2.47.0 + diff --git a/sources b/sources index 9418806..8587216 100644 --- a/sources +++ b/sources @@ -1,18 +1,14 @@ SHA512 (dacite-1.8.1.tar.gz) = 4b40c0bdcf5490bcc77de9e7f04b7267642bcfd41e4168607a5457f38abe3ad4b3041d8a23cb43af76de14eabee45f900ad5ddf7af8f70a2be4850bccc2d3af1 SHA512 (ethon-0.16.0.gem) = 3b31affcee0d5a5be05b5497d4a8d13515f8393f54579a3a9c8de49f78d3f065bb92659434b023f0a8bf8e0cccfbc94b617695b93c4d3f744cccd1eff2e68905 -SHA512 (ffi-1.16.3.gem) = b3d823a03055412a85ae3dbc10c3b50615614f0b66830e144ca47610b1f93f588ff693a95d364b4f686968b79bba91f9f9fa60b932479c6bf9ceb10e15575b98 SHA512 (pyagentx-0.4.pcs.2.tar.gz) = d4194fec9a3e5fefe3793d49b7fec1feafef294c7e613a06046c2993daeefc5cb39d7c5b2b402ff83e49b2d976953f862264288c758c0be09d997b5323cc558a SHA512 (pycurl-7.45.3.tar.gz) = 12a55070602a1fd22b160ad582a4001bdd28531d2b2ccd365ff0136bc13dd23af80b19488bdbbc60a902a3a362b64383b9ae6acce6ed328c74dcffc8a6a3f4ad SHA512 (rack-test-2.1.0.gem) = e349ce61c3d787e0a772980db697e92212d4d9592ce33f55516d1f85fba55cbe666496c76392679b057786d6dab603d74b83e7bb773ab54940343e36dbf05d6f -SHA512 (ruby2_keywords-0.0.5.gem) = f6b9078b111e68c0017e0025ecdccb976c7a32f35c1a8adf9fd879db0c91f89eb9bd799f9527a846e28056f2a5fbf0f3610cda9538570288c493613c35c83a6f SHA512 (backports-3.25.0.gem) = 47a2ffb83030cb317e85a4f72a1c4a76a90324b8928ac73e1aa3404a22136661e9ce718bfdd937fbe07b9e05a338fcbd717bb505fb1dd91cfee570bbff9e3f72 SHA512 (base64-0.2.0.gem) = ee5cdc30e73e625c15cb674cdd16a839ad44ffb0a27d1363f94491b48d95da37a2976c34f6f616b722a35750a067eb2245c4746d7d36f8e9a9ecee68ff5540fb SHA512 (childprocess-5.0.0.gem) = 9ec340c86f4fd978b7a9925bcf90811ff3443f014469e4ff121e2c4758a4068823029ab413d1a57eb9de4a864435505b1edfa60a611709f2a5f99aaf08da422d SHA512 (rack-protection-4.0.0.gem) = 5eb33e4829e5e0d320a14d169fd007111641e388f2b6e5f8de98d45dfd1e6705cdb4e1ce29524ebb6fb5afe14079b8e5370c9c389cb2befca4ca508da73165b3 SHA512 (rack-session-2.0.0.gem) = 827cd1acf20eb814adda7663f61755febd2e6acec6ee085dbc393b614a621f845dffa8f759e434055dbf029be370afeb921c8759c9e9e1fee17119830d9b2899 SHA512 (sinatra-4.0.0.gem) = 1eb8c6e8966461d3fa463b5c87e8bc3cd58243fc997a104671e252b866bb653dfc16d7b9f677e016ae91cb30998d72f8778eb2b2254ce27cf304944a6bfa8c05 -SHA512 (webrick-1.8.1.gem) = 3bf45e3a52190dccaa6e883923448b745a420eff2a1533eacdd2aed0e4c67f5c6d813c85606f8fc12952c004e4984fd97ebc3c361a42b49cebe5b84c8fc6e99d -SHA512 (tornado-6.4.0.tar.gz) = dc584acc14d93c7109e4744b690641ae318ee9ad2c42a4c3560c315fa8654de3a64574c7187f5afdbde2906b7cccf5725f45462e710effb6f025e5ec1a3810d4 SHA512 (ffi-1.17.0.gem) = 5cdaf19eaa499127607de7389f69b4927c7bd8a154a53071c53906050bc712b67c1fbc7b4b37fcf9a82fa6c79d705796032cd7ab61755646cfed0c2d279940a1 SHA512 (mustermann-3.0.3.gem) = d205985a5da83d83248899642ed359056b0cdb511e77d51309319c2f8d8b6c84040e9e1d3a56b7f83a0b26aed4b344f4df371b310e419c20170f0a486e89ba6f SHA512 (nio4r-2.7.4.gem) = 6c8280484066ffc39e98b99dfaf5a69fe2a28cafb380924f448673fda8b69b5d97f8b75b8345b91d92f6186f0664e09bec8e1c7c19c070219b030f554824d2ac @@ -20,6 +16,6 @@ SHA512 (puma-6.4.3.gem) = e8baf137c5164f11b8563561405fc4218210707bfb15d0f21118d4 SHA512 (rack-3.1.8.gem) = 7d7b3d8d40c3afc184de90c7602385854bc890ec13c98029e31db0134dbebd7655425334249c908bdb9e5fd1f15754872064611bbf1317a46c6082fd7cdf9b9d SHA512 (rackup-2.2.1.gem) = e63c4dee6f1a677d507df0ae7bcebec88673e7a0a8d6621997949045db60801907038a148a0608f6e62864cb2ac056fca382f3438dc227b0fa7a3be52d56ea66 SHA512 (tilt-2.4.0.gem) = 8cf5036017f501da8843340a9c574ee647074782dcb27ee0aa906fb96ad1e66b90dfb80159aa4c5e7605490058c5ae478bd0fe09f17ae50a2697327d02c814cc -SHA512 (pcs-0.12.0b1.tar.gz) = d6916416d6202a12ee7246ce79fe467d5b6e9e8924f0dd593418fc2f51e18d2814c1311eff7c5d6f24ba3f5bbaae77c4a1b87d613f7846d6509143cd53e8ce29 -SHA512 (pcs-web-ui-0.1.21.tar.gz) = 7d619457ba0e104cb96552057fedcb8a80e95be9aedd0e7decf37af7d424c0177ef6a6c0864654d16a60275ab109e29fe9c4b4d84efb620c560bf988e6c5898d SHA512 (pcs-web-ui-node-modules-0.1.21.tar.xz) = fb69949224b5637cf7e825b3bd9694c98667513f54c044d06911cce7964ccdcc66530d46b9289f24995abaff9dd6ed62a805ab926773c595c150a70a80cc989b +SHA512 (pcs-1353dfbb3af82d77f4de17a3fa4cbde185bb2b2d.tar.gz) = 5b5faf9ddbefbbca170f0c45e00c1a1a5e719bba4d7fb97ea22be26029373b27a33ea4b7558a1f740986931bbdcf5c04fb7f76446346a78bd734cc732c0328cc +SHA512 (pcs-web-ui-34372d1268f065ed186546f55216aaa2d7e76b54.tar.gz) = 67f388c020243764ab52e291ff6cdb8e7346f6d184e31919561ca63affc301b0baf8a968e1088161d9b7f9f2cc5c4f1a517aa3e2016b0d0930d1e2ba320c6865