Skip to content

Commit 8e01421

Browse files
authored
Merge pull request #35 from bouskaJ/cleanup
chore: repo migration cleanup
2 parents 4d110f2 + 75f916b commit 8e01421

File tree

15 files changed

+80
-63
lines changed

15 files changed

+80
-63
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
/vendor/
2+
3+
/bin
4+
5+
# editor and IDE paraphernalia
6+
.idea
7+
.vscode
8+
*.swp
9+
*.swo
10+
*~
11+
.DS_Store
12+
*.iml

Containerfile

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
1-
# Use the official Golang image as a base
2-
FROM golang:1.23
1+
# Build the manager binary
2+
FROM golang:1.23 AS builder
3+
ARG TARGETOS
4+
ARG TARGETARCH
35

4-
# Set the working directory
5-
WORKDIR /app
6+
WORKDIR /workspace
7+
# Copy the Go Modules manifests
8+
COPY go.mod go.mod
9+
COPY go.sum go.sum
10+
# cache deps before building and copying source so that we don't need to re-download as much
11+
# and so that source changes don't invalidate our downloaded layer
12+
RUN go mod download
613

7-
# Copy all files
8-
COPY . .
14+
# Copy the go source
15+
COPY cmd/main.go cmd/main.go
16+
COPY api/ api/
17+
COPY internal/ internal/
918

10-
# Download dependencies
11-
RUN go mod download && go mod verify
19+
# Build
20+
# the GOARCH has not a default value to allow the binary be built according to the host where the command
21+
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
22+
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
23+
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
24+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
1225

13-
# Build the application
14-
RUN CGO_ENABLED=0 go build -v -o app .
26+
# Use distroless as minimal base image to package the manager binary
27+
# Refer to https://github.com/GoogleContainerTools/distroless for more details
28+
FROM gcr.io/distroless/static:nonroot
29+
WORKDIR /
30+
COPY --from=builder /workspace/manager .
31+
USER 65532:65532
1532

16-
FROM scratch
17-
COPY --from=0 /app/app /app
18-
EXPOSE 8080
19-
CMD ["/app"]
33+
ENTRYPOINT ["/manager"]

Dockerfile

Lines changed: 0 additions & 33 deletions
This file was deleted.

