Skip to content

Commit 0573d7d

Browse files
authored
Release resources (#10)
Signed-off-by: SequeI <[email protected]>
1 parent dd5e1a3 commit 0573d7d

10 files changed

+69
-18
lines changed

.github/workflows/test-e2e.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [ "main" ]
88

9+
env:
10+
MODEL_TRANSPARENCY_IMG: quay.io/securesign/model-transparency@sha256:3c870f9fe54b8c1ad625f7bc54420c8af2d877045d327598bea32e33edd9ee11
11+
912
permissions:
1013
contents: read
1114

@@ -34,6 +37,9 @@ jobs:
3437
kubectl wait --for=condition=Ready --namespace=kube-system pod --all --timeout=300s
3538
echo "Cluster is ready"
3639
40+
- name: Swap to dev images
41+
run: make dev-images
42+
3743
- name: Run E2E tests
3844
run: |
39-
make test-e2e-ci
45+
make test-e2e-ci MODEL_TRANSPARENCY_IMG=${{ env.MODEL_TRANSPARENCY_IMG }}

.tekton/model-validation-operator-bundle-pull-request.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,26 @@ spec:
2828
value: 5d
2929
- name: dockerfile
3030
value: bundle.Dockerfile.model-validation.rh
31+
- name: path-context
32+
value: .
3133
- name: hermetic
3234
value: "true"
3335
- name: prefetch-input
3436
value: '{"type": "generic", "path": "."}'
3537
- name: build-source-image
3638
value: "true"
39+
- name: manager-pipelinerun-selector
40+
value: appstudio.openshift.io/application=model-validation-operator,appstudio.openshift.io/component=model-validation-operator,pipelinesascode.tekton.dev/sha={{revision}},pipelinesascode.tekton.dev/event-type=pull_request
41+
- name: manager-registry-url
42+
value: registry.redhat.io/rhtas/model-validation-rhel9-operator
3743
pipelineRef:
3844
params:
3945
- name: url
4046
value: https://github.com/securesign/pipelines.git
4147
- name: revision
4248
value: main
4349
- name: pathInRepo
44-
value: pipelines/docker-build-oci-ta.yaml
50+
value: pipelines/bundle-build-oci-ta.yaml
4551
resolver: git
4652
taskRunTemplate:
4753
serviceAccountName: build-pipeline-model-validation-operator-bundle

.tekton/model-validation-operator-bundle-push.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,18 @@ spec:
3131
value: '{"type": "generic", "path": "."}'
3232
- name: build-source-image
3333
value: "true"
34+
- name: manager-pipelinerun-selector
35+
value: appstudio.openshift.io/application=model-validation-operator,appstudio.openshift.io/component=model-validation-operator,pipelinesascode.tekton.dev/sha={{revision}},pipelinesascode.tekton.dev/event-type=push
36+
- name: manager-registry-url
37+
value: registry.redhat.io/rhtas/model-validation-rhel9-operator
3438
pipelineRef:
3539
params:
3640
- name: url
3741
value: https://github.com/securesign/pipelines.git
3842
- name: revision
3943
value: main
4044
- name: pathInRepo
41-
value: pipelines/docker-build-oci-ta.yaml
45+
value: pipelines/bundle-build-oci-ta.yaml
4246
resolver: git
4347
taskRunTemplate:
4448
serviceAccountName: build-pipeline-model-validation-operator-bundle

.tekton/model-validation-operator-pull-request.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ spec:
2828
value: 5d
2929
- name: dockerfile
3030
value: Dockerfile
31+
- name: path-context
32+
value: .
33+
- name: build-platforms
34+
value:
35+
- linux/x86_64
3136
- name: hermetic
3237
value: "true"
3338
- name: build-source-image
@@ -41,7 +46,7 @@ spec:
4146
- name: revision
4247
value: main
4348
- name: pathInRepo
44-
value: pipelines/docker-build-oci-ta.yaml
49+
value: pipelines/docker-build-multi-platform-oci-ta.yaml
4550
resolver: git
4651
taskRunTemplate:
4752
serviceAccountName: build-pipeline-model-validation-operator

.tekton/model-validation-operator-push.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ spec:
2525
value: quay.io/securesign/model-validation-operator:{{revision}}
2626
- name: dockerfile
2727
value: Dockerfile
28+
- name: path-context
29+
value: .
30+
- name: build-platforms
31+
value:
32+
- linux/x86_64
2833
- name: hermetic
2934
value: "true"
3035
- name: build-source-image
@@ -38,7 +43,7 @@ spec:
3843
- name: revision
3944
value: main
4045
- name: pathInRepo
41-
value: pipelines/docker-build-oci-ta.yaml
46+
value: pipelines/docker-build-multi-platform-oci-ta.yaml
4247
resolver: git
4348
taskRunTemplate:
4449
serviceAccountName: build-pipeline-model-validation-operator

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ help: ## Display this help.
9999

100100
##@ Development
101101

102+
# Switch images from `registry.redhat.io` images to the dev images
103+
.PHONY: dev-images
104+
dev-images:
105+
sed -E -i 's#registry.redhat.io/rhtas/model-transparency-rhel9#quay.io/securesign/model-transparency#g' \
106+
internal/constants/images.go
107+
102108
.PHONY: manifests
103109
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
104110
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
@@ -453,9 +459,9 @@ e2e-sign-test-model: e2e-generate-test-keys
453459
$(CONTAINER_TOOL) run --rm \
454460
-v $(PWD)/testdata/tensorflow_saved_model:/model \
455461
-v $(PWD)/testdata/docker/test_private_key.priv:/test_private_key.priv \
456-
--entrypoint="" \
457-
ghcr.io/sigstore/model-transparency-cli:v1.0.1 \
458-
/usr/local/bin/model_signing sign key /model \
462+
--entrypoint "" \
463+
$(MODEL_TRANSPARENCY_IMG) \
464+
model_signing sign key /model \
459465
--private_key /test_private_key.priv \
460466
--signature /model/model.sig
461467

@@ -490,8 +496,6 @@ e2e-load-images: e2e-build-image e2e-build-test-model
490496
$(CONTAINER_TOOL) pull $(MODEL_TRANSPARENCY_IMG)
491497
@echo "Loading manager image into Kind cluster..."
492498
$(KIND) load docker-image -n $(KIND_CLUSTER) $(IMG)
493-
@echo "Loading model-transparency-cli image into Kind cluster..."
494-
$(KIND) load docker-image -n $(KIND_CLUSTER) $(MODEL_TRANSPARENCY_IMG)
495499
@echo "Loading test model image into Kind cluster..."
496500
$(KIND) load docker-image -n $(KIND_CLUSTER) $(E2E_TEST_MODEL)
497501

config/manifests/bases/model-validation-operator.clusterserviceversion.yaml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,27 @@ metadata:
44
annotations:
55
alm-examples: '[]'
66
capabilities: Basic Install
7-
name: model-validation-operator.v0.0.0
7+
containerImage: placeholder
8+
features.operators.openshift.io/cnf: "false"
9+
features.operators.openshift.io/cni: "false"
10+
features.operators.openshift.io/csi: "false"
11+
features.operators.openshift.io/disconnected: "false"
12+
features.operators.openshift.io/fips-compliant: "false"
13+
features.operators.openshift.io/proxy-aware: "false"
14+
features.operators.openshift.io/tls-profiles: "false"
15+
features.operators.openshift.io/token-auth-aws: "false"
16+
features.operators.openshift.io/token-auth-azure: "false"
17+
features.operators.openshift.io/token-auth-gcp: "false"
18+
operators.openshift.io/valid-subscription: '["Red Hat Trusted Artifact Signer"]'
19+
repository: https://github.com/securesign/model-validation-operator
20+
support: Red Hat
21+
name: model-validation-operator.v0.0.1
822
namespace: placeholder
923
spec:
1024
apiservicedefinitions: {}
1125
customresourcedefinitions:
1226
owned:
13-
- description: ModelValidation is the Schema for the modelvalidations API
27+
- description: ModelValidation is the Schema for the modelvalidations API.
1428
displayName: Model Validation
1529
kind: ModelValidation
1630
name: modelvalidations.ml.sigstore.dev
@@ -47,8 +61,12 @@ spec:
4761
name: Rachel Yordan
4862
4963
name: Ivan Font
50-
maturity: alpha
64+
65+
name: Aleksy Siek
66+
67+
name: Kevin Conner
68+
maturity: tech-preview
5169
minKubeVersion: 1.24.0
5270
provider:
53-
name: Sigstore
54-
version: 0.0.0
71+
name: Red Hat
72+
version: 0.0.1-techpreview

internal/constants/images.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ const (
2323
var (
2424
// ModelTransparencyCliImage is the default image for the model transparency CLI
2525
// used as an init container to validate model signatures
26-
ModelTransparencyCliImage = "ghcr.io/sigstore/model-transparency-cli:v1.0.1"
26+
ModelTransparencyCliImage = "registry.redhat.io/rhtas/model-transparency-rhel9@" +
27+
"sha256:3c870f9fe54b8c1ad625f7bc54420c8af2d877045d327598bea32e33edd9ee11"
2728
)

internal/webhooks/pod_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (p *podInterceptor) Handle(ctx context.Context, req admission.Request) admi
121121
Name: constants.ModelValidationInitContainerName,
122122
ImagePullPolicy: corev1.PullAlways,
123123
Image: constants.ModelTransparencyCliImage,
124-
Command: []string{"/usr/local/bin/model_signing"},
124+
Command: []string{"model_signing"},
125125
Args: args,
126126
VolumeMounts: vm,
127127
})

test/e2e/testdata/model-data-daemonset.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ spec:
2626
mkdir -p /host-data /host-keys
2727
cp -r /data/* /host-data/
2828
cp -r /keys/* /host-keys/
29+
find /host-data /host-keys -type d -exec chmod 755 {} +
30+
find /host-data /host-keys -type f -exec chmod 644 {} +
2931
echo "Model data setup complete on node $NODE_NAME"
3032
# Keep running so DaemonSet stays active
3133
sleep infinity
@@ -53,4 +55,4 @@ spec:
5355
type: DirectoryOrCreate
5456
tolerations:
5557
- operator: Exists
56-
effect: NoSchedule
58+
effect: NoSchedule

0 commit comments

Comments
 (0)