Adding nessie to factory #243

Closed
geoagriogiannis wants to merge 1 commits from geoagriogiannis/Factory:nessie into main
4 changed files with 146 additions and 0 deletions

28
nessie-image/Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
# SPDX-License-Identifier: Apache-2.0
#!BuildTag: %%IMG_PREFIX%%nessie:v%%nessie_version%%
Review

we don't prefix tags version with v

we don't prefix tags version with `v`
#!BuildTag: %%IMG_PREFIX%%nessie:v%%nessie_version%%-%RELEASE%
FROM registry.suse.com/bci/bci-base:15.7
LABEL org.opencontainers.image.title="nessie"
geoagriogiannis marked this conversation as resolved
Review

You need a # labelprefix=com.suse.application.nessie line before this line and a # endlabelprefix line after the LABELs block to trigger the label helper service

You need a `# labelprefix=com.suse.application.nessie` line before this line and a `# endlabelprefix` line after the `LABEL`s block to trigger the label helper service
Review

added it on #244 thanks!

added it on #244 thanks!
LABEL org.opencontainers.image.description="Nessie diagnostic tool for SUSE Kubernetes environments"
LABEL org.opencontainers.image.version="%%nessie_version%%"
LABEL org.opencontainers.image.authors="George Agriogiannis <george.agriogiannis2@suse.com>"
LABEL org.opencontainers.image.url="https://github.com/suse-edge/support-tools/tree/main/nessie"
LABEL org.opencontainers.image.vendor="SUSE LLC"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opensuse.reference="%%IMG_REPO%%/%%IMG_PREFIX%%nessie:v%%nessie_version%%-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.supportlevel="%%SUPPORT_LEVEL%%"
LABEL com.suse.eula="SUSE Combined EULA February 2024"
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle"
LABEL com.suse.image-type="application"
LABEL com.suse.release-stage="released"
RUN zypper --non-interactive refresh && \
zypper --non-interactive install --no-recommends nessie && \
zypper clean
WORKDIR /tmp
ENTRYPOINT ["/usr/bin/nessie"]

19
nessie-image/_service Normal file
View File

@@ -0,0 +1,19 @@
<services>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service mode="buildtime" name="docker_label_helper"/>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="regex">%%nessie_version%%</param>
<param name="package">nessie</param>
<param name="parse-version">patch</param>
</service>
<service name="replace_using_env" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="eval">IMG_PREFIX=$(rpm --macros=/root/.rpmmacros -E %{?img_prefix})</param>
<param name="var">IMG_PREFIX</param>
<param name="eval">IMG_REPO=$(rpm --macros=/root/.rpmmacros -E %img_repo)</param>
<param name="var">IMG_REPO</param>
<param name="eval">SUPPORT_LEVEL=$(rpm --macros=/root/.rpmmacros -E %support_level)</param>
<param name="var">SUPPORT_LEVEL</param>
</service>
</services>

19
nessie/_service Normal file
View File

@@ -0,0 +1,19 @@
<services>
<service name="obs_scm">
<param name="url">https://github.com/suse-edge/support-tools</param>
<param name="scm">git</param>
<param name="revision">nessie-v1.0.0</param>
<param name="subdir">nessie</param>
<param name="exclude">.git</param>
<param name="changesgenerate">enable</param>
<param name="versionformat">1.0.0</param>
geoagriogiannis marked this conversation as resolved
Review

you want something like this here:

    <param name="versionformat">@PARENT_TAG@</param>
    <param name="versionrewrite-pattern">nessie-v(\d+\.\d+\.\d+)</param>
    <param name="versionrewrite-replacement">\1</param>
you want something like this here: ``` <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">nessie-v(\d+\.\d+\.\d+)</param> <param name="versionrewrite-replacement">\1</param> ```
Review

uploaded the wrong service file :( fixed on #244

uploaded the wrong service file :( fixed on #244
<param name="filename">nessie</param>
</service>
<service mode="buildtime" name="tar">
<param name="obsinfo">nessie.obsinfo</param>
</service>
<service mode="buildtime" name="recompress">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
</services>

80
nessie/nessie.spec Normal file
View File

@@ -0,0 +1,80 @@
#
# spec file for package nessie
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: nessie
# Version will be set automatically by factory's set_version service
geoagriogiannis marked this conversation as resolved
Review

For this to be true, you'd need to enable the set_version service in your _service file.

For this to be true, you'd need to enable the `set_version` service in your `_service` file.
Review

same as above, I have the service on #244

same as above, I have the service on #244
Version: 1.0.0
Release: 0
Summary: Node Environment Support Script for Inspection and Export
License: Apache-2.0
Group: System/Management
URL: https://github.com/suse-edge/support-tools/tree/main/nessie
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
# Build dependencies
BuildRequires: python3-devel
# Runtime dependencies
Requires: python3
Requires: python3-kubernetes
Requires: python3-PyYAML
Requires: helm
Requires: systemd
# Optional dependencies for enhanced functionality
Recommends: util-linux
Recommends: kubernetes1.29-client
geoagriogiannis marked this conversation as resolved
Review

not sure we want to recommend the 1.29 kubectl

not sure we want to recommend the `1.29` kubectl
Review

removed it!

removed it!
%description
Nessie (Node Environment Support Script for Inspection and Export) is a
comprehensive diagnostic tool for SUSE Kubernetes environments. It collects
logs, configurations, and system information from Kubernetes clusters for
troubleshooting and support purposes.
Key features:
- Collects system service logs and Kubernetes pod logs
- Gathers cluster configurations and Helm releases
- Retrieves node metrics and component versions
- Supports RKE2 and K3s environments
- Fault-tolerant with configurable options
- Can be run directly or as a container
The tool is designed specifically for SUSE Edge environments and integrates
well with SUSE Linux Micro, RKE2, and K3s distributions.
%prep
%autosetup
%build
# Validate Python syntax
python3 -m py_compile nessie.py
%install
# Install the main script
install -D -m 0755 nessie.py %{buildroot}%{_bindir}/nessie
# Install documentation files
install -D -m 0644 README.md %{buildroot}%{_docdir}/%{name}/README.md
install -D -m 0644 LICENSE %{buildroot}%{_docdir}/%{name}/LICENSE
%files
%{_bindir}/nessie
%doc %{_docdir}/%{name}/README.md
%license %{_docdir}/%{name}/LICENSE
%changelog