PROJECT

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ plugins:
99
manifests.sdk.operatorframework.io/v2: {}
1010
scorecard.sdk.operatorframework.io/v2: {}
1111
projectName: sdk-init
12-
repo: github.com/miyunari/model-validation-controller
12+
repo: github.com/sigstore/model-validation-operator
1313
resources:
1414
- api:
1515
crdVersion: v1
1616
namespaced: true
1717
domain: sigstore.dev
1818
group: ml
1919
kind: ModelValidation
20-
path: github.com/miyunari/model-validation-controller/api/v1alpha1
20+
path: github.com/sigstore/model-validation-controller/api/v1alpha1
2121
version: v1alpha1
2222
version: "3"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ This project is a proof of concept based on the [sigstore/model-transperency-cli
1919

2020
The controller can be installed in the `model-validation-controller` namespace via [kustomize](https://kustomize.io/).
2121
```bash
22-
kubectl apply -k https://raw.githubusercontent.com/miyunari/model-validation-controller/main/manifests
22+
kubectl apply -k https://raw.githubusercontent.com/sigstore/model-validation-operator/main/manifests
2323
# or local
2424
kubectl apply -k manifests
2525
```
2626

2727
Run delete to uninstall the controller.
2828
```bash
29-
kubectl delete -k https://raw.githubusercontent.com/miyunari/model-validation-controller/main/manifests
29+
kubectl delete -k https://raw.githubusercontent.com/sigstore/model-validation-operator/main/manifests
3030
# or local
3131
kubectl delete -k manifests
3232
```
@@ -84,7 +84,7 @@ metadata:
8484
spec:
8585
config:
8686
sigstoreConfig:
87-
certificateIdentity: "https://github.com/miyunari/model-validation-controller/.github/workflows/sign-model.yaml@refs/tags/v0.0.2"
87+
certificateIdentity: "https://github.com/sigstore/model-validation-operator/.github/workflows/sign-model.yaml@refs/tags/v0.0.2"
8888
certificateOidcIssuer: "https://token.actions.githubusercontent.com"
8989
model:
9090
path: /data/tensorflow_saved_model
@@ -123,13 +123,13 @@ The example folder contains two files `prepare.yaml` and `signed.yaml`.
123123

124124
- prepare: contains a persistent volume claim and a job that downloads a signed test model.
125125
```bash
126-
kubectl apply -f https://raw.githubusercontent.com/miyunari/model-validation-controller/main/examples/prepare.yaml
126+
kubectl apply -f https://raw.githubusercontent.com/sigstore/model-validation-operator/main/examples/prepare.yaml
127127
# or local
128128
kubectl apply -f examples/prepare.yaml
129129
```
130130
- signed: contains a model validation manifest for the validation of this model and a demo pod, which is provided with the appropriate label for validation.
131131
```bash
132-
kubectl apply -f https://raw.githubusercontent.com/miyunari/model-validation-controller/main/examples/verify.yaml
132+
kubectl apply -f https://raw.githubusercontent.com/sigstore/model-validation-operator/main/examples/verify.yaml
133133
# or local
134134
kubectl apply -f examples/verify.yaml
135135
```

bin/controller-gen

Lines changed: 0 additions & 1 deletion
This file was deleted.

bin/controller-gen-v0.16.1

-23.4 MB
Binary file not shown.

cmd/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ import (
2121
"flag"
2222
"os"
2323

24+
"github.com/sigstore/model-validation-controller/internal/constants"
25+
"github.com/sigstore/model-validation-controller/internal/utils"
26+
2427
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
2528
// to ensure that exec-entrypoint and run can make use of them.
2629
_ "k8s.io/client-go/plugin/pkg/client/auth"
2730

28-
"github.com/miyunari/model-validation-controller/internal/webhooks"
31+
"github.com/sigstore/model-validation-controller/internal/webhooks"
2932
"k8s.io/apimachinery/pkg/runtime"
3033
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
3134
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
@@ -37,7 +40,7 @@ import (
3740
"sigs.k8s.io/controller-runtime/pkg/webhook"
3841
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
3942

40-
mlv1alpha1 "github.com/miyunari/model-validation-controller/api/v1alpha1"
43+
mlv1alpha1 "github.com/sigstore/model-validation-controller/api/v1alpha1"
4144
// +kubebuilder:scaffold:imports
4245
)
4346

@@ -70,6 +73,7 @@ func main() {
7073
"If set, the metrics endpoint is served securely via HTTPS. Use --metrics-secure=false to use HTTP instead.")
7174
flag.BoolVar(&enableHTTP2, "enable-http2", false,
7275
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
76+
utils.StringFlagOrEnv(&constants.ModelTransparencyCliImage, "model-transparency-cli-image", "MODEL_TRANSPARENCY_CLI_IMAGE", constants.ModelTransparencyCliImage, "Model transparency CLI image to be used.")
7377
opts := zap.Options{
7478
Development: true,
7579
}

examples/prepare.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
- /bin/sh
2525
- -c
2626
- |
27-
wget -O /data/tensorflow_saved_model.tar.gz https://github.com/miyunari/model-validation-controller/releases/download/v0.0.1/signed_model.tar.gz
27+
wget -O /data/tensorflow_saved_model.tar.gz https://github.com/sigstore/model-validation-operator/releases/download/v0.0.1/signed_model.tar.gz
2828
tar -xzvf /data/tensorflow_saved_model.tar.gz -C /data
2929
rm /data/tensorflow_saved_model.tar.gz
3030
volumeMounts:

examples/verify.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
# privateKeyConfig:
1313
# keyPath: /root/pub.key
1414
sigstoreConfig:
15-
certificateIdentity: "https://github.com/miyunari/model-validation-controller/.github/workflows/sign-model.yaml@refs/tags/v0.0.2"
15+
certificateIdentity: "https://github.com/sigstore/model-validation-operator/.github/workflows/sign-model.yaml@refs/tags/v0.0.2"
1616
certificateOidcIssuer: "https://token.actions.githubusercontent.com"
1717
model:
1818
path: /data

0 commit comments

Comments
 (0)