Skip to content
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

RedHat Community Operator #1519

Merged
merged 42 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0750280
initial redhat updates to generate resources at startup
ukclivecox Mar 2, 2020
e2620b7
Merge branch 'master' into 1477_redhat
ukclivecox Mar 3, 2020
97f634a
update kustomize and helm with lite version
ukclivecox Mar 3, 2020
67210e8
update generated folder creation
ukclivecox Mar 3, 2020
9d5af0f
Add watch namespace
ukclivecox Mar 4, 2020
06e640c
rerun mutate on reconcile and add owner refs
ukclivecox Mar 4, 2020
4f46b7b
initial open operator folder
ukclivecox Mar 4, 2020
8cbb065
finish initial commit
ukclivecox Mar 8, 2020
5e0c78d
further tests
ukclivecox Mar 8, 2020
6da2682
Add Redhat Dockerfiles for operator and executor
ukclivecox Mar 9, 2020
68664d8
rebase
ukclivecox Mar 9, 2020
3b34e38
engine redhat docker files
ukclivecox Mar 10, 2020
1fd2c71
Add initial redhat certification steps for operator and scafollding f…
ukclivecox Mar 10, 2020
3ff6eba
rebase
ukclivecox Mar 11, 2020
9530492
update to add ownership to crd
ukclivecox Mar 11, 2020
c9c5b47
testing for new crd ownership
ukclivecox Mar 11, 2020
49ed5fb
update to 1.1.0-SNAPSHOT
ukclivecox Mar 11, 2020
836cdd3
add related images for engine and executor
ukclivecox Mar 13, 2020
b3a3871
Add related images
ukclivecox Mar 13, 2020
516b957
Merge branch 'master' into 1477_redhat
ukclivecox Mar 17, 2020
82d6cd6
start README
ukclivecox Mar 17, 2020
eb4911b
rebase
ukclivecox Mar 17, 2020
7ffacf4
rebase
ukclivecox Mar 17, 2020
eb9533e
update docs for testing
ukclivecox Mar 18, 2020
0b5133a
Update release process
ukclivecox Mar 18, 2020
3df4a0d
rebase
ukclivecox Mar 24, 2020
fbfffe7
rebase and get tests working again
ukclivecox Apr 7, 2020
d61b5f8
openshift updates from testing - gateway in istio-system, no user id …
ukclivecox Apr 10, 2020
3b6b2e6
lint
ukclivecox Apr 10, 2020
ff1a3bd
Fix istio tests - only need to install gateway once in istio-system
ukclivecox Apr 11, 2020
f7e27f2
Fix mlflow server permission issue when running with non root user
ukclivecox Apr 11, 2020
c70eac8
increase flake retries for rolling updates test
ukclivecox Apr 11, 2020
1450842
fix e2e tests s2i version
ukclivecox Apr 11, 2020
1d4a015
lint
ukclivecox Apr 11, 2020
794afa6
Update linter
ukclivecox Apr 12, 2020
6222c77
updates from review
ukclivecox Apr 12, 2020
ba85b4b
add missing test resources
ukclivecox Apr 12, 2020
70dc811
fix flakiness of rolling updates notebook running as test
ukclivecox Apr 12, 2020
7b12aa3
update alibiexplainer image to handle running as non root user id
ukclivecox Apr 12, 2020
52b2eca
Add new env for DEFAULT_USER_ID to allow user if to be defaulted for …
ukclivecox Apr 13, 2020
9818538
lint
ukclivecox Apr 13, 2020
bc05a94
revert to label v0.5 due to helm upgrade issues
ukclivecox Apr 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ repos:
rev: stable
hooks:
- id: black
args: ['python/', 'testing/', '--exclude', '(testing/scripts/proto|seldon_core/proto/|.eggs)']
args: ['python/', 'testing/', 'operator/helm', 'operator/seldon-operator/hack', '--exclude', '(testing/scripts/proto|seldon_core/proto/|.eggs)']
language_version: python3.6
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ run_core_builder_in_host:
-v /var/run/docker.sock:/var/run/docker.sock \
-v $${HOME}/.m2:/root/.m2 \
-v $(SELDON_CORE_LOCAL_DIR):/work \
seldonio/core-builder:0.13 bash
seldonio/core-builder:0.14 bash


run_core_builder_in_minikube:
Expand All @@ -37,7 +37,7 @@ run_core_builder_in_minikube:
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/docker/.m2:/root/.m2 \
-v $(SELDON_CORE_VM_DIR):/work \
seldonio/core-builder:0.13 bash
seldonio/core-builder:0.14 bash

show_paths:
@echo "local: $(SELDON_CORE_LOCAL_DIR)"
Expand Down
3 changes: 3 additions & 0 deletions core-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ ENV PATH="${PATH}:/root/go/bin"
COPY dev_requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt

# Ginkgo
RUN go get -u github.com/onsi/ginkgo/ginkgo

WORKDIR /work

# Define default command.
Expand Down
5 changes: 0 additions & 5 deletions engine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ RUN mvn clean verify -Dlicense.useMissingFile -B

FROM openjdk:11.0.5-jre-slim

RUN \
apt-get update -y && \
apt-get remove -y --auto-remove && \
apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=builder /workspace/target/seldon-engine-*.jar app.jar
COPY --from=builder /workspace/target/generated-resources /licenses/

Expand Down
26 changes: 26 additions & 0 deletions engine/Dockerfile.redhat
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM maven:3.6.3-jdk-11 as builder

WORKDIR /workspace

COPY pom.xml pom.xml
COPY src/ src/

# Build
RUN mvn clean verify -Dlicense.useMissingFile -B

FROM registry.access.redhat.com/ubi8/ubi

RUN yum install -y java-11-openjdk.x86_64

LABEL name="Seldon Engine" \
vendor="Seldon Technologies" \
version="v1.1.0" \
release="1" \
summary="The Seldon Engine that is deployed for each model to handle the data flow of each ML computational graph." \
description="The Seldon Engine that is deployed for each model to handle the data flow of each ML computational graph."

COPY --from=builder /workspace/target/seldon-engine-*.jar app.jar
COPY --from=builder /workspace/target/generated-resources /licenses/

ENTRYPOINT [ "sh", "-c", "java -Djava.security.egd=file:/dev/./urandom $JAVA_OPTS -jar app.jar" ]

25 changes: 13 additions & 12 deletions engine/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
IMAGE_NAME=engine
VERSION := $(shell cat ../version.txt)
IMG ?= seldonio/engine:$(VERSION)
IMG_REDHAT ?= seldonio/engine-ubi8:$(VERSION)

version:
echo ${VERSION}
Expand All @@ -8,10 +9,13 @@ build_jar: update_proto update_swagger
mvn clean verify -Dlicense.useMissingFile -B

build_image: update_proto update_swagger
docker build -f Dockerfile -t seldonio/$(IMAGE_NAME):$(VERSION) .
docker build -f Dockerfile -t ${IMG} .

build_image_redhat: update_proto update_swagger
docker build -f Dockerfile.redhat -t ${IMG_REDHAT} .

push_to_registry:
docker push seldonio/$(IMAGE_NAME):$(VERSION)
docker push ${IMG}

clean:
@mvn clean
Expand All @@ -22,15 +26,6 @@ cache_dependencies:
mvn -Dmaven.repo.local=./.m2 dependency:resolve
mvn -Dmaven.repo.local=./.m2 verify

engine.json: engine.json.in Makefile
@cat engine.json.in | sed \
-e "s|%ENGINE_IMAGE_VERSION%|$(ENGINE_IMAGE_VERSION)|" > $@ && echo "created $@"

start_engine: engine.json
kubectl create -f engine.json
stop_engine: engine.json
kubectl delete --ignore-not-found=true -f engine.json

download_protos_k8s:
cd ../proto/k8s ; make create_protos

Expand All @@ -56,3 +51,9 @@ dependencies: update_proto
cd target/site && aws s3 cp dependencies.html s3://seldon-core-docs/master/engine/dependencies/dependencies.html --acl public-read
cd target/site && aws s3 cp css s3://seldon-core-docs/master/engine/dependencies/css --recursive --acl public-read
cd target/site && aws s3 cp images s3://seldon-core-docs/master/engine/dependencies/images --recursive --acl public-read

kind-image-install: build_image
kind load -v 3 docker-image ${IMG}

kind-image-install-redhat: build_image_redhat
kind load -v 3 docker-image ${IMG_REDHAT}
2 changes: 1 addition & 1 deletion engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
</parent>
<groupId>io.seldon.engine</groupId>
<artifactId>seldon-engine</artifactId>
<version>1.0.3-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>engine</name>
<url>http://maven.apache.org</url>
Expand Down
34 changes: 34 additions & 0 deletions executor/Dockerfile.redhat
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Build the manager binary
FROM golang:1.13 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
COPY proto/ proto/
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY predictor/ predictor/
COPY logger/ logger/
COPY k8s/ k8s/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o executor main.go

FROM registry.access.redhat.com/ubi8/ubi-minimal
LABEL name="Seldon Executor" \
vendor="Seldon Technologies" \
version="v1.1.0" \
release="1" \
summary="The service orchestrator for Seldon Core" \
description="The service orchestrator for Seldon Core which manages the request/response flow through the Seldon Core inference graphs deployed via the Seldon Core Operator as SeldonDeployments custom resources"

WORKDIR /
COPY --from=builder /workspace/executor .
COPY licenses/license.txt .
ENTRYPOINT ["/executor"]
22 changes: 21 additions & 1 deletion executor/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
VERSION := $(shell cat ../version.txt)
# Image URL to use all building/pushing image targets
IMG ?= seldonio/seldon-core-executor:${VERSION}
IMAGE_NAME_BASE=seldon-core-executor
IMG ?= seldonio/${IMAGE_NAME_BASE}:${VERSION}
IMG_VERSION_REDHAT ?= ${IMAGE_NAME_BASE}-ubi8:${VERSION}
IMG_REDHAT ?= seldonio/${IMG_VERSION_REDHAT}

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -57,14 +60,31 @@ test: fmt vet
docker-build: test
docker build -f Dockerfile -t ${IMG} .

# Build the docker image for Redhat
docker-build-redhat: test
docker build . -f Dockerfile.redhat -t ${IMG_REDHAT}

# Push the docker image
docker-push:
docker push ${IMG}

# Push the docker image
docker-push-redhat:
docker push ${IMG_REDHAT}

# password can be found at: https://connect.redhat.com/project/1074021/view
axsaucedo marked this conversation as resolved.
Show resolved Hide resolved
# TODO update to correct project
#redhat-image-scan:
# docker login -u unused scan.connect.redhat.com
# docker tag ${IMG_REDHAT} scan.connect.redhat.com/ospid-82f819a9-f40d-4d59-b67c-136491f22cfb/${IMG_VERSION_REDHAT}
# docker push scan.connect.redhat.com/ospid-82f819a9-f40d-4d59-b67c-136491f22cfb/${IMG_VERSION_REDHAT}

kind-image-install: docker-build
kind load -v 3 docker-image ${IMG}

kind-image-install-redhat: docker-build-redhat
kind load -v 3 docker-image ${IMG_REDHAT}


.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/seldon-core-analytics/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ keywords:
name: seldon-core-analytics
sources:
- https://github.com/SeldonIO/seldon-core
version: 1.0.3-SNAPSHOT
version: 1.1.0-SNAPSHOT
2 changes: 1 addition & 1 deletion helm-charts/seldon-core-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ keywords:
name: seldon-core-operator
sources:
- https://github.com/SeldonIO/seldon-core
version: 1.0.3-SNAPSHOT
version: 1.1.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{{- if not .Values.createResources }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app: seldon
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-webhook-role-{{ .Release.Namespace }}
rules:
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- get
- list
- create
- update
- apiGroups:
- apps
resources:
- deployments/finalizers
verbs:
- get
- patch
- update
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions/finalizers
verbs:
- get
- patch
- update
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
{{- if .Values.rbac.create }}
{{- if .Values.rbac.configmap.create }}
{{- if not .Values.createResources }}
apiVersion: rbac.authorization.k8s.io/v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed we may want to still suround this on an if statement in case user installing seldon doesn't want to have clusterroles for security limitations

kind: RoleBinding
kind: ClusterRoleBinding
metadata:
labels:
app: seldon
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-manager-cm-rolebinding
namespace: '{{ .Release.Namespace }}'
name: seldon-webhook-rolebinding-{{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: seldon-manager-cm-role
kind: ClusterRole
name: seldon-webhook-role-{{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
name: seldon-manager
namespace: '{{ .Release.Namespace }}'
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.createResources }}
apiVersion: v1
data:
credentials: '{{ .Values.credentials | toJson }}'
Expand All @@ -13,3 +14,4 @@ metadata:
control-plane: seldon-controller-manager
name: seldon-config
namespace: '{{ .Release.Namespace }}'
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,19 @@ spec:
- args:
- --enable-leader-election
- --webhook-port={{ .Values.webhook.port }}
- --create-resources=$(CREATE_RESOURCES)
- '{{- if .Values.singleNamespace }}--namespace={{ .Release.Namespace }}{{- end }}'
command:
- /manager
env:
- name: WATCH_NAMESPACE
value: ''
- name: RELATED_IMAGE_EXECUTOR
value: ''
- name: RELATED_IMAGE_ENGINE
value: ''
- name: CREATE_RESOURCES
value: '{{ .Values.createResources }}'
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down Expand Up @@ -92,6 +101,8 @@ spec:
value: '{{ .Values.executor.serviceAccount.name }}'
- name: EXECUTOR_REQUEST_LOGGER_DEFAULT_ENDPOINT_PREFIX
value: '{{ .Values.executor.defaultRequestLoggerEndpointPrefix }}'
- name: DEFAULT_USER_ID
value: '{{ .Values.defaultUserID }}'
image: '{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}'
imagePullPolicy: '{{ .Values.image.pullPolicy }}'
name: manager
Expand All @@ -109,14 +120,18 @@ spec:
requests:
cpu: '{{ .Values.manager.cpuRequest }}'
memory: '{{ .Values.manager.memoryRequest }}'
{{- if not .Values.createResources }}
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
{{- end }}
serviceAccountName: seldon-manager
terminationGracePeriodSeconds: 10
{{- if not .Values.createResources }}
volumes:
- name: cert
secret:
defaultMode: 420
secretName: seldon-webhook-server-cert
{{- end }}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.createResources }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -18,3 +19,4 @@ spec:
app.kubernetes.io/name: seldon
app.kubernetes.io/version: v0.5
control-plane: seldon-controller-manager
{{- end }}
Loading