diff --git a/.circleci/config.yml b/.circleci/config.yml index 64be3a4b9e..af8df1eaa3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: command: docker login ${DOCKER_REGISTRY} -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} - run: name: "Seldon-core Domino Build & Push Script" - command: ./domino-build.sh + command: ./domino-build.sh -a - persist_to_workspace: root: ~/ paths: @@ -53,11 +53,11 @@ jobs: at: ~/ - checkout - helm/install-helm-client: - version: v3.6.3 + version: v3.13.1 - run: name: Install and Launch Kubernetes command: | - curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.24.3+k3s1 sh -x - + curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.3+k3s1 sh -x - sleep 10 kubectl wait --for=condition=Available --timeout=60s deployments --all -n kube-system - run: @@ -94,7 +94,7 @@ workflows: - org-global filters: tags: - only: /v\d+(\.\d+)*(-.*)*/ + only: /\d+(\.\d+)*(-.*)*-rabbitmq(-.*)*/ - test: context: - org-global @@ -102,4 +102,4 @@ workflows: - build-and-push filters: tags: - only: /v\d+(\.\d+)*(-.*)*/ + only: /\d+(\.\d+)*(-.*)*-rabbitmq(-.*)*/ diff --git a/.github/workflows/alibidetect_tests.yml b/.github/workflows/alibidetect_tests.yml index e04dc3dc1f..099469b79f 100644 --- a/.github/workflows/alibidetect_tests.yml +++ b/.github/workflows/alibidetect_tests.yml @@ -2,9 +2,9 @@ name: V1 Alibi Detect Tests on: push: - branches: [ master, rabbitmq* ] + branches: [ master ] pull_request: - branches: [ master, rabbitmq* ] + branches: [ master ] jobs: lint: diff --git a/.github/workflows/alibiexplainer_tests.yml b/.github/workflows/alibiexplainer_tests.yml index 01e594d171..e661bdec90 100644 --- a/.github/workflows/alibiexplainer_tests.yml +++ b/.github/workflows/alibiexplainer_tests.yml @@ -2,9 +2,9 @@ name: V1 Alibi Explainer Tests on: push: - branches: [ master, rabbitmq* ] + branches: [ master ] pull_request: - branches: [ master, rabbitmq* ] + branches: [ master ] jobs: lint: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f7adb25d05..0e8afa74ae 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,9 +2,9 @@ name: V1 Docs Test on: push: - branches: [ master, rabbitmq* ] + branches: [ master ] pull_request: - branches: [ master, rabbitmq* ] + branches: [ master ] jobs: docs-lint: diff --git a/.github/workflows/executor_lint.yml b/.github/workflows/executor_lint.yml index fccfc8ecf0..f01ed47c32 100644 --- a/.github/workflows/executor_lint.yml +++ b/.github/workflows/executor_lint.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v3 with: - go-version: '^1.17.0' + go-version: '^1.20.0' - name: test-executor run: | make -C executor lint diff --git a/.github/workflows/executor_tests.yml b/.github/workflows/executor_tests.yml index be23257726..a5195b9b38 100644 --- a/.github/workflows/executor_tests.yml +++ b/.github/workflows/executor_tests.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v3 with: - go-version: '^1.17.0' + go-version: '^1.20.0' - name: test-executor run: | make -C executor test diff --git a/.github/workflows/operator_lint.yml b/.github/workflows/operator_lint.yml index c4f9befe7a..9190de7ae0 100644 --- a/.github/workflows/operator_lint.yml +++ b/.github/workflows/operator_lint.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v3 with: - go-version: '^1.17.0' + go-version: '^1.20.0' - name: test-executor run: | make -C operator lint diff --git a/.github/workflows/operator_tests.yml b/.github/workflows/operator_tests.yml index be68f3b01c..dfa032f5ef 100644 --- a/.github/workflows/operator_tests.yml +++ b/.github/workflows/operator_tests.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v3 with: - go-version: '^1.17.0' + go-version: '^1.20.0' - name: test-operator run: | make -C operator test diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml index 92fe960d96..e92a1405b6 100644 --- a/.github/workflows/python_lint.yml +++ b/.github/workflows/python_lint.yml @@ -2,9 +2,9 @@ name: V1 Python Lint on: push: - branches: [ master, rabbitmq* ] + branches: [ master ] pull_request: - branches: [ master, rabbitmq* ] + branches: [ master ] jobs: python-lint: diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 4a20ecb751..5dbca7438d 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -2,9 +2,9 @@ name: V1 Python Tests on: push: - branches: [ master, rabbitmq* ] + branches: [ master ] pull_request: - branches: [ master, rabbitmq* ] + branches: [ master ] jobs: python-tests: diff --git a/.github/workflows/security_tests.yml b/.github/workflows/security_tests.yml index 0e9b41bea4..f7ba9d6f49 100644 --- a/.github/workflows/security_tests.yml +++ b/.github/workflows/security_tests.yml @@ -2,9 +2,9 @@ name: V1 Security Tests on: push: - branches: [ master, rabbitmq* ] + branches: [ master ] pull_request: - branches: [ master, rabbitmq* ] + branches: [ master ] workflow_dispatch: jobs: diff --git a/domino-build.sh b/domino-build.sh index 1fa7370410..c7eac21a16 100755 --- a/domino-build.sh +++ b/domino-build.sh @@ -2,20 +2,23 @@ set -o nounset -o errexit -o pipefail set -e -nopush_flag='' -tag_arg='' -while getopts 'nt:' flag; do +AUTO_TAG_FLAG='' +NO_PUSH_FLAG='' +TAG_ARG='' +while getopts 'ant:' flag; do case "${flag}" in - n) nopush_flag='true' ;; - t) tag_arg="${OPTARG}" ;; + a) AUTO_TAG_FLAG='true' ;; + n) NO_PUSH_FLAG='true' ;; + t) TAG_ARG="${OPTARG}" ;; *) echo "Unexpected option ${flag}" exit 1 ;; esac done -readonly nopush_flag -readonly tag_arg +readonly AUTO_TAG_FLAG +readonly NO_PUSH_FLAG +readonly TAG_ARG SELDON_REPO=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) @@ -31,13 +34,18 @@ if [ -n "${BRANCH_NAME}" ]; then TARGET_IMAGE_TAGS+=("${SOURCE_IMAGE_TAG}-${BRANCH_NAME}.latest") fi -if [ -n "${tag_arg}" ]; then - TARGET_IMAGE_TAGS+=("${tag_arg}") +if [ -n "${TAG_ARG}" ]; then + TARGET_IMAGE_TAGS+=("${TAG_ARG}") +fi + +GIT_HEAD_TAG="$(git describe --tags --exact-match HEAD 2> /dev/null || echo "")" +if [ -n "${AUTO_TAG_FLAG}" ] && [ -n "${GIT_HEAD_TAG}" ]; then + TARGET_IMAGE_TAGS+=("${GIT_HEAD_TAG}") fi echo -e "\n Building operator...\n" cd "$SELDON_REPO/operator" -make docker-build-no-test +make docker-build echo -e "\n Building executor...\n" cd "$SELDON_REPO/executor" @@ -45,7 +53,7 @@ make docker-build cd "${SELDON_REPO}" -if [ "${nopush_flag}" == "" ]; then +if [ -z "${NO_PUSH_FLAG}" ]; then if [ -f ~/.docker/config.json ] && [ "$(cat ~/.docker/config.json | jq '.auths | has("quay.io")')" == "true" ]; then echo -e "[Docker is already logged into quay.io, using existing credentials.]" diff --git a/executor/licenses/dep.txt b/executor/licenses/dep.txt index a938fda166..c49367fb67 100644 --- a/executor/licenses/dep.txt +++ b/executor/licenses/dep.txt @@ -1,13 +1,127 @@ github.com/seldonio/seldon-core/executor cloud.google.com/go +cloud.google.com/go/accessapproval +cloud.google.com/go/accesscontextmanager +cloud.google.com/go/aiplatform +cloud.google.com/go/analytics +cloud.google.com/go/apigateway +cloud.google.com/go/apigeeconnect +cloud.google.com/go/apigeeregistry +cloud.google.com/go/apikeys +cloud.google.com/go/appengine +cloud.google.com/go/area120 +cloud.google.com/go/artifactregistry +cloud.google.com/go/asset +cloud.google.com/go/assuredworkloads +cloud.google.com/go/automl +cloud.google.com/go/baremetalsolution +cloud.google.com/go/batch +cloud.google.com/go/beyondcorp cloud.google.com/go/bigquery +cloud.google.com/go/billing +cloud.google.com/go/binaryauthorization +cloud.google.com/go/certificatemanager +cloud.google.com/go/channel +cloud.google.com/go/cloudbuild +cloud.google.com/go/clouddms +cloud.google.com/go/cloudtasks cloud.google.com/go/compute +cloud.google.com/go/compute/metadata +cloud.google.com/go/contactcenterinsights +cloud.google.com/go/container +cloud.google.com/go/containeranalysis +cloud.google.com/go/datacatalog +cloud.google.com/go/dataflow +cloud.google.com/go/dataform +cloud.google.com/go/datafusion +cloud.google.com/go/datalabeling +cloud.google.com/go/dataplex +cloud.google.com/go/dataproc +cloud.google.com/go/dataqna cloud.google.com/go/datastore +cloud.google.com/go/datastream +cloud.google.com/go/deploy +cloud.google.com/go/dialogflow +cloud.google.com/go/dlp +cloud.google.com/go/documentai +cloud.google.com/go/domains +cloud.google.com/go/edgecontainer +cloud.google.com/go/errorreporting +cloud.google.com/go/essentialcontacts +cloud.google.com/go/eventarc +cloud.google.com/go/filestore cloud.google.com/go/firestore +cloud.google.com/go/functions +cloud.google.com/go/gaming +cloud.google.com/go/gkebackup +cloud.google.com/go/gkeconnect +cloud.google.com/go/gkehub +cloud.google.com/go/gkemulticloud +cloud.google.com/go/gsuiteaddons cloud.google.com/go/iam +cloud.google.com/go/iap +cloud.google.com/go/ids +cloud.google.com/go/iot +cloud.google.com/go/kms +cloud.google.com/go/language +cloud.google.com/go/lifesciences +cloud.google.com/go/logging +cloud.google.com/go/longrunning +cloud.google.com/go/managedidentities +cloud.google.com/go/maps +cloud.google.com/go/mediatranslation +cloud.google.com/go/memcache +cloud.google.com/go/metastore cloud.google.com/go/monitoring +cloud.google.com/go/networkconnectivity +cloud.google.com/go/networkmanagement +cloud.google.com/go/networksecurity +cloud.google.com/go/notebooks +cloud.google.com/go/optimization +cloud.google.com/go/orchestration +cloud.google.com/go/orgpolicy +cloud.google.com/go/osconfig +cloud.google.com/go/oslogin +cloud.google.com/go/phishingprotection +cloud.google.com/go/policytroubleshooter +cloud.google.com/go/privatecatalog cloud.google.com/go/pubsub +cloud.google.com/go/pubsublite +cloud.google.com/go/recaptchaenterprise/v2 +cloud.google.com/go/recommendationengine +cloud.google.com/go/recommender +cloud.google.com/go/redis +cloud.google.com/go/resourcemanager +cloud.google.com/go/resourcesettings +cloud.google.com/go/retail +cloud.google.com/go/run +cloud.google.com/go/scheduler +cloud.google.com/go/secretmanager +cloud.google.com/go/security +cloud.google.com/go/securitycenter +cloud.google.com/go/servicecontrol +cloud.google.com/go/servicedirectory +cloud.google.com/go/servicemanagement +cloud.google.com/go/serviceusage +cloud.google.com/go/shell +cloud.google.com/go/spanner +cloud.google.com/go/speech cloud.google.com/go/storage +cloud.google.com/go/storagetransfer +cloud.google.com/go/talent +cloud.google.com/go/texttospeech +cloud.google.com/go/tpu +cloud.google.com/go/trace +cloud.google.com/go/translate +cloud.google.com/go/video +cloud.google.com/go/videointelligence +cloud.google.com/go/vision/v2 +cloud.google.com/go/vmmigration +cloud.google.com/go/vmwareengine +cloud.google.com/go/vpcaccess +cloud.google.com/go/webrisk +cloud.google.com/go/websecurityscanner +cloud.google.com/go/workflows contrib.go.opencensus.io/exporter/ocagent contrib.go.opencensus.io/exporter/prometheus contrib.go.opencensus.io/exporter/zipkin @@ -111,6 +225,7 @@ github.com/elastic/go-elasticsearch/v7 github.com/elazarl/goproxy github.com/emicklei/go-restful github.com/emicklei/go-restful-swagger12 +github.com/emicklei/go-restful/v3 github.com/emissary-ingress/emissary/v3 github.com/envoyproxy/go-control-plane github.com/envoyproxy/protoc-gen-validate diff --git a/operator/licenses/dep.txt b/operator/licenses/dep.txt index b2f98d606a..8c74c1f4da 100644 --- a/operator/licenses/dep.txt +++ b/operator/licenses/dep.txt @@ -115,6 +115,7 @@ github.com/elastic/go-elasticsearch/v7 github.com/elazarl/goproxy github.com/emicklei/go-restful github.com/emicklei/go-restful-swagger12 +github.com/emicklei/go-restful/v3 github.com/emissary-ingress/emissary/v3 github.com/envoyproxy/go-control-plane github.com/envoyproxy/protoc-gen-validate diff --git a/test/models/cifar10-rest-rabbitmq.yaml b/test/models/cifar10-rest-rabbitmq.yaml index d10b721f29..90925f5298 100644 --- a/test/models/cifar10-rest-rabbitmq.yaml +++ b/test/models/cifar10-rest-rabbitmq.yaml @@ -1,5 +1,31 @@ # Source: https://docs.seldon.io/projects/seldon-core/en/latest/streaming/kafka.html --- +apiVersion: rabbitmq.com/v1beta1 +kind: Queue +metadata: + name: cifar10-rest-input + namespace: seldon-regression-test +spec: + name: cifar10-rest-input + autoDelete: false + durable: true + rabbitmqClusterReference: + name: rabbitmq-cluster + namespace: rabbitmq +--- +apiVersion: rabbitmq.com/v1beta1 +kind: Queue +metadata: + name: cifar10-rest-output + namespace: seldon-regression-test +spec: + name: cifar10-rest-output + autoDelete: false + durable: true + rabbitmqClusterReference: + name: rabbitmq-cluster + namespace: rabbitmq +--- apiVersion: machinelearning.seldon.io/v1 kind: SeldonDeployment metadata: diff --git a/test/models/iris-model-rabbitmq.yaml b/test/models/iris-model-rabbitmq.yaml index e9e10712a2..c2b5a12d34 100644 --- a/test/models/iris-model-rabbitmq.yaml +++ b/test/models/iris-model-rabbitmq.yaml @@ -1,6 +1,32 @@ # Iris sample model # Source: https://docs.seldon.io/projects/seldon-core/en/latest/workflow/github-readme.html#deploy-your-model-using-pre-packaged-model-servers --- +apiVersion: rabbitmq.com/v1beta1 +kind: Queue +metadata: + name: iris-model-rabbitmq-input + namespace: seldon-regression-test +spec: + name: iris-model-rabbitmq-input + autoDelete: false + durable: true + rabbitmqClusterReference: + name: rabbitmq-cluster + namespace: rabbitmq +--- +apiVersion: rabbitmq.com/v1beta1 +kind: Queue +metadata: + name: iris-model-rabbitmq-output + namespace: seldon-regression-test +spec: + name: iris-model-rabbitmq-output + autoDelete: false + durable: true + rabbitmqClusterReference: + name: rabbitmq-cluster + namespace: rabbitmq +--- apiVersion: machinelearning.seldon.io/v1 kind: SeldonDeployment metadata: diff --git a/test/seldon/model/create-rabbit-models b/test/seldon/model/create-rabbit-models index 8bb7867084..2f3f23ca82 100755 --- a/test/seldon/model/create-rabbit-models +++ b/test/seldon/model/create-rabbit-models @@ -11,15 +11,20 @@ COMPUTE_NAMESPACE=seldon-regression-test echo ">>> Creating iris rabbitmq model..." kubectl apply -f $MODELS_DIR/iris-model-rabbitmq.yaml -n $COMPUTE_NAMESPACE -echo ">>> Creating cifar10 rabbitmq model..." -kubectl apply -f $MODELS_DIR/cifar10-rest-rabbitmq.yaml -n $COMPUTE_NAMESPACE - sleep 5 echo ">>> Waiting for iris model deployment to become available..." kubectl wait deployment.apps/iris-model-rabbitmq-default-0-classifier -n $COMPUTE_NAMESPACE --for condition=Available=True --timeout=600s -echo ">>> Waiting for cifar10 model deployment to become available..." -kubectl wait deployment.apps/tfserving-cifar10-rabbitmq-model-0-resnet32 -n $COMPUTE_NAMESPACE --for condition=Available=True --timeout=600s +# +# Tensorflow model does not work as our RabbitMQ server only accepts payloads in Seldon format, not raw tensorflow +# +#echo ">>> Creating cifar10 rabbitmq model..." +#kubectl apply -f $MODELS_DIR/cifar10-rest-rabbitmq.yaml -n $COMPUTE_NAMESPACE +# +#sleep 5 +# +#echo ">>> Waiting for cifar10 model deployment to become available..." +#kubectl wait deployment.apps/tfserving-cifar10-rabbitmq-model-0-resnet32 -n $COMPUTE_NAMESPACE --for condition=Available=True --timeout=600s echo ">>> Done deploying models." diff --git a/test/seldon/model/test-rabbit-models b/test/seldon/model/test-rabbit-models index e0fb5d961a..75324340b5 100755 --- a/test/seldon/model/test-rabbit-models +++ b/test/seldon/model/test-rabbit-models @@ -12,8 +12,7 @@ COMPUTE_NAMESPACE=seldon-regression-test RABBITMQ_USER=$(kubectl -n rabbitmq get secret rabbitmq-cluster-default-user -o jsonpath="{.data.username}" | base64 --decode) RABBITMQ_PASSWORD=$(kubectl -n rabbitmq get secret rabbitmq-cluster-default-user -o jsonpath="{.data.password}" | base64 --decode) -EXPECTED_IRIS_RESULT_PAYLOAD='{"data":{"names":["t:0","t:1","t:2"],"ndarray":[[0.0006985194531162835,0.00366803903943666,0.995633441507447]]},"meta":{"requestPath":{"classifier":"seldonio/sklearnserver:1.14.1"}}}' -EXPECTED_CIFAR10_RESULT_PAYLOAD='1.45e-08,1.25e-09,1.63e-07,1.15e-01,1.74e-07,6.19e-06,8.85e-01,6.07e-09,7.44e-08,4.73e-09,' +EXPECTED_IRIS_RESULT_PAYLOAD='{"data":{"names":["t:0","t:1","t:2"],"ndarray":[[0.0006985194531162835,0.00366803903943666,0.995633441507447]]},"meta":{"requestPath":{"classifier":"seldonio/sklearnserver:1.17.1"}}}' echo ">>> Sending predict message to iris rabbitmq model input queue..." kubectl -n rabbitmq exec rabbitmq-cluster-server-0 -c rabbitmq -- \ @@ -38,27 +37,31 @@ if [ "${EXPECTED_IRIS_RESULT_PAYLOAD}" != "${IRIS_RESULT_PAYLOAD}" ]; then exit 1 fi -CIFAR10_REQUEST_PAYLOAD="$(<$MODELS_DIR/cifar10_tensorflow_single.json)" -echo ">>> Sending predict message to cifar10 rabbitmq model input queue..." -kubectl -n rabbitmq exec rabbitmq-cluster-server-0 -c rabbitmq -- \ - curl -X POST "http://localhost:15672/api/exchanges/%2F/amq.default/publish" \ - --user "${RABBITMQ_USER}:${RABBITMQ_PASSWORD}" \ - -H "Content-type: application/json" \ - -H "Accept: application/json" \ - -d "${CIFAR10_REQUEST_PAYLOAD}" - -function retrieveCifar10Result { - CIFAR10_RESULT_PAYLOAD=$(kubectl -n rabbitmq exec rabbitmq-cluster-server-0 -c rabbitmq -- \ - curl -X POST "http://localhost:15672/api/queues/%2F/cifar10-rest-output/get" \ - --user "${RABBITMQ_USER}:${RABBITMQ_PASSWORD}" \ - -H "Content-type: application/json" \ - -H "Accept: application/json" \ - -d '{"count":1,"ackmode":"ack_requeue_false","encoding":"auto"}' | \ - jq -e -r '.[0].payload' | jq -r '.predictions[0][]' | xargs -I{} printf "%.2e," "{}") -} -with_backoff retrieveCifar10Result - -if [ "${EXPECTED_CIFAR10_RESULT_PAYLOAD}" != "${CIFAR10_RESULT_PAYLOAD}" ]; then - echo "UNEXPECTED CIFAR10 MODEL RESULT: ${CIFAR10_RESULT_PAYLOAD}" - exit 1 -fi +# +# Tensorflow model does not work as our RabbitMQ server only accepts payloads in Seldon format, not raw tensorflow +# +#EXPECTED_CIFAR10_RESULT_PAYLOAD='1.45e-08,1.25e-09,1.63e-07,1.15e-01,1.74e-07,6.19e-06,8.85e-01,6.07e-09,7.44e-08,4.73e-09,' +#CIFAR10_REQUEST_PAYLOAD="$(<$MODELS_DIR/cifar10_tensorflow_single.json)" +#echo ">>> Sending predict message to cifar10 rabbitmq model input queue..." +#kubectl -n rabbitmq exec rabbitmq-cluster-server-0 -c rabbitmq -- \ +# curl -X POST "http://localhost:15672/api/exchanges/%2F/amq.default/publish" \ +# --user "${RABBITMQ_USER}:${RABBITMQ_PASSWORD}" \ +# -H "Content-type: application/json" \ +# -H "Accept: application/json" \ +# -d "${CIFAR10_REQUEST_PAYLOAD}" +# +#function retrieveCifar10Result { +# CIFAR10_RESULT_PAYLOAD=$(kubectl -n rabbitmq exec rabbitmq-cluster-server-0 -c rabbitmq -- \ +# curl -X POST "http://localhost:15672/api/queues/%2F/cifar10-rest-output/get" \ +# --user "${RABBITMQ_USER}:${RABBITMQ_PASSWORD}" \ +# -H "Content-type: application/json" \ +# -H "Accept: application/json" \ +# -d '{"count":1,"ackmode":"ack_requeue_false","encoding":"auto"}' | \ +# jq -e -r '.[0].payload' | jq -r '.predictions[0][]' | xargs -I{} printf "%.2e," "{}") +#} +#with_backoff retrieveCifar10Result +# +#if [ "${EXPECTED_CIFAR10_RESULT_PAYLOAD}" != "${CIFAR10_RESULT_PAYLOAD}" ]; then +# echo "UNEXPECTED CIFAR10 MODEL RESULT: ${CIFAR10_RESULT_PAYLOAD}" +# exit 1 +#fi