From 5a8e259c61b20c61e8fa25704e682c356faa9f6d Mon Sep 17 00:00:00 2001 From: ryankert Date: Mon, 12 Aug 2024 21:32:51 +0800 Subject: [PATCH 1/5] [YUNIKORN-2446] Add OCI annotations to public docker images --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Makefile b/Makefile index 64e9454e4..f6fa9e000 100644 --- a/Makefile +++ b/Makefile @@ -501,8 +501,18 @@ sched_image: $(OUTPUT)/third-party-licenses.md scheduler docker/scheduler --label "yunikorn-k8shim-revision=${SHIM_SHA}" \ --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ + --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ + --label org.opencontainers.image.description="Apache Yunikorn" \ + --label org.opencontainers.image.created="$(DATE)" \ + --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ + --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ + --label org.opencontainers.image.revision="$(SHIM_SHA)" \ + --label org.opencontainers.image.license="Apache-2.0" \ + --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ ${QUIET} + + # Build a plugin image based on the production ready version .PHONY: plugin_image plugin_image: $(OUTPUT)/third-party-licenses.md plugin docker/plugin conf/scheduler-config.yaml @@ -522,6 +532,14 @@ plugin_image: $(OUTPUT)/third-party-licenses.md plugin docker/plugin conf/schedu --label "yunikorn-k8shim-revision=${SHIM_SHA}" \ --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ + --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ + --label org.opencontainers.image.description="Apache Yunikorn" \ + --label org.opencontainers.image.created="$(DATE)" \ + --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ + --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ + --label org.opencontainers.image.revision="$(SHIM_SHA)" \ + --label org.opencontainers.image.license="Apache-2.0" \ + --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ ${QUIET} # Build admission controller binary in a production ready version @@ -570,6 +588,14 @@ adm_image: $(OUTPUT)/third-party-licenses.md admission docker/admission --label "yunikorn-k8shim-revision=${SHIM_SHA}" \ --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ + --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ + --label org.opencontainers.image.description="Apache Yunikorn" \ + --label org.opencontainers.image.created="$(DATE)" \ + --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ + --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ + --label org.opencontainers.image.revision="$(SHIM_SHA)" \ + --label org.opencontainers.image.license="Apache-2.0" \ + --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ ${QUIET} # Build all images based on the production ready version From 28481267bb3f32a83cb2acce4dfea2d439b420bf Mon Sep 17 00:00:00 2001 From: "Hsien-Cheng(Ryan) Huang" Date: Mon, 12 Aug 2024 21:41:43 +0800 Subject: [PATCH 2/5] indentation --- Makefile | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index f6fa9e000..eac7dbf41 100644 --- a/Makefile +++ b/Makefile @@ -502,13 +502,13 @@ sched_image: $(OUTPUT)/third-party-licenses.md scheduler docker/scheduler --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ - --label org.opencontainers.image.description="Apache Yunikorn" \ - --label org.opencontainers.image.created="$(DATE)" \ - --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ - --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ - --label org.opencontainers.image.revision="$(SHIM_SHA)" \ - --label org.opencontainers.image.license="Apache-2.0" \ - --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ + --label org.opencontainers.image.description="Apache Yunikorn" \ + --label org.opencontainers.image.created="$(DATE)" \ + --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ + --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ + --label org.opencontainers.image.revision="$(SHIM_SHA)" \ + --label org.opencontainers.image.license="Apache-2.0" \ + --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ ${QUIET} @@ -533,13 +533,13 @@ plugin_image: $(OUTPUT)/third-party-licenses.md plugin docker/plugin conf/schedu --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ - --label org.opencontainers.image.description="Apache Yunikorn" \ - --label org.opencontainers.image.created="$(DATE)" \ - --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ - --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ - --label org.opencontainers.image.revision="$(SHIM_SHA)" \ - --label org.opencontainers.image.license="Apache-2.0" \ - --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ + --label org.opencontainers.image.description="Apache Yunikorn" \ + --label org.opencontainers.image.created="$(DATE)" \ + --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ + --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ + --label org.opencontainers.image.revision="$(SHIM_SHA)" \ + --label org.opencontainers.image.license="Apache-2.0" \ + --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ ${QUIET} # Build admission controller binary in a production ready version @@ -589,13 +589,13 @@ adm_image: $(OUTPUT)/third-party-licenses.md admission docker/admission --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ - --label org.opencontainers.image.description="Apache Yunikorn" \ - --label org.opencontainers.image.created="$(DATE)" \ - --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ - --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ - --label org.opencontainers.image.revision="$(SHIM_SHA)" \ - --label org.opencontainers.image.license="Apache-2.0" \ - --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ + --label org.opencontainers.image.description="Apache Yunikorn" \ + --label org.opencontainers.image.created="$(DATE)" \ + --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ + --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ + --label org.opencontainers.image.revision="$(SHIM_SHA)" \ + --label org.opencontainers.image.license="Apache-2.0" \ + --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ ${QUIET} # Build all images based on the production ready version From dfcdf1f8542d9ddb02f53d00e7219c7aee2e6452 Mon Sep 17 00:00:00 2001 From: ryankert Date: Mon, 12 Aug 2024 21:47:26 +0800 Subject: [PATCH 3/5] [YUNIKORN-2446] Add OCI annotations to public docker images --- Makefile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index eac7dbf41..2f1a52b5d 100644 --- a/Makefile +++ b/Makefile @@ -502,13 +502,13 @@ sched_image: $(OUTPUT)/third-party-licenses.md scheduler docker/scheduler --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ - --label org.opencontainers.image.description="Apache Yunikorn" \ - --label org.opencontainers.image.created="$(DATE)" \ - --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ - --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ - --label org.opencontainers.image.revision="$(SHIM_SHA)" \ - --label org.opencontainers.image.license="Apache-2.0" \ - --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ + --label org.opencontainers.image.description="Apache Yunikorn Scheduler" \ + --label org.opencontainers.image.created="$(DATE)" \ + --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ + --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ + --label org.opencontainers.image.revision="$(SHIM_SHA)" \ + --label org.opencontainers.image.license="Apache-2.0" \ + --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ ${QUIET} @@ -532,8 +532,8 @@ plugin_image: $(OUTPUT)/third-party-licenses.md plugin docker/plugin conf/schedu --label "yunikorn-k8shim-revision=${SHIM_SHA}" \ --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ - --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ - --label org.opencontainers.image.description="Apache Yunikorn" \ + --label org.opencontainers.image.title="yunikorn-scheduler-plugin-k8s" \ + --label org.opencontainers.image.description="Apache Yunikorn Plugin" \ --label org.opencontainers.image.created="$(DATE)" \ --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ @@ -588,8 +588,8 @@ adm_image: $(OUTPUT)/third-party-licenses.md admission docker/admission --label "yunikorn-k8shim-revision=${SHIM_SHA}" \ --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ - --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ - --label org.opencontainers.image.description="Apache Yunikorn" \ + --label org.opencontainers.image.title="yunikorn-admission-controller-k8s" \ + --label org.opencontainers.image.description="Apache Yunikorn Admission Controller" \ --label org.opencontainers.image.created="$(DATE)" \ --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ From ab71cfb0e5755c748d997c011b7da9a4a58c9a26 Mon Sep 17 00:00:00 2001 From: ryankert Date: Mon, 12 Aug 2024 21:48:06 +0800 Subject: [PATCH 4/5] [YUNIKORN-2446] Add OCI annotations to public docker images --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 2f1a52b5d..c98d1d88f 100644 --- a/Makefile +++ b/Makefile @@ -511,8 +511,6 @@ sched_image: $(OUTPUT)/third-party-licenses.md scheduler docker/scheduler --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ ${QUIET} - - # Build a plugin image based on the production ready version .PHONY: plugin_image plugin_image: $(OUTPUT)/third-party-licenses.md plugin docker/plugin conf/scheduler-config.yaml From 48ede8c7c252f0ba7532a7307e397b9a6cb4f65f Mon Sep 17 00:00:00 2001 From: ryankert Date: Tue, 13 Aug 2024 07:24:43 +0800 Subject: [PATCH 5/5] code review --- Makefile | 56 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index c98d1d88f..3c8dd3019 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,11 @@ TEST_SERVER_BINARY=web-test-server TOOLS_DIR=tools REPO=github.com/apache/yunikorn-k8shim/pkg +IMAGE_SOURCE?=https://github.com/apache/yunikorn-k8shim +IMAGE_URL?=https://hub.docker.com/r/apache/yunikorn +LICENSE=Apache-2.0 +DOCS_URL=https://yunikorn.apache.org + # PATH export PATH := $(BASE_DIR)/$(TOOLS_DIR):$(GO_EXE_PATH):$(PATH) @@ -501,14 +506,15 @@ sched_image: $(OUTPUT)/third-party-licenses.md scheduler docker/scheduler --label "yunikorn-k8shim-revision=${SHIM_SHA}" \ --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ - --label org.opencontainers.image.title="yunikorn-scheduler-k8s" \ - --label org.opencontainers.image.description="Apache Yunikorn Scheduler" \ - --label org.opencontainers.image.created="$(DATE)" \ - --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ - --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ - --label org.opencontainers.image.revision="$(SHIM_SHA)" \ - --label org.opencontainers.image.license="Apache-2.0" \ - --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ + --label "org.opencontainers.image.title=${SCHEDULER_BINARY}" \ + --label "org.opencontainers.image.description=Apache YuniKorn Scheduler" \ + --label "org.opencontainers.image.version=${VERSION}" \ + --label "org.opencontainers.image.created=$(DATE)" \ + --label "org.opencontainers.image.source=${IMAGE_SOURCE}" \ + --label "org.opencontainers.image.url=${IMAGE_URL}" \ + --label "org.opencontainers.image.revision=$(SHIM_SHA)" \ + --label "org.opencontainers.image.license=${LICENSE}" \ + --label "org.opencontainers.image.documentation=${DOCS_URL}" \ ${QUIET} # Build a plugin image based on the production ready version @@ -530,14 +536,15 @@ plugin_image: $(OUTPUT)/third-party-licenses.md plugin docker/plugin conf/schedu --label "yunikorn-k8shim-revision=${SHIM_SHA}" \ --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ - --label org.opencontainers.image.title="yunikorn-scheduler-plugin-k8s" \ - --label org.opencontainers.image.description="Apache Yunikorn Plugin" \ - --label org.opencontainers.image.created="$(DATE)" \ - --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ - --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ - --label org.opencontainers.image.revision="$(SHIM_SHA)" \ - --label org.opencontainers.image.license="Apache-2.0" \ - --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ + --label "org.opencontainers.image.title=${PLUGIN_BINARY}" \ + --label "org.opencontainers.image.description=Apache YuniKorn Scheduler (Plugin)" \ + --label "org.opencontainers.image.version=${VERSION}" \ + --label "org.opencontainers.image.created=$(DATE)" \ + --label "org.opencontainers.image.source=${IMAGE_SOURCE}" \ + --label "org.opencontainers.image.url=${IMAGE_URL}" \ + --label "org.opencontainers.image.revision=$(SHIM_SHA)" \ + --label "org.opencontainers.image.license=${LICENSE}" \ + --label "org.opencontainers.image.documentation=${DOCS_URL}" \ ${QUIET} # Build admission controller binary in a production ready version @@ -586,14 +593,15 @@ adm_image: $(OUTPUT)/third-party-licenses.md admission docker/admission --label "yunikorn-k8shim-revision=${SHIM_SHA}" \ --label "BuildTimeStamp=${DATE}" \ --label "Version=${VERSION}" \ - --label org.opencontainers.image.title="yunikorn-admission-controller-k8s" \ - --label org.opencontainers.image.description="Apache Yunikorn Admission Controller" \ - --label org.opencontainers.image.created="$(DATE)" \ - --label org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim" \ - --label org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn" \ - --label org.opencontainers.image.revision="$(SHIM_SHA)" \ - --label org.opencontainers.image.license="Apache-2.0" \ - --label org.opencontainers.image.documentation="https://yunikorn.apache.org" \ + --label "org.opencontainers.image.title=${ADMISSION_CONTROLLER_BINARY}" \ + --label "org.opencontainers.image.description=Apache YuniKorn Admission Controller" \ + --label "org.opencontainers.image.version=${VERSION}" \ + --label "org.opencontainers.image.created=$(DATE)" \ + --label "org.opencontainers.image.source=${IMAGE_SOURCE}" \ + --label "org.opencontainers.image.url=${IMAGE_URL}" \ + --label "org.opencontainers.image.revision=$(SHIM_SHA)" \ + --label "org.opencontainers.image.license=${LICENSE}" \ + --label "org.opencontainers.image.documentation=${DOCS_URL}" \ ${QUIET} # Build all images based on the production ready version