Skip to content

Commit

Permalink
rename stream to modelgateway (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ukclivecox authored Mar 22, 2022
1 parent 5e66ee0 commit 9423454
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ WORKDIR /build
RUN rm -r apis && mv apis-TEMP apis

# Build the binary
RUN go build -o stream ./cmd/stream/main.go
RUN go build -o modelgateway ./cmd/modelgateway/main.go

# Copy into scratch
FROM gcr.io/distroless/base-debian10:latest
COPY --from=builder /build/stream /bin/stream
CMD ["/bin/stream"]
COPY --from=builder /build/modelgateway /bin/modelgateway
CMD ["/bin/modelgateway"]
64 changes: 35 additions & 29 deletions scheduler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DOCKERHUB_USERNAME ?= seldonio
SCHEDULER_IMG ?= ${DOCKERHUB_USERNAME}/seldon-scheduler:${CUSTOM_IMAGE_TAG}
AGENT_IMG ?= ${DOCKERHUB_USERNAME}/seldon-agent:${CUSTOM_IMAGE_TAG}
RCLONE_IMG ?= ${DOCKERHUB_USERNAME}/seldon-rclone:${CUSTOM_IMAGE_TAG}
STREAM_IMG ?= ${DOCKERHUB_USERNAME}/seldon-stream:${CUSTOM_IMAGE_TAG}
MODELGATEWAY_IMG ?= ${DOCKERHUB_USERNAME}/seldon-modelgateway:${CUSTOM_IMAGE_TAG}
ENVOY_IMG ?= ${DOCKERHUB_USERNAME}/seldon-envoy:${CUSTOM_IMAGE_TAG}
MLSERVER_IMG ?= seldonio/mlserver:1.0.0.rc1
TRITON_IMG ?= nvcr.io/nvidia/tritonserver:21.12-py3
Expand All @@ -24,10 +24,10 @@ build-proxy:
build-agent: test
go build -o bin/agent ./cmd/agent

build-stream: test
go build -o bin/stream -v ./cmd/stream
build-modelgateway: test
go build -o bin/modelgateway -v ./cmd/modelgateway

build: build-scheduler build-agent build-proxy build-stream
build: build-scheduler build-agent build-proxy build-modelgateway

lint: ## Run go linters against code.
gofmt -w pkg
Expand Down Expand Up @@ -63,21 +63,21 @@ docker-build-rclone:
docker-push-rclone:
docker push ${RCLONE_IMG}

docker-build-stream: copy-apis
docker build -t ${STREAM_IMG} -f Dockerfile.stream .
docker-build-modelgateway: copy-apis
docker build -t ${MODELGATEWAY_IMG} -f Dockerfile.modelgateway .

docker-push-stream:
docker push ${STREAM_IMG}
docker-push-modelgateway:
docker push ${MODELGATEWAY_IMG}

docker-build-envoy:
docker build -t ${ENVOY_IMG} -f Dockerfile.envoy .

docker-push-envoy:
docker push ${ENVOY_IMG}

docker-build-all: docker-build-agent docker-build-envoy docker-build-rclone docker-build-scheduler docker-build-stream
docker-build-all: docker-build-agent docker-build-envoy docker-build-rclone docker-build-scheduler docker-build-modelgateway

docker-push-all: docker-push-agent docker-push-envoy docker-push-rclone docker-push-scheduler docker-push-stream
docker-push-all: docker-push-agent docker-push-envoy docker-push-rclone docker-push-scheduler docker-push-modelgateway

#####################################
# Kind
Expand All @@ -95,10 +95,10 @@ kind-image-install-envoy: docker-build-envoy
kind-image-install-rclone: docker-build-rclone
kind load -v 3 docker-image ${RCLONE_IMG} --name ${KIND_NAME}

kind-image-install-stream: docker-build-stream
kind load -v 3 docker-image ${STREAM_IMG} --name ${KIND_NAME}
kind-image-install-modelgateway: docker-build-modelgateway
kind load -v 3 docker-image ${MODELGATEWAY_IMG} --name ${KIND_NAME}

kind-image-install-all: kind-image-install-scheduler kind-image-install-envoy kind-image-install-agent kind-image-install-rclone kind-image-install-stream
kind-image-install-all: kind-image-install-scheduler kind-image-install-envoy kind-image-install-agent kind-image-install-rclone kind-image-install-modelgateway

#####################################
# Start with Docker Compose
Expand Down Expand Up @@ -152,6 +152,12 @@ start-all-triton: copy-apis
stop-all-triton:
${DOCKER_COMPOSE_TRITON_COMMAND} down ${DOCKER_COMPOSE_REMOVE_VOLUMES}

.PHONY: start-all
start-all: start-all-mlserver

.PHONY: stop-all
stop-all: stop-all-mlserver

# Tooling

.PHONY: list-services-mlserver
Expand Down Expand Up @@ -314,21 +320,21 @@ start-rclone-host:
stop-rclone-host:
${DOCKER_COMPOSE_SERVICE_HOST_COMMAND} rm --stop --force ${DOCKER_COMPOSE_REMOVE_VOLUMES} rclone

.PHONY: start-stream
start-stream:
${DOCKER_COMPOSE_SERVICE_COMMAND} up -d stream
.PHONY: start-modelgateway
start-modelgateway:
${DOCKER_COMPOSE_SERVICE_COMMAND} up -d modelgateway

.PHONY: stop-stream
stop-stream:
${DOCKER_COMPOSE_SERVICE_COMMAND} rm --stop --force ${DOCKER_COMPOSE_REMOVE_VOLUMES} stream
.PHONY: stop-modelgateway
stop-modelgateway:
${DOCKER_COMPOSE_SERVICE_COMMAND} rm --stop --force ${DOCKER_COMPOSE_REMOVE_VOLUMES} modelgateway

.PHONY: start-stream-host
start-stream-host:
${DOCKER_COMPOSE_SERVICE_HOST_COMMAND} up -d stream
.PHONY: start-modelgateway-host
start-modelgateway-host:
${DOCKER_COMPOSE_SERVICE_HOST_COMMAND} up -d modelgateway

.PHONY: stop-stream-host
stop-stream-host:
${DOCKER_COMPOSE_SERVICE_HOST_COMMAND} rm --stop --force ${DOCKER_COMPOSE_REMOVE_VOLUMES} stream
.PHONY: stop-modelgateway-host
stop-modelgateway-host:
${DOCKER_COMPOSE_SERVICE_HOST_COMMAND} rm --stop --force ${DOCKER_COMPOSE_REMOVE_VOLUMES} modelgateway

.PHONY: start-kafka
start-kafka:
Expand All @@ -348,7 +354,7 @@ stop-kafka-host:


.PHONY: stop-all
stop-all: stop-scheduler stop-envoy stop-rclone stop-agent-mlserver stop-agent-triton stop-mlserver stop-triton stop-stream stop-kafka
stop-all: stop-scheduler stop-envoy stop-rclone stop-agent-mlserver stop-agent-triton stop-mlserver stop-triton stop-modelgateway stop-kafka


#####################################
Expand Down Expand Up @@ -391,8 +397,8 @@ else
./bin/proxy
endif

start-stream-local:
./bin/stream --config-path ${PWD}/config --log-level debug
start-modelgateway-local:
./bin/modelgateway --config-path ${PWD}/config --log-level debug

#####################################
# K8S Testing
Expand All @@ -403,7 +409,7 @@ deploy:
cd k8s/envoy && kustomize edit set image envoy=${ENVOY_IMG}
cd k8s/mlserver && kustomize edit set image agent=${AGENT_IMG}
cd k8s/mlserver && kustomize edit set image rclone=${RCLONE_IMG}
cd k8s/stream && kustomize edit set image stream=${STREAM_IMG}
cd k8s/modelgateway && kustomize edit set image modelgateway=${MODELGATEWAY_IMG}
kustomize build k8s/default | kubectl apply -f -

build-push-deploy: build docker-build-all docker-push-all deploy
Expand Down
8 changes: 4 additions & 4 deletions scheduler/all-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ services:
server:
image: "${SERVER_IMAGE_AND_TAG}"

stream:
modelgateway:
build:
dockerfile: ./Dockerfile.stream
dockerfile: ./Dockerfile.modelgateway
context: .
image: "${STREAM_IMAGE_AND_TAG}"
image: "${MODELGATEWAY_IMAGE_AND_TAG}"
command:
- "/bin/stream"
- "/bin/modelgateway"
- "--log-level"
- "debug"
- "--config-path"
Expand Down
4 changes: 2 additions & 2 deletions scheduler/all-host-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ services:
source: ./mnt
target: /mnt/agent

stream:
modelgateway:
network_mode: "host"
volumes:
- type: bind
source: ./config
target: /mnt/config
command:
- "/bin/stream"
- "/bin/modelgateway"
- "--log-level"
- "debug"
- "--config-path"
Expand Down
2 changes: 1 addition & 1 deletion scheduler/all-internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
source: models
target: /mnt/agent

stream:
modelgateway:
volumes:
- type: bind
source: ./config
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion scheduler/config/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ rclone:
- '{"type":"google cloud storage","name":"gs","parameters":{"anonymous":true}}'
kafka:
active: true
broker: "0.0.0.0:9092"
broker: "kafka:29092"
2 changes: 1 addition & 1 deletion scheduler/env.all
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SERVER_GRPC_PORT=8081
AGENT_IMAGE_AND_TAG=seldonio/seldon-agent:latest
ENVOY_IMAGE_AND_TAG=seldonio/seldon-envoy:latest
RCLONE_IMAGE_AND_TAG=seldonio/seldon-rclone:latest
STREAM_IMAGE_AND_TAG=seldonio/seldon-stream:latest
MODELGATEWAY_IMAGE_AND_TAG=seldonio/seldon-modelgateway:latest
SERVER_IMAGE_AND_TAG=seldonio/mlserver:1.0.0.rc1
SCHEDULER_IMAGE_AND_TAG=seldonio/seldon-scheduler:latest

Expand Down
2 changes: 1 addition & 1 deletion scheduler/k8s/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ bases:
- ../scheduler
- ../envoy
- ../config
- ../stream
- ../modelgateway
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- stream.yaml
- modelgateway.yaml

images:
- name: stream
newName: seldonio/seldon-stream
- name: modelgateway
newName: seldonio/seldon-modelgateway
newTag: latest
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: stream
name: modelgateway
namespace: system
labels:
control-plane: seldon-stream
control-plane: seldon-modelgateway
spec:
selector:
matchLabels:
control-plane: seldon-stream
control-plane: seldon-modelgateway
replicas: 1
template:
metadata:
labels:
control-plane: seldon-stream
control-plane: seldon-modelgateway
spec:
securityContext:
runAsUser: 8888
containers:
- command:
- /bin/stream
- /bin/modelgateway
args:
- --scheduler-host=seldon-scheduler
- --scheduler-port=9004
- --envoy-host=seldon-mesh
- --envoy-port=80
image: stream:latest
image: modelgateway:latest
imagePullPolicy: IfNotPresent
name: stream
name: modelgateway
resources:
limits:
cpu: 500m
Expand Down
Loading

0 comments on commit 9423454

Please sign in to comment.