Skip to content

Commit

Permalink
Cleanups and more test fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
razvan committed Aug 23, 2023
1 parent efb05c4 commit 4599120
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 20 deletions.
4 changes: 2 additions & 2 deletions tests/templates/kuttl/pod_overrides/04-prepare-bucket.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ commands:
- command: sleep 5
- script: |
POD=$(kubectl -n $NAMESPACE get pod -l app.kubernetes.io/instance=test-minio -o name | head -n 1 | sed -e 's#pod/##')
kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar $POD:/tmp
kubectl -n $NAMESPACE exec $POD -- mc cp /tmp/spark-examples_{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar local/my-bucket
kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split(',')[0] }}.jar $POD:/tmp
kubectl -n $NAMESPACE exec $POD -- mc cp /tmp/spark-examples_{{ test_scenario['values']['spark'].split(',')[0] }}.jar local/my-bucket
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
pullPolicy: IfNotPresent
mode: cluster
mainClass: org.apache.spark.examples.SparkPi
mainApplicationFile: "s3a://my-bucket/spark-examples_{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar"
mainApplicationFile: "s3a://my-bucket/spark-examples_{{ test_scenario['values']['spark'].split(',')[0] }}.jar"
s3connection:
reference: spark-data-s3-connection
logFileDirectory:
Expand Down
4 changes: 2 additions & 2 deletions tests/templates/kuttl/smoke/04-prepare-bucket.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ commands:
- command: sleep 5
- script: |
POD=$(kubectl -n $NAMESPACE get pod -l app.kubernetes.io/instance=test-minio -o name | head -n 1 | sed -e 's#pod/##')
kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar $POD:/tmp
kubectl -n $NAMESPACE exec $POD -- mc cp /tmp/spark-examples_{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar local/my-bucket
kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split(',')[0] }}.jar $POD:/tmp
kubectl -n $NAMESPACE exec $POD -- mc cp /tmp/spark-examples_{{ test_scenario['values']['spark'].split(',')[0] }}.jar local/my-bucket
2 changes: 1 addition & 1 deletion tests/templates/kuttl/smoke/10-deploy-spark-app.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
pullPolicy: IfNotPresent
mode: cluster
mainClass: org.apache.spark.examples.SparkPi
mainApplicationFile: "s3a://my-bucket/spark-examples_{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar"
mainApplicationFile: "s3a://my-bucket/spark-examples_{{ test_scenario['values']['spark'].split(',')[0] }}.jar"
s3connection:
reference: spark-data-s3-connection
logFileDirectory:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ kind: TestStep
commands:
# give minio enough time to start
- command: sleep 10
- command: kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar minio-client:/tmp/spark-examples.jar
- command: kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split(',')[0] }}.jar minio-client:/tmp/spark-examples.jar
- command: kubectl exec -n $NAMESPACE minio-client -- mc --insecure alias set test-minio http://test-minio:9000 spark sparkspark
- command: kubectl exec -n $NAMESPACE minio-client -- mc cp /tmp/spark-examples.jar test-minio/my-bucket
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ commands:
# give minio enough time to start
- command: sleep 10
- command: kubectl cp -n $NAMESPACE yellow_tripdata_2021-07.csv minio-client:/tmp
- command: kubectl cp -n $NAMESPACE ny-tlc-report-1.1.0-{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar minio-client:/tmp/ny-tlc-report.jar
- command: kubectl cp -n $NAMESPACE ny-tlc-report-1.1.0-{{ test_scenario['values']['spark'].split(',')[0] }}.jar minio-client:/tmp/ny-tlc-report.jar
{% if test_scenario['values']['s3-use-tls'] == 'true' %}
- command: kubectl exec -n $NAMESPACE minio-client -- mc --insecure alias set minio https://minio:9000 spark sparkspark
{% else %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: TestStep
commands:
# give minio enough time to start
- command: sleep 10
- command: kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar minio-client:/tmp/spark-examples.jar
- command: kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split(',')[0] }}.jar minio-client:/tmp/spark-examples.jar
- command: kubectl exec -n $NAMESPACE minio-client -- sh -c 'mc alias set test-minio http://test-minio:9000 $$MINIO_SERVER_ACCESS_KEY $$MINIO_SERVER_SECRET_KEY'
- command: kubectl exec -n $NAMESPACE minio-client -- mc mb test-minio/my-bucket
- command: kubectl exec -n $NAMESPACE minio-client -- mc cp /tmp/spark-examples.jar test-minio/my-bucket
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: TestStep
commands:
# give minio enough time to start
- command: sleep 10
- command: kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split('-stackable')[0] }}.jar minio-client:/tmp/spark-examples.jar
- command: kubectl cp -n $NAMESPACE spark-examples_{{ test_scenario['values']['spark'].split(',')[0] }}.jar minio-client:/tmp/spark-examples.jar
- command: kubectl exec -n $NAMESPACE minio-client -- sh -c 'mc alias set test-minio http://test-minio:9000 $$MINIO_SERVER_ACCESS_KEY $$MINIO_SERVER_SECRET_KEY'
- command: kubectl exec -n $NAMESPACE minio-client -- mc mb test-minio/my-bucket
- command: kubectl exec -n $NAMESPACE minio-client -- mc policy set public test-minio/my-bucket
Expand Down
10 changes: 0 additions & 10 deletions tests/test-definition.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# These tests can run against an OpenShift cluster, provided you note the following:
#
# 1. Set the "openshift" dimension below to "true" (with quotes)
# 2. Comment out the "true" option in the "s3-use-tls" dimension
#
# Regarding point 2.: the bitnami chart is used for S3 on OpenShift as it correctly installs
# a minio instance (the chart from minio does not correctly apply the service account to
# the job that creates the bucket, and so the permissions are not sufficient). However, it
# cannot correctly use self-signed TLS certificates due to a bug in libminioclient.sh: for
# non-OpenShift clusters the minio chart is thus used instead.
---
dimensions:
- name: openshift
Expand Down

0 comments on commit 4599120

Please sign in to comment.