aztk/spark/client/base/helpers/generate_cluster_start_task.py
def __cluster_install_cmd(
        zip_resource_file: batch_models.ResourceFile,
        gpu_enabled: bool,
        docker_repo: str = None,
        docker_run_options: str = None,
        file_mounts=None,
):
    """
        For Docker on ubuntu 16.04 - return the command line
        to be run on the start task of the pool to setup spark.
    """
    default_docker_repo = constants.DEFAULT_DOCKER_REPO if not gpu_enabled else constants.DEFAULT_DOCKER_REPO_GPU
    docker_repo = docker_repo or default_docker_repo

    shares = []

    if file_mounts:
        for mount in file_mounts:
            # Create the directory on the node
            shares.append("mkdir -p {0}".format(mount.mount_path))

            # Mount the file share
            shares.append(
                "mount -t cifs //{0}.file.core.windows.net/{2} {3} -o vers=3.0,username={0},password={1},dir_mode=0777,file_mode=0777,sec=ntlmssp".
                format(mount.storage_account_name, mount.storage_account_key, mount.file_share_path, mount.mount_path))

    setup = [
        "time("
        "apt-get -y update;"
        "apt-get -y --no-install-recommends install unzip;"
        "unzip -o $AZ_BATCH_TASK_WORKING_DIR/{0};"
        "chmod 777 $AZ_BATCH_TASK_WORKING_DIR/aztk/node_scripts/setup_host.sh;"
        ") 2>&1".format(zip_resource_file.file_path),
        '/bin/bash $AZ_BATCH_TASK_WORKING_DIR/aztk/node_scripts/setup_host.sh {0} {1} "{2}"'.format(
            constants.DOCKER_SPARK_CONTAINER_NAME,
            docker_repo,
            "" if docker_run_options is None else docker_run_options.replace('"', '\\"'),
        ),
    ]

    commands = shares + setup
    return commands

        For Docker on ubuntu 16.04 - return the command line
        to be run on the start task of the pool to setup spark.
    
For Docker on ubuntu 16.04 - return the command line
to be run on the start task of the pool to setup spark.
For Docker on ubuntu 16 . 04 - return the command line to be run on the start task of the pool to setup spark .
def __cluster_install_cmd(
        zip_resource_file: batch_models.ResourceFile,
        gpu_enabled: bool,
        docker_repo: str = None,
        docker_run_options: str = None,
        file_mounts=None,
):
    default_docker_repo = constants.DEFAULT_DOCKER_REPO if not gpu_enabled else constants.DEFAULT_DOCKER_REPO_GPU
    docker_repo = docker_repo or default_docker_repo
    shares = []
    if file_mounts:
        for mount in file_mounts:
            shares.append("mkdir -p {0}".format(mount.mount_path))
            shares.append(
                "mount -t cifs //{0}.file.core.windows.net/{2} {3} -o vers=3.0,username={0},password={1},dir_mode=0777,file_mode=0777,sec=ntlmssp".
                format(mount.storage_account_name, mount.storage_account_key, mount.file_share_path, mount.mount_path))
    setup = [
        "time("
        "apt-get -y update;"
        "apt-get -y --no-install-recommends install unzip;"
        "unzip -o $AZ_BATCH_TASK_WORKING_DIR/{0};"
        "chmod 777 $AZ_BATCH_TASK_WORKING_DIR/aztk/node_scripts/setup_host.sh;"
        ") 2>&1".format(zip_resource_file.file_path),
        '/bin/bash $AZ_BATCH_TASK_WORKING_DIR/aztk/node_scripts/setup_host.sh {0} {1} "{2}"'.format(
            constants.DOCKER_SPARK_CONTAINER_NAME,
            docker_repo,
            "" if docker_run_options is None else docker_run_options.replace('"', '\\"'),
        ),
    ]
    commands = shares + setup
    return commands
def __cluster_install_cmd ( zip_resource_file : batch_models . ResourceFile , gpu_enabled : bool , docker_repo : str = None , docker_run_options : str = None , file_mounts = None , ) : default_docker_repo = constants . DEFAULT_DOCKER_REPO if not gpu_enabled else constants . DEFAULT_DOCKER_REPO_GPU docker_repo = docker_repo or default_docker_repo shares = [ ] if file_mounts : for mount in file_mounts : shares . append ( "mkdir -p {0}" . format ( mount . mount_path ) ) shares . append ( "mount -t cifs //{0}.file.core.windows.net/{2} {3} -o vers=3.0,username={0},password={1},dir_mode=0777,file_mode=0777,sec=ntlmssp" . format ( mount . storage_account_name , mount . storage_account_key , mount . file_share_path , mount . mount_path ) ) setup = [ "time(" "apt-get -y update;" "apt-get -y --no-install-recommends install unzip;" "unzip -o $AZ_BATCH_TASK_WORKING_DIR/{0};" "chmod 777 $AZ_BATCH_TASK_WORKING_DIR/aztk/node_scripts/setup_host.sh;" ") 2>&1" . format ( zip_resource_file . file_path ) , '/bin/bash $AZ_BATCH_TASK_WORKING_DIR/aztk/node_scripts/setup_host.sh {0} {1} "{2}"' . format ( constants . DOCKER_SPARK_CONTAINER_NAME , docker_repo , "" if docker_run_options is None else docker_run_options . replace ( '"' , '\\"' ) , ) , ] commands = shares + setup return commands
For Docker on ubuntu 16.04 - return the command line
to be run on the start task of the pool to setup spark.
For Docker on ubuntu 16 . 04 - return the command line to be run on the start task of the pool to setup spark .
"""
        For Docker on ubuntu 16.04 - return the command line
        to be run on the start task of the pool to setup spark.
    """ # Create the directory on the node # Mount the file share
zip_resource_file
batch_models.ResourceFile
gpu_enabled
bool
docker_repo
str
docker_run_options
str
file_mounts