-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport PR #2705 to release/v1.7 for add example-client docker image #2709
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# | ||
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]> | ||
# | ||
# 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/actions/gen/main.go | ||
|
||
name: "Build docker image: example-client" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- release/v*.* | ||
- "!release/v*.*.*" | ||
tags: | ||
- "*.*.*" | ||
- v*.*.* | ||
- "*.*.*-*" | ||
- v*.*.*-* | ||
pull_request: | ||
paths: | ||
- hack/docker/gen/main.go | ||
- dockers/example/client/Dockerfile | ||
- hack/actions/gen/main.go | ||
- .github/workflows/dockers-example-client-image.yaml | ||
- .github/actions/docker-build/action.yaml | ||
- .github/workflows/_docker-image.yaml | ||
- example/client/** | ||
- apis/grpc/** | ||
- apis/proto/** | ||
- go.mod | ||
- go.sum | ||
- versions/GO_VERSION | ||
- internal/** | ||
- "!internal/**/*_test.go" | ||
- "!internal/**/*_mock.go" | ||
- "!internal/db/**" | ||
- Makefile | ||
- Makefile.d/** | ||
pull_request_target: | ||
paths: | ||
- hack/docker/gen/main.go | ||
- dockers/example/client/Dockerfile | ||
- hack/actions/gen/main.go | ||
- .github/workflows/dockers-example-client-image.yaml | ||
- .github/actions/docker-build/action.yaml | ||
- .github/workflows/_docker-image.yaml | ||
- example/client/** | ||
- apis/grpc/** | ||
- apis/proto/** | ||
- go.mod | ||
- go.sum | ||
- versions/GO_VERSION | ||
- internal/** | ||
- "!internal/**/*_test.go" | ||
- "!internal/**/*_mock.go" | ||
- "!internal/db/**" | ||
- Makefile | ||
- Makefile.d/** | ||
jobs: | ||
build: | ||
uses: ./.github/workflows/_docker-image.yaml | ||
with: | ||
target: example-client | ||
secrets: inherit | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,16 +29,17 @@ docker/build: \ | |
docker/build/ci-container \ | ||
docker/build/dev-container \ | ||
docker/build/discoverer-k8s \ | ||
docker/build/example-client \ | ||
docker/build/gateway-filter \ | ||
docker/build/gateway-lb \ | ||
docker/build/gateway-mirror \ | ||
docker/build/helm-operator \ | ||
Comment on lines
+32
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification helm-operator is still referenced in Makefile.d/docker.mk The removal of
🔗 Analysis chainVerify the removal of helm-operator from the docker/build target The addition of 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Verify if helm-operator is built elsewhere
grep -n "docker/build/helm-operator" Makefile.d/*.mk
Length of output: 529 |
||
docker/build/index-correction \ | ||
docker/build/index-creation \ | ||
docker/build/index-operator \ | ||
docker/build/index-save \ | ||
docker/build/loadtest \ | ||
docker/build/manager-index \ | ||
docker/build/helm-operator \ | ||
docker/build/readreplica-rotate | ||
|
||
docker/xpanes/build: | ||
|
@@ -56,6 +57,7 @@ docker/xpanes/build: | |
docker/build/ci-container \ | ||
docker/build/dev-container \ | ||
docker/build/discoverer-k8s \ | ||
docker/build/example-client \ | ||
docker/build/gateway-filter \ | ||
docker/build/gateway-lb \ | ||
docker/build/gateway-mirror \ | ||
|
@@ -383,3 +385,15 @@ docker/build/benchmark-operator: | |
@make DOCKERFILE="$(ROOTDIR)/dockers/tools/benchmark/operator/Dockerfile" \ | ||
IMAGE=$(BENCHMARK_OPERATOR_IMAGE) \ | ||
docker/build/image | ||
|
||
.PHONY: docker/name/example-client | ||
docker/name/example-client: | ||
@echo "$(ORG)/$(EXAMPLE_CLIENT_IMAGE)" | ||
|
||
.PHONY: docker/build/example-client | ||
## build example client docker image | ||
docker/build/example-client: | ||
@make DOCKERFILE="$(ROOTDIR)/dockers/example/client/Dockerfile" \ | ||
IMAGE=$(EXAMPLE_CLIENT_IMAGE) \ | ||
DOCKER_OPTS="--build-arg ZLIB_VERSION=$(ZLIB_VERSION) --build-arg HDF5_VERSION=$(HDF5_VERSION)" \ | ||
docker/build/image |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# syntax = docker/dockerfile:latest | ||
# | ||
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]> | ||
# | ||
# 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 <[email protected]>" | ||
# skipcq: DOK-DL3002 | ||
USER root:root | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
ARG TARGETARCH | ||
ARG TARGETOS | ||
ARG GO_VERSION | ||
ARG RUST_VERSION | ||
ENV APP_NAME=client | ||
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=example/client | ||
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 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
--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 \ | ||
cmake \ | ||
g++ \ | ||
gcc \ | ||
libssl-dev \ | ||
unzip \ | ||
libhdf5-dev \ | ||
libaec-dev \ | ||
&& 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 hdf5/install \ | ||
&& make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" ${PKG}/${APP_NAME} \ | ||
&& mv "${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" | ||
# skipcq: DOK-DL3026,DOK-DL3007 | ||
FROM gcr.io/distroless/static:nonroot | ||
LABEL maintainer="vdaas.org vald team <[email protected]>" | ||
COPY --from=builder /usr/bin/client /usr/bin/client | ||
# skipcq: DOK-DL3002 | ||
USER nonroot:nonroot | ||
ENTRYPOINT ["/usr/bin/client"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Issue Found: 'example-client' target not configured in _docker-image.yaml.
example-client
target specified in the main workflow is missing from.github/workflows/_docker-image.yaml
.🔗 Analysis chain
LGTM: Efficient job definition using reusable workflow.
The job definition is concise and leverages a reusable workflow, which is an excellent practice for maintaining consistency and reducing duplication across different workflows.
To ensure the referenced workflow file exists and is correctly configured, please run the following command:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 962
Script:
Length of output: 442