From 839bb2b488b518626d0ac339bf529c3d28b42d6e Mon Sep 17 00:00:00 2001 From: vdaas-ci <57942646+vdaas-ci@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:29:26 +0900 Subject: [PATCH] [CI] Add workflow to synchronize ubuntu base image (#2526) (#2527) * feat: add sync workflow for ubuntu base image * fix: add todo comment * fix: docker pull step * fix: invalid command * fix: add docker tagging * fix: invalid config * fix: enable arm * fix: add tag * fix: invalid command * fix: add debug job * fix: invalid command * fix: invalid command * fix: invalid command * fix: refactor * fix: add push image * fix: image not found error * fix: use docker build action * fix: add docker file * fix: add docker meta * fix: invalid command * fix: add build command for buildbase * fix: deleted unnecessary workflow * fix: file name * fix: image name * fix: invalid name * fix: resolve warning * fix: deleted unnecessary file * fix: add file to event path * fix: add schedule event --------- Signed-off-by: hlts2 Co-authored-by: Hiroto Funakoshi --- .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 003c6a3644..e82c8f0d1c 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