diff --git a/.github/workflows/dockers-index-exportation-image.yaml b/.github/workflows/dockers-index-exportation-image.yaml new file mode 100644 index 0000000000..e1562edd70 --- /dev/null +++ b/.github/workflows/dockers-index-exportation-image.yaml @@ -0,0 +1,247 @@ +# +# 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. +# + +# DO_NOT_EDIT this workflow file is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go + + +name: 'Build docker image: index-exportation' +on: + push: + branches: + - main + - release/v*.* + - '!release/v*.*.*' + tags: + - '*.*.*' + - '*.*.*-*' + - v*.*.* + - v*.*.*-* + pull_request: + paths: + - '!**/*_mock.go' + - '!**/*_test.go' + - .github/actions/docker-build/action.yaml + - .github/workflows/_docker-image.yaml + - .github/workflows/dockers-index-exportation-image.yaml + - Makefile + - Makefile.d/** + - apis/grpc/v1/payload/*.go + - apis/grpc/v1/rpc/errdetails/*.go + - apis/grpc/v1/vald/*.go + - apis/proto/** + - cmd/index/job/exportation/*.go + - dockers/index/job/exportation/Dockerfile + - go.mod + - go.sum + - hack/docker/gen/main.go + - internal/backoff/*.go + - internal/cache/*.go + - internal/cache/cacher/*.go + - internal/cache/gache/*.go + - internal/circuitbreaker/*.go + - internal/client/v1/client/vald/*.go + - internal/config/*.go + - internal/conv/*.go + - internal/db/kvs/pogreb/*.go + - internal/db/kvs/redis/*.go + - internal/db/nosql/cassandra/*.go + - internal/db/rdb/mysql/*.go + - internal/db/rdb/mysql/dbr/*.go + - internal/encoding/json/*.go + - internal/errors/*.go + - internal/file/*.go + - internal/info/*.go + - internal/io/*.go + - internal/k8s/*.go + - internal/log/*.go + - internal/log/format/*.go + - internal/log/glg/*.go + - internal/log/level/*.go + - internal/log/logger/*.go + - internal/log/nop/*.go + - internal/log/retry/*.go + - internal/log/zap/*.go + - internal/net/*.go + - internal/net/control/*.go + - internal/net/grpc/*.go + - internal/net/grpc/admin/*.go + - internal/net/grpc/codes/*.go + - internal/net/grpc/credentials/*.go + - internal/net/grpc/errdetails/*.go + - internal/net/grpc/health/*.go + - internal/net/grpc/interceptor/client/metric/*.go + - internal/net/grpc/interceptor/client/trace/*.go + - internal/net/grpc/interceptor/server/logging/*.go + - internal/net/grpc/interceptor/server/metric/*.go + - internal/net/grpc/interceptor/server/recover/*.go + - internal/net/grpc/interceptor/server/trace/*.go + - internal/net/grpc/keepalive/*.go + - internal/net/grpc/logger/*.go + - internal/net/grpc/pool/*.go + - internal/net/grpc/proto/*.go + - internal/net/grpc/reflection/*.go + - internal/net/grpc/status/*.go + - internal/net/grpc/types/*.go + - internal/net/http/dump/*.go + - internal/net/http/json/*.go + - internal/net/http/metrics/*.go + - internal/net/http/middleware/*.go + - internal/net/http/rest/*.go + - internal/net/http/routing/*.go + - internal/net/quic/*.go + - internal/observability/*.go + - internal/observability/attribute/*.go + - internal/observability/exporter/*.go + - internal/observability/exporter/otlp/*.go + - internal/observability/metrics/*.go + - internal/observability/metrics/grpc/*.go + - internal/observability/metrics/mem/*.go + - internal/observability/metrics/runtime/cgo/*.go + - internal/observability/metrics/runtime/goroutine/*.go + - internal/observability/metrics/version/*.go + - internal/observability/trace/*.go + - internal/os/*.go + - internal/params/*.go + - internal/rand/*.go + - internal/runner/*.go + - internal/safety/*.go + - internal/servers/*.go + - internal/servers/server/*.go + - internal/servers/starter/*.go + - internal/strings/*.go + - internal/sync/*.go + - internal/sync/errgroup/*.go + - internal/sync/semaphore/*.go + - internal/sync/singleflight/*.go + - internal/timeutil/*.go + - internal/timeutil/location/*.go + - internal/tls/*.go + - internal/version/*.go + - pkg/index/job/exportation/config/*.go + - pkg/index/job/exportation/service/*.go + - pkg/index/job/exportation/usecase/*.go + - versions/GO_VERSION + pull_request_target: + paths: + - '!**/*_mock.go' + - '!**/*_test.go' + - .github/actions/docker-build/action.yaml + - .github/workflows/_docker-image.yaml + - .github/workflows/dockers-index-exportation-image.yaml + - Makefile + - Makefile.d/** + - apis/grpc/v1/payload/*.go + - apis/grpc/v1/rpc/errdetails/*.go + - apis/grpc/v1/vald/*.go + - apis/proto/** + - cmd/index/job/exportation/*.go + - dockers/index/job/exportation/Dockerfile + - go.mod + - go.sum + - hack/docker/gen/main.go + - internal/backoff/*.go + - internal/cache/*.go + - internal/cache/cacher/*.go + - internal/cache/gache/*.go + - internal/circuitbreaker/*.go + - internal/client/v1/client/vald/*.go + - internal/config/*.go + - internal/conv/*.go + - internal/db/kvs/pogreb/*.go + - internal/db/kvs/redis/*.go + - internal/db/nosql/cassandra/*.go + - internal/db/rdb/mysql/*.go + - internal/db/rdb/mysql/dbr/*.go + - internal/encoding/json/*.go + - internal/errors/*.go + - internal/file/*.go + - internal/info/*.go + - internal/io/*.go + - internal/k8s/*.go + - internal/log/*.go + - internal/log/format/*.go + - internal/log/glg/*.go + - internal/log/level/*.go + - internal/log/logger/*.go + - internal/log/nop/*.go + - internal/log/retry/*.go + - internal/log/zap/*.go + - internal/net/*.go + - internal/net/control/*.go + - internal/net/grpc/*.go + - internal/net/grpc/admin/*.go + - internal/net/grpc/codes/*.go + - internal/net/grpc/credentials/*.go + - internal/net/grpc/errdetails/*.go + - internal/net/grpc/health/*.go + - internal/net/grpc/interceptor/client/metric/*.go + - internal/net/grpc/interceptor/client/trace/*.go + - internal/net/grpc/interceptor/server/logging/*.go + - internal/net/grpc/interceptor/server/metric/*.go + - internal/net/grpc/interceptor/server/recover/*.go + - internal/net/grpc/interceptor/server/trace/*.go + - internal/net/grpc/keepalive/*.go + - internal/net/grpc/logger/*.go + - internal/net/grpc/pool/*.go + - internal/net/grpc/proto/*.go + - internal/net/grpc/reflection/*.go + - internal/net/grpc/status/*.go + - internal/net/grpc/types/*.go + - internal/net/http/dump/*.go + - internal/net/http/json/*.go + - internal/net/http/metrics/*.go + - internal/net/http/middleware/*.go + - internal/net/http/rest/*.go + - internal/net/http/routing/*.go + - internal/net/quic/*.go + - internal/observability/*.go + - internal/observability/attribute/*.go + - internal/observability/exporter/*.go + - internal/observability/exporter/otlp/*.go + - internal/observability/metrics/*.go + - internal/observability/metrics/grpc/*.go + - internal/observability/metrics/mem/*.go + - internal/observability/metrics/runtime/cgo/*.go + - internal/observability/metrics/runtime/goroutine/*.go + - internal/observability/metrics/version/*.go + - internal/observability/trace/*.go + - internal/os/*.go + - internal/params/*.go + - internal/rand/*.go + - internal/runner/*.go + - internal/safety/*.go + - internal/servers/*.go + - internal/servers/server/*.go + - internal/servers/starter/*.go + - internal/strings/*.go + - internal/sync/*.go + - internal/sync/errgroup/*.go + - internal/sync/semaphore/*.go + - internal/sync/singleflight/*.go + - internal/timeutil/*.go + - internal/timeutil/location/*.go + - internal/tls/*.go + - internal/version/*.go + - pkg/index/job/exportation/config/*.go + - pkg/index/job/exportation/service/*.go + - pkg/index/job/exportation/usecase/*.go + - versions/GO_VERSION +jobs: + build: + uses: ./.github/workflows/_docker-image.yaml + with: + target: index-exportation + secrets: inherit diff --git a/Makefile.d/build.mk b/Makefile.d/build.mk index 562d849784..32d05126e0 100644 --- a/Makefile.d/build.mk +++ b/Makefile.d/build.mk @@ -26,7 +26,6 @@ binary/build: \ cmd/index/job/creation/index-creation \ cmd/index/job/deletion/index-deletion \ cmd/index/job/exportation/index-exportation \ - cmd/index/job/importation/index-importation \ cmd/index/job/readreplica/rotate/readreplica-rotate \ cmd/index/job/save/index-save \ cmd/index/operator/index-operator \ @@ -91,10 +90,6 @@ cmd/index/job/exportation/index-exportation: $(eval CGO_ENABLED = 0) $(call go-build,index/job/exportation,,-static,,,$@) -cmd/index/job/importation/index-importation: - $(eval CGO_ENABLED = 0) - $(call go-build,index/job/importation,,-static,,,$@) - cmd/index/job/save/index-save: $(eval CGO_ENABLED = 0) $(call go-build,index/job/save,,-static,,,$@) @@ -145,7 +140,6 @@ binary/build/zip: \ artifacts/vald-index-creation-$(GOOS)-$(GOARCH).zip \ artifacts/vald-index-deletion-$(GOOS)-$(GOARCH).zip \ artifacts/vald-index-exportation-$(GOOS)-$(GOARCH).zip \ - artifacts/vald-index-importation-$(GOOS)-$(GOARCH).zip \ artifacts/vald-index-operator-$(GOOS)-$(GOARCH).zip \ artifacts/vald-index-save-$(GOOS)-$(GOARCH).zip \ artifacts/vald-lb-gateway-$(GOOS)-$(GOARCH).zip \ @@ -213,10 +207,6 @@ artifacts/vald-index-exporation-$(GOOS)-$(GOARCH).zip: cmd/index/job/exportation $(call mkdir, $(dir $@)) zip --junk-paths $@ $< -artifacts/vald-index-importation-$(GOOS)-$(GOARCH).zip: cmd/index/job/importation/index-importation - $(call mkdir, $(dir $@)) - zip --junk-paths $@ $< - artifacts/vald-index-save-$(GOOS)-$(GOARCH).zip: cmd/index/job/save/index-save $(call mkdir, $(dir $@)) zip --junk-paths $@ $< diff --git a/Makefile.d/docker.mk b/Makefile.d/docker.mk index d964d6d1eb..8b06a66a62 100644 --- a/Makefile.d/docker.mk +++ b/Makefile.d/docker.mk @@ -38,7 +38,6 @@ docker/build: \ docker/build/index-creation \ docker/build/index-deletion \ docker/build/index-exportation \ - docker/build/index-importation \ docker/build/index-operator \ docker/build/index-save \ docker/build/loadtest \ @@ -68,7 +67,6 @@ docker/xpanes/build: docker/build/index-creation \ docker/build/index-deletion \ docker/build/index-exportation \ - docker/build/index-importation \ docker/build/index-operator \ docker/build/index-save \ docker/build/loadtest \ @@ -369,17 +367,6 @@ docker/build/index-exportation: IMAGE=$(INDEX_EXPORTATION_IMAGE) \ docker/build/image -.PHONY: docker/name/index-importation -docker/name/index-importation: - @echo "$(ORG)/$(INDEX_IMPORTATION_IMAGE)" - -.PHONY: docker/build/index-importation -## build index-importation image -docker/build/index-importation: - @make DOCKERFILE="$(ROOTDIR)/dockers/index/job/importation/Dockerfile" \ - IMAGE=$(INDEX_IMPORTATION_IMAGE) \ - docker/build/image - .PHONY: docker/name/index-operator docker/name/index-operator: @echo "$(ORG)/$(INDEX_OPERATOR_IMAGE)" diff --git a/dockers/index/job/exportation/Dockerfile b/dockers/index/job/exportation/Dockerfile index 495f985dab..d329680172 100644 --- a/dockers/index/job/exportation/Dockerfile +++ b/dockers/index/job/exportation/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # diff --git a/dockers/index/job/importation/Dockerfile b/dockers/index/job/importation/Dockerfile deleted file mode 100644 index c7eb529861..0000000000 --- a/dockers/index/job/importation/Dockerfile +++ /dev/null @@ -1,87 +0,0 @@ -# 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. -# - -# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go -ARG UPX_OPTIONS=-9 -# skipcq: DOK-DL3026,DOK-DL3007 -FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder -LABEL maintainer="vdaas.org vald team " -# skipcq: DOK-DL3002 -USER root:root -ARG TARGETARCH -ARG TARGETOS -ARG GO_VERSION -ARG RUST_VERSION -ENV APP_NAME=index-importation -ENV DEBIAN_FRONTEND=noninteractive -ENV GO111MODULE=on -ENV GOPATH=/go -ENV GOROOT=/opt/go -ENV HOME=/root -ENV INITRD=No -ENV LANG=en_US.UTF-8 -ENV LANGUAGE=en_US.UTF-8 -ENV LC_ALL=en_US.UTF-8 -ENV ORG=vdaas -ENV PKG=index/job/importation -ENV REPO=vald -ENV TZ=Etc/UTC -ENV USER=root -ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -#skipcq: DOK-W1001, DOK-SC2046, DOK-SC2086, DOK-DL3008 -RUN --mount=type=bind,target=.,rw \ - --mount=type=tmpfs,target=/tmp \ - --mount=type=cache,target=/var/lib/apt,sharing=locked,id=${APP_NAME} \ - --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${APP_NAME} \ - --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ - --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - --mount=type=tmpfs,target="${GOPATH}/src" \ - set -ex \ - && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \ - && echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/no-install-recommends \ - && apt-get clean \ - && apt-get update -y \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends --fix-missing \ - build-essential \ - ca-certificates \ - curl \ - tzdata \ - locales \ - git \ - && ldconfig \ - && echo "${LANG} UTF-8" > /etc/locale.gen \ - && ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \ - && locale-gen ${LANGUAGE} \ - && update-locale LANG=${LANGUAGE} \ - && dpkg-reconfigure -f noninteractive tzdata \ - && apt-get clean \ - && apt-get autoclean -y \ - && apt-get autoremove -y \ - && make GOPATH="${GOPATH}" GOROOT="${GOROOT}" GO_VERSION="${GO_VERSION}" go/install \ - && make GOPATH="${GOPATH}" GOROOT="${GOROOT}" GO_VERSION="${GO_VERSION}" go/download \ - && make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" cmd/${PKG}/${APP_NAME} \ - && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" -# skipcq: DOK-DL3026,DOK-DL3007 -FROM gcr.io/distroless/static:nonroot -LABEL maintainer="vdaas.org vald team " -COPY --from=builder /usr/bin/index-importation /usr/bin/index-importation -# skipcq: DOK-DL3002 -USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-importation"] \ No newline at end of file