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

feat: Add kube api for k6 scaffolding #5494

Merged
merged 23 commits into from
Apr 9, 2024

Conversation

sakoush
Copy link
Member

@sakoush sakoush commented Apr 5, 2024

This PR adds the necessary scaffolding to be able to use kube apis (e.g apply and delete model resources) in our k6 tests.

This is just the initial work with an simple example and we will patch our scenarios incrementally in follow up PRs.

The main addition is using xk6 which provides kubernetes api extensions in k6.

There is an example test scenario k8s-test-script.js that showcases a model being created/adjusted/deleted.

Other changes:

  • add ability to specify namespace for k6 deployment.
  • tidy up stress-tests.sh to include random model generation in a given pipeline (not related to this main change).

Tests:

  • k8s-test-script.js has been tested as standalone script running against the current kube cluster
  • also it has been tested running as part of a job in the same namespace as a core 2 deployment, in this case we are re-using seldon-v2-controller-manager service account to give the k6 job kube api auth
  • there is a new image pushed for seldonio/seldon-k6:latest that contains the xk6 changes

Fixes INFRA-941 (internal)

@sakoush sakoush requested a review from lc525 as a code owner April 5, 2024 15:43
@sakoush sakoush added the v2 label Apr 5, 2024
@@ -152,7 +175,7 @@ function tfsimple_join_pipeline() {
seldon pipeline infer join${1} '{"inputs":[{"name":"INPUT0","data":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"datatype":"INT32","shape":[1,16]},{"name":"INPUT1","data":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"datatype":"INT32","shape":[1,16]}]}'
seldon pipeline infer join${1} --inference-mode grpc '{"model_name":"simple","inputs":[{"name":"INPUT0","contents":{"int_contents":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},"datatype":"INT32","shape":[1,16]},{"name":"INPUT1","contents":{"int_contents":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},"datatype":"INT32","shape":[1,16]}]}'
unload pipeline join${1} /tmp/pipelines/tfsimples-join${1}.yaml
# we cant unload the models here as they are used by other pipelines
# we cant unload the models here as they are used by other pipelines ?
Copy link
Member

Choose a reason for hiding this comment

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

This was for running multiple smoke tests in parallel, driving load to the same models. (just for context)

@@ -12,7 +12,8 @@ if [ -f "$GOOGLE_APPLICATION_CREDENTIALS" ]; then
gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
fi
echo "start:"$(date) > $DIR/$METADATA
k6 $@
# use locak k6 that is built with xk6 to include kube apis
Copy link
Member

@lc525 lc525 Apr 9, 2024

Choose a reason for hiding this comment

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

nit: /s/locak/local/

@@ -35,6 +35,14 @@ spec:
# "csv=results/base.gz",
# "scenarios/infer_constant_rate.js",
# ]
# # k8s-test-script
Copy link
Member

Choose a reason for hiding this comment

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

The idea here would be that atm we'll manually comment/uncomment depending on what types of tests we want to run right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, let me revert it back to the main script.

Copy link
Member

@lc525 lc525 left a comment

Choose a reason for hiding this comment

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

lgtm, left some minor comments/observations

@sakoush sakoush merged commit bcf72b7 into SeldonIO:v2 Apr 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants