diff --git a/Makefile.common b/Makefile.common index e71918e..bb9153b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -3,7 +3,7 @@ UPSTREAM_VERSION ?= "" VERSION := "${VERSION_PREFIX}${UPSTREAM_VERSION}" IMAGE_NAME ?= "" PLATFORM ?= "amd64" -BIN="../bin/" +BIN="$(abspath $(CURDIR)/../bin)/" ifeq ($(UPSTREAM_VERSION),"") $(error UPSTREAM_VERSION is required) diff --git a/autoinstrumentation-dotnet/Dockerfile b/autoinstrumentation-dotnet/Dockerfile index c60d1ad..d613b99 100644 --- a/autoinstrumentation-dotnet/Dockerfile +++ b/autoinstrumentation-dotnet/Dockerfile @@ -9,12 +9,12 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -LABEL name="Autoinstrumentation-dotnet" \ +LABEL name="OpenTelemetry .NET Automatic Instrumentation" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ - summary="UBI based OpenTelemetry .NET Automatic Instrumentation " \ - description="Kubernetes Operator for OpenTelemetry Collector" \ + summary="UBI based OpenTelemetry .NET Automatic Instrumentation image" \ + description="OpenTelemetry .NET Automatic Instrumentation adds instrumentation to .NET applications without having to modify their source code." \ maintainer="opensource-collection-team@sumologic.com" ADD https://raw.githubusercontent.com/open-telemetry/opentelemetry-dotnet-instrumentation/v${UPSTREAM_VERSION}/LICENSE \ diff --git a/autoinstrumentation-java/Dockerfile b/autoinstrumentation-java/Dockerfile index f2decdb..e9f7bb5 100644 --- a/autoinstrumentation-java/Dockerfile +++ b/autoinstrumentation-java/Dockerfile @@ -9,12 +9,12 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -LABEL name="Autoinstrumentation-java" \ +LABEL name="OpenTelemetry Java Automatic Instrumentation" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ - summary="UBI based OpenTelemetry Java Automatic Instrumentation " \ - description="Kubernetes Operator for OpenTelemetry Collector" \ + summary="UBI based OpenTelemetry Java Automatic Instrumentation image" \ + description="OpenTelemetry Java Automatic Instrumentation provides a Java agent JAR that can be attached to any Java 8+ application and dynamically injects bytecode to capture telemetry from a number of popular libraries and frameworks." \ maintainer="opensource-collection-team@sumologic.com" ADD https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-instrumentation/v${UPSTREAM_VERSION}/LICENSE \ diff --git a/autoinstrumentation-nodejs/Dockerfile b/autoinstrumentation-nodejs/Dockerfile index 5c175da..f77b3b0 100644 --- a/autoinstrumentation-nodejs/Dockerfile +++ b/autoinstrumentation-nodejs/Dockerfile @@ -9,12 +9,12 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -LABEL name="Autoinstrumentation-nodejs" \ +LABEL name="OpenTelemetry Node JS Automatic Instrumentation" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ - summary="UBI based OpenTelemetry Node JS Automatic Instrumentation " \ - description="Kubernetes Operator for OpenTelemetry Collector" \ + summary="UBI based OpenTelemetry Node JS Automatic Instrumentation image" \ + description="OpenTelemetry Node JS Automatic Instrumentation adds instrumentation to .NET applications without having to modify their source code." \ maintainer="opensource-collection-team@sumologic.com" ADD https://raw.githubusercontent.com/open-telemetry/opentelemetry-js-contrib/auto-instrumentations-node-v${UPSTREAM_VERSION}/LICENSE \ diff --git a/autoinstrumentation-python/Dockerfile b/autoinstrumentation-python/Dockerfile index 920927c..64c7467 100644 --- a/autoinstrumentation-python/Dockerfile +++ b/autoinstrumentation-python/Dockerfile @@ -9,12 +9,12 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -LABEL name="Autoinstrumentation-python" \ +LABEL name="OpenTelemetry Python Automatic Instrumentation" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ - summary="UBI based OpenTelemetry Python Automatic Instrumentation " \ - description="Kubernetes Operator for OpenTelemetry Collector" \ + summary="UBI based OpenTelemetry Python Automatic Instrumentation image" \ + description="Python auto-instrumentation libraries for OpenTelemetry" \ maintainer="opensource-collection-team@sumologic.com" ADD https://raw.githubusercontent.com/open-telemetry/opentelemetry-python-contrib/v${UPSTREAM_VERSION}/LICENSE \ diff --git a/fluent-bit/Dockerfile b/fluent-bit/Dockerfile index 31a2710..7e4c1c2 100644 --- a/fluent-bit/Dockerfile +++ b/fluent-bit/Dockerfile @@ -65,7 +65,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based Fluent Bit" \ +ENV SUMMARY="UBI based Fluent Bit image" \ DESCRIPTION="Fluent Bit is a fast Log Processor and Forwarder" LABEL name="Fluent Bit" \ diff --git a/kube-rbac-proxy/Dockerfile b/kube-rbac-proxy/Dockerfile index 7ce1198..106db77 100644 --- a/kube-rbac-proxy/Dockerfile +++ b/kube-rbac-proxy/Dockerfile @@ -8,10 +8,10 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based kube-rbac-proxy" \ +ENV SUMMARY="UBI based Kube RBAC Proxy image" \ DESCRIPTION="The kube-rbac-proxy is a small HTTP proxy for a single upstream, that can perform RBAC authorization against the Kubernetes API using SubjectAccessReview." -LABEL name="Kube-rbac-proxy" \ +LABEL name="Kube RBAC Proxy" \ vendor="Sumo Logic" \ version="$UPSTREAM_VERSION" \ release="$RELEASE" \ diff --git a/kube-state-metrics/Dockerfile b/kube-state-metrics/Dockerfile index b0e55f5..c0fd0d8 100644 --- a/kube-state-metrics/Dockerfile +++ b/kube-state-metrics/Dockerfile @@ -9,10 +9,10 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based kube-state-metrics" \ +ENV SUMMARY="UBI based Kube State Metrics image" \ DESCRIPTION="kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects." -LABEL name="Kube-state-metrics" \ +LABEL name="Kube State Metrics" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ diff --git a/metrics-server/Dockerfile b/metrics-server/Dockerfile index 3f4907e..2c32f89 100644 --- a/metrics-server/Dockerfile +++ b/metrics-server/Dockerfile @@ -10,10 +10,10 @@ ARG RELEASE COPY --from=builder /opt/bitnami /opt/bitnami -ENV SUMMARY="UBI based metrics-server" \ +ENV SUMMARY="UBI based Metrics Server image" \ DESCRIPTION="Metrics Server is a cluster-wide aggregator of resource usage data. Metrics Server collects metrics from the Summary API, exposed by Kubelet on each node." -LABEL name="metrics-server" \ +LABEL name="Metrics Server" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ diff --git a/nginx-unprivileged/Dockerfile b/nginx-unprivileged/Dockerfile index 9ff6f05..7e05c0f 100644 --- a/nginx-unprivileged/Dockerfile +++ b/nginx-unprivileged/Dockerfile @@ -12,8 +12,8 @@ ARG RELEASE ARG NGINX_UID=999 ARG NGINX_GID=999 -ENV SUMMARY="UBI based Unprivileged NGINX" \ - DESCRIPTION="nginx is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server" +ENV SUMMARY="UBI based Unprivileged NGINX image" \ + DESCRIPTION="NGINX is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server" LABEL name="Unprivileged NGINX" \ vendor="Sumo Logic" \ diff --git a/node-exporter/Dockerfile b/node-exporter/Dockerfile index 33ab9f7..ea1c7f3 100644 --- a/node-exporter/Dockerfile +++ b/node-exporter/Dockerfile @@ -9,10 +9,10 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based node-exporter" \ +ENV SUMMARY="UBI based Prometheus Node Exporter image" \ DESCRIPTION="Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written in Go with pluggable metric collectors." -LABEL name="Node-exporter" \ +LABEL name="Prometheus Node Exporter" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ diff --git a/opentelemetry-operator/Dockerfile b/opentelemetry-operator/Dockerfile index 533b563..3f025d7 100644 --- a/opentelemetry-operator/Dockerfile +++ b/opentelemetry-operator/Dockerfile @@ -12,10 +12,10 @@ ARG RELEASE WORKDIR / COPY --from=builder /manager . -ENV SUMMARY="UBI based opentelemetry operator" \ +ENV SUMMARY="UBI based OpenTelemetry Operator image" \ DESCRIPTION="OpenTelemetry Operator manages OpenTelemetry Collector and auto-instrumentation of the workloads using OpenTelemetry instrumentation libraries" -LABEL name="opentelemetry-operator" \ +LABEL name="OpenTelemetry Operator" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ diff --git a/prometheus-config-reloader/Dockerfile b/prometheus-config-reloader/Dockerfile index 0c6782f..b55c116 100644 --- a/prometheus-config-reloader/Dockerfile +++ b/prometheus-config-reloader/Dockerfile @@ -8,10 +8,10 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based prometheus-config-reloader" \ - DESCRIPTION="Prometheus configuration reloader" +ENV SUMMARY="UBI based Prometheus Configuration Reloader image" \ + DESCRIPTION="Prometheus Configuration Reloader automatically reloads Prometheus Configuration" -LABEL name="Prometheus-config-reloader" \ +LABEL name="Prometheus Configuration Reloader" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ diff --git a/prometheus-operator/Dockerfile b/prometheus-operator/Dockerfile index 7626506..e57a95b 100644 --- a/prometheus-operator/Dockerfile +++ b/prometheus-operator/Dockerfile @@ -9,10 +9,10 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based prometheus-operator" \ +ENV SUMMARY="UBI based Prometheus Operator image" \ DESCRIPTION="The Prometheus Operator provides Kubernetes native deployment and management of Prometheus and related monitoring components." -LABEL name="Prometheus-operator" \ +LABEL name="Prometheus Operator" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ diff --git a/prometheus/Dockerfile b/prometheus/Dockerfile index 990f084..e0ae5eb 100644 --- a/prometheus/Dockerfile +++ b/prometheus/Dockerfile @@ -10,7 +10,7 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based prometheus" \ +ENV SUMMARY="UBI based Prometheus image" \ DESCRIPTION="Prometheus, a Cloud Native Computing Foundation project, is a systems and service monitoring system." LABEL name="Prometheus" \ diff --git a/scripts/build-push.sh b/scripts/build-push.sh index 7146dd0..18dbdf0 100755 --- a/scripts/build-push.sh +++ b/scripts/build-push.sh @@ -4,6 +4,9 @@ set -e # consts readonly SUMO_REGISTRY="public.ecr.aws/sumologic/" +## Sumo Logic Helm Operator project id +## rel: https://connect.redhat.com/manage/products/6075d88c2b962feb86bea730/overview +readonly OPERATOR_PROJECT_ID=6075d88c2b962feb86bea730 function usage() { echo "usage: NAME=image name VERSION= PYAXIS_API_TOKEN= ./scripts/build-push.sh @@ -34,7 +37,28 @@ function submit(){ if [[ -z ${CONTAINER_PROJECT_ID} ]]; then echo "Missing project for ${IMAGE_NAME}" - exit 1 + + ## Create new project + readonly IMAGE_DESCRIPTION="$(docker inspect "${IMAGE_NAME}" | jq '.[0].Config.Labels.description' --raw-output)" + readonly IMAGE_SUMMARY="$(docker inspect "${IMAGE_NAME}" | jq '.[0].Config.Labels.summary' --raw-output)" + readonly APPLICATION_NAME="$(docker inspect "${IMAGE_NAME}" | jq '.[0].Config.Labels.name' --raw-output)" + export IMAGE_DESCRIPTION + export IMAGE_SUMMARY + export APPLICATION_NAME + DATA="$(envsubst < scripts/new_project.json)" + RESULT="$(curl -sH "X-API-KEY: ${PYAXIS_API_TOKEN}" -H 'Content-Type: application/json' -X POST https://catalog.redhat.com/api/containers/v1/projects/certification --data "${DATA}")" + + ## Add new project to product + CONTAINER_PROJECT_ID="$(echo ${RESULT} | jq '._id' --raw-output)" + + if [[ -z ${CONTAINER_PROJECT_ID} ||"${CONTAINER_PROJECT_ID}" == "null" ]]; then + echo "Error during create project for ${IMAGE_NAME}" + echo $RESULT + exit 1 + fi + + DATA=$(curl -sH "X-API-KEY: ${PYAXIS_API_TOKEN}" https://catalog.redhat.com/api/containers/v1/product-listings/id/${OPERATOR_PROJECT_ID} | jq ".cert_projects |= . + [\"${CONTAINER_PROJECT_ID}\"] | {cert_projects}") + RESULT="$(curl -sH "X-API-KEY: ${PYAXIS_API_TOKEN}" -H 'Content-Type: application/json' -X PATCH https://catalog.redhat.com/api/containers/v1/product-listings/id/${OPERATOR_PROJECT_ID} --data "${DATA}")" fi ## Fetch key for image registry @@ -66,10 +90,6 @@ readonly ACTION_CERTIFY="certify" readonly ACTION="${ACTION:-${ACTION_BUILD}}" DEV_SUFFIX="" -## Sumo Logic Helm Operator project id -## rel: https://connect.redhat.com/manage/products/6075d88c2b962feb86bea730/overview -readonly OPERATOR_PROJECT_ID=6075d88c2b962feb86bea730 - if ! [[ "$ACTION" =~ ${ACTION_BUILD}|${ACTION_PUSH}|${ACTION_CHECK}|${ACTION_CERTIFY} ]]; then echo "ACTION should be '${ACTION_BUILD}', '${ACTION_PUSH}', '${ACTION_CHECK}' or ${ACTION_CERTIFY}" exit 1 diff --git a/scripts/new_project.json b/scripts/new_project.json new file mode 100644 index 0000000..304ed17 --- /dev/null +++ b/scripts/new_project.json @@ -0,0 +1,32 @@ +{ + "contacts": [ + { + "email_address": "opensource-collection-team@sumologic.com", + "type": "Technical contact" + } + ], + "container": { + "application_categories": [ + "Logging & Metrics", + "Monitoring" + ], + "auto_publish": true, + "build_categories": "Standalone image", + "distribution_method": "rhcc", + "os_content_type": "Red Hat Universal Base Image (UBI)", + "release_category": "Generally Available", + "repository_description": "${IMAGE_DESCRIPTION}", + "repository_name": "${NAME}", + "short_description": "${IMAGE_SUMMARY}", + "support_platforms": [ + "OpenShift Container Platform" + ], + "type": "container" + }, + "name": "${APPLICATION_NAME}", + "product_listings": [ + "6075d88c2b962feb86bea730" + ], + "project_status": "active", + "type": "Containers" +} diff --git a/scripts/submit_image.sh b/scripts/submit_image.sh index 74d8ddd..7e7b232 100755 --- a/scripts/submit_image.sh +++ b/scripts/submit_image.sh @@ -2,6 +2,22 @@ set -e +# consts +## Sumo Logic Helm Operator project id +## rel: https://connect.redhat.com/manage/products/6075d88c2b962feb86bea730/overview +readonly OPERATOR_PROJECT_ID=6075d88c2b962feb86bea730 + +function cleanup() { + if [[ -n ${CONTAINER_PROJECT_ID} && -n ${SUMOLOGIC_IMAGE} ]]; then + readonly APPLICATION_NAME="$(docker inspect ${SUMOLOGIC_IMAGE} | jq '.[0].Config.Labels.name' --raw-output)" + echo "https://connect.redhat.com/component/${OPERATOR_PROJECT_ID}/${CONTAINER_PROJECT_ID}/certification" + echo "Project ID: ${CONTAINER_PROJECT_ID}" + echo "Name of Application: ${APPLICATION_NAME}" + fi +} + +trap cleanup EXIT + if [ -z ${CONTAINER_PROJECT_ID} ] || [ -z ${CONTAINER_REGISTRY_KEY} ] || [ -z ${SUMOLOGIC_IMAGE} ] || [ -z ${PYAXIS_API_TOKEN} ] then echo "One of required environment variables is missing" diff --git a/sumo-ubi-minimal/Dockerfile b/sumo-ubi-minimal/Dockerfile index 876582c..0ee929a 100644 --- a/sumo-ubi-minimal/Dockerfile +++ b/sumo-ubi-minimal/Dockerfile @@ -5,13 +5,13 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:${UPSTREAM_VERSION} ARG UPSTREAM_VERSION ARG RELEASE -LABEL name="sumo-ubi9-minimal" \ +LABEL name="Sumo Logic Universal Base Image Minimal" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ - summary="Provides the latest release of the minimal Red Hat Universal Base Image 8 prepared by Sumo Logic." \ + summary="Sumo Logic Universal Base Image Minimal" \ description="The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager." \ maintainer="opensource-collection-team@sumologic.com" ADD https://www.apache.org/licenses/LICENSE-2.0.txt \ - /licenses/LICENSE + /licenses/LICENSE diff --git a/telegraf-operator/Dockerfile b/telegraf-operator/Dockerfile index 78b7c25..9ec18d2 100644 --- a/telegraf-operator/Dockerfile +++ b/telegraf-operator/Dockerfile @@ -9,10 +9,10 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based telegraf-operator" \ +ENV SUMMARY="UBI based Telegraf Operator image" \ DESCRIPTION="The telegraf facilitates management of telegraf CRDs in Kubernetes." -LABEL name="telegraf-operator" \ +LABEL name="Telegraf Operator" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ diff --git a/telegraf/Dockerfile b/telegraf/Dockerfile index ad499e0..0a19437 100644 --- a/telegraf/Dockerfile +++ b/telegraf/Dockerfile @@ -9,10 +9,10 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based telegraf" \ +ENV SUMMARY="UBI based Telegraf image" \ DESCRIPTION="Telegraf is an agent for collecting metrics and writing them to InfluxDB or other outputs." -LABEL name="telegraf" \ +LABEL name="Telegraf" \ vendor="Sumo Logic" \ version="${UPSTREAM_VERSION}" \ release="${RELEASE}" \ diff --git a/thanos/Dockerfile b/thanos/Dockerfile index 8eb9671..564ba08 100644 --- a/thanos/Dockerfile +++ b/thanos/Dockerfile @@ -9,7 +9,7 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4 ARG UPSTREAM_VERSION ARG RELEASE -ENV SUMMARY="UBI based thanos" \ +ENV SUMMARY="UBI based Thanos image" \ DESCRIPTION="Thanos is a set of components that can be composed into a highly available metric system with unlimited storage capacity, which can be added seamlessly on top of existing Prometheus deployments." LABEL name="Thanos" \