Skip to content

Commit

Permalink
[PPML] Fix BigDL Graphene Azure scripts (#5767)
Browse files Browse the repository at this point in the history
* update

* update submit scripts
  • Loading branch information
jenniew authored Sep 16, 2022
1 parent e4fcf7e commit ce260ec
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
22 changes: 11 additions & 11 deletions docs/readthedocs/source/doc/PPML/Overview/azure_ppml.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ export TF_MKL_ALLOC_MAX_BYTES=10737418240 && \
--conf spark.driver.defaultJavaOptions="-Dlog4j.configuration=/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/log4j2.xml" \
--conf spark.executor.defaultJavaOptions="-Dlog4j.configuration=/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/log4j2.xml" \
--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark \
--conf spark.kubernetes.container.image=intelanalytics/bigdl-ppml-trusted-big-data-ml-python-graphene:2.1.1-SNAPSHOT \
--conf spark.kubernetes.driver.podTemplateFile=/ppml/trusted-big-data-ml/spark-driver-template-kv.yaml \
--conf spark.kubernetes.executor.podTemplateFile=/ppml/trusted-big-data-ml/spark-executor-template-kv.yaml \
--conf spark.kubernetes.container.image=intelanalytics/bigdl-ppml-trusted-big-data-ml-python-graphene:2.1.0-SNAPSHOT \
--conf spark.kubernetes.driver.podTemplateFile=/ppml/trusted-big-data-ml/azure/spark-driver-template-az.yaml \
--conf spark.kubernetes.executor.podTemplateFile=/ppml/trusted-big-data-ml/azure/spark-executor-template-az.yaml \
--conf spark.kubernetes.executor.deleteOnTermination=false \
--conf spark.network.timeout=10000000 \
--conf spark.executor.heartbeatInterval=10000000 \
Expand Down Expand Up @@ -345,7 +345,7 @@ export TF_MKL_ALLOC_MAX_BYTES=10737418240 && \
--conf spark.bigdl.kms.key.data=$DATA_KEY_PATH \
--class $SPARK_JOB_MAIN_CLASS \
--verbose \
local://$SPARK_EXTRA_JAR_PATH \
$SPARK_EXTRA_JAR_PATH \
$ARGS

```
Expand Down Expand Up @@ -378,7 +378,7 @@ Generate primary key and data key, then save to file system.

The example code of generate primary key and data key is like below:
```
java -cp '/ppml/trusted-big-data-ml/work/bigdl-2.1.0-SNAPSHOT/lib/bigdl-ppml-spark_3.1.2-2.1.0-SNAPSHOT-jar-with-dependencies.jar:/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/:/ppml/trusted-big-data-ml/work/spark-3.1.2/jars/* \
java -cp '/ppml/trusted-big-data-ml/work/bigdl-2.1.0-SNAPSHOT/jars/*:/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/:/ppml/trusted-big-data-ml/work/spark-3.1.2/jars/* \
-Xmx10g \
com.intel.analytics.bigdl.ppml.examples.GenerateKeys \
--kmsType AzureKeyManagementService \
Expand All @@ -392,7 +392,7 @@ Encrypt data with specified BigDL `AzureKeyManagementService`

The example code of encrypt data is like below:
```
java -cp '/ppml/trusted-big-data-ml/work/bigdl-2.1.0-SNAPSHOT/lib/bigdl-ppml-spark_3.1.2-2.1.0-SNAPSHOT-jar-with-dependencies.jar:/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/:/ppml/trusted-big-data-ml/work/spark-3.1.2/jars/* \
java -cp '/ppml/trusted-big-data-ml/work/bigdl-2.1.0-SNAPSHOT/jars/*:/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/:/ppml/trusted-big-data-ml/work/spark-3.1.2/jars/* \
-Xmx10g \
com.intel.analytics.bigdl.ppml.examples.tpch.EncryptFiles \
--kmsType AzureKeyManagementService \
Expand Down Expand Up @@ -432,7 +432,7 @@ OUTPUT_DIR=xxx/output
export TF_MKL_ALLOC_MAX_BYTES=10737418240 && \
/opt/jdk8/bin/java \
-cp '/ppml/trusted-big-data-ml/work/bigdl-2.1.0-SNAPSHOT/lib/bigdl-ppml-spark_3.1.2-2.1.0-SNAPSHOT-jar-with-dependencies.jar:/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/:/ppml/trusted-big-data-ml/work/spark-3.1.2/jars/*' \
-cp '/ppml/trusted-big-data-ml/work/bigdl-2.1.0-SNAPSHOT/jars/*:/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/:/ppml/trusted-big-data-ml/work/spark-3.1.2/jars/*' \
-Xmx10g \
-Dbigdl.mklNumThreads=1 \
org.apache.spark.deploy.SparkSubmit \
Expand All @@ -448,9 +448,9 @@ export TF_MKL_ALLOC_MAX_BYTES=10737418240 && \
--conf spark.driver.defaultJavaOptions="-Dlog4j.configuration=/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/log4j2.xml" \
--conf spark.executor.defaultJavaOptions="-Dlog4j.configuration=/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/log4j2.xml" \
--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark \
--conf spark.kubernetes.container.image=intelanalytics/bigdl-ppml-trusted-big-data-ml-python-graphene:2.1.1-SNAPSHOT \
--conf spark.kubernetes.driver.podTemplateFile=/ppml/trusted-big-data-ml/spark-driver-template-kv.yaml \
--conf spark.kubernetes.executor.podTemplateFile=/ppml/trusted-big-data-ml/spark-executor-template-kv.yaml \
--conf spark.kubernetes.container.image=intelanalytics/bigdl-ppml-trusted-big-data-ml-python-graphene:2.1.0-SNAPSHOT \
--conf spark.kubernetes.driver.podTemplateFile=/ppml/trusted-big-data-ml/azure/spark-driver-template-az.yaml \
--conf spark.kubernetes.executor.podTemplateFile=/ppml/trusted-big-data-ml/azure/spark-executor-template-az.yaml \
--conf spark.kubernetes.executor.deleteOnTermination=false \
--conf spark.network.timeout=10000000 \
--conf spark.executor.heartbeatInterval=10000000 \
Expand Down Expand Up @@ -495,7 +495,7 @@ export TF_MKL_ALLOC_MAX_BYTES=10737418240 && \
--conf spark.bigdl.kms.key.data=$DATA_KEY_PATH \
--class $SPARK_JOB_MAIN_CLASS \
--verbose \
/ppml/trusted-big-data-ml/work/bigdl-2.1.0-SNAPSHOT/lib/bigdl-ppml-spark_3.1.2-2.1.0-SNAPSHOT-jar-with-dependencies.jar \
/ppml/trusted-big-data-ml/work/bigdl-2.1.0-SNAPSHOT/jars/bigdl-ppml-spark_3.1.2-2.1.0-SNAPSHOT.jar \
$INPUT_DIR $OUTPUT_DIR aes_cbc_pkcs5padding plain_text [QUERY]
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ openssl x509 -req -days 9999 -in server.csr -signkey server.key -out server.crt
# Use sudo on cat if necessary.
# Changing from redirection to tee to elude permission denials.

cat server.key | sudo tee server.pem
cat server.crt | sudo tee -a server.pem
cat server.key | tee server.pem
cat server.crt | tee -a server.pem
openssl pkcs12 -export -in server.pem -out keystore.pkcs12
keytool -importkeystore -srckeystore keystore.pkcs12 -destkeystore keystore.jks -srcstoretype PKCS12 -deststoretype JKS
openssl pkcs12 -in keystore.pkcs12 -nodes -out server.pem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ spec:
objectName: key-pass
objectType: secret
objectVersion: ""
tenantId: <tenant-id>
tenantId: <tenant-id>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
#sgx.intel.com/enclave: 10
#sgx.intel.com/provision: 10
volumes:
- name: secretes-store01
- name: secrets-store01
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
Expand All @@ -50,4 +50,4 @@ spec:
secretName: ssl-keys
- name: kube-config
secret:
secretName: kubeconf
secretName: kubeconf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
#sgx.intel.com/enclave: 10
#sgx.intel.com/provision: 10
volumes:
- name: secretes-store01
- name: secrets-store01
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#set -x
#SPARK_EXTRA_JAR_PATH=/ppml/trusted-big-data-ml/work/spark-3.1.2/examples/jars/spark-encrypt-io.jar
SPARK_EXTRA_JAR_PATH=
SPARK_JOB_MAIN_CLASS=
ARGS=
Expand Down Expand Up @@ -34,8 +33,8 @@ export TF_MKL_ALLOC_MAX_BYTES=10737418240 && \
--conf spark.executor.defaultJavaOptions="-Dlog4j.configuration=/ppml/trusted-big-data-ml/work/spark-3.1.2/conf/log4j2.xml" \
--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark \
--conf spark.kubernetes.container.image=intelanalytics/bigdl-ppml-trusted-big-data-ml-python-graphene:2.1.0-SNAPSHOT \
--conf spark.kubernetes.driver.podTemplateFile=/ppml/trusted-big-data-ml/spark-driver-template-az.yaml \
--conf spark.kubernetes.executor.podTemplateFile=/ppml/trusted-big-data-ml/spark-executor-template-az.yaml \
--conf spark.kubernetes.driver.podTemplateFile=/ppml/trusted-big-data-ml/azure/spark-driver-template-az.yaml \
--conf spark.kubernetes.executor.podTemplateFile=/ppml/trusted-big-data-ml/azure/spark-executor-template-az.yaml \
--conf spark.kubernetes.executor.deleteOnTermination=false \
--conf spark.network.timeout=10000000 \
--conf spark.executor.heartbeatInterval=10000000 \
Expand Down Expand Up @@ -80,5 +79,5 @@ export TF_MKL_ALLOC_MAX_BYTES=10737418240 && \
--conf spark.bigdl.kms.key.data=$DATA_KEY_PATH \
--class $SPARK_JOB_MAIN_CLASS \
--verbose \
local://$SPARK_EXTRA_JAR_PATH \
$SPARK_EXTRA_JAR_PATH \
$ARGS

0 comments on commit ce260ec

Please sign in to comment.