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

rclone-based storage initializer - first steps #3089

Merged
merged 3 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 11 additions & 2 deletions ci_build_and_push_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ function build_push_storage_initializer {
STORAGE_INITIALIZER_EXIT_VALUE=$?
}

function build_push_rclone_storage_initializer {
make \
-C components/rclone-storage-initializer \
docker-build \
docker-push
RCLONE_STORAGE_INITIALIZER_EXIT_VALUE=$?
}

function build_push_mab {
make \
-C components/routers/epsilon-greedy \
Expand All @@ -161,6 +169,7 @@ build_push_xgboostserver
build_push_tfproxy
build_push_alibi_explainer
build_push_storage_initializer
build_push_rclone_storage_initializer
build_push_mab

#######################################
Expand All @@ -180,6 +189,7 @@ echo "Mock model exit value: $MOCK_MODEL_EXIT_VALUE"
echo "Alibi Detect exit value: $ALIBI_DETECT_EXIT_VALUE"
echo "Request Logger exit value: $LOGGER_EXIT_VALUE"
echo "Tensorflow Proxy exit value: $TFPROXY_EXIT_VALUE"
echo "Rclone Storage Initializer exit value: $RCLONE_STORAGE_INITIALIZER_EXIT_VALUE"
echo "MAB exit value: $MAB_EXIT_VALUE"

exit $((${PYTHON_EXIT_VALUE} \
Expand All @@ -194,7 +204,6 @@ exit $((${PYTHON_EXIT_VALUE} \
+ ${XGBOOST_EXIT_VALUE} \
+ ${TFPROXY_EXIT_VALUE} \
+ ${STORAGE_INITIALIZER_EXIT_VALUE} \
+ ${RCLONE_STORAGE_INITIALIZER_EXIT_VALUE} \
+ ${MAB_EXIT_VALUE} \
+ ${EXPLAIN_EXIT_VALUE}))


9 changes: 9 additions & 0 deletions components/rclone-storage-initializer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM rclone/rclone:1.54.0
LABEL name="Storage Initializer (rclone based)" \
vendor="Seldon Technologies" \
version="1.8.0-dev" \
release="1" \
summary="Storage Initializer for Seldon Core" \
description="Allows Seldon Core to download artifacts from cloud and local storage to a local volume"

ENTRYPOINT ["rclone", "copy"]
14 changes: 14 additions & 0 deletions components/rclone-storage-initializer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SHELL := /bin/bash
IMAGE := rclone-storage-initializer
VERSION := $(shell cat ../../version.txt)

KIND_NAME ?= kind

docker-build:
docker build --file=Dockerfile --force-rm=true -t seldonio/${IMAGE}:${VERSION} .

docker-push:
docker push seldonio/${IMAGE}:${VERSION}

kind-load: docker-build
kind load docker-image seldonio/${IMAGE}:${VERSION} --name ${KIND_NAME}
102 changes: 102 additions & 0 deletions components/rclone-storage-initializer/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Rclone Based Storage Initializer



## Rclone configuration

### General notes

Rclone remotes can be configured using the environmental variables:
```
RCLONE_CONFIG_<remote name>_<config variable>: <config value>
```

Note: multiple remotes can be configured simultaneously.

Once the remote is configured the modelUri that is compatible with `rclone` takes form
```
modelUri: <remote>:<bucket name>
```
for example `modelUri: s3:sklearn/iris`.

### Helm values

To configure rclone-based storage initializer with your Seldon Core installation create
the `seldon-rclone-secret` using one of the configurations bellow and use following helm values:


```yaml
storageInitializer:
image: seldonio/rclone-storage-initializer:1.8.0-dev

predictiveUnit:
defaultEnvSecretRefName: seldon-rclone-secret
```


### Example for public GCS configuration

```yaml
apiVersion: v1
kind: Secret
metadata:
name: seldon-rclone-secret
type: Opaque
stringData:
RCLONE_CONFIG_GS_TYPE: google cloud storage
RCLONE_CONFIG_GS_ANONYMOUS: "true"
```

Example deployment

```yaml
apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
name: rclone-sklearn-gs
spec:
predictors:
- name: default
replicas: 1
graph:
name: classifier
implementation: SKLEARN_SERVER
modelUri: gs:seldon-models/sklearn/iris
envSecretRefName: seldon-rclone-secret
```


### Example minio configuration

```yaml
apiVersion: v1
kind: Secret
metadata:
name: seldon-rclone-secret
type: Opaque
stringData:
RCLONE_CONFIG_S3_TYPE: s3
RCLONE_CONFIG_S3_PROVIDER: minio
RCLONE_CONFIG_S3_ENV_AUTH: "false"
RCLONE_CONFIG_S3_ACCESS_KEY_ID: minioadmin
RCLONE_CONFIG_S3_SECRET_ACCESS_KEY: minioadmin
RCLONE_CONFIG_S3_ENDPOINT: http://minio.minio-system.svc.cluster.local:9000
```



### Example S3 with IAM roles configuration

```yaml
apiVersion: v1
kind: Secret
metadata:
name: seldon-rclone-secret
type: Opaque
stringData:
RCLONE_CONFIG_S3_TYPE: s3
RCLONE_CONFIG_S3_PROVIDER: aws
RCLONE_CONFIG_S3_ACCESS_KEY_ID: ""
RCLONE_CONFIG_S3_SECRET_ACCESS_KEY: ""
RCLONE_CONFIG_S3_ENV_AUTH: "true"
```