Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Improve DSEngine workload deployment script and options.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpereira committed Oct 10, 2019
1 parent 0820ef1 commit d7235ac
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 68 deletions.
14 changes: 7 additions & 7 deletions scale-tests/configs/jupiter-options.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"service": {
"name": "jupyter/jupyter",
"service_account": "jupyter__jupyter",
"service_account_secret": "jupyter__jupyter-secret",
"name": "data-services/jupyter",
"service_account": "data_services__jupyter",
"service_account_secret": "data_services__jupyter-secret",
"gpu": {
"enabled": true
},
"virtual_network_enabled": true,
"virtual_network_name": "dcos"
},
"spark": {
"spark_mesos_role": "jupyter__jupyter",
"spark_mesos_principal": "jupyter__jupyter",
"spark_mesos_secret": "jupyter__jupyter-secret"
"spark_mesos_role": "data_services__jupyter",
"spark_mesos_principal": "data_services__jupyter",
"spark_mesos_secret": "data_services__jupyter-secret"
}
}
}
87 changes: 87 additions & 0 deletions scale-tests/deploy_dsengine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/usr/bin/env bash

set -x

create_service_account() {
SERVICE_ACCOUNT="${1}"
SECRET_NAME="${SERVICE_ACCOUNT}-secret"

dcos security org service-accounts delete "${SERVICE_ACCOUNT}"
dcos security secrets delete "${SECRET_NAME}"

dcos security org service-accounts keypair private.pem public.pem
dcos security org service-accounts create \
-p public.pem \
-d "Service account for ${SERVICE_ACCOUNT}" "${SERVICE_ACCOUNT}"
dcos security secrets create-sa-secret \
--strict private.pem \
"${SERVICE_ACCOUNT}" \
"${SECRET_NAME}"

rm -f private.pem public.pem
}

grant_permissions() {
SERVICE_ACCOUNT="${1}"

echo "Granting permissions to Service Account ${SERVICE_ACCOUNT}"

dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:master:task:user:nobody" \
create
dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:agent:task:user:nobody" \
create
dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:secrets:list:default:__dcos_base64__hdfs_jupyter_keytab" \
read
}

grant_spark_permissions() {
SERVICE_ACCOUNT=$1
echo "Granting Spark permissions to Jupyter Service Account ${SERVICE_ACCOUNT}"

dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:master:framework:role:${SERVICE_ACCOUNT}" \
create
dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:master:reservation:role:${SERVICE_ACCOUNT}" \
create
dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:master:reservation:principal:${SERVICE_ACCOUNT}" \
delete
dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:master:volume:role:${SERVICE_ACCOUNT}" \
create
dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:master:volume:principal:${SERVICE_ACCOUNT}" \
delete

dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:master:task:role:${SERVICE_ACCOUNT}" \
create
dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:master:task:principal:${SERVICE_ACCOUNT}" \
create
dcos security org users grant "${SERVICE_ACCOUNT}" \
"dcos:mesos:master:task:app_id:data-services/jupyter" \
create
}
create_service_account data_services__jupyter

grant_permissions data_services__jupyter
grant_spark_permissions data_services__jupyter

dcos package install --yes data-science-engine \
--options=scale-tests/configs/jupiter-options.json

# Run the following in the Jupyter notebook UI (password: jupyter):
#
# ! spark-submit \
# --conf spark.mesos.gpus.max=40 \
# --conf spark.cores.max=40 \
# --conf spark.mesos.executor.gpus=1 \
# --conf spark.executor.cores=1 \
# --verbose \
# --class MockTaskRunner \
# https://infinity-artifacts.s3.amazonaws.com/scale-tests/dcos-spark-scala-tests-assembly-2.4.0-20190325.jar 5000 10
61 changes: 0 additions & 61 deletions scale-tests/jupiter.sh

This file was deleted.

0 comments on commit d7235ac

Please sign in to comment.