From cc4a38e6cc017e0f385c1c33d32423e83c3ba2b9 Mon Sep 17 00:00:00 2001 From: Hiroto Funakoshi Date: Wed, 17 Jul 2024 17:24:39 +0900 Subject: [PATCH] [CI] Add workflow to synchronize ubuntu base image (#2526) * feat: add sync workflow for ubuntu base image Signed-off-by: hlts2 * fix: add todo comment Signed-off-by: hlts2 * fix: docker pull step Signed-off-by: hlts2 * fix: invalid command Signed-off-by: hlts2 * fix: add docker tagging Signed-off-by: hlts2 * fix: invalid config Signed-off-by: hlts2 * fix: enable arm Signed-off-by: hlts2 * fix: add tag Signed-off-by: hlts2 * fix: invalid command Signed-off-by: hlts2 * fix: add debug job Signed-off-by: hlts2 * fix: invalid command Signed-off-by: hlts2 * fix: invalid command Signed-off-by: hlts2 * fix: invalid command Signed-off-by: hlts2 * fix: refactor Signed-off-by: hlts2 * fix: add push image Signed-off-by: hlts2 * fix: image not found error Signed-off-by: hlts2 * fix: use docker build action Signed-off-by: hlts2 * fix: add docker file Signed-off-by: hlts2 * fix: add docker meta Signed-off-by: hlts2 * fix: invalid command Signed-off-by: hlts2 * fix: add build command for buildbase Signed-off-by: hlts2 * fix: deleted unnecessary workflow Signed-off-by: hlts2 * fix: file name Signed-off-by: hlts2 * fix: image name Signed-off-by: hlts2 * fix: invalid name Signed-off-by: hlts2 * fix: resolve warning Signed-off-by: hlts2 * fix: deleted unnecessary file Signed-off-by: hlts2 * fix: add file to event path Signed-off-by: hlts2 * fix: add schedule event Signed-off-by: hlts2 --------- Signed-off-by: hlts2 --- .github/workflows/dockers-buildbase-image.yml | 48 +++++++++++++++++++ Makefile | 1 + Makefile.d/docker.mk | 11 +++++ dockers/buildbase/Dockerfile | 18 +++++++ 4 files changed, 78 insertions(+) create mode 100644 .github/workflows/dockers-buildbase-image.yml create mode 100644 dockers/buildbase/Dockerfile diff --git a/.github/workflows/dockers-buildbase-image.yml b/.github/workflows/dockers-buildbase-image.yml new file mode 100644 index 0000000000..4b99dc4027 --- /dev/null +++ b/.github/workflows/dockers-buildbase-image.yml @@ -0,0 +1,48 @@ +# +# Copyright (C) 2019-2024 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +name: "Build docker image: buildbase" +on: + schedule: + - cron: "0 1 * * *" + push: + branches: + - "main" + - "release/v*.*" + - "!release/v*.*.*" + tags: + - "*.*.*" + - "v*.*.*" + - "*.*.*-*" + - "v*.*.*-*" + pull_request: + paths: + - ".github/actions/docker-build/action.yaml" + - ".github/workflows/_docker-image.yaml" + - ".github/workflows/dockers-buildbase-image.yml" + - "dockers/buildbase/Dockerfile" + pull_request_target: + paths: + - ".github/actions/docker-build/action.yaml" + - ".github/workflows/_docker-image.yaml" + - ".github/workflows/dockers-buildbase-image.yml" + - "dockers/buildbase/Dockerfile" +jobs: + build: + uses: ./.github/workflows/_docker-image.yaml + with: + target: buildbase + platforms: linux/amd64,linux/arm64 + secrets: inherit diff --git a/Makefile b/Makefile index 1b08e62324..4dfc1b0138 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ AGENT_NGT_IMAGE = $(NAME)-agent-ngt AGENT_FAISS_IMAGE = $(NAME)-agent-faiss AGENT_SIDECAR_IMAGE = $(NAME)-agent-sidecar AGENT_IMAGE = $(NAME)-agent +BUILDBASE_IMAGE = $(NAME)-buildbase CI_CONTAINER_IMAGE = $(NAME)-ci-container DEV_CONTAINER_IMAGE = $(NAME)-dev-container DISCOVERER_IMAGE = $(NAME)-discoverer-k8s diff --git a/Makefile.d/docker.mk b/Makefile.d/docker.mk index 96d1db40db..e466f8b368 100644 --- a/Makefile.d/docker.mk +++ b/Makefile.d/docker.mk @@ -175,6 +175,17 @@ docker/build/manager-index: IMAGE=$(MANAGER_INDEX_IMAGE) \ docker/build/image +.PHONY: docker/name/buildbase +docker/name/buildbase: + @echo "$(ORG)/$(BUILDBASE_IMAGE)" + +.PHONY: docker/build/buildbase +## build buildbase image +docker/build/buildbase: + @make DOCKERFILE="$(ROOTDIR)/dockers/buildbase/Dockerfile" \ + IMAGE=$(BUILDBASE_IMAGE) \ + docker/build/image + .PHONY: docker/name/ci-container docker/name/ci-container: @echo "$(ORG)/$(CI_CONTAINER_IMAGE)" diff --git a/dockers/buildbase/Dockerfile b/dockers/buildbase/Dockerfile new file mode 100644 index 0000000000..9be2e4b20b --- /dev/null +++ b/dockers/buildbase/Dockerfile @@ -0,0 +1,18 @@ +# syntax = docker/dockerfile:latest +# +# Copyright (C) 2019-2024 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM ubuntu:devel AS builder