Skip to content

Commit

Permalink
finalize minio kw and test
Browse files Browse the repository at this point in the history
  • Loading branch information
bdattoma committed Feb 27, 2024
1 parent beb7fd2 commit ecae5fa
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 34 deletions.
47 changes: 29 additions & 18 deletions ods_ci/tests/Resources/CLI/Minio.resource
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,41 @@ ${MINIO_SA_FILEPATH}= ${MINIO_RESOURCES_DIRPATH}/minio_serviceaccount.yaml
*** Keywords ***
Deploy MinIO

Check warning

Code scanning / Robocop

Missing documentation in '{{ name }}' keyword Warning test

Missing documentation in 'Deploy MinIO' keyword

Check warning

Code scanning / Robocop

Keyword '{{ keyword_name }}' has too many keywords inside ({{ keyword_count }}/{{ max_allowed_count }}) Warning test

Keyword 'Deploy MinIO' has too many keywords inside (16/10)
[Arguments] ${minio_image}=quay.io/modh/ods-ci-minio-models:1.0
... ${namespace}=minio
# ${key} ${pw}= Generate Minio Random Credentials
${key}= Set Variable user
${pw}= Set Variable myfakepassword
Set Test Variable ${key}
Set Test Variable ${pw}
Set Test Variable ${url} ${minio_image}
Create File From Template ${MINIO_POD_FILEPATH} ${MINIO_RESOURCES_DIRPATH}/minio_filled.yaml
# Create File From Template ${MINIO_SECRET_FILEPATH} ${MINIO_RESOURCES_DIRPATH}/minio_secret_filled.yaml
${rc}= Run And Return Rc oc new-project ${namespace}
${rc} ${out}= Run And Return Rc And Output oc apply -f ${MINIO_RESOURCES_DIRPATH}/minio_filled.yaml -n ${namespace}
# Oc Apply kind=Pod src=${MINIO_RESOURCES_DIRPATH}/minio_filled.yaml namespace=${namespace}
# Oc Apply kind=Secret src=${MINIO_RESOURCES_DIRPATH}/minio_secret_filled.yaml namespace=${namespace}
# Oc Apply kind=ServiceAccount src=${MINIO_SA_FILEPATH} namespace=${namespace}
${route}= Run And Return Rc And Output oc get route minio-route -n ${namespace} --template={{.spec.host}}
... ${namespace}=minio ${podname}=ods-ci-minio

Check notice

Code scanning / Robocop

There is too many arguments per continuation line ({{ arguments_count }} / {{ max_arguments_count }}) Note test

There is too many arguments per continuation line (2 / 1)
... ${service_name}=ods-ci-minio-srv ${route_name}=ods-ci-minio-route

Check notice

Code scanning / Robocop

There is too many arguments per continuation line ({{ arguments_count }} / {{ max_arguments_count }}) Note test

There is too many arguments per continuation line (2 / 1)
${exists}= Run Keyword And Return Status
... Check If Pod Exists namespace=${namespace} label_selector=app=minio status_only=${FALSE}
IF ${exists}
Log message=Minio pod with name ${podname} in ${namespace} NS already present. Re-using existing one.
ELSE
${key} ${pw}= Generate Minio Random Credentials
Set Test Variable ${key}

Check notice

Code scanning / Robocop

{{ set_variable_keyword }} can be replaced with VAR Note test

Set Test Variable can be replaced with VAR

Check warning

Code scanning / Robocop

Test, suite and global variables should be uppercase Warning test

Test, suite and global variables should be uppercase
Set Test Variable ${pw}

Check notice

Code scanning / Robocop

{{ set_variable_keyword }} can be replaced with VAR Note test

Set Test Variable can be replaced with VAR

Check warning

Code scanning / Robocop

Test, suite and global variables should be uppercase Warning test

Test, suite and global variables should be uppercase
Set Test Variable ${podname}

Check notice

Code scanning / Robocop

{{ set_variable_keyword }} can be replaced with VAR Note test

Set Test Variable can be replaced with VAR

Check warning

Code scanning / Robocop

Test, suite and global variables should be uppercase Warning test

Test, suite and global variables should be uppercase
Set Test Variable ${minio_image}

Check notice

Code scanning / Robocop

{{ set_variable_keyword }} can be replaced with VAR Note test

Set Test Variable can be replaced with VAR

Check warning

Code scanning / Robocop

Test, suite and global variables should be uppercase Warning test

Test, suite and global variables should be uppercase
Set Test Variable ${service_name}

Check notice

Code scanning / Robocop

{{ set_variable_keyword }} can be replaced with VAR Note test

Set Test Variable can be replaced with VAR

Check warning

Code scanning / Robocop

Test, suite and global variables should be uppercase Warning test

Test, suite and global variables should be uppercase
Set Test Variable ${route_name}

Check notice

Code scanning / Robocop

{{ set_variable_keyword }} can be replaced with VAR Note test

Set Test Variable can be replaced with VAR

Check warning

Code scanning / Robocop

Test, suite and global variables should be uppercase Warning test

Test, suite and global variables should be uppercase
Create File From Template ${MINIO_POD_FILEPATH} ${MINIO_RESOURCES_DIRPATH}/minio_filled.yaml
${rc}= Run And Return Rc oc new-project ${namespace}

Check warning

Code scanning / Robocop

Local variable '{{ name }}' is overwritten before usage Warning test

Local variable '${rc}' is overwritten before usage
${rc} ${out}= Run And Return Rc And Output oc apply -f ${MINIO_RESOURCES_DIRPATH}/minio_filled.yaml -n ${namespace}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (132/120)
Wait For Pods To Be Ready label_selector=app=minio
... namespace=${namespace}
END
${rc} ${route}= Run And Return Rc And Output oc get route ${route_name} -n ${namespace} --template={{.spec.host}}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (126/120)
Should Be Equal As Integers ${rc} ${0}
RETURN ${route}

Generate Minio Random Credentials

Check warning

Code scanning / Robocop

Missing documentation in '{{ name }}' keyword Warning test

Missing documentation in 'Generate Minio Random Credentials' keyword
${key}= Generate Random String chars=[NUMBERS][LETTERS]
${pw}= Generate Random String chars=[NUMBERS][LETTERS]
${pw}= Generate Random String chars=[NUMBERS][LETTERS] length=12
RETURN ${key} ${pw}

Get Minio Credentials

Check warning

Code scanning / Robocop

Missing documentation in '{{ name }}' keyword Warning test

Missing documentation in 'Get Minio Credentials' keyword
[Arguments] ${namespace} ${podname}=ods-ci-minio
${key}= Set Variable user
${pw}= Set Variable myfakepassword
${rc} ${key}= Run And Return Rc And Output
... oc get pod ${podname} -n ${namespace} -o jsonpath='{range .spec.containers[*].env[?(@.name=="MINIO_ACCESS_KEY")]}{@.value}{end}' # robocop: disable
Should Be Equal As Integers ${rc} ${0}
${rc} ${pw}= Run And Return Rc And Output
... oc get pod ${podname} -n ${namespace} -o jsonpath='{range .spec.containers[*].env[?(@.name=="MINIO_SECRET_KEY")]}{@.value}{end}' # robocop: disable
Should Be Equal As Integers ${rc} ${0}
RETURN ${key} ${pw}

Check warning

Code scanning / Robocop

Missing trailing blank line at the end of file Warning test

Missing trailing blank line at the end of file
12 changes: 6 additions & 6 deletions ods_ci/tests/Resources/Files/minio/minio.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: minio-service
name: ${service_name}
spec:
ports:
- name: minio-client-port
Expand All @@ -14,14 +14,14 @@ spec:
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: minio-route
name: ${route_name}
spec:
to:
kind: Service
name: minio-service
name: ${service_name}
weight: 100
port:
targetPort: ui
targetPort: minio-client-port
wildcardPolicy: None
tls:
termination: edge
Expand All @@ -32,7 +32,7 @@ kind: Pod
metadata:
labels:
app: minio
name: ods-ci-minio
name: ${podname}
spec:

Check warning

Code scanning / SonarCloud

Service account tokens should not be mounted in pods Medium test

Set automountServiceAccountToken to false for this specification of kind Pod. See more on SonarCloud
containers:
- args:

Check warning

Code scanning / SonarCloud

CPU limits should be enforced Medium test

Specify a CPU limit for this container. See more on SonarCloud

Check warning

Code scanning / SonarCloud

Memory limits should be enforced Medium test

Specify a memory limit for this container. See more on SonarCloud
Expand All @@ -43,6 +43,6 @@ spec:
value: ${key}
- name: MINIO_SECRET_KEY
value: ${pw}
image: ${url}
image: ${minio_image}
imagePullPolicy: Always
name: minio
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ Verify User Can Serve And Query A Model From Minio
... using Kserve and Caikit+TGIS runtime
[Tags] Tier1 RHOAIENG-3490
${minio_namespace}= Set Variable minio-models
Deploy MinIO namespace=${minio_namespace}
Wait For Pods To Be Ready label_selector=app=minio
... namespace=${minio_namespace}
${minio_endpoint}= Deploy MinIO namespace=${minio_namespace}
${key} ${pw}= Get Minio Credentials namespace=${minio_namespace}
Set Project And Runtime runtime=${TGIS_RUNTIME_NAME} namespace=${TEST_NS}-minio
... access_key_id=${key} access_key=${pw}
... endpoint=minio-service.${minio_namespace}.svc.cluster.local:9000
... endpoint=${minio_endpoint}
... verify_ssl=${FALSE} # temporary
${test_namespace}= Set Variable ${TEST_NS}-minio
${model_name}= Set Variable flan-t5-small-hf
Expand All @@ -46,17 +44,19 @@ Verify User Can Serve And Query A Model From Minio
Query Model Multiple Times model_name=${model_name} runtime=${TGIS_RUNTIME_NAME}
... inference_type=all-tokens n_times=1
... namespace=${test_namespace}
# Query Model Multiple Times model_name=${model_name} runtime=${TGIS_RUNTIME_NAME}
# ... inference_type=streaming n_times=1
# ... namespace=${test_namespace} validate_response=${FALSE}
# [Teardown] Clean Up Test Project test_ns=${test_namespace}
# ... isvc_names=${models_names} wait_prj_deletion=${FALSE}
Query Model Multiple Times model_name=${model_name} runtime=${TGIS_RUNTIME_NAME}
... inference_type=streaming n_times=1
... namespace=${test_namespace} validate_response=${FALSE}
[Teardown] Run Keywords
... Clean Up Test Project test_ns=${test_namespace} isvc_names=${models_names} wait_prj_deletion=${FALSE}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (121/120)
... AND
... Run And Return Rc oc delete project ${minio_namespace}


*** Keywords ***
Suite Setup
[Documentation]

Check warning

Code scanning / Robocop

Documentation of {{ block_name }} is empty Warning test

Documentation of 'Suite Setup' Keyword is empty
Skip If Component Is Not Enabled kserve
# RHOSi Setup
RHOSi Setup
Load Expected Responses
Run git clone https://github.com/IBM/text-generation-inference/

Check warning

Code scanning / Robocop

Missing trailing blank line at the end of file Warning test

Missing trailing blank line at the end of file

0 comments on commit ecae5fa

Please sign in to comment.