Skip to content

Commit

Permalink
refactor docker and change buildkit-syft-scanner reference to ghcr.io
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango committed Aug 7, 2024
1 parent 3457a5b commit 941ab25
Show file tree
Hide file tree
Showing 36 changed files with 126 additions and 331 deletions.
67 changes: 2 additions & 65 deletions .gitfiles
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
.github/workflows/dockers-binfmt-image.yaml
.github/workflows/dockers-buildbase-image.yml
.github/workflows/dockers-buildkit-image.yaml
.github/workflows/dockers-buildkit-syft-scanner-image.yaml
.github/workflows/dockers-ci-container-image.yml
.github/workflows/dockers-dev-container-image.yml
.github/workflows/dockers-discoverer-k8s-image.yml
Expand Down Expand Up @@ -292,17 +293,11 @@ assets/test/templates/common/call.tmpl
assets/test/templates/common/fill.tmpl
assets/test/templates/common/function.tmpl
assets/test/templates/common/header.tmpl
assets/test/templates/common/inline.tmpl
assets/test/templates/common/inputs.tmpl
assets/test/templates/common/message.tmpl
assets/test/templates/common/results.tmpl
assets/test/templates/option/call.tmpl
assets/test/templates/option/fill.tmpl
assets/test/templates/option/function.tmpl
assets/test/templates/option/header.tmpl
assets/test/templates/option/inline.tmpl
assets/test/templates/option/inputs.tmpl
assets/test/templates/option/message.tmpl
assets/test/templates/option/results.tmpl
buf.gen.yaml
buf.work.yaml
Expand Down Expand Up @@ -516,7 +511,6 @@ cmd/tools/cli/loadtest/main_test.go
cmd/tools/cli/loadtest/sample.yaml
cmd/tools/cli/vdctl/main.go
cmd/tools/cli/vdctl/main_test.go
design/.gitkeep
design/Vald Architecture Assets.drawio
design/Vald Architecture Dataflow.drawio
design/Vald Architecture Overview.drawio
Expand All @@ -531,6 +525,7 @@ dockers/agent/sidecar/README.md
dockers/binfmt/Dockerfile
dockers/buildbase/Dockerfile
dockers/buildkit/Dockerfile
dockers/buildkit/syft/scanner/Dockerfile
dockers/ci/base/Dockerfile
dockers/ci/base/README.md
dockers/dev/Dockerfile
Expand Down Expand Up @@ -1403,85 +1398,41 @@ internal/worker/worker.go
internal/worker/worker_option.go
internal/worker/worker_option_test.go
internal/worker/worker_test.go
k8s/agent/clusterrole.yaml
k8s/agent/clusterrolebinding.yaml
k8s/agent/daemonset.yaml
k8s/agent/deployment.yaml
k8s/agent/faiss/configmap.yaml
k8s/agent/hpa.yaml
k8s/agent/networkpolicy.yaml
k8s/agent/ngt/configmap.yaml
k8s/agent/pdb.yaml
k8s/agent/priorityclass.yaml
k8s/agent/serviceaccount.yaml
k8s/agent/sidecar/configmap.yaml
k8s/agent/sidecar/svc.yaml
k8s/agent/statefulset.yaml
k8s/agent/svc.yaml
k8s/debug/kind/config.yaml
k8s/discoverer/clusterrole.yaml
k8s/discoverer/clusterrolebinding.yaml
k8s/discoverer/configmap.yaml
k8s/discoverer/daemonset.yaml
k8s/discoverer/deployment.yaml
k8s/discoverer/hpa.yaml
k8s/discoverer/networkpolicy.yaml
k8s/discoverer/pdb.yaml
k8s/discoverer/priorityclass.yaml
k8s/discoverer/serviceaccount.yaml
k8s/discoverer/svc.yaml
k8s/external/minio/deployment.yaml
k8s/external/minio/mb-job.yaml
k8s/external/minio/svc.yaml
k8s/gateway/gateway/filter/configmap.yaml
k8s/gateway/gateway/filter/daemonset.yaml
k8s/gateway/gateway/filter/deployment.yaml
k8s/gateway/gateway/filter/hpa.yaml
k8s/gateway/gateway/filter/networkpolicy.yaml
k8s/gateway/gateway/filter/pdb.yaml
k8s/gateway/gateway/filter/priorityclass.yaml
k8s/gateway/gateway/filter/svc.yaml
k8s/gateway/gateway/ing.yaml
k8s/gateway/gateway/lb/configmap.yaml
k8s/gateway/gateway/lb/daemonset.yaml
k8s/gateway/gateway/lb/deployment.yaml
k8s/gateway/gateway/lb/hpa.yaml
k8s/gateway/gateway/lb/networkpolicy.yaml
k8s/gateway/gateway/lb/pdb.yaml
k8s/gateway/gateway/lb/priorityclass.yaml
k8s/gateway/gateway/lb/svc.yaml
k8s/gateway/gateway/mirror/clusterrole.yaml
k8s/gateway/gateway/mirror/clusterrolebinding.yaml
k8s/gateway/gateway/mirror/configmap.yaml
k8s/gateway/gateway/mirror/daemonset.yaml
k8s/gateway/gateway/mirror/deployment.yaml
k8s/gateway/gateway/mirror/hpa.yaml
k8s/gateway/gateway/mirror/networkpolicy.yaml
k8s/gateway/gateway/mirror/pdb.yaml
k8s/gateway/gateway/mirror/priorityclass.yaml
k8s/gateway/gateway/mirror/serviceaccount.yaml
k8s/gateway/gateway/mirror/svc.yaml
k8s/index/job/correction/configmap.yaml
k8s/index/job/correction/cronjob.yaml
k8s/index/job/correction/networkpolicy.yaml
k8s/index/job/creation/configmap.yaml
k8s/index/job/creation/cronjob.yaml
k8s/index/job/creation/networkpolicy.yaml
k8s/index/job/readreplica/rotate/clusterrole.yaml
k8s/index/job/readreplica/rotate/clusterrolebinding.yaml
k8s/index/job/readreplica/rotate/configmap.yaml
k8s/index/job/readreplica/rotate/networkpolicy.yaml
k8s/index/job/readreplica/rotate/serviceaccount.yaml
k8s/index/job/save/configmap.yaml
k8s/index/job/save/cronjob.yaml
k8s/index/job/save/networkpolicy.yaml
k8s/index/operator/configmap.yaml
k8s/index/operator/deployment.yaml
k8s/index/operator/priorityclass.yaml
k8s/manager/index/configmap.yaml
k8s/manager/index/daemonset.yaml
k8s/manager/index/deployment.yaml
k8s/manager/index/networkpolicy.yaml
k8s/manager/index/pdb.yaml
k8s/manager/index/priorityclass.yaml
k8s/manager/index/svc.yaml
Expand Down Expand Up @@ -1540,12 +1491,6 @@ k8s/operator/helm/operator.yaml
k8s/operator/helm/serviceaccount.yaml
k8s/operator/helm/svc.yaml
k8s/readreplica/configmap.yaml
k8s/readreplica/deployment.yaml
k8s/readreplica/hpa.yaml
k8s/readreplica/networkpolicy.yaml
k8s/readreplica/pvc.yaml
k8s/readreplica/snapshot.yaml
k8s/readreplica/svc.yaml
k8s/tools/benchmark/job/clusterrole.yaml
k8s/tools/benchmark/job/clusterrolebinding.yaml
k8s/tools/benchmark/job/serviceaccount.yaml
Expand Down Expand Up @@ -1960,29 +1905,21 @@ rust/libs/ngt-rs/src/lib.rs
rust/libs/ngt/Cargo.toml
rust/libs/ngt/src/lib.rs
rust/libs/proto/Cargo.toml
rust/libs/proto/src/core.v1.rs
rust/libs/proto/src/core.v1.tonic.rs
rust/libs/proto/src/discoverer.v1.rs
rust/libs/proto/src/discoverer.v1.tonic.rs
rust/libs/proto/src/filter.egress.v1.rs
rust/libs/proto/src/filter.egress.v1.tonic.rs
rust/libs/proto/src/filter.ingress.v1.rs
rust/libs/proto/src/filter.ingress.v1.tonic.rs
rust/libs/proto/src/lib.rs
rust/libs/proto/src/mirror.v1.rs
rust/libs/proto/src/mirror.v1.tonic.rs
rust/libs/proto/src/payload.v1.rs
rust/libs/proto/src/rpc.v1.rs
rust/libs/proto/src/sidecar.v1.rs
rust/libs/proto/src/sidecar.v1.tonic.rs
rust/libs/proto/src/vald.v1.rs
rust/libs/proto/src/vald.v1.tonic.rs
rust/rust-toolchain
rust/rust-toolchain.toml
tests/chaos/chart/.helmignore
tests/chaos/chart/Chart.yaml
tests/chaos/chart/README.md
tests/chaos/chart/templates/NOTES.txt
tests/chaos/chart/templates/_helpers.tpl
tests/chaos/chart/templates/network/bandwidth.yaml
tests/chaos/chart/templates/network/partition.yaml
Expand Down
2 changes: 1 addition & 1 deletion Makefile.d/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ifeq ($(REMOTE),true)
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg RUST_VERSION=$(RUST_VERSION) \
--build-arg MAINTAINER=$(MAINTAINER) \
--attest type=sbom,generator=docker/buildkit-syft-scanner:edge \
--attest type=sbom,generator=ghcr.io/vdaas/vald/vald-buildkit-syft-scanner:nightly \
--provenance=mode=max \
-t $(CRORG)/$(IMAGE):$(TAG) \
-t $(GHCRORG)/$(IMAGE):$(TAG) \
Expand Down
15 changes: 3 additions & 12 deletions dockers/agent/core/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
#

# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go

ARG UPX_OPTIONS=-9
# skipcq: DOK-DL3026,DOK-DL3007
FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder
ARG MAINTAINER="vdaas.org vald team <[email protected]>"
LABEL maintainer="${MAINTAINER}"

LABEL maintainer="vdaas.org vald team <[email protected]>"
# skipcq: DOK-DL3002
USER root:root

ARG TARGETARCH
ARG TARGETOS
ARG GO_VERSION
Expand All @@ -46,7 +42,6 @@ ENV USER=root
ENV RUSTUP_HOME=${RUST_HOME}/rustup
ENV CARGO_HOME=${RUST_HOME}/cargo
ENV PATH=${CARGO_HOME}/bin:${RUSTUP_HOME}/bin:/usr/local/bin:${PATH}

WORKDIR ${HOME}/rust/src/github.com/${ORG}/${REPO}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
#skipcq: DOK-W1001, DOK-SC2046, DOK-SC2086, DOK-DL3008
Expand Down Expand Up @@ -92,12 +87,8 @@ RUN --mount=type=bind,target=.,rw \
&& rm -rf rust/target
# skipcq: DOK-DL3026,DOK-DL3007
FROM gcr.io/distroless/cc-debian12:nonroot
ARG MAINTAINER="vdaas.org vald team <[email protected]>"
LABEL maintainer="${MAINTAINER}"

ENV APP_NAME=agent

COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME}
LABEL maintainer="vdaas.org vald team <[email protected]>"
COPY --from=builder /usr/bin/agent /usr/bin/agent
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/agent"]
15 changes: 3 additions & 12 deletions dockers/agent/core/faiss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
#

# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go

ARG UPX_OPTIONS=-9
# skipcq: DOK-DL3026,DOK-DL3007
FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder
ARG MAINTAINER="vdaas.org vald team <[email protected]>"
LABEL maintainer="${MAINTAINER}"

LABEL maintainer="vdaas.org vald team <[email protected]>"
# skipcq: DOK-DL3002
USER root:root

ARG TARGETARCH
ARG TARGETOS
ARG GO_VERSION
Expand All @@ -46,7 +42,6 @@ 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
Expand Down Expand Up @@ -93,12 +88,8 @@ RUN --mount=type=bind,target=.,rw \
&& mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}"
# skipcq: DOK-DL3026,DOK-DL3007
FROM gcr.io/distroless/static:nonroot
ARG MAINTAINER="vdaas.org vald team <[email protected]>"
LABEL maintainer="${MAINTAINER}"

ENV APP_NAME=faiss

COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME}
LABEL maintainer="vdaas.org vald team <[email protected]>"
COPY --from=builder /usr/bin/faiss /usr/bin/faiss
COPY cmd/agent/core/faiss/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
Expand Down
15 changes: 3 additions & 12 deletions dockers/agent/core/ngt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
#

# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go

ARG UPX_OPTIONS=-9
# skipcq: DOK-DL3026,DOK-DL3007
FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder
ARG MAINTAINER="vdaas.org vald team <[email protected]>"
LABEL maintainer="${MAINTAINER}"

LABEL maintainer="vdaas.org vald team <[email protected]>"
# skipcq: DOK-DL3002
USER root:root

ARG TARGETARCH
ARG TARGETOS
ARG GO_VERSION
Expand All @@ -46,7 +42,6 @@ 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
Expand Down Expand Up @@ -92,12 +87,8 @@ RUN --mount=type=bind,target=.,rw \
&& mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}"
# skipcq: DOK-DL3026,DOK-DL3007
FROM gcr.io/distroless/static:nonroot
ARG MAINTAINER="vdaas.org vald team <[email protected]>"
LABEL maintainer="${MAINTAINER}"

ENV APP_NAME=ngt

COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME}
LABEL maintainer="vdaas.org vald team <[email protected]>"
COPY --from=builder /usr/bin/ngt /usr/bin/ngt
COPY cmd/agent/core/ngt/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
Expand Down
15 changes: 3 additions & 12 deletions dockers/agent/sidecar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
#

# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go

ARG UPX_OPTIONS=-9
# skipcq: DOK-DL3026,DOK-DL3007
FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder
ARG MAINTAINER="vdaas.org vald team <[email protected]>"
LABEL maintainer="${MAINTAINER}"

LABEL maintainer="vdaas.org vald team <[email protected]>"
# skipcq: DOK-DL3002
USER root:root

ARG TARGETARCH
ARG TARGETOS
ARG GO_VERSION
Expand All @@ -46,7 +42,6 @@ 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
Expand Down Expand Up @@ -83,12 +78,8 @@ RUN --mount=type=bind,target=.,rw \
&& mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}"
# skipcq: DOK-DL3026,DOK-DL3007
FROM gcr.io/distroless/static:nonroot
ARG MAINTAINER="vdaas.org vald team <[email protected]>"
LABEL maintainer="${MAINTAINER}"

ENV APP_NAME=sidecar

COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME}
LABEL maintainer="vdaas.org vald team <[email protected]>"
COPY --from=builder /usr/bin/sidecar /usr/bin/sidecar
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/sidecar"]
1 change: 1 addition & 0 deletions dockers/binfmt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
# limitations under the License.
#

# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go
FROM tonistiigi/binfmt:master AS builder
1 change: 1 addition & 0 deletions dockers/buildbase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
# limitations under the License.
#

# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go
FROM ubuntu:devel AS builder
1 change: 1 addition & 0 deletions dockers/buildkit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
# limitations under the License.
#

# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go
FROM moby/buildkit:master AS builder
1 change: 1 addition & 0 deletions dockers/buildkit/syft/scanner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
# limitations under the License.
#

# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go
FROM docker/buildkit-syft-scanner:edge AS scanner
7 changes: 1 addition & 6 deletions dockers/ci/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
#

# DO_NOT_EDIT this Dockerfile is generated by hack/docker/gen/main.go

ARG UPX_OPTIONS=-9
# skipcq: DOK-DL3026,DOK-DL3007
FROM ghcr.io/vdaas/vald/vald-buildbase:nightly
ARG MAINTAINER="vdaas.org vald team <[email protected]>"
LABEL maintainer="${MAINTAINER}"

LABEL maintainer="vdaas.org vald team <[email protected]>"
# skipcq: DOK-DL3002
USER root:root

ARG TARGETARCH
ARG TARGETOS
ARG GO_VERSION
Expand All @@ -51,7 +47,6 @@ ENV USER=root
ENV RUSTUP_HOME=${RUST_HOME}/rustup
ENV CARGO_HOME=${RUST_HOME}/cargo
ENV PATH=${CARGO_HOME}/bin:${GOPATH}/bin:${GOROOT}/bin:${RUSTUP_HOME}/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
Expand Down
Loading

0 comments on commit 941ab25

Please sign in to comment.