BatchAI. Initial drop of azure-cli-batchai. (#4600)

* BatchAI. Initial drop of azure-cli-batchai.

* BatchAI. Getting rid of legacy "learning" term.

The old service name "Batch AI Learning" has been changed to "Batch AI",
so we need to update all environment variables names.

* BatchAI. Added scenario for configless cluster and nfs creation

* BatchAI. Update cluster resize and cluster auto-scale.

After adding payload-flattening-threshold=2, cluster.update signature
changed. Updating affected commands.
This commit is contained in:
AlexanderYukhanov 2017-10-04 10:44:14 -07:00 коммит произвёл Troy Dai
Родитель a2ca64137d
Коммит 448f420a10
32 изменённых файлов: 5639 добавлений и 0 удалений

1
.github/CODEOWNERS поставляемый
Просмотреть файл

@ -11,6 +11,7 @@
/src/command_modules/azure-cli-appservice/ @yugangw-msft
/src/command_modules/azure-cli-backup/ @dragonfly91
/src/command_modules/azure-cli-batch/ @annatisch
/src/command_modules/azure-cli-batchai/ @AlexanderYukhanov
/src/command_modules/azure-cli-cdn/ @tjprescott
/src/command_modules/azure-cli-cosmosdb/ @dmakwana
/src/command_modules/azure-cli-cloud/ @derekbekoe

Просмотреть файл

@ -10,6 +10,7 @@
"acs": "src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/_help.py",
"appservice": "src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_help.py",
"batch": "src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_help.py",
"batchai": "src/command_modules/azure-cli-batchai/azure/cli/command_modules/batchai/_help.py",
"backup": "src/command_modules/azure-cli-backup/azure/cli/command_modules/backup/_help.py",
"billing": "src/command_modules/azure-cli-billing/azure/cli/command_modules/billing/_help.py",
"cdn": "src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/_help.py",

Просмотреть файл

@ -53,6 +53,7 @@ DEPENDENCIES = [
'azure-cli-acs',
'azure-cli-appservice',
'azure-cli-batch',
'azure-cli-batchai',
'azure-cli-backup',
'azure-cli-billing',
'azure-cli-cdn',

Просмотреть файл

@ -0,0 +1,9 @@
.. :changelog:
Release History
===============
(unreleased)
++++++++++++++++++
* Initial release of Batch AI module.

Просмотреть файл

@ -0,0 +1 @@
include *.rst

Просмотреть файл

@ -0,0 +1,4 @@
Microsoft Azure CLI Batch AI Module
=========================================
This package is for the `batchai` module.

Просмотреть файл

@ -0,0 +1,7 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -0,0 +1,7 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -0,0 +1,7 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)

Просмотреть файл

@ -0,0 +1,14 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import azure.cli.command_modules.batchai._help # pylint: disable=unused-import
def load_params(_):
import azure.cli.command_modules.batchai._params # pylint: disable=redefined-outer-name, unused-variable
def load_commands():
import azure.cli.command_modules.batchai.commands # pylint: disable=redefined-outer-name, unused-variable

Просмотреть файл

@ -0,0 +1,26 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
def batchai_client_factory(_=None):
from azure.mgmt.batchai import BatchAIManagementClient
from azure.cli.core.commands.client_factory import get_mgmt_service_client
return get_mgmt_service_client(BatchAIManagementClient)
def cluster_client_factory(_):
return batchai_client_factory().clusters
def job_client_factory(_):
return batchai_client_factory().jobs
def file_client_factory(_):
return batchai_client_factory().jobs
def file_server_client_factory(_):
return batchai_client_factory().file_servers

Просмотреть файл

@ -0,0 +1,91 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from collections import OrderedDict
def cluster_list_table_format(result):
"""Format cluster list as a table."""
table = []
for item in result:
row = OrderedDict()
row['Name'] = item['name']
row['Resource Group'] = item['resourceGroup']
row['VM Size'] = item['vmSize']
row['State'] = item['allocationState']
row['Idle'] = str(item['nodeStateCounts']['idleNodeCount'])
row['Running'] = str(item['nodeStateCounts']['runningNodeCount'])
row['Preparing'] = str(item['nodeStateCounts']['preparingNodeCount'])
row['Leaving'] = str(item['nodeStateCounts']['leavingNodeCount'])
row['Unusable'] = str(item['nodeStateCounts']['unusableNodeCount'])
table.append(row)
return table
def job_list_table_format(result):
"""Format job list as a table."""
table = []
for item in result:
row = OrderedDict()
row['Name'] = item['name']
row['Resource Group'] = item['resourceGroup']
cluster = item['cluster']['id'].split('/')[8]
row['Cluster'] = cluster
row['Cluster RG'] = item['cluster']['resourceGroup']
row['Tool'] = item['toolType']
row['Nodes'] = item['nodeCount']
row['State'] = item['executionState']
if item['executionInfo'] and \
item['executionInfo']['exitCode'] is not None:
row['Exit code'] = str(item['executionInfo']['exitCode'])
else:
row['Exit code'] = ''
table.append(row)
return table
def file_list_table_format(result):
"""Format file list as a table."""
table = []
for item in result:
row = OrderedDict()
row['Name'] = item['name']
row['Size'] = str(item['contentLength'])
row['URL'] = item['downloadUrl']
table.append(row)
return table
def file_server_table_format(result):
"""Format file server list as a table."""
table = []
for item in result:
row = OrderedDict()
row['Name'] = item['name']
row['Resource Group'] = item['resourceGroup']
row['Size'] = item['vmSize']
disks = item['dataDisks']
if disks:
row['Disks'] = '{0} x {1} Gb'.format(disks['diskCount'], disks['diskSizeInGb'])
mount_settings = item['mountSettings']
if mount_settings:
row['Public IP'] = mount_settings['fileServerPublicIp']
row['Internal IP'] = mount_settings['fileServerInternalIp']
row['Type'] = mount_settings['fileServerType']
row['Mount Point'] = mount_settings['mountPoint']
table.append(row)
return table
def remote_login_table_format(result):
"""Format remote login info list as a table."""
table = []
for item in result:
row = OrderedDict()
row['ID'] = item['nodeId']
row['IP'] = item['ipAddress']
row['Port'] = int(item['port'])
table.append(row)
return table

Просмотреть файл

@ -0,0 +1,122 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from azure.cli.core.help_files import helps
helps['batchai'] = """
type: group
short-summary: Batch AI.
"""
helps['batchai cluster'] = """
type: group
short-summary: Commands to manage clusters.
"""
helps['batchai cluster create'] = """
type: command
short-summary: Create a cluster.
"""
helps['batchai cluster resize'] = """
type: command
short-summary: Resize a cluster.
"""
helps['batchai cluster set-auto-scale-parameters'] = """
type: command
short-summary: Set auto-scale parameters for a cluster.
"""
helps['batchai cluster delete'] = """
type: command
short-summary: Delete a cluster.
"""
helps['batchai cluster list'] = """
type: command
short-summary: List clusters.
"""
helps['batchai cluster show'] = """
type: command
short-summary: Show information about a cluster.
"""
helps['batchai cluster list-nodes'] = """
type: command
short-summary: List remote login information for cluster's nodes.
"""
helps['batchai job'] = """
type: group
short-summary: Commands to manage jobs.
"""
helps['batchai job create'] = """
type: command
short-summary: Create a job.
"""
helps['batchai job terminate'] = """
type: command
short-summary: Terminate a job.
"""
helps['batchai job delete'] = """
type: command
short-summary: Delete a job.
"""
helps['batchai job list'] = """
type: command
short-summary: List jobs.
"""
helps['batchai job show'] = """
type: command
short-summary: Show information about a job.
"""
helps['batchai job list-nodes'] = """
type: command
short-summary: List remote login information for nodes on which the job was run.
"""
helps['batchai file list-files'] = """
type: command
short-summary: List job's output files in a directory with given id.
"""
helps['batchai stream-file'] = """
type: command
short-summary: Output the current content of the file and outputs appended data as the file grows
(similar to 'tail -f').
"""
helps['batchai file-server'] = """
type: group
short-summary: Commands to manage file servers.
"""
helps['batchai file-server create'] = """
type: command
short-summary: Create a file server.
"""
helps['batchai file-server delete'] = """
type: command
short-summary: Delete a file server.
"""
helps['batchai file-server list'] = """
type: command
short-summary: List file servers.
"""
helps['batchai file-server show'] = """
type: command
short-summary: Show information about a file server.
"""

Просмотреть файл

@ -0,0 +1,199 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from enum import Enum
from azure.cli.command_modules.vm._actions import get_vm_sizes
from azure.cli.core.commands.parameters import (
ignore_type, location_type, resource_group_name_type, enum_choice_list, get_one_of_subscription_locations)
from azure.cli.core.sdk.util import ParametersContext
from azure.mgmt.storage.models import SkuName
def get_vm_size_completion_list(prefix, action, parsed_args, **kwargs): # pylint: disable=unused-argument
try:
location = parsed_args.location
except AttributeError:
location = get_one_of_subscription_locations()
result = get_vm_sizes(location)
return [r.name for r in result]
class SupportedImages(Enum): # pylint: disable=too-few-public-methods
ubuntu_tls = "UbuntuLTS"
ubuntu_dsvm = "UbuntuDSVM"
with ParametersContext(command='batchai cluster create') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.argument('location', options_list=('--location', '-l'), arg_type=location_type,
help='Location. You can configure the default location using `az configure --defaults '
'location=<location>` or specify it in the cluster configuration file.')
c.register_alias('cluster_name', options_list=('--name', '-n'), help='Name of the cluster.')
c.argument('user_name', options_list=('--user-name', '-u'),
help='Name of the admin user to be created on every compute node.', arg_group='Admin Account')
c.argument('ssh_key', options_list=('--ssh-key', '-k'),
help='SSH public key value or path.', arg_group='Admin Account')
c.argument('password', options_list=('--password', '-p'),
help='Password.', arg_group='Admin Account')
c.argument('image', options_list=('--image', '-i'), arg_group='Nodes',
help='Operation system.', **enum_choice_list(SupportedImages))
c.argument('vm_size', options_list=('--vm-size', '-s'),
help='VM size (e.g. Standard_NC6 for 1 GPU node)', completer=get_vm_size_completion_list,
arg_group='Nodes')
c.argument('min_nodes', options_list=('--min',),
help='Min nodes count.', type=int, arg_group='Nodes')
c.argument('max_nodes', options_list=('--max',),
help='Max nodes count.', type=int, arg_group='Nodes')
c.argument('nfs_name', options_list=('--nfs',),
help='Name of a file server to mount. If you need to mount more than one file server, configure them in '
'a configuration file and use --config option.',
arg_group='File Server Mount')
c.argument('nfs_resource_group', options_list=('--nfs-resource-group',),
help='Resource group in which file server is created. Can be omitted if the file server and the cluster '
'belong to the same resource group',
arg_group='File Server Mount')
c.argument('nfs_mount_path', options_list=('--nfs-mount-path',),
help='Relative mount path for nfs. The nfs will be available at '
'$AZ_LEARNING_MOUNT_ROOT/<relative_mount_path> folder.',
arg_group='File Server Mount')
c.argument('azure_file_share', options_list=('--afs-name',),
help='Name of the azure file share to mount. Please provide AZURE_BATCHAI_STORAGE_ACCOUNT and '
'AZURE_BATCHAI_STORAGE_KEY environment variables containing storage account name and key.',
arg_group='Azure File Share Mount')
c.argument('afs_mount_path', options_list=('--afs-mount-path',),
help='Relative mount path for Azure File share. The file share will be available at '
'$AZ_LEARNING_MOUNT_ROOT/<relative_mount_path> folder. If you to mount more than one Azure '
'Storage container, configure them in a configuration file and use --config option.',
arg_group='Azure File Share Mount')
c.argument('container_name', options_list=('--container-name',),
help='Name of Azure Storage container to mount. Please provide AZURE_BATCHAI_STORAGE_ACCOUNT and '
'AZURE_BATCHAI_STORAGE_KEY environment variables containing storage account name and key. If you '
'to mount more than one Azure Storage container, configure them in a configuration file and use '
'--config option.',
arg_group='Azure Storage Container Mount')
c.argument('container_mount_path', options_list=('--container-mount-path',),
help='Relative mount path for Azure Storage container. The container will be available at '
'$AZ_LEARNING_MOUNT_ROOT/<relative_mount_path> folder.',
arg_group='Azure Storage Container Mount')
c.argument('json_file', options_list=('--config', '-c'),
help='A path to a json file containing cluster create parameters '
'(json representation of azure.mgmt.batchai.models.ClusterCreateParameters).',
arg_group='Advanced')
with ParametersContext(command='batchai cluster resize') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('cluster_name', options_list=('--name', '-n'), help='Name of the cluster.')
c.argument('target', options_list=('--target', '-t'), help='Target number of compute nodes.')
with ParametersContext(command='batchai cluster auto-scale') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('cluster_name', options_list=('--name', '-n'), help='Name of the cluster.')
c.argument('min', options_list=('--min',), help='Minimum number of nodes.')
c.argument('max', options_list=('--max',), help='Minimum number of nodes.')
with ParametersContext(command='batchai cluster delete') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('cluster_name', options_list=('--name', '-n'), help='Name of the cluster.')
with ParametersContext(command='batchai cluster show') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('cluster_name', options_list=('--name', '-n'), help='Name of the cluster.')
with ParametersContext(command='batchai cluster list') as c:
c.argument('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
# Not implemented yet
c.register_alias('clusters_list_options', options_list=('--clusters-list-options',), arg_type=ignore_type)
with ParametersContext(command='batchai cluster list-nodes') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('cluster_name', options_list=('--name', '-n'), help='Name of the cluster.')
with ParametersContext(command='batchai job create') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.argument('location', options_list=('--location', '-l'), arg_type=location_type,
help='Location. You can configure the default location using `az configure --defaults '
'location=<location>` or specify it in the job configuration file.')
c.register_alias('job_name', options_list=('--name', '-n'), help='Name of the job.')
c.argument('json_file', options_list=('--config', '-c'),
help='A path to a json file containing job create parameters '
'(json representation of azure.mgmt.batchai.models.JobCreateParameters).')
c.argument('cluster_name', options_list=('--cluster-name',),
help='If specified, the job will run on the given cluster instead of the '
'one configured in the json file.')
c.argument('cluster_resource_group', options_list=('--cluster-resource-group',),
help='Specifies a resource group for the cluster given with --cluster-name parameter. '
'If omitted, --resource-group value will be used.')
with ParametersContext(command='batchai job terminate') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('job_name', options_list=('--name', '-n'), help='Name of the job.')
with ParametersContext(command='batchai job delete') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('job_name', options_list=('--name', '-n'), help='Name of the job.')
with ParametersContext(command='batchai job show') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('job_name', options_list=('--name', '-n'), help='Name of the job.')
with ParametersContext(command='batchai job list') as c:
c.argument('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
# Not implemented yet
c.register_alias('jobs_list_options', options_list=('--jobs-list-options',), arg_type=ignore_type)
with ParametersContext(command='batchai job list-nodes') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('job_name', options_list=('--name', '-n'), help='Name of the job.')
with ParametersContext(command='batchai job list-files') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('job_name', options_list=('--name', '-n'), help='Name of the job.')
c.register_alias('directory', options_list=('--output-directory-id', '-d'),
help='The Id of the Job output directory (as specified by "id" element in outputDirectories '
'collection in job create parameters). Use "stdouterr" to access job stdout and stderr '
'files.')
with ParametersContext(command='batchai job stream-file') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('job_name', options_list=('--job-name', '-j'), help='Name of the job.')
c.register_alias('directory', options_list=('--output-directory-id', '-d'),
help='The Id of the Job output directory (as specified by "id" element in outputDirectories '
'collection in job create parameters). Use "stdouterr" to access job stdout and stderr '
'files.')
c.argument('file_name', options_list=('--name', '-n'), help='The name of the file to stream.')
with ParametersContext(command='batchai file-server create') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.argument('location', options_list=('--location', '-l'), arg_type=location_type,
help='Location. You can configure the default location using `az configure --defaults '
'location=<location>` or specify it in the file server configuration file.')
c.register_alias('file_server_name', options_list=('--name', '-n'), help='Name of the file server.')
c.argument('vm_size', help='VM size.', completer=get_vm_size_completion_list)
c.argument('disk_count', help='Number of disks.', type=int, arg_group='Storage')
c.argument('disk_size', help='Disk size in Gb.', type=int, arg_group='Storage')
c.argument('storage_sku', help='The sku of storage account to persist VM.',
arg_group='Storage', **enum_choice_list(SkuName))
c.argument('user_name', options_list=('--admin-user-name', '-u'),
help='Name of the admin user to be created on every compute node.', arg_group='Admin Account')
c.argument('ssh_key', options_list=('--ssh-key', '-k'),
help='SSH public key value or path.', arg_group='Admin Account')
c.argument('password', options_list=('--password', '-p'), help='Password.', arg_group='Admin Account')
c.argument('json_file', options_list=('--config', '-c'),
help='A path to a json file containing file server create parameters (json representation of '
'azure.mgmt.batchai.models.FileServerCreateParameters). Note, parameters given via command line '
'will overwrite parameters specified in the configuration file.', arg_group='Advanced')
with ParametersContext(command='batchai file-server show') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('file_server_name', options_list=('--name', '-n'), help='Name of the file server.')
with ParametersContext(command='batchai file-server delete') as c:
c.register_alias('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
c.register_alias('file_server_name', options_list=('--name', '-n'), help='Name of the file server.')
with ParametersContext(command='batchai file-server list') as c:
c.argument('resource_group', options_list=('--resource-group', '-g'), arg_type=resource_group_name_type)
# Not implemented yet
c.register_alias('file_servers_list_options', options_list=('--file-servers-list-options',), arg_type=ignore_type)

Просмотреть файл

@ -0,0 +1,46 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long
from azure.cli.command_modules.batchai._client_factory import (
batchai_client_factory,
cluster_client_factory,
job_client_factory,
file_client_factory,
file_server_client_factory)
from azure.cli.command_modules.batchai._format import (
cluster_list_table_format,
job_list_table_format,
file_list_table_format,
file_server_table_format,
remote_login_table_format,
)
from azure.cli.core.commands import cli_command
custom_path = 'azure.cli.command_modules.batchai.custom#{}'
mgmt_path = 'azure.mgmt.batchai.operations.{}_operations#{}.{}'
cli_command(__name__, 'batchai cluster create', custom_path.format('create_cluster'), batchai_client_factory, no_wait_param='raw')
cli_command(__name__, 'batchai cluster delete', mgmt_path.format('clusters', 'ClustersOperations', 'delete'), cluster_client_factory, confirmation=True, no_wait_param='raw')
cli_command(__name__, 'batchai cluster show', mgmt_path.format('clusters', 'ClustersOperations', 'get'), cluster_client_factory)
cli_command(__name__, 'batchai cluster list', custom_path.format('list_clusters'), cluster_client_factory, table_transformer=cluster_list_table_format)
cli_command(__name__, 'batchai cluster list-nodes', mgmt_path.format('clusters', 'ClustersOperations', 'list_remote_login_information'), cluster_client_factory, table_transformer=remote_login_table_format)
cli_command(__name__, 'batchai cluster resize', custom_path.format('resize_cluster'), cluster_client_factory)
cli_command(__name__, 'batchai cluster auto-scale', custom_path.format('set_cluster_auto_scale_parameters'), cluster_client_factory)
cli_command(__name__, 'batchai job create', custom_path.format('create_job'), batchai_client_factory, no_wait_param='raw')
cli_command(__name__, 'batchai job delete', mgmt_path.format('jobs', 'JobsOperations', 'delete'), job_client_factory, confirmation=True, no_wait_param='raw')
cli_command(__name__, 'batchai job terminate', mgmt_path.format('jobs', 'JobsOperations', 'terminate'), job_client_factory, no_wait_param='raw')
cli_command(__name__, 'batchai job show', mgmt_path.format('jobs', 'JobsOperations', 'get'), job_client_factory)
cli_command(__name__, 'batchai job list', custom_path.format('list_jobs'), job_client_factory, table_transformer=job_list_table_format)
cli_command(__name__, 'batchai job list-nodes', mgmt_path.format('jobs', 'JobsOperations', 'list_remote_login_information'), job_client_factory, table_transformer=remote_login_table_format)
cli_command(__name__, 'batchai job list-files', custom_path.format('list_files'), file_client_factory, table_transformer=file_list_table_format)
cli_command(__name__, 'batchai job stream-file', custom_path.format('tail_file'), file_client_factory)
cli_command(__name__, 'batchai file-server create', custom_path.format('create_file_server'), file_server_client_factory, no_wait_param='raw')
cli_command(__name__, 'batchai file-server delete', mgmt_path.format('file_servers', 'FileServersOperations', 'delete'), file_server_client_factory, confirmation=True, no_wait_param='raw')
cli_command(__name__, 'batchai file-server show', mgmt_path.format('file_servers', 'FileServersOperations', 'get'), file_server_client_factory)
cli_command(__name__, 'batchai file-server list', custom_path.format('list_file_servers'), file_server_client_factory, table_transformer=file_server_table_format)

Просмотреть файл

@ -0,0 +1,390 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from __future__ import print_function
import json
import os
import signal
import time
import requests
from azure.cli.core.keys import is_valid_ssh_rsa_public_key
from azure.cli.core.util import CLIError
import azure.mgmt.batchai.models as models
from msrest.serialization import Deserializer
# Environment variables for specifying azure storage account and key. We want the user to make explicit
# decision about which storage account to use instead of using his default account specified via AZURE_STORAGE_ACCOUNT
# and AZURE_STORAGE_KEY.
AZURE_BATCHAI_STORAGE_ACCOUNT = 'AZURE_BATCHAI_STORAGE_ACCOUNT'
AZURE_BATCHAI_STORAGE_KEY = 'AZURE_BATCHAI_STORAGE_KEY'
# Supported images.
SUPPORTED_IMAGES = {
"ubuntults": models.ImageReference(
publisher='Canonical',
offer='UbuntuServer',
sku='16.04-LTS'
),
"ubuntudsvm": models.ImageReference(
publisher='microsoft-ads',
offer='linux-data-science-vm-ubuntu',
sku='linuxdsvmubuntu'
)
}
def _get_deserializer():
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
return Deserializer(client_models)
def get_environment_variable_or_die(name):
"""Returns the value of an environment variable with given name or raises CLIError exception.
:param str name: name of the environment variable.
:raise CLIError: if environment variable not found or empty.
"""
value = os.environ.get(name, None)
if not value:
raise CLIError('Please set {0} environment variable.'.format(name))
return value
def update_cluster_create_parameters_with_env_variables(params):
"""Replaces placeholders with information from the environment variables.
Currently we support replacing of storage account name and key in mount volumes.
:param models.ClusterCreateParameters params: cluster creation parameters to patch.
"""
# Patch parameters of azure file share.
if params.node_setup and \
params.node_setup.mount_volumes and \
params.node_setup.mount_volumes.azure_file_shares:
for ref in params.node_setup.mount_volumes.azure_file_shares:
if ref.account_name == '<{0}>'.format(AZURE_BATCHAI_STORAGE_ACCOUNT):
ref.account_name = get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_ACCOUNT)
if ref.azure_file_url and '<{0}>'.format(AZURE_BATCHAI_STORAGE_ACCOUNT) in ref.azure_file_url:
ref.azure_file_url = ref.azure_file_url.replace(
'<{0}>'.format(AZURE_BATCHAI_STORAGE_ACCOUNT),
get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_ACCOUNT))
if ref.credentials_info and ref.credentials_info.account_key == \
'<{0}>'.format(AZURE_BATCHAI_STORAGE_KEY):
ref.credentials_info.account_key = get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_KEY)
# Patch parameters of blob file system.
if params.node_setup and \
params.node_setup.mount_volumes and \
params.node_setup.mount_volumes.azure_blob_file_systems:
for ref in params.node_setup.mount_volumes.azure_blob_file_systems:
if ref.account_name == '<{0}>'.format(AZURE_BATCHAI_STORAGE_ACCOUNT):
ref.account_name = get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_ACCOUNT)
if ref.credentials_info and ref.credentials_info.account_key == \
'<{0}>'.format(AZURE_BATCHAI_STORAGE_KEY):
ref.credentials_info.account_key = get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_KEY)
def update_user_account_settings(params, admin_user_name, ssh_key, password):
"""Update account settings of cluster or file server creation parameters
:param models.ClusterCreateParameters or models.FileServerCreateParameters params: params to update
:param str or None admin_user_name: name of admin user to create.
:param str or None ssh_key: ssh public key value or path to the file containing the key.
:param str or None password: password.
"""
key = ssh_key
if ssh_key:
if os.path.exists(os.path.expanduser(ssh_key)):
with open(os.path.expanduser(ssh_key)) as f:
key = f.read()
if not is_valid_ssh_rsa_public_key(key):
raise CLIError('Incorrect ssh public key value.')
if hasattr(params, 'user_account_settings'):
parent = params
else:
if params.ssh_configuration is None:
params.ssh_configuration = models.SshConfiguration(None)
parent = params.ssh_configuration
if parent.user_account_settings is None:
parent.user_account_settings = models.UserAccountSettings(
admin_user_name=admin_user_name, admin_user_ssh_public_key=key)
if admin_user_name:
parent.user_account_settings.admin_user_name = admin_user_name
if key:
parent.user_account_settings.admin_user_ssh_public_key = key
if password:
parent.user_account_settings.admin_user_password = password
if not parent.user_account_settings.admin_user_name:
raise CLIError('Please provide admin user name.')
if (not parent.user_account_settings.admin_user_ssh_public_key and
not parent.user_account_settings.admin_user_password):
raise CLIError('Please provide admin user password or ssh key.')
def add_nfs_to_cluster_create_parameters(params, file_server_id, mount_path):
"""Adds NFS to the cluster create parameters.
:param model.ClusterCreateParameters params: cluster create parameters.
:param str file_server_id: resource id of the file server.
:param str mount_path: relative mount path for the file server.
"""
if not mount_path:
raise CLIError('File server relative mount path cannot be empty.')
if params.node_setup is None:
params.node_setup = models.NodeSetup()
if params.node_setup.mount_volumes is None:
params.node_setup.mount_volumes = models.MountVolumes()
if params.node_setup.mount_volumes.file_servers is None:
params.node_setup.mount_volumes.file_servers = []
params.node_setup.mount_volumes.file_servers.append(models.FileServerReference(
relative_mount_path=mount_path,
file_server=models.ResourceId(file_server_id),
mount_options="rw"))
def add_azure_file_share_to_cluster_create_parameters(params, azure_file_share, mount_path):
"""Add Azure File share to the cluster create parameters.
:param model.ClusterCreateParameters params: cluster create parameters.
:param str azure_file_share: name of the azure file share.
:param str mount_path: relative mount path for Azure File share.
"""
if not mount_path:
raise CLIError('Azure File share relative mount path cannot be empty.')
if params.node_setup is None:
params.node_setup = models.NodeSetup()
if params.node_setup.mount_volumes is None:
params.node_setup.mount_volumes = models.MountVolumes()
if params.node_setup.mount_volumes.azure_file_shares is None:
params.node_setup.mount_volumes.azure_file_shares = []
params.node_setup.mount_volumes.azure_file_shares.append(models.AzureFileShareReference(
relative_mount_path=mount_path,
account_name=get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_ACCOUNT),
azure_file_url='https://{0}.file.core.windows.net/{1}'.format(
get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_ACCOUNT), azure_file_share),
credentials_info=models.AzureStorageCredentialsInfo(
account_key=get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_KEY))))
def add_azure_container_to_cluster_create_parameters(params, container_name, mount_path):
"""Add Azure Storage container to the cluster create parameters.
:param model.ClusterCreateParameters params: cluster create parameters.
:param str container_name: container name.
:param str mount_path: relative mount path for the container.
"""
if not mount_path:
raise CLIError('Azure Storage container relative mount path cannot be empty.')
if params.node_setup is None:
params.node_setup = models.NodeSetup()
if params.node_setup.mount_volumes is None:
params.node_setup.mount_volumes = models.MountVolumes()
if params.node_setup.mount_volumes.azure_blob_file_systems is None:
params.node_setup.mount_volumes.azure_blob_file_systems = []
params.node_setup.mount_volumes.azure_blob_file_systems.append(models.AzureBlobFileSystemReference(
relative_mount_path=mount_path,
account_name=get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_ACCOUNT),
container_name=container_name,
credentials_info=models.AzureStorageCredentialsInfo(
account_key=get_environment_variable_or_die(AZURE_BATCHAI_STORAGE_KEY))))
def get_image_reference_or_die(image):
"""Returns image reference for the given image alias.
:param str image: image alias.
:return models.ImageReference: the image reference.
:raise CLIError: if the image with given alias was not found.
"""
reference = SUPPORTED_IMAGES.get(image.lower(), None)
if not reference:
raise CLIError('Unsupported image alias "{0}"'.format(image))
return reference
def update_nodes_information(params, image, vm_size, min_nodes, max_nodes):
"""Updates cluster's nodes information.
:param models.ClusterCreateParameters params: cluster create parameters.
:param str or None image: image.
:param str or None vm_size: VM size.
:param int min_nodes: min number of nodes.
:param int or None max_nodes: max number of nodes.
"""
if vm_size:
params.vm_size = vm_size
if not params.vm_size:
raise CLIError('Please provide VM size')
if image:
params.virtual_machine_configuration = models.VirtualMachineConfiguration(get_image_reference_or_die(image))
if min_nodes == max_nodes:
params.scale_settings = models.ScaleSettings(manual=models.ManualScaleSettings(min_nodes))
elif max_nodes is not None:
params.scale_settings = models.ScaleSettings(auto_scale=models.AutoScaleSettings(min_nodes, max_nodes))
if not params.scale_settings or (not params.scale_settings.manual and not params.scale_settings.auto_scale):
raise CLIError('Please provide scale setting for the cluster via configuration file or via --min and --max '
'parameters.')
def create_cluster(client, resource_group, cluster_name, json_file=None, location=None, user_name=None,
ssh_key=None, password=None, image='UbuntuLTS', vm_size=None, min_nodes=0, max_nodes=None,
nfs_name=None, nfs_resource_group=None, nfs_mount_path='nfs', azure_file_share=None,
afs_mount_path='afs', container_name=None, container_mount_path='bfs', raw=False):
models.ClustersListOptions()
if json_file:
with open(json_file) as f:
json_obj = json.load(f)
params = _get_deserializer()('ClusterCreateParameters', json_obj)
else:
params = models.ClusterCreateParameters(None, None, None)
update_cluster_create_parameters_with_env_variables(params)
update_user_account_settings(params, user_name, ssh_key, password)
if location:
params.location = location
if not params.location:
raise CLIError('Please provide location for cluster creation.')
update_nodes_information(params, image, vm_size, min_nodes, max_nodes)
if nfs_name:
file_server = client.file_servers.get(nfs_resource_group if nfs_resource_group else resource_group, nfs_name)
add_nfs_to_cluster_create_parameters(params, file_server.id, nfs_mount_path)
if azure_file_share:
add_azure_file_share_to_cluster_create_parameters(params, azure_file_share, afs_mount_path)
if container_name:
add_azure_container_to_cluster_create_parameters(params, container_name, container_mount_path)
return client.clusters.create(resource_group, cluster_name, params, raw=raw)
def list_clusters(client, resource_group=None):
if resource_group:
return list(client.list_by_resource_group(resource_group))
return list(client.list())
def resize_cluster(client, resource_group, cluster_name, target):
return client.update(resource_group, cluster_name, scale_settings=models.ScaleSettings(
manual=models.ManualScaleSettings(target)))
def set_cluster_auto_scale_parameters(client, resource_group, cluster_name, min_nodes, max_nodes):
return client.update(resource_group, cluster_name, scale_settings=models.ScaleSettings(
auto_scale=models.AutoScaleSettings(min_nodes, max_nodes)))
def create_job(client, resource_group, job_name, json_file, location=None, cluster_name=None,
cluster_resource_group=None, raw=False):
with open(json_file) as f:
json_obj = json.load(f)
params = _get_deserializer()('JobCreateParameters', json_obj)
if location:
params.location = location
if not params.location:
raise CLIError('Please provide location for job creation.')
# If cluster name is specified, find the cluster and use its resource id for the new job.
if cluster_name is not None:
if cluster_resource_group is None: # The job must be created in the cluster's resource group.
cluster_resource_group = resource_group
cluster = client.clusters.get(cluster_resource_group, cluster_name)
params.cluster = models.ResourceId(cluster.id)
if params.cluster is None:
raise CLIError('Please provide cluster information via command line or configuration file.')
return client.jobs.create(resource_group, job_name, params, raw=raw)
def list_jobs(client, resource_group=None):
if resource_group:
return list(client.list_by_resource_group(resource_group))
return list(client.list())
def list_files(client, resource_group, job_name, directory):
options = models.JobsListOutputFilesOptions(directory)
return list(client.list_output_files(resource_group, job_name, options))
def sigint_handler(*_):
# Some libs do not handle KeyboardInterrupt nicely and print junk
# messages. So, let's just exit without any cleanup.
os._exit(0) # pylint: disable=protected-access
def tail_file(client, resource_group, job_name, directory, file_name):
"""Output the current content of the file and outputs appended data as the file grows (similar to 'tail -f').
Press Ctrl-C to interrupt the output.
:param BatchAIClient client: the client.
:param resource_group: name of the resource group.
:param job_name: job's name.
:param directory: job's output directory id.
:param file_name: name of the file.
"""
signal.signal(signal.SIGINT, sigint_handler)
url = None
# Wait until the file become available.
while url is None:
files = list_files(client, resource_group, job_name, directory)
for f in files:
if f.name == file_name:
url = f.download_url
break
if url is None:
time.sleep(1)
# Stream the file
downloaded = 0
while True:
r = requests.get(url, headers={'Range': 'bytes={0}-'.format(downloaded)})
if int(r.status_code / 100) == 2:
downloaded += len(r.content)
print(r.content.decode(), end='')
def create_file_server(client, resource_group, file_server_name, json_file=None, vm_size=None, location=None,
user_name=None, ssh_key=None, password=None, disk_count=None, disk_size=None,
storage_sku='Premium_LRS', raw=False):
if json_file:
with open(json_file) as f:
json_obj = json.load(f)
parameters = _get_deserializer()('FileServerCreateParameters', json_obj)
else:
parameters = models.FileServerCreateParameters(None, None, None, None)
update_user_account_settings(parameters, user_name, ssh_key, password)
if location:
parameters.location = location
if not parameters.location:
raise CLIError('Please provide location for cluster creation.')
if not parameters.data_disks:
parameters.data_disks = models.DataDisks(None, None, None)
if disk_size:
parameters.data_disks.disk_size_in_gb = disk_size
if not parameters.data_disks.disk_size_in_gb:
raise CLIError('Please provide disk size in Gb.')
if disk_count:
parameters.data_disks.disk_count = disk_count
if not parameters.data_disks.disk_count:
raise CLIError('Please provide number of data disks (at least one disk is required).')
if storage_sku:
parameters.data_disks.storage_account_type = storage_sku
if not parameters.data_disks.storage_account_type:
raise CLIError('Please provide storage account type (storage sku).')
if vm_size:
parameters.vm_size = vm_size
if not parameters.vm_size:
raise CLIError('Please provide VM size.')
return client.create(resource_group, file_server_name, parameters, raw=raw)
def list_file_servers(client, resource_group=None):
if resource_group:
return list(client.list_by_resource_group(resource_group))
return list(client.list())

Просмотреть файл

@ -0,0 +1,4 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

Просмотреть файл

@ -0,0 +1,32 @@
{
"location": "eastus",
"properties": {
"nodeSetup": {
"mountVolumes": {
"azureFileShares": [
{
"accountName": "<AZURE_BATCHAI_STORAGE_ACCOUNT>",
"azureFileUrl": "https://<AZURE_BATCHAI_STORAGE_ACCOUNT>.file.core.windows.net/share",
"credentialsInfo": {
"accountKey": "<AZURE_BATCHAI_STORAGE_KEY>"
},
"directoryMode": "0777",
"fileMode": "0777",
"relativeMountPath": "azfiles"
}
]
}
},
"userAccountSettings": {
"adminUserName": "DemoUser",
"adminUserPassword": "DemoPa$$w0rd"
},
"vmSize": "STANDARD_D1",
"scaleSettings": {
"autoScale": {
"minimumNodeCount": 0,
"maximumNodeCount": 1
}
}
}
}

Просмотреть файл

@ -0,0 +1,31 @@
{
"location": "eastus",
"properties": {
"nodeSetup": {
"mountVolumes": {
"azureFileShares": [
{
"accountName": "<AZURE_BATCHAI_STORAGE_ACCOUNT>",
"azureFileUrl": "https://<AZURE_BATCHAI_STORAGE_ACCOUNT>.file.core.windows.net/share",
"credentialsInfo": {
"accountKey": "<AZURE_BATCHAI_STORAGE_KEY>"
},
"directoryMode": "0777",
"fileMode": "0777",
"relativeMountPath": "azfiles"
}
]
}
},
"userAccountSettings": {
"adminUserName": "DemoUser",
"adminUserPassword": "DemoPa$$w0rd"
},
"vmSize": "STANDARD_D1",
"scaleSettings": {
"manual": {
"targetNodeCount": 1
}
}
}
}

Просмотреть файл

@ -0,0 +1,25 @@
{
"location": "eastus",
"properties":
{
"containerSettings": {
"imageSourceRegistry": {
"image": "ubuntu"
}
},
"stdOutErrPathPrefix": "$AZ_BATCHAI_MOUNT_ROOT/azfiles",
"outputDirectories": [
{
"id": "OUTPUT",
"pathPrefix": "$AZ_BATCHAI_MOUNT_ROOT/azfiles",
"pathSuffix": "output",
"type": "custom"
}
],
"nodeCount": 1,
"toolType": "custom",
"customToolkitSettings": {
"commandLine": "echo hi | tee $AZ_BATCHAI_OUTPUT_OUTPUT/result.txt"
}
}
}

Просмотреть файл

@ -0,0 +1,17 @@
{
"location": "eastus",
"properties": {
"dataDisks": {
"diskSizeInGB": 10,
"diskCount": 2,
"storageAccountType": "Standard_LRS"
},
"sshConfiguration": {
"userAccountSettings": {
"adminUserName": "DemoUser",
"adminUserPassword": "DemoPa$$w0rd"
}
},
"vmSize": "STANDARD_D1"
}
}

Просмотреть файл

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKUDnWeK6rx36apNE9ij1iAXn68FKXLTW0009XK/7dyMewlNfXi6Z2opnxHDDYWucMluU0dsvBR22OuYH2RHriPJTi1jN3aZ0zZSrlH/W4MSNQKlG/AnrjJPA3xfYjIKLGuKBqSIvMsmrkuDfIfMaDnPcxb+GzM10L5epRhoP5FwqaQbLqp640YzFSLqMChz7E6RG54CpEm+MRvA7lj9nD9AlYnfRQAKj2thsFrkz7AlYLQ1ug8vV+1Y3xSKDbo5vy6oqM3QKeLiUiyN9Ff1Rq4uYnrqJqcWN1ADfiPGZZjEStOkRgG3V6JrpIN+z0Zl3n+sjrH+CKwrYmyni6D41L

Просмотреть файл

@ -0,0 +1,11 @@
{
"location": "eastus",
"properties": {
"vmSize": "STANDARD_D1",
"scaleSettings": {
"manual": {
"targetNodeCount": 1
}
}
}
}

Просмотреть файл

@ -0,0 +1,556 @@
interactions:
- request:
body: '{"tags": {"use": "az-test"}, "location": "eastus"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [group create]
Connection: [keep-alive]
Content-Length: ['50']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 resourcemanagementclient/1.2.0rc2
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"eastus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'}
headers:
cache-control: [no-cache]
content-length: ['328']
content-type: [application/json; charset=utf-8]
date: ['Fri, 29 Sep 2017 23:26:46 GMT']
expires: ['-1']
pragma: [no-cache]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 201, message: Created}
- request:
body: '{"sku": {"name": "Standard_LRS"}, "properties": {"supportsHttpsTrafficOnly":
false}, "location": "eastus", "kind": "Storage"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account create]
Connection: [keep-alive]
Content-Length: ['125']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002?api-version=2017-06-01
response:
body: {string: ''}
headers:
cache-control: [no-cache]
content-length: ['0']
date: ['Fri, 29 Sep 2017 23:26:47 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/7a5d9794-edbc-4bfb-a7cc-ae81de4420e0?monitor=true&api-version=2017-06-01']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/7a5d9794-edbc-4bfb-a7cc-ae81de4420e0?monitor=true&api-version=2017-06-01
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002","kind":"Storage","location":"eastus","name":"clitest000002","properties":{"creationTime":"2017-09-29T23:26:48.1807718Z","networkAcls":{"bypass":"AzureServices","defaultAction":"Allow","ipRules":[],"virtualNetworkRules":[]},"primaryEndpoints":{"blob":"https://clitest000002.blob.core.windows.net/","file":"https://clitest000002.file.core.windows.net/","queue":"https://clitest000002.queue.core.windows.net/","table":"https://clitest000002.table.core.windows.net/"},"primaryLocation":"eastus","provisioningState":"Succeeded","statusOfPrimary":"available","supportsHttpsTrafficOnly":false},"sku":{"name":"Standard_LRS","tier":"Standard"},"tags":{},"type":"Microsoft.Storage/storageAccounts"}
'}
headers:
cache-control: [no-cache]
content-length: ['964']
content-type: [application/json]
date: ['Fri, 29 Sep 2017 23:27:04 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account keys list]
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2017-06-01
response:
body: {string: '{"keys":[{"keyName":"key1","permissions":"Full","value":"Jnjy02M6dZ1DnlXPYKGN3mJgShed9dCWdursv1u7w98985OAtO0iaUGZOmJvxU6Rz7l2hNB/Z1VRGl6W1Eakpg=="},{"keyName":"key2","permissions":"Full","value":"1TSVus8ptibFrq6ccJdaykblObvpGnBYNLUZ4uk2WJusVsVL8Ma1rSaMfxcCgSEPQkeCrujz6/i5w3wdo07wdQ=="}]}
'}
headers:
cache-control: [no-cache]
content-length: ['289']
content-type: [application/json]
date: ['Fri, 29 Sep 2017 23:27:05 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account keys list]
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2017-06-01
response:
body: {string: '{"keys":[{"keyName":"key1","permissions":"Full","value":"Jnjy02M6dZ1DnlXPYKGN3mJgShed9dCWdursv1u7w98985OAtO0iaUGZOmJvxU6Rz7l2hNB/Z1VRGl6W1Eakpg=="},{"keyName":"key2","permissions":"Full","value":"1TSVus8ptibFrq6ccJdaykblObvpGnBYNLUZ4uk2WJusVsVL8Ma1rSaMfxcCgSEPQkeCrujz6/i5w3wdo07wdQ=="}]}
'}
headers:
cache-control: [no-cache]
content-length: ['289']
content-type: [application/json]
date: ['Fri, 29 Sep 2017 23:27:06 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: null
headers:
Connection: [keep-alive]
Content-Length: ['0']
User-Agent: [Azure-Storage/0.36.0 (Python CPython 3.5.3; Linux 4.10.0-35-generic)
AZURECLI/2.0.16+dev]
x-ms-date: ['Fri, 29 Sep 2017 23:27:07 GMT']
x-ms-version: ['2017-04-17']
method: PUT
uri: https://clitest000002.file.core.windows.net/share?restype=share
response:
body: {string: ''}
headers:
date: ['Fri, 29 Sep 2017 23:27:06 GMT']
etag: ['"0x8D5079199D4A72D"']
last-modified: ['Fri, 29 Sep 2017 23:27:07 GMT']
server: [Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0]
transfer-encoding: [chunked]
x-ms-version: ['2017-04-17']
status: {code: 201, message: Created}
- request:
body: 'b''{"properties": {"scaleSettings": {"autoScale": {"maximumNodeCount":
1, "minimumNodeCount": 0}}, "nodeSetup": {"mountVolumes": {"azureFileShares":
[{"relativeMountPath": "azfiles", "accountName": "clitest000002", "azureFileUrl":
"https://clitest000002.file.core.windows.net/share", "directoryMode": "0777",
"credentialsInfo": {"accountKey": "Jnjy02M6dZ1DnlXPYKGN3mJgShed9dCWdursv1u7w98985OAtO0iaUGZOmJvxU6Rz7l2hNB/Z1VRGl6W1Eakpg=="},
"fileMode": "0777"}]}}, "vmSize": "STANDARD_D1", "userAccountSettings": {"adminUserName":
"DemoUser", "adminUserPassword": "DemoPa$$w0rd"}}, "location": "eastus"}'''
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Length: ['617']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: ''}
headers:
azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/5d03b4eb-75ee-4f9f-8341-aec951ec23ce?api-version=2017-09-01-preview']
cache-control: [no-cache]
content-length: ['0']
date: ['Fri, 29 Sep 2017 23:27:09 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/5d03b4eb-75ee-4f9f-8341-aec951ec23ce?api-version=2017-09-01-preview']
pragma: [no-cache]
request-id: [88c6e706-a0df-4ab9-bad9-c2743a44fdbc]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/5d03b4eb-75ee-4f9f-8341-aec951ec23ce?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/5d03b4eb-75ee-4f9f-8341-aec951ec23ce","name":"5d03b4eb-75ee-4f9f-8341-aec951ec23ce","status":"Succeeded","startTime":"2017-09-29T23:27:08.523Z","endTime":"2017-09-29T23:27:09.409Z","properties":{"resourceId":"8001b49e-e169-4ee6-a5ff-9c3ea5385053$clitest.rg000001$cluster"}}'}
headers:
cache-control: [no-cache]
content-length: ['481']
content-type: [application/json; charset=utf-8]
date: ['Fri, 29 Sep 2017 23:27:26 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [8f9ed145-5092-478d-b7bf-e2503bfd4b26]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster","name":"cluster","type":"Microsoft.BatchAI/Clusters","location":"eastus","properties":{"provisioningState":"Succeeded","allocationState":"Steady","creationTime":"2017-09-29T23:27:08.476Z","lastModified":"2017-09-29T23:27:08.476Z","allocationStateTransitionTime":"2017-09-29T23:27:11.192Z","provisioningStateTransitionTime":"2017-09-29T23:27:09.362Z","vmSize":"STANDARD_D1","currentNodeCount":0,"nodeStateCounts":{"runningNodeCount":0,"idleNodeCount":0,"unusableNodeCount":0,"preparingNodeCount":0},"vmPriority":"Dedicated","scaleSettings":{"autoScale":{"minimumNodeCount":0,"maximumNodeCount":1,"initialNodeCount":0}},"virtualMachineConfiguration":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"16.04-LTS","version":"latest"}},"userAccountSettings":{"adminUserName":"DemoUser"},"nodeSetup":{"mountVolumes":{"azureFileShares":[{"accountName":"clitest000002","azureFileUrl":"https://clitest000002.file.core.windows.net/share","credentialsInfo":{},"relativeMountPath":"azfiles","fileMode":"0777","directoryMode":"0777"}]}},"subnet":{}}}'}
headers:
cache-control: [no-cache]
content-length: ['1277']
content-type: [application/json; charset=utf-8]
date: ['Fri, 29 Sep 2017 23:27:27 GMT']
etag: ['"0x8D507919A6521A6"']
expires: ['-1']
last-modified: ['Fri, 29 Sep 2017 23:27:08 GMT']
pragma: [no-cache]
request-id: [6ee4bc1f-11ef-482b-a6bd-ad9ddd2074b2]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster list]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters?api-version=2017-09-01-preview
response:
body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster","name":"cluster","type":"Microsoft.BatchAI/Clusters","location":"eastus","properties":{"provisioningState":"Succeeded","allocationState":"Steady","creationTime":"2017-09-29T23:27:08.476Z","lastModified":"2017-09-29T23:27:08.476Z","allocationStateTransitionTime":"2017-09-29T23:27:11.192Z","provisioningStateTransitionTime":"2017-09-29T23:27:09.362Z","vmSize":"STANDARD_D1","currentNodeCount":0,"nodeStateCounts":{"runningNodeCount":0,"idleNodeCount":0,"unusableNodeCount":0,"preparingNodeCount":0},"vmPriority":"Dedicated","scaleSettings":{"autoScale":{"minimumNodeCount":0,"maximumNodeCount":1,"initialNodeCount":0}},"virtualMachineConfiguration":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"16.04-LTS","version":"latest"}},"userAccountSettings":{"adminUserName":"DemoUser"},"nodeSetup":{"mountVolumes":{"azureFileShares":[{"accountName":"clitest000002","azureFileUrl":"https://clitest000002.file.core.windows.net/share","credentialsInfo":{},"relativeMountPath":"azfiles","fileMode":"0777","directoryMode":"0777"}]}},"subnet":{}}}]}'}
headers:
cache-control: [no-cache]
content-length: ['1289']
content-type: [application/json; charset=utf-8]
date: ['Fri, 29 Sep 2017 23:27:29 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [264357c8-166a-4ce6-938a-7cd242e9eb0f]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai job create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster","name":"cluster","type":"Microsoft.BatchAI/Clusters","location":"eastus","properties":{"provisioningState":"Succeeded","allocationState":"Steady","creationTime":"2017-09-29T23:27:08.476Z","lastModified":"2017-09-29T23:27:08.476Z","allocationStateTransitionTime":"2017-09-29T23:27:11.192Z","provisioningStateTransitionTime":"2017-09-29T23:27:09.362Z","vmSize":"STANDARD_D1","currentNodeCount":0,"nodeStateCounts":{"runningNodeCount":0,"idleNodeCount":0,"unusableNodeCount":0,"preparingNodeCount":0},"vmPriority":"Dedicated","scaleSettings":{"autoScale":{"minimumNodeCount":0,"maximumNodeCount":1,"initialNodeCount":0}},"virtualMachineConfiguration":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"16.04-LTS","version":"latest"}},"userAccountSettings":{"adminUserName":"DemoUser"},"nodeSetup":{"mountVolumes":{"azureFileShares":[{"accountName":"clitest000002","azureFileUrl":"https://clitest000002.file.core.windows.net/share","credentialsInfo":{},"relativeMountPath":"azfiles","fileMode":"0777","directoryMode":"0777"}]}},"subnet":{}}}'}
headers:
cache-control: [no-cache]
content-length: ['1277']
content-type: [application/json; charset=utf-8]
date: ['Fri, 29 Sep 2017 23:27:30 GMT']
etag: ['"0x8D507919A6521A6"']
expires: ['-1']
last-modified: ['Fri, 29 Sep 2017 23:27:08 GMT']
pragma: [no-cache]
request-id: [15d2c08f-cde7-4cdf-a55b-89b828849e5b]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: 'b''{"properties": {"containerSettings": {"imageSourceRegistry": {"image":
"ubuntu"}}, "customToolkitSettings": {"commandLine": "echo hi | tee $AZ_BATCHAI_OUTPUT_OUTPUT/result.txt"},
"outputDirectories": [{"pathPrefix": "$AZ_BATCHAI_MOUNT_ROOT/azfiles", "pathSuffix":
"output", "type": "custom", "id": "OUTPUT"}], "nodeCount": 1, "cluster": {"id":
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster"},
"stdOutErrPathPrefix": "$AZ_BATCHAI_MOUNT_ROOT/azfiles"}, "location": "eastus"}'''
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai job create]
Connection: [keep-alive]
Content-Length: ['618']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/jobs/job?api-version=2017-09-01-preview
response:
body: {string: ''}
headers:
azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/46886e26-c034-41c4-a1ee-4a27af9882d6?api-version=2017-09-01-preview']
cache-control: [no-cache]
content-length: ['0']
date: ['Fri, 29 Sep 2017 23:27:32 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/46886e26-c034-41c4-a1ee-4a27af9882d6?api-version=2017-09-01-preview']
pragma: [no-cache]
request-id: [998f43ae-8015-4e22-b804-5c2c104afb9c]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai job create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/46886e26-c034-41c4-a1ee-4a27af9882d6?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/46886e26-c034-41c4-a1ee-4a27af9882d6","name":"46886e26-c034-41c4-a1ee-4a27af9882d6","status":"Succeeded","startTime":"2017-09-29T23:27:31.537Z","endTime":"2017-09-29T23:27:33.252Z","properties":{"resourceId":"8001b49e-e169-4ee6-a5ff-9c3ea5385053$clitest.rg000001$job"}}'}
headers:
cache-control: [no-cache]
content-length: ['477']
content-type: [application/json; charset=utf-8]
date: ['Fri, 29 Sep 2017 23:27:48 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [d8071a89-83bb-45be-90d4-b57200eda535]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai job create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/jobs/job?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/jobs/job","name":"job","type":"Microsoft.BatchAI/Jobs","properties":{"priority":0,"cluster":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster"},"nodeCount":1,"containerSettings":{"imageSourceRegistry":{"image":"ubuntu"}},"toolType":"Custom","customToolkitSettings":{"commandLine":"echo
hi | tee $AZ_BATCHAI_OUTPUT_OUTPUT/result.txt"},"stdOutErrPathPrefix":"$AZ_BATCHAI_MOUNT_ROOT/azfiles","outputDirectories":[{"id":"OUTPUT","pathPrefix":"$AZ_BATCHAI_MOUNT_ROOT/azfiles","pathSuffix":"output","type":"Custom","createNew":true}],"constraints":{"maxWallClockTime":"P7D","maxRetryCount":0},"creationTime":"2017-09-29T23:27:31.521Z","provisioningState":"Succeeded","provisioningStateTransitionTime":"2017-09-29T23:27:33.236Z","executionState":"Queued","executionStateTransitionTime":"2017-09-29T23:27:33.738Z"}}'}
headers:
cache-control: [no-cache]
content-length: ['1133']
content-type: [application/json; charset=utf-8]
date: ['Fri, 29 Sep 2017 23:27:49 GMT']
etag: ['"0x8D50791A8219231"']
expires: ['-1']
last-modified: ['Fri, 29 Sep 2017 23:27:31 GMT']
pragma: [no-cache]
request-id: [37415b1f-58a6-4562-b365-ab5917583155]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai job list]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/jobs?api-version=2017-09-01-preview
response:
body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/jobs/job","name":"job","type":"Microsoft.BatchAI/Jobs","properties":{"priority":0,"cluster":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster"},"nodeCount":1,"containerSettings":{"imageSourceRegistry":{"image":"ubuntu"}},"toolType":"Custom","customToolkitSettings":{"commandLine":"echo
hi | tee $AZ_BATCHAI_OUTPUT_OUTPUT/result.txt"},"stdOutErrPathPrefix":"$AZ_BATCHAI_MOUNT_ROOT/azfiles","outputDirectories":[{"id":"OUTPUT","pathPrefix":"$AZ_BATCHAI_MOUNT_ROOT/azfiles","pathSuffix":"output","type":"Custom","createNew":true}],"constraints":{"maxWallClockTime":"P7D","maxRetryCount":0},"creationTime":"2017-09-29T23:27:31.521Z","provisioningState":"Succeeded","provisioningStateTransitionTime":"2017-09-29T23:27:33.236Z","executionState":"Queued","executionStateTransitionTime":"2017-09-29T23:27:33.738Z"}}]}'}
headers:
cache-control: [no-cache]
content-length: ['1145']
content-type: [application/json; charset=utf-8]
date: ['Fri, 29 Sep 2017 23:27:51 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [fae563f9-0bb5-4b64-a49e-951fc891d93e]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai job show]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/jobs/job?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/jobs/job","name":"job","type":"Microsoft.BatchAI/Jobs","properties":{"priority":0,"cluster":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster"},"nodeCount":1,"containerSettings":{"imageSourceRegistry":{"image":"ubuntu"}},"toolType":"Custom","customToolkitSettings":{"commandLine":"echo
hi | tee $AZ_BATCHAI_OUTPUT_OUTPUT/result.txt"},"stdOutErrPathPrefix":"$AZ_BATCHAI_MOUNT_ROOT/azfiles","outputDirectories":[{"id":"OUTPUT","pathPrefix":"$AZ_BATCHAI_MOUNT_ROOT/azfiles","pathSuffix":"output","type":"Custom","createNew":true}],"constraints":{"maxWallClockTime":"P7D","maxRetryCount":0},"creationTime":"2017-09-29T23:27:31.521Z","provisioningState":"Succeeded","provisioningStateTransitionTime":"2017-09-29T23:27:33.236Z","executionState":"Succeeded","executionStateTransitionTime":"2017-09-29T23:41:52.529Z","executionInfo":{"startTime":"2017-09-29T23:27:33.779Z","endTime":"2017-09-29T23:43:11.98Z","exitCode":0}}}'}
headers:
cache-control: [no-cache]
content-length: ['1242']
content-type: [application/json; charset=utf-8]
date: ['Fri, 29 Sep 2017 23:47:53 GMT']
etag: ['"0x8D50791A8219231"']
expires: ['-1']
last-modified: ['Fri, 29 Sep 2017 23:27:31 GMT']
pragma: [no-cache]
request-id: [c77a3401-f138-4b45-82cf-eced50f35c9f]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster show]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaiclient/0.2.0 Azure-SDK-For-Python
AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster","name":"cluster","type":"Microsoft.BatchAI/Clusters","location":"eastus","properties":{"provisioningState":"Succeeded","allocationState":"Steady","creationTime":"2017-09-29T23:27:08.476Z","lastModified":"2017-09-29T23:27:08.476Z","allocationStateTransitionTime":"2017-09-29T23:51:35.38Z","provisioningStateTransitionTime":"2017-09-29T23:27:09.362Z","vmSize":"STANDARD_D1","currentNodeCount":0,"nodeStateCounts":{"runningNodeCount":0,"idleNodeCount":0,"unusableNodeCount":0,"preparingNodeCount":0},"vmPriority":"Dedicated","scaleSettings":{"autoScale":{"minimumNodeCount":0,"maximumNodeCount":1,"initialNodeCount":0}},"virtualMachineConfiguration":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"16.04-LTS","version":"latest"}},"userAccountSettings":{"adminUserName":"DemoUser"},"nodeSetup":{"mountVolumes":{"azureFileShares":[{"accountName":"clitest000002","azureFileUrl":"https://clitest000002.file.core.windows.net/share","credentialsInfo":{},"relativeMountPath":"azfiles","fileMode":"0777","directoryMode":"0777"}]}},"subnet":{}}}'}
headers:
cache-control: [no-cache]
content-length: ['1276']
content-type: [application/json; charset=utf-8]
date: ['Sat, 30 Sep 2017 00:07:56 GMT']
etag: ['"0x8D507919A6521A6"']
expires: ['-1']
last-modified: ['Fri, 29 Sep 2017 23:27:08 GMT']
pragma: [no-cache]
request-id: [3f9bb26f-a43e-43ab-89b6-510a14e085a3]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [group delete]
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 resourcemanagementclient/1.2.0rc2
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10
response:
body: {string: ''}
headers:
cache-control: [no-cache]
content-length: ['0']
date: ['Sat, 30 Sep 2017 00:07:58 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdORFI3T1Y3WkJKVVQzQTZNUzJIRExPQldMUDNHWkxCTjZPUnxBMjc1OEIzNzA4NUI0QTA1LUVBU1RVUyIsImpvYkxvY2F0aW9uIjoiZWFzdHVzIn0?api-version=2017-05-10']
pragma: [no-cache]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 202, message: Accepted}
version: 1

Просмотреть файл

@ -0,0 +1,761 @@
interactions:
- request:
body: '{"location": "eastus", "tags": {"use": "az-test"}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [group create]
Connection: [keep-alive]
Content-Length: ['50']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 resourcemanagementclient/1.2.0rc2
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"eastus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'}
headers:
cache-control: [no-cache]
content-length: ['328']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:42:58 GMT']
expires: ['-1']
pragma: [no-cache]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 201, message: Created}
- request:
body: '{"location": "eastus", "sku": {"name": "Standard_LRS"}, "kind": "Storage",
"properties": {"supportsHttpsTrafficOnly": false}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account create]
Connection: [keep-alive]
Content-Length: ['125']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002?api-version=2017-06-01
response:
body: {string: ''}
headers:
cache-control: [no-cache]
content-length: ['0']
date: ['Sun, 01 Oct 2017 10:43:00 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/5dd28d2a-e94f-4b5a-94e4-bd67a1248c91?monitor=true&api-version=2017-06-01']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/5dd28d2a-e94f-4b5a-94e4-bd67a1248c91?monitor=true&api-version=2017-06-01
response:
body: {string: ''}
headers:
cache-control: [no-cache]
content-length: ['0']
date: ['Sun, 01 Oct 2017 10:43:17 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/5dd28d2a-e94f-4b5a-94e4-bd67a1248c91?monitor=true&api-version=2017-06-01']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/5dd28d2a-e94f-4b5a-94e4-bd67a1248c91?monitor=true&api-version=2017-06-01
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002","kind":"Storage","location":"eastus","name":"clitest000002","properties":{"creationTime":"2017-10-01T10:43:00.0229586Z","networkAcls":{"bypass":"AzureServices","defaultAction":"Allow","ipRules":[],"virtualNetworkRules":[]},"primaryEndpoints":{"blob":"https://clitest000002.blob.core.windows.net/","file":"https://clitest000002.file.core.windows.net/","queue":"https://clitest000002.queue.core.windows.net/","table":"https://clitest000002.table.core.windows.net/"},"primaryLocation":"eastus","provisioningState":"Succeeded","statusOfPrimary":"available","supportsHttpsTrafficOnly":false},"sku":{"name":"Standard_LRS","tier":"Standard"},"tags":{},"type":"Microsoft.Storage/storageAccounts"}
'}
headers:
cache-control: [no-cache]
content-length: ['964']
content-type: [application/json]
date: ['Sun, 01 Oct 2017 10:43:35 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account keys list]
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2017-06-01
response:
body: {string: '{"keys":[{"keyName":"key1","permissions":"Full","value":"woITvtPDk6DSX3wfX7FRHnLV4hsPigSRUo5eUBLhq6t43tAJTBwaOprA82zWrSt4zAtYaJ/P70JKpSxkfeYfhg=="},{"keyName":"key2","permissions":"Full","value":"dTgqk0nDeP/W4rZbytVPUJFXhSa9i33GYGDgijlpSRUAMwdrXqYAedmFxH/QIey4UfBRKDcX6bn2ENeWjiA8sA=="}]}
'}
headers:
cache-control: [no-cache]
content-length: ['289']
content-type: [application/json]
date: ['Sun, 01 Oct 2017 10:43:36 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account keys list]
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2017-06-01
response:
body: {string: '{"keys":[{"keyName":"key1","permissions":"Full","value":"woITvtPDk6DSX3wfX7FRHnLV4hsPigSRUo5eUBLhq6t43tAJTBwaOprA82zWrSt4zAtYaJ/P70JKpSxkfeYfhg=="},{"keyName":"key2","permissions":"Full","value":"dTgqk0nDeP/W4rZbytVPUJFXhSa9i33GYGDgijlpSRUAMwdrXqYAedmFxH/QIey4UfBRKDcX6bn2ENeWjiA8sA=="}]}
'}
headers:
cache-control: [no-cache]
content-length: ['289']
content-type: [application/json]
date: ['Sun, 01 Oct 2017 10:43:36 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-ms-ratelimit-remaining-subscription-writes: ['1197']
status: {code: 200, message: OK}
- request:
body: null
headers:
Connection: [keep-alive]
Content-Length: ['0']
User-Agent: [Azure-Storage/0.36.0 (Python CPython 3.5.3; Linux 4.10.0-35-generic)
AZURECLI/2.0.16+dev]
x-ms-date: ['Sun, 01 Oct 2017 10:43:36 GMT']
x-ms-version: ['2017-04-17']
method: PUT
uri: https://clitest000002.file.core.windows.net/share?restype=share
response:
body: {string: ''}
headers:
date: ['Sun, 01 Oct 2017 10:43:36 GMT']
etag: ['"0x8D508B945564EA2"']
last-modified: ['Sun, 01 Oct 2017 10:43:36 GMT']
server: [Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0]
transfer-encoding: [chunked]
x-ms-version: ['2017-04-17']
status: {code: 201, message: Created}
- request:
body: '{"location": "eastus", "properties": {"dataDisks": {"diskSizeInGB": 10,
"storageAccountType": "Standard_LRS", "diskCount": 2}, "vmSize": "STANDARD_D1",
"sshConfiguration": {"userAccountSettings": {"adminUserName": "DemoUser", "adminUserPassword":
"DemoPa$$w0rd"}}}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Length: ['265']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileServers/nfs?api-version=2017-09-01-preview
response:
body: {string: ''}
headers:
azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview']
cache-control: [no-cache]
content-length: ['0']
date: ['Sun, 01 Oct 2017 10:43:38 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview']
pragma: [no-cache]
request-id: [acbd2385-934d-4794-87f7-1e408bda3fbd]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b","name":"29723784-9abf-423b-9e0d-25cd3283e92b","status":"InProgress","startTime":"2017-10-01T10:43:38.872Z"}'}
headers:
cache-control: [no-cache]
content-length: ['294']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:43:54 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [d3501db6-f093-44ec-b6a2-21494af95509]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b","name":"29723784-9abf-423b-9e0d-25cd3283e92b","status":"InProgress","startTime":"2017-10-01T10:43:38.872Z"}'}
headers:
cache-control: [no-cache]
content-length: ['294']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:44:25 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [4114292b-be08-4ef0-8290-ac0cf0bad2ba]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b","name":"29723784-9abf-423b-9e0d-25cd3283e92b","status":"InProgress","startTime":"2017-10-01T10:43:38.872Z"}'}
headers:
cache-control: [no-cache]
content-length: ['294']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:44:56 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [700f1840-a646-4d1a-9fd2-09d4508e5985]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b","name":"29723784-9abf-423b-9e0d-25cd3283e92b","status":"InProgress","startTime":"2017-10-01T10:43:38.872Z"}'}
headers:
cache-control: [no-cache]
content-length: ['294']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:45:27 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [a66adb7c-0a92-4d46-8815-91a1632317ba]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b","name":"29723784-9abf-423b-9e0d-25cd3283e92b","status":"InProgress","startTime":"2017-10-01T10:43:38.872Z"}'}
headers:
cache-control: [no-cache]
content-length: ['294']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:45:58 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [8d1d2ac2-3d6f-4fc5-85f1-b9604d0cceec]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b","name":"29723784-9abf-423b-9e0d-25cd3283e92b","status":"InProgress","startTime":"2017-10-01T10:43:38.872Z"}'}
headers:
cache-control: [no-cache]
content-length: ['294']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:46:29 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [a101f4d2-0983-4a01-b3bc-9223c5418977]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b","name":"29723784-9abf-423b-9e0d-25cd3283e92b","status":"InProgress","startTime":"2017-10-01T10:43:38.872Z"}'}
headers:
cache-control: [no-cache]
content-length: ['294']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:47:00 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [6356a1a1-f7e9-4a23-bea5-ddf924d7fd70]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b","name":"29723784-9abf-423b-9e0d-25cd3283e92b","status":"InProgress","startTime":"2017-10-01T10:43:38.872Z"}'}
headers:
cache-control: [no-cache]
content-length: ['294']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:47:31 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [4b7f293c-14cd-4e6c-ad55-1de693266166]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/29723784-9abf-423b-9e0d-25cd3283e92b","name":"29723784-9abf-423b-9e0d-25cd3283e92b","status":"Succeeded","startTime":"2017-10-01T10:43:38.872Z","endTime":"2017-10-01T10:47:47.867Z","properties":{"resourceId":"8001b49e-e169-4ee6-a5ff-9c3ea5385053$clitest.rg000001$nfs"}}'}
headers:
cache-control: [no-cache]
content-length: ['477']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:48:01 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [25284d41-54f2-4769-86db-57eaa65e938b]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileServers/nfs?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs","name":"nfs","type":"Microsoft.BatchAI/FileServers","location":"eastus","properties":{"provisioningState":"Succeeded","creationTime":"2017-10-01T10:43:38.856Z","provisioningStateTransitionTime":"2017-10-01T10:47:47.789Z","vmSize":"STANDARD_D1","sshConfiguration":{"userAccountSettings":{"adminUserName":"DemoUser"}},"dataDisks":{"fileSystemType":"BRTFS","raidLevel":"NoRaid","diskSizeInGB":10,"cachingType":"None","diskCount":2,"storageAccountType":"Standard_LRS"},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492/providers/Microsoft.Network/virtualNetworks/52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492vnet/subnets/Subnet-1"},"mountSettings":{"mountPoint":"/mnt/data","fileServerPublicIP":"40.71.210.3","fileServerInternalIP":"10.0.0.4","fileServerType":"NFS"}}}'}
headers:
cache-control: [no-cache]
content-length: ['1033']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:48:03 GMT']
etag: ['"0x8D508B9468F5F1D"']
expires: ['-1']
last-modified: ['Sun, 01 Oct 2017 10:43:38 GMT']
pragma: [no-cache]
request-id: [5b6ce9d8-b51f-4141-9565-1285ef2593ad]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileServers/nfs?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs","name":"nfs","type":"Microsoft.BatchAI/FileServers","location":"eastus","properties":{"provisioningState":"Succeeded","creationTime":"2017-10-01T10:43:38.856Z","provisioningStateTransitionTime":"2017-10-01T10:47:47.789Z","vmSize":"STANDARD_D1","sshConfiguration":{"userAccountSettings":{"adminUserName":"DemoUser"}},"dataDisks":{"fileSystemType":"BRTFS","raidLevel":"NoRaid","diskSizeInGB":10,"cachingType":"None","diskCount":2,"storageAccountType":"Standard_LRS"},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492/providers/Microsoft.Network/virtualNetworks/52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492vnet/subnets/Subnet-1"},"mountSettings":{"mountPoint":"/mnt/data","fileServerPublicIP":"40.71.210.3","fileServerInternalIP":"10.0.0.4","fileServerType":"NFS"}}}'}
headers:
cache-control: [no-cache]
content-length: ['1033']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:48:04 GMT']
etag: ['"0x8D508B9468F5F1D"']
expires: ['-1']
last-modified: ['Sun, 01 Oct 2017 10:43:38 GMT']
pragma: [no-cache]
request-id: [03c29642-28cb-42e5-a9ad-67280e4a2a01]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: 'b''b\''{"location": "eastus", "properties": {"userAccountSettings": {"adminUserSshPublicKey":
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKUDnWeK6rx36apNE9ij1iAXn68FKXLTW0009XK/7dyMewlNfXi6Z2opnxHDDYWucMluU0dsvBR22OuYH2RHriPJTi1jN3aZ0zZSrlH/W4MSNQKlG/AnrjJPA3xfYjIKLGuKBqSIvMsmrkuDfIfMaDnPcxb+GzM10L5epRhoP5FwqaQbLqp640YzFSLqMChz7E6RG54CpEm+MRvA7lj9nD9AlYnfRQAKj2thsFrkz7AlYLQ1ug8vV+1Y3xSKDbo5vy6oqM3QKeLiUiyN9Ff1Rq4uYnrqJqcWN1ADfiPGZZjEStOkRgG3V6JrpIN+z0Zl3n+sjrH+CKwrYmyni6D41L",
"adminUserName": "alex"}, "vmSize": "STANDARD_D1", "scaleSettings": {"manual":
{"targetNodeCount": 1}}, "nodeSetup": {"mountVolumes": {"fileServers": [{"fileServer":
{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs"},
"mountOptions": "rw", "relativeMountPath": "nfs"}], "azureFileShares": [{"credentialsInfo":
{"accountKey": "woITvtPDk6DSX3wfX7FRHnLV4hsPigSRUo5eUBLhq6t43tAJTBwaOprA82zWrSt4zAtYaJ/P70JKpSxkfeYfhg=="},
"fileMode": "0777", "accountName": "clitest000002", "relativeMountPath": "afs",
"directoryMode": "0777", "azureFileUrl": "https://clitest000002.file.core.windows.net/share"}]}}}}\'''''
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Length: ['1235']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: ''}
headers:
azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/d5e0b4e1-9579-451b-80bf-6a4f1948ee29?api-version=2017-09-01-preview']
cache-control: [no-cache]
content-length: ['0']
date: ['Sun, 01 Oct 2017 10:48:06 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/d5e0b4e1-9579-451b-80bf-6a4f1948ee29?api-version=2017-09-01-preview']
pragma: [no-cache]
request-id: [1bb5f3be-8848-4339-a59a-4a446b2ebe78]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/d5e0b4e1-9579-451b-80bf-6a4f1948ee29?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/d5e0b4e1-9579-451b-80bf-6a4f1948ee29","name":"d5e0b4e1-9579-451b-80bf-6a4f1948ee29","status":"Succeeded","startTime":"2017-10-01T10:48:06.923Z","endTime":"2017-10-01T10:48:08.26Z","properties":{"resourceId":"8001b49e-e169-4ee6-a5ff-9c3ea5385053$clitest.rg000001$cluster"}}'}
headers:
cache-control: [no-cache]
content-length: ['480']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:48:22 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [88443f0d-1e14-4242-96c7-b4c329c9a970]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster","name":"cluster","type":"Microsoft.BatchAI/Clusters","location":"eastus","properties":{"provisioningState":"Succeeded","allocationState":"Resizing","creationTime":"2017-10-01T10:48:06.845Z","lastModified":"2017-10-01T10:48:06.845Z","allocationStateTransitionTime":"2017-10-01T10:48:08.248Z","provisioningStateTransitionTime":"2017-10-01T10:48:08.228Z","vmSize":"STANDARD_D1","currentNodeCount":0,"nodeStateCounts":{"runningNodeCount":0,"idleNodeCount":0,"unusableNodeCount":0,"preparingNodeCount":0},"vmPriority":"Dedicated","scaleSettings":{"manual":{"targetNodeCount":1,"nodeDeallocationOption":"Requeue"}},"virtualMachineConfiguration":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"16.04-LTS","version":"latest"}},"userAccountSettings":{"adminUserName":"alex","adminUserSSHPublicKey":"ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQDKUDnWeK6rx36apNE9ij1iAXn68FKXLTW0009XK/7dyMewlNfXi6Z2opnxHDDYWucMluU0dsvBR22OuYH2RHriPJTi1jN3aZ0zZSrlH/W4MSNQKlG/AnrjJPA3xfYjIKLGuKBqSIvMsmrkuDfIfMaDnPcxb+GzM10L5epRhoP5FwqaQbLqp640YzFSLqMChz7E6RG54CpEm+MRvA7lj9nD9AlYnfRQAKj2thsFrkz7AlYLQ1ug8vV+1Y3xSKDbo5vy6oqM3QKeLiUiyN9Ff1Rq4uYnrqJqcWN1ADfiPGZZjEStOkRgG3V6JrpIN+z0Zl3n+sjrH+CKwrYmyni6D41L"},"nodeSetup":{"mountVolumes":{"azureFileShares":[{"accountName":"clitest000002","azureFileUrl":"https://clitest000002.file.core.windows.net/share","credentialsInfo":{},"relativeMountPath":"afs","fileMode":"0777","directoryMode":"0777"}],"fileServers":[{"fileServer":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs"},"relativeMountPath":"nfs","mountOptions":"rw"}]}},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492/providers/Microsoft.Network/virtualNetworks/52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492vnet/subnets/Subnet-1"}}}'}
headers:
cache-control: [no-cache]
content-length: ['2165']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 10:48:24 GMT']
etag: ['"0x8D508B9E64B3B74"']
expires: ['-1']
last-modified: ['Sun, 01 Oct 2017 10:48:06 GMT']
pragma: [no-cache]
request-id: [32cf9828-4f19-4d32-88dc-d1188aab6f36]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster show]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster","name":"cluster","type":"Microsoft.BatchAI/Clusters","location":"eastus","properties":{"provisioningState":"Succeeded","allocationState":"Steady","creationTime":"2017-10-01T10:48:06.845Z","lastModified":"2017-10-01T10:48:06.845Z","allocationStateTransitionTime":"2017-10-01T10:49:09.627Z","provisioningStateTransitionTime":"2017-10-01T10:48:08.228Z","vmSize":"STANDARD_D1","currentNodeCount":1,"nodeStateCounts":{"runningNodeCount":0,"idleNodeCount":1,"unusableNodeCount":0,"preparingNodeCount":0},"vmPriority":"Dedicated","scaleSettings":{"manual":{"targetNodeCount":1,"nodeDeallocationOption":"Requeue"}},"virtualMachineConfiguration":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"16.04-LTS","version":"latest"}},"userAccountSettings":{"adminUserName":"alex","adminUserSSHPublicKey":"ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQDKUDnWeK6rx36apNE9ij1iAXn68FKXLTW0009XK/7dyMewlNfXi6Z2opnxHDDYWucMluU0dsvBR22OuYH2RHriPJTi1jN3aZ0zZSrlH/W4MSNQKlG/AnrjJPA3xfYjIKLGuKBqSIvMsmrkuDfIfMaDnPcxb+GzM10L5epRhoP5FwqaQbLqp640YzFSLqMChz7E6RG54CpEm+MRvA7lj9nD9AlYnfRQAKj2thsFrkz7AlYLQ1ug8vV+1Y3xSKDbo5vy6oqM3QKeLiUiyN9Ff1Rq4uYnrqJqcWN1ADfiPGZZjEStOkRgG3V6JrpIN+z0Zl3n+sjrH+CKwrYmyni6D41L"},"nodeSetup":{"mountVolumes":{"azureFileShares":[{"accountName":"clitest000002","azureFileUrl":"https://clitest000002.file.core.windows.net/share","credentialsInfo":{},"relativeMountPath":"afs","fileMode":"0777","directoryMode":"0777"}],"fileServers":[{"fileServer":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs"},"relativeMountPath":"nfs","mountOptions":"rw"}]}},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492/providers/Microsoft.Network/virtualNetworks/52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492vnet/subnets/Subnet-1"}}}'}
headers:
cache-control: [no-cache]
content-length: ['2163']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 11:03:19 GMT']
etag: ['"0x8D508B9E64B3B74"']
expires: ['-1']
last-modified: ['Sun, 01 Oct 2017 10:48:06 GMT']
pragma: [no-cache]
request-id: [4ecc1613-4cea-476a-aa7a-dbf4f3a11ab7]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server show]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileServers/nfs?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs","name":"nfs","type":"Microsoft.BatchAI/FileServers","location":"eastus","properties":{"provisioningState":"Succeeded","creationTime":"2017-10-01T10:43:38.856Z","provisioningStateTransitionTime":"2017-10-01T10:47:47.789Z","vmSize":"STANDARD_D1","sshConfiguration":{"userAccountSettings":{"adminUserName":"DemoUser"}},"dataDisks":{"fileSystemType":"BRTFS","raidLevel":"NoRaid","diskSizeInGB":10,"cachingType":"None","diskCount":2,"storageAccountType":"Standard_LRS"},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492/providers/Microsoft.Network/virtualNetworks/52b6ee8c-2cc0-44f2-8649-b0bb3a1dd492vnet/subnets/Subnet-1"},"mountSettings":{"mountPoint":"/mnt/data","fileServerPublicIP":"40.71.210.3","fileServerInternalIP":"10.0.0.4","fileServerType":"NFS"}}}'}
headers:
cache-control: [no-cache]
content-length: ['1033']
content-type: [application/json; charset=utf-8]
date: ['Sun, 01 Oct 2017 11:03:20 GMT']
etag: ['"0x8D508B9468F5F1D"']
expires: ['-1']
last-modified: ['Sun, 01 Oct 2017 10:43:38 GMT']
pragma: [no-cache]
request-id: [2e430f20-3e6b-4237-91a3-f002fdadc176]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [group delete]
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 resourcemanagementclient/1.2.0rc2
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10
response:
body: {string: ''}
headers:
cache-control: [no-cache]
content-length: ['0']
date: ['Sun, 01 Oct 2017 11:03:22 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdYR1gzTjNMNDdDMjZTWElCNktRRUJBN0Q0WTZBRVhINElHTXwyREU4NEEzNkIyOEE3Mjk2LUVBU1RVUyIsImpvYkxvY2F0aW9uIjoiZWFzdHVzIn0?api-version=2017-05-10']
pragma: [no-cache]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 202, message: Accepted}
version: 1

Просмотреть файл

@ -0,0 +1,734 @@
interactions:
- request:
body: '{"location": "eastus", "tags": {"use": "az-test"}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [group create]
Connection: [keep-alive]
Content-Length: ['50']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 resourcemanagementclient/1.2.0rc2
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"eastus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'}
headers:
cache-control: [no-cache]
content-length: ['328']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:52:05 GMT']
expires: ['-1']
pragma: [no-cache]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1197']
status: {code: 201, message: Created}
- request:
body: '{"location": "eastus", "sku": {"name": "Standard_LRS"}, "properties": {"supportsHttpsTrafficOnly":
false}, "kind": "Storage"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account create]
Connection: [keep-alive]
Content-Length: ['125']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002?api-version=2017-06-01
response:
body: {string: ''}
headers:
cache-control: [no-cache]
content-length: ['0']
date: ['Tue, 03 Oct 2017 15:52:09 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/617a1e66-ab88-4bdb-81cd-a0f3d5b4931f?monitor=true&api-version=2017-06-01']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/617a1e66-ab88-4bdb-81cd-a0f3d5b4931f?monitor=true&api-version=2017-06-01
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002","kind":"Storage","location":"eastus","name":"clitest000002","properties":{"creationTime":"2017-10-03T15:52:06.6729478Z","networkAcls":{"bypass":"AzureServices","defaultAction":"Allow","ipRules":[],"virtualNetworkRules":[]},"primaryEndpoints":{"blob":"https://clitest000002.blob.core.windows.net/","file":"https://clitest000002.file.core.windows.net/","queue":"https://clitest000002.queue.core.windows.net/","table":"https://clitest000002.table.core.windows.net/"},"primaryLocation":"eastus","provisioningState":"Succeeded","statusOfPrimary":"available","supportsHttpsTrafficOnly":false},"sku":{"name":"Standard_LRS","tier":"Standard"},"tags":{},"type":"Microsoft.Storage/storageAccounts"}
'}
headers:
cache-control: [no-cache]
content-length: ['964']
content-type: [application/json]
date: ['Tue, 03 Oct 2017 15:52:26 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account keys list]
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2017-06-01
response:
body: {string: '{"keys":[{"keyName":"key1","permissions":"Full","value":"yopuh9YAZs/dTEqbgFmnef2LJMf6IKtYO+qXFZvirYkJMr2inzY7ALd6rukDX84a3bIBGpFdxrz/fW9hU/0A7Q=="},{"keyName":"key2","permissions":"Full","value":"8jKI/4vkV9JaZHQasSL23PXwIjoEECqeeoi+1ioUNf8fLrh7T69VIV5Aha1pV8LZWH9LcOJugsEru48aM1JUdA=="}]}
'}
headers:
cache-control: [no-cache]
content-length: ['289']
content-type: [application/json]
date: ['Tue, 03 Oct 2017 15:52:26 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [storage account keys list]
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 storagemanagementclient/1.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2017-06-01
response:
body: {string: '{"keys":[{"keyName":"key1","permissions":"Full","value":"yopuh9YAZs/dTEqbgFmnef2LJMf6IKtYO+qXFZvirYkJMr2inzY7ALd6rukDX84a3bIBGpFdxrz/fW9hU/0A7Q=="},{"keyName":"key2","permissions":"Full","value":"8jKI/4vkV9JaZHQasSL23PXwIjoEECqeeoi+1ioUNf8fLrh7T69VIV5Aha1pV8LZWH9LcOJugsEru48aM1JUdA=="}]}
'}
headers:
cache-control: [no-cache]
content-length: ['289']
content-type: [application/json]
date: ['Tue, 03 Oct 2017 15:52:27 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-ms-ratelimit-remaining-subscription-writes: ['1196']
status: {code: 200, message: OK}
- request:
body: null
headers:
Connection: [keep-alive]
Content-Length: ['0']
User-Agent: [Azure-Storage/0.36.0 (Python CPython 3.5.3; Linux 4.10.0-35-generic)
AZURECLI/2.0.16+dev]
x-ms-date: ['Tue, 03 Oct 2017 15:52:28 GMT']
x-ms-version: ['2017-04-17']
method: PUT
uri: https://clitest000002.file.core.windows.net/share?restype=share
response:
body: {string: ''}
headers:
date: ['Tue, 03 Oct 2017 15:52:28 GMT']
etag: ['"0x8D50A76C03A51F5"']
last-modified: ['Tue, 03 Oct 2017 15:52:29 GMT']
server: [Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0]
transfer-encoding: [chunked]
x-ms-version: ['2017-04-17']
status: {code: 201, message: Created}
- request:
body: '{"location": "eastus", "properties": {"vmSize": "STANDARD_D1", "sshConfiguration":
{"userAccountSettings": {"adminUserName": "alex", "adminUserPassword": "Password_123"}},
"dataDisks": {"diskSizeInGB": 10, "storageAccountType": "Standard_LRS", "diskCount":
2}}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Length: ['261']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileServers/nfs?api-version=2017-09-01-preview
response:
body: {string: ''}
headers:
azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview']
cache-control: [no-cache]
content-length: ['0']
date: ['Tue, 03 Oct 2017 15:52:30 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview']
pragma: [no-cache]
request-id: [d8bd3c12-a748-4b87-99b0-26f2ac90b7cf]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e","name":"9aefad8b-a249-4739-9ca2-abbfc9c0082e","status":"InProgress","startTime":"2017-10-03T15:52:31.2Z"}'}
headers:
cache-control: [no-cache]
content-length: ['292']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:52:46 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [15307c9e-3c74-4544-97cb-50706c8ab7be]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e","name":"9aefad8b-a249-4739-9ca2-abbfc9c0082e","status":"InProgress","startTime":"2017-10-03T15:52:31.2Z"}'}
headers:
cache-control: [no-cache]
content-length: ['292']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:53:18 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [779b6ede-3d85-4450-b68f-a0889f69cbb6]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e","name":"9aefad8b-a249-4739-9ca2-abbfc9c0082e","status":"InProgress","startTime":"2017-10-03T15:52:31.2Z"}'}
headers:
cache-control: [no-cache]
content-length: ['292']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:53:48 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [c0231e05-2875-4bc1-9835-1a37f08adb9f]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e","name":"9aefad8b-a249-4739-9ca2-abbfc9c0082e","status":"InProgress","startTime":"2017-10-03T15:52:31.2Z"}'}
headers:
cache-control: [no-cache]
content-length: ['292']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:54:19 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [890fb337-5658-42ec-a857-91d25b7fd7c2]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e","name":"9aefad8b-a249-4739-9ca2-abbfc9c0082e","status":"InProgress","startTime":"2017-10-03T15:52:31.2Z"}'}
headers:
cache-control: [no-cache]
content-length: ['292']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:54:50 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [cc6cc107-4cf8-4e8c-a9b9-4cbf3c4f8446]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e","name":"9aefad8b-a249-4739-9ca2-abbfc9c0082e","status":"InProgress","startTime":"2017-10-03T15:52:31.2Z"}'}
headers:
cache-control: [no-cache]
content-length: ['292']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:55:22 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [b526d238-a2a7-4fc4-bb11-3e876869bc8c]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e","name":"9aefad8b-a249-4739-9ca2-abbfc9c0082e","status":"InProgress","startTime":"2017-10-03T15:52:31.2Z"}'}
headers:
cache-control: [no-cache]
content-length: ['292']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:55:53 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [c29850e2-d7cd-4de1-88d7-60196a6527d3]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e","name":"9aefad8b-a249-4739-9ca2-abbfc9c0082e","status":"InProgress","startTime":"2017-10-03T15:52:31.2Z"}'}
headers:
cache-control: [no-cache]
content-length: ['292']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:56:24 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [6d3f44bd-310d-4b6e-a6f4-c3cf0eebb709]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/9aefad8b-a249-4739-9ca2-abbfc9c0082e","name":"9aefad8b-a249-4739-9ca2-abbfc9c0082e","status":"Succeeded","startTime":"2017-10-03T15:52:31.2Z","endTime":"2017-10-03T15:56:41.929Z","properties":{"resourceId":"8001b49e-e169-4ee6-a5ff-9c3ea5385053$clitest.rg000001$nfs"}}'}
headers:
cache-control: [no-cache]
content-length: ['475']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:56:54 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [ad158b18-df6f-42b1-b429-64d06a958a97]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileServers/nfs?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs","name":"nfs","type":"Microsoft.BatchAI/FileServers","location":"eastus","properties":{"provisioningState":"Succeeded","creationTime":"2017-10-03T15:52:31.18Z","provisioningStateTransitionTime":"2017-10-03T15:56:41.913Z","vmSize":"STANDARD_D1","sshConfiguration":{"userAccountSettings":{"adminUserName":"alex"}},"dataDisks":{"fileSystemType":"BRTFS","raidLevel":"NoRaid","diskSizeInGB":10,"cachingType":"None","diskCount":2,"storageAccountType":"Standard_LRS"},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-afc7309a-95eb-4244-a0c2-9175a6e308d6/providers/Microsoft.Network/virtualNetworks/afc7309a-95eb-4244-a0c2-9175a6e308d6vnet/subnets/Subnet-1"},"mountSettings":{"mountPoint":"/mnt/data","fileServerPublicIP":"13.90.85.51","fileServerInternalIP":"10.0.0.4","fileServerType":"NFS"}}}'}
headers:
cache-control: [no-cache]
content-length: ['1028']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:56:55 GMT']
etag: ['"0x8D50A76C183126F"']
expires: ['-1']
last-modified: ['Tue, 03 Oct 2017 15:52:31 GMT']
pragma: [no-cache]
request-id: [a846ce5f-0305-4f98-b069-da9adfa40685]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileServers/nfs?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs","name":"nfs","type":"Microsoft.BatchAI/FileServers","location":"eastus","properties":{"provisioningState":"Succeeded","creationTime":"2017-10-03T15:52:31.18Z","provisioningStateTransitionTime":"2017-10-03T15:56:41.913Z","vmSize":"STANDARD_D1","sshConfiguration":{"userAccountSettings":{"adminUserName":"alex"}},"dataDisks":{"fileSystemType":"BRTFS","raidLevel":"NoRaid","diskSizeInGB":10,"cachingType":"None","diskCount":2,"storageAccountType":"Standard_LRS"},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-afc7309a-95eb-4244-a0c2-9175a6e308d6/providers/Microsoft.Network/virtualNetworks/afc7309a-95eb-4244-a0c2-9175a6e308d6vnet/subnets/Subnet-1"},"mountSettings":{"mountPoint":"/mnt/data","fileServerPublicIP":"13.90.85.51","fileServerInternalIP":"10.0.0.4","fileServerType":"NFS"}}}'}
headers:
cache-control: [no-cache]
content-length: ['1028']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:56:57 GMT']
etag: ['"0x8D50A76C183126F"']
expires: ['-1']
last-modified: ['Tue, 03 Oct 2017 15:52:31 GMT']
pragma: [no-cache]
request-id: [53c67bd8-174b-4da6-bb8c-0aacf700484d]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: 'b''b\''{"location": "eastus", "properties": {"vmSize": "STANDARD_D1", "virtualMachineConfiguration":
{"imageReference": {"sku": "16.04-LTS", "offer": "UbuntuServer", "publisher":
"Canonical"}}, "scaleSettings": {"manual": {"targetNodeCount": 1, "nodeDeallocationOption":
"requeue"}}, "userAccountSettings": {"adminUserName": "alex", "adminUserPassword":
"Password_123"}, "nodeSetup": {"mountVolumes": {"fileServers": [{"fileServer":
{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs"},
"relativeMountPath": "nfs", "mountOptions": "rw"}], "azureFileShares": [{"directoryMode":
"0777", "fileMode": "0777", "credentialsInfo": {"accountKey": "yopuh9YAZs/dTEqbgFmnef2LJMf6IKtYO+qXFZvirYkJMr2inzY7ALd6rukDX84a3bIBGpFdxrz/fW9hU/0A7Q=="},
"relativeMountPath": "afs", "azureFileUrl": "https://clitest000002.file.core.windows.net/share",
"accountName": "clitest000002"}]}}, "vmPriority": "dedicated"}}\'''''
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Length: ['1051']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: ''}
headers:
azure-asyncoperation: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/cf38cbf1-c986-4906-af6e-8e0516132dbf?api-version=2017-09-01-preview']
cache-control: [no-cache]
content-length: ['0']
date: ['Tue, 03 Oct 2017 15:56:59 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/cf38cbf1-c986-4906-af6e-8e0516132dbf?api-version=2017-09-01-preview']
pragma: [no-cache]
request-id: [38552e08-95af-4e30-a86b-52195cf9c233]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
x-ms-ratelimit-remaining-subscription-writes: ['1197']
status: {code: 202, message: Accepted}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/cf38cbf1-c986-4906-af6e-8e0516132dbf?api-version=2017-09-01-preview
response:
body: {string: '{"id":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.BatchAI/locations/eastus/operationresults/cf38cbf1-c986-4906-af6e-8e0516132dbf","name":"cf38cbf1-c986-4906-af6e-8e0516132dbf","status":"Succeeded","startTime":"2017-10-03T15:57:00.129Z","endTime":"2017-10-03T15:57:01.409Z","properties":{"resourceId":"8001b49e-e169-4ee6-a5ff-9c3ea5385053$clitest.rg000001$cluster"}}'}
headers:
cache-control: [no-cache]
content-length: ['481']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:57:15 GMT']
expires: ['-1']
pragma: [no-cache]
request-id: [e28c4b0a-a67f-49c7-a983-6049655a66b0]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster create]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster","name":"cluster","type":"Microsoft.BatchAI/Clusters","location":"eastus","properties":{"provisioningState":"Succeeded","allocationState":"Resizing","creationTime":"2017-10-03T15:57:00.098Z","lastModified":"2017-10-03T15:57:00.098Z","allocationStateTransitionTime":"2017-10-03T15:57:01.321Z","provisioningStateTransitionTime":"2017-10-03T15:57:01.393Z","vmSize":"STANDARD_D1","currentNodeCount":0,"nodeStateCounts":{"runningNodeCount":0,"idleNodeCount":0,"unusableNodeCount":0,"preparingNodeCount":0},"vmPriority":"Dedicated","scaleSettings":{"manual":{"targetNodeCount":1,"nodeDeallocationOption":"Requeue"}},"virtualMachineConfiguration":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"16.04-LTS","version":"latest"}},"userAccountSettings":{"adminUserName":"alex"},"nodeSetup":{"mountVolumes":{"azureFileShares":[{"accountName":"clitest000002","azureFileUrl":"https://clitest000002.file.core.windows.net/share","credentialsInfo":{},"relativeMountPath":"afs","fileMode":"0777","directoryMode":"0777"}],"fileServers":[{"fileServer":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs"},"relativeMountPath":"nfs","mountOptions":"rw"}]}},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-afc7309a-95eb-4244-a0c2-9175a6e308d6/providers/Microsoft.Network/virtualNetworks/afc7309a-95eb-4244-a0c2-9175a6e308d6vnet/subnets/Subnet-1"}}}'}
headers:
cache-control: [no-cache]
content-length: ['1758']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 15:57:17 GMT']
etag: ['"0x8D50A7761CCC882"']
expires: ['-1']
last-modified: ['Tue, 03 Oct 2017 15:57:00 GMT']
pragma: [no-cache]
request-id: [7ec67173-ba8e-4a83-a549-e40fab1700a2]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai cluster show]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/clusters/cluster","name":"cluster","type":"Microsoft.BatchAI/Clusters","location":"eastus","properties":{"provisioningState":"Succeeded","allocationState":"Steady","creationTime":"2017-10-03T15:57:00.098Z","lastModified":"2017-10-03T15:57:00.098Z","allocationStateTransitionTime":"2017-10-03T15:57:57.653Z","provisioningStateTransitionTime":"2017-10-03T15:57:01.393Z","vmSize":"STANDARD_D1","currentNodeCount":1,"nodeStateCounts":{"runningNodeCount":0,"idleNodeCount":1,"unusableNodeCount":0,"preparingNodeCount":0},"vmPriority":"Dedicated","scaleSettings":{"manual":{"targetNodeCount":1,"nodeDeallocationOption":"Requeue"}},"virtualMachineConfiguration":{"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"16.04-LTS","version":"latest"}},"userAccountSettings":{"adminUserName":"alex"},"nodeSetup":{"mountVolumes":{"azureFileShares":[{"accountName":"clitest000002","azureFileUrl":"https://clitest000002.file.core.windows.net/share","credentialsInfo":{},"relativeMountPath":"afs","fileMode":"0777","directoryMode":"0777"}],"fileServers":[{"fileServer":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs"},"relativeMountPath":"nfs","mountOptions":"rw"}]}},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-afc7309a-95eb-4244-a0c2-9175a6e308d6/providers/Microsoft.Network/virtualNetworks/afc7309a-95eb-4244-a0c2-9175a6e308d6vnet/subnets/Subnet-1"}}}'}
headers:
cache-control: [no-cache]
content-length: ['1756']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 16:15:03 GMT']
etag: ['"0x8D50A7761CCC882"']
expires: ['-1']
last-modified: ['Tue, 03 Oct 2017 15:57:00 GMT']
pragma: [no-cache]
request-id: [55c72905-a9c7-414f-9a5b-8f990a4919fb]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [batchai file-server show]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 batchaimanagementclient/0.2.0
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileServers/nfs?api-version=2017-09-01-preview
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.BatchAI/fileservers/nfs","name":"nfs","type":"Microsoft.BatchAI/FileServers","location":"eastus","properties":{"provisioningState":"Succeeded","creationTime":"2017-10-03T15:52:31.18Z","provisioningStateTransitionTime":"2017-10-03T15:56:41.913Z","vmSize":"STANDARD_D1","sshConfiguration":{"userAccountSettings":{"adminUserName":"alex"}},"dataDisks":{"fileSystemType":"BRTFS","raidLevel":"NoRaid","diskSizeInGB":10,"cachingType":"None","diskCount":2,"storageAccountType":"Standard_LRS"},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fileserverrg-afc7309a-95eb-4244-a0c2-9175a6e308d6/providers/Microsoft.Network/virtualNetworks/afc7309a-95eb-4244-a0c2-9175a6e308d6vnet/subnets/Subnet-1"},"mountSettings":{"mountPoint":"/mnt/data","fileServerPublicIP":"13.90.85.51","fileServerInternalIP":"10.0.0.4","fileServerType":"NFS"}}}'}
headers:
cache-control: [no-cache]
content-length: ['1028']
content-type: [application/json; charset=utf-8]
date: ['Tue, 03 Oct 2017 16:15:04 GMT']
etag: ['"0x8D50A76C183126F"']
expires: ['-1']
last-modified: ['Tue, 03 Oct 2017 15:52:31 GMT']
pragma: [no-cache]
request-id: [d8387764-5d54-461f-b865-682d9935369b]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
vary: [Accept-Encoding]
x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
CommandName: [group delete]
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.3 (Linux-4.10.0-35-generic-x86_64-with-Ubuntu-17.04-zesty)
requests/2.9.1 msrest/0.4.14 msrest_azure/0.4.14 resourcemanagementclient/1.2.0rc2
Azure-SDK-For-Python AZURECLI/2.0.16+dev]
accept-language: [en-US]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2017-05-10
response:
body: {string: ''}
headers:
cache-control: [no-cache]
content-length: ['0']
date: ['Tue, 03 Oct 2017 16:15:07 GMT']
expires: ['-1']
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdCQlNDVkZMNlM3WU03MkNXS0xHMlpDQVhaRlhZSUpWRldTVHw2NzdEQjc5RjkyODdCNUYxLUVBU1RVUyIsImpvYkxvY2F0aW9uIjoiZWFzdHVzIn0?api-version=2017-05-10']
pragma: [no-cache]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
version: 1

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,302 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import os
import unittest
from azure.cli.command_modules.batchai.custom import (
update_cluster_create_parameters_with_env_variables,
update_nodes_information,
update_user_account_settings,
add_azure_container_to_cluster_create_parameters,
add_azure_file_share_to_cluster_create_parameters,
add_nfs_to_cluster_create_parameters)
from azure.cli.core.util import CLIError
from azure.mgmt.batchai.models import (
ClusterCreateParameters, UserAccountSettings, NodeSetup, MountVolumes, FileServerCreateParameters,
AzureFileShareReference, AzureBlobFileSystemReference, AzureStorageCredentialsInfo, SshConfiguration, DataDisks,
ImageReference, ScaleSettings, ManualScaleSettings, AutoScaleSettings
)
# Some valid ssh public key value.
SSH_KEY = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKUDnWeK6rx36apNE9ij1iAXn68FKXLTW0009XK/7dyMewlNfXi6Z2opnxHDD' \
'YWucMluU0dsvBR22OuYH2RHriPJTi1jN3aZ0zZSrlH/W4MSNQKlG/AnrjJPA3xfYjIKLGuKBqSIvMsmrkuDfIfMaDnPcxb+GzM1' \
'0L5epRhoP5FwqaQbLqp640YzFSLqMChz7E6RG54CpEm+MRvA7lj9nD9AlYnfRQAKj2thsFrkz7AlYLQ1ug8vV+1Y3xSKDbo5vy6' \
'oqM3QKeLiUiyN9Ff1Rq4uYnrqJqcWN1ADfiPGZZjEStOkRgG3V6JrpIN+z0Zl3n+sjrH+CKwrYmyni6D41L'
def _data_file(filename):
filepath = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data', filename)
return filepath.replace('\\', '\\\\')
class TestBatchAICustom(unittest.TestCase):
def __init__(self, method):
super(TestBatchAICustom, self).__init__(method)
pass
def test_batchai_update_cluster_create_parameters_with_user_account_settings(self):
"""Test updating of user account settings."""
params = ClusterCreateParameters(location='eastus', vm_size='STANDARD_D1',
user_account_settings=UserAccountSettings(admin_user_name='name',
admin_user_password='password'))
# No update.
update_user_account_settings(params, None, None, None)
self.assertEquals(params.user_account_settings.admin_user_name, 'name')
self.assertEquals(params.user_account_settings.admin_user_password, 'password')
self.assertIsNone(params.user_account_settings.admin_user_ssh_public_key)
# Updating.
params.user_account_settings = None
update_user_account_settings(params, 'user', SSH_KEY, None)
self.assertEquals(params.user_account_settings.admin_user_name, 'user')
self.assertIsNone(params.user_account_settings.admin_user_password)
self.assertEquals(params.user_account_settings.admin_user_ssh_public_key, SSH_KEY)
# Incorrect ssh public key.
params.user_account_settings = None # user may emit user account settings in config file
with self.assertRaises(CLIError):
update_user_account_settings(params, 'user', 'wrong' + SSH_KEY, 'password')
# No user account.
params.user_account_settings = None
with self.assertRaises(CLIError):
update_user_account_settings(params, None, SSH_KEY, None)
# No credentials.
params.user_account_settings = None
with self.assertRaises(CLIError):
update_user_account_settings(params, 'user', None, None)
# ssh public key from a file.
update_user_account_settings(params, 'user', _data_file('key.txt'), None)
self.assertEquals(params.user_account_settings.admin_user_ssh_public_key, SSH_KEY)
def test_batchai_update_file_server_create_parameters_with_user_account_settings(self):
"""Test updating of user account settings."""
params = FileServerCreateParameters(location='eastus', vm_size='STANDARD_D1',
ssh_configuration=SshConfiguration(
user_account_settings=UserAccountSettings(
admin_user_name='name', admin_user_password='password')),
data_disks=DataDisks(10, 2, 'Standard_LRS'))
# No update.
update_user_account_settings(params, None, None, None)
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_name, 'name')
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_password, 'password')
self.assertIsNone(params.ssh_configuration.user_account_settings.admin_user_ssh_public_key)
# Updating when user_account_setting are omitted.
params.ssh_configuration.user_account_settings = None
update_user_account_settings(params, 'user', SSH_KEY, None)
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_name, 'user')
self.assertIsNone(params.ssh_configuration.user_account_settings.admin_user_password)
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_ssh_public_key, SSH_KEY)
# Updating when ssh_configuration is omitted.
params.ssh_configuration = None
update_user_account_settings(params, 'user', SSH_KEY, 'password')
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_name, 'user')
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_password, 'password')
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_ssh_public_key, SSH_KEY)
# Incorrect ssh public key.
params.ssh_configuration.user_account_settings = None # user may emit user account settings in config file
with self.assertRaises(CLIError):
update_user_account_settings(params, 'user', 'wrong' + SSH_KEY, None)
# No user account.
params.ssh_configuration.user_account_settings = None
with self.assertRaises(CLIError):
update_user_account_settings(params, None, SSH_KEY, None)
# No credentials.
params.ssh_configuration.user_account_settings = None
with self.assertRaises(CLIError):
update_user_account_settings(params, 'user', None, None)
# Only password.
params.ssh_configuration.user_account_settings = None
update_user_account_settings(params, 'user', None, 'password')
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_name, 'user')
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_password, 'password')
# ssh public key from a file.
update_user_account_settings(params, 'user', _data_file('key.txt'), None)
self.assertEquals(params.ssh_configuration.user_account_settings.admin_user_ssh_public_key, SSH_KEY)
def test_batchai_cluster_parameter_update_with_environment_variables(self):
"""Test patching of cluster create parameters with environment variables."""
params = ClusterCreateParameters(
location='eastus', vm_size='STANDARD_D1',
user_account_settings=UserAccountSettings(admin_user_name='name',
admin_user_password='password'),
node_setup=NodeSetup(mount_volumes=MountVolumes(
azure_file_shares=[AzureFileShareReference(
relative_mount_path='azfiles',
account_name='<AZURE_BATCHAI_STORAGE_ACCOUNT>',
azure_file_url='https://<AZURE_BATCHAI_STORAGE_ACCOUNT>.file.core.windows.net/share',
credentials_info=AzureStorageCredentialsInfo(
account_key='<AZURE_BATCHAI_STORAGE_KEY>'
)
)],
azure_blob_file_systems=[AzureBlobFileSystemReference(
relative_mount_path='blobfs',
container_name='container',
account_name='<AZURE_BATCHAI_STORAGE_ACCOUNT>',
credentials_info=AzureStorageCredentialsInfo(
account_key='<AZURE_BATCHAI_STORAGE_KEY>'
)
)]
)))
# No environment variables provided.
os.environ['AZURE_BATCHAI_STORAGE_ACCOUNT'] = ''
os.environ['AZURE_BATCHAI_STORAGE_KEY'] = ''
with self.assertRaises(CLIError):
update_cluster_create_parameters_with_env_variables(params)
# Set environment variables and check patching results.
os.environ['AZURE_BATCHAI_STORAGE_ACCOUNT'] = 'account'
os.environ['AZURE_BATCHAI_STORAGE_KEY'] = 'key'
update_cluster_create_parameters_with_env_variables(params)
self.assertEquals(params.node_setup.mount_volumes.azure_file_shares[0].account_name, 'account')
self.assertEquals(params.node_setup.mount_volumes.azure_file_shares[0].credentials_info.account_key, 'key')
self.assertEquals(params.node_setup.mount_volumes.azure_blob_file_systems[0].account_name, 'account')
self.assertEquals(params.node_setup.mount_volumes.azure_blob_file_systems[0].credentials_info.account_key,
'key')
# Test a case when no patching required.
os.environ['AZURE_BATCHAI_STORAGE_ACCOUNT'] = 'another_account'
os.environ['AZURE_BATCHAI_STORAGE_KEY'] = 'another_key'
update_cluster_create_parameters_with_env_variables(params)
# Check that no patching has been done.
self.assertEquals(params.node_setup.mount_volumes.azure_file_shares[0].account_name, 'account')
self.assertEquals(params.node_setup.mount_volumes.azure_file_shares[0].credentials_info.account_key, 'key')
self.assertEquals(params.node_setup.mount_volumes.azure_blob_file_systems[0].account_name, 'account')
self.assertEquals(params.node_setup.mount_volumes.azure_blob_file_systems[0].credentials_info.account_key,
'key')
def test_batchai_add_nfs_to_cluster_create_parameters(self):
"""Test adding of nfs into cluster create parameters."""
params = ClusterCreateParameters(location='eastus', vm_size='STANDARD_D1',
user_account_settings=UserAccountSettings(admin_user_name='name',
admin_user_password='password'))
# No relative mount path provided.
with self.assertRaises(CLIError):
add_nfs_to_cluster_create_parameters(params, 'id', '')
# Check valid update.
add_nfs_to_cluster_create_parameters(params, 'id', 'relative_path')
self.assertEquals(params.node_setup.mount_volumes.file_servers[0].file_server.id, 'id')
self.assertEquals(params.node_setup.mount_volumes.file_servers[0].relative_mount_path, 'relative_path')
self.assertEquals(params.node_setup.mount_volumes.file_servers[0].mount_options, 'rw')
def test_batchai_add_azure_file_share_to_cluster_create_parameters(self):
"""Test adding of azure file share into cluster create parameters."""
params = ClusterCreateParameters(location='eastus', vm_size='STANDARD_D1',
user_account_settings=UserAccountSettings(admin_user_name='name',
admin_user_password='password'))
# No environment variables given.
os.environ['AZURE_BATCHAI_STORAGE_ACCOUNT'] = ''
os.environ['AZURE_BATCHAI_STORAGE_KEY'] = ''
with self.assertRaises(CLIError):
add_azure_file_share_to_cluster_create_parameters(params, 'share', 'relative_path')
os.environ['AZURE_BATCHAI_STORAGE_ACCOUNT'] = 'account'
os.environ['AZURE_BATCHAI_STORAGE_KEY'] = 'key'
# No relative mount path provided.
with self.assertRaises(CLIError):
add_azure_file_share_to_cluster_create_parameters(params, 'share', '')
# Check valid update.
add_azure_file_share_to_cluster_create_parameters(params, 'share', 'relative_path')
self.assertEquals(params.node_setup.mount_volumes.azure_file_shares[0].account_name, 'account')
self.assertEquals(params.node_setup.mount_volumes.azure_file_shares[0].azure_file_url,
'https://account.file.core.windows.net/share')
self.assertEquals(params.node_setup.mount_volumes.azure_file_shares[0].relative_mount_path, 'relative_path')
self.assertEquals(params.node_setup.mount_volumes.azure_file_shares[0].credentials_info.account_key, 'key')
def test_batchai_add_azure_container_to_cluster_create_parameters(self):
"""Test adding of azure file share into cluster create parameters."""
params = ClusterCreateParameters(location='eastus', vm_size='STANDARD_D1',
user_account_settings=UserAccountSettings(admin_user_name='name',
admin_user_password='password'))
# No environment variables given.
os.environ['AZURE_BATCHAI_STORAGE_ACCOUNT'] = ''
os.environ['AZURE_BATCHAI_STORAGE_KEY'] = ''
with self.assertRaises(CLIError):
add_azure_container_to_cluster_create_parameters(params, 'container', 'relative_path')
os.environ['AZURE_BATCHAI_STORAGE_ACCOUNT'] = 'account'
os.environ['AZURE_BATCHAI_STORAGE_KEY'] = 'key'
# No relative mount path provided.
with self.assertRaises(CLIError):
add_azure_container_to_cluster_create_parameters(params, 'container', '')
# Check valid update.
add_azure_container_to_cluster_create_parameters(params, 'container', 'relative_path')
self.assertEquals(params.node_setup.mount_volumes.azure_blob_file_systems[0].account_name, 'account')
self.assertEquals(params.node_setup.mount_volumes.azure_blob_file_systems[0].container_name,
'container')
self.assertEquals(params.node_setup.mount_volumes.azure_blob_file_systems[0].relative_mount_path,
'relative_path')
self.assertEquals(params.node_setup.mount_volumes.azure_blob_file_systems[0].credentials_info.account_key,
'key')
def test_batchai_update_nodes_information(self):
"""Test updating of nodes information."""
params = ClusterCreateParameters(location='eastus', vm_size='STANDARD_D1',
user_account_settings=UserAccountSettings(admin_user_name='name',
admin_user_password='password'))
# Update to autoscale Ubuntu DSVM.
update_nodes_information(params, 'ubuntudsvm', 'Standard_NC6', 1, 3)
self.assertEquals(params.vm_size, 'Standard_NC6')
self.assertEquals(params.virtual_machine_configuration.image_reference,
ImageReference('microsoft-ads', 'linux-data-science-vm-ubuntu', 'linuxdsvmubuntu'))
self.assertEquals(params.scale_settings, ScaleSettings(auto_scale=AutoScaleSettings(1, 3)))
# Update to manual scale Ubuntu LTS.
update_nodes_information(params, 'UbuntuLTS', 'Standard_NC6', 2, 2)
self.assertEquals(params.vm_size, 'Standard_NC6')
self.assertEquals(params.virtual_machine_configuration.image_reference,
ImageReference('Canonical', 'UbuntuServer', '16.04-LTS'))
self.assertEquals(params.scale_settings, ScaleSettings(manual=ManualScaleSettings(2)))
# Update image.
update_nodes_information(params, 'UbuntuDsvm', None, 0, None)
self.assertEquals(params.vm_size, 'Standard_NC6')
self.assertEquals(params.virtual_machine_configuration.image_reference,
ImageReference('microsoft-ads', 'linux-data-science-vm-ubuntu', 'linuxdsvmubuntu'))
self.assertEquals(params.scale_settings, ScaleSettings(manual=ManualScaleSettings(2)))
# Update nothing.
update_nodes_information(params, None, None, 0, None)
self.assertEquals(params.vm_size, 'Standard_NC6')
self.assertEquals(params.virtual_machine_configuration.image_reference,
ImageReference('microsoft-ads', 'linux-data-science-vm-ubuntu', 'linuxdsvmubuntu'))
self.assertEquals(params.scale_settings, ScaleSettings(manual=ManualScaleSettings(2)))
# Wrong image.
with self.assertRaises(CLIError):
update_nodes_information(params, 'unsupported', None, 0, None)
# No VM size.
params.vm_size = None
with self.assertRaises(CLIError):
update_nodes_information(params, 'unsupported', None, 0, None)
# No scale settings.
params.vm_size = 'Standard_NC6'
params.scale_settings = None
with self.assertRaises(CLIError):
update_nodes_information(params, None, None, 0, None)

Просмотреть файл

@ -0,0 +1,276 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from __future__ import print_function
import os
import time
from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer
try:
import unittest.mock as mock
except ImportError:
import mock
from azure.cli.testsdk import JMESPathCheck, JMESPathCheckExists
NODE_STARTUP_TIME = 10 * 60 # Compute node should start in 10 mins after cluster creation.
CLUSTER_RESIZE_TIME = 20 * 60 # Cluster should resize in 20 mins after job submitted/completed.
def _data_file(filename):
filepath = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data', filename)
return filepath.replace('\\', '\\\\')
class BatchAIEndToEndScenariosTest(ScenarioTest):
@ResourceGroupPreparer(location='eastus')
@StorageAccountPreparer(location='eastus')
def test_batchai_manual_scale_scenario(self, resource_group, storage_account):
""" Typical usage scenario for regular (not auto scale) cluster.
1. Create a compute cluster
2. Execute some jobs on the cluster
3. Resize the compute cluster to 0
4. Resize the compute cluster to have some nodes
5. Execute more jobs and examine execution results
6. Delete the cluster
7. Delete the jobs
"""
self._configure_environment(resource_group, storage_account)
# Create a file share 'share' to be mounted on the cluster
self.cmd('az storage share create -n share')
# Create a cluster
self.cmd('batchai cluster create -n cluster -g {0} -c {1}'.format(
resource_group, _data_file('cluster_with_azure_files.json')),
checks=[
JMESPathCheck('name', 'cluster'),
JMESPathCheck('allocationState', 'resizing'),
JMESPathCheck('location', 'eastus'),
JMESPathCheck('scaleSettings.manual.targetNodeCount', 1),
JMESPathCheck('vmSize', 'STANDARD_D1'),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].accountName', storage_account),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].azureFileUrl',
'https://{0}.file.core.windows.net/share'.format(storage_account)),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].credentialsInfo.accountKey', None),
JMESPathCheck('userAccountSettings.adminUserName', 'DemoUser'),
JMESPathCheck('userAccountSettings.adminUserPassword', None)])
# Create the first job
self.cmd('batchai job create -n job --cluster-name cluster -g {0} -c {1}'.format(
resource_group, _data_file('custom_toolkit_job.json')),
checks=[
JMESPathCheck('name', 'job'),
JMESPathCheck('customToolkitSettings.commandLine',
'echo hi | tee $AZ_BATCHAI_OUTPUT_OUTPUT/result.txt'),
JMESPathCheck('executionState', 'queued')])
# Wait for the cluster to be allocated and job completed
time.sleep(NODE_STARTUP_TIME)
# The job must succeed by this time
self.cmd('batchai job show -n job -g {0}'.format(resource_group), checks=[
JMESPathCheck('name', 'job'),
JMESPathCheck('customToolkitSettings.commandLine', 'echo hi | tee $AZ_BATCHAI_OUTPUT_OUTPUT/result.txt'),
JMESPathCheck('executionState', 'succeeded'),
JMESPathCheck('executionInfo.exitCode', 0),
JMESPathCheck('executionInfo.errors', None),
])
# Check the job's standard output: stdout.txt with length equal 3 ("hi\n"), stderr.txt
self.cmd('batchai job list-files -n job -g {0} -d=stdouterr'.format(resource_group), checks=[
JMESPathCheck("[].name | sort(@)", ['stderr.txt', 'stdout.txt']),
JMESPathCheck("[?name == 'stdout.txt'].contentLength", [3]),
JMESPathCheck("[?name == 'stderr.txt'].contentLength", [0]),
JMESPathCheckExists("[0].downloadUrl"),
JMESPathCheckExists("[1].downloadUrl"),
])
# Check the job's output directory
self.cmd('batchai job list-files -n job -g {0} -d=OUTPUT'.format(resource_group), checks=[
JMESPathCheck("[].name | sort(@)", ['result.txt']),
JMESPathCheck("[0].contentLength", 3), # hi/n
JMESPathCheckExists("[0].downloadUrl")
])
# Resize the cluster to 0 nodes
self.cmd('batchai cluster resize -n cluster -g {0} --target 0'.format(resource_group))
time.sleep(NODE_STARTUP_TIME)
# Cluster must be resized by this time
self.cmd('batchai cluster show -n cluster -g {0}'.format(resource_group), checks=[
JMESPathCheck('name', 'cluster'),
JMESPathCheck('currentNodeCount', 0),
JMESPathCheck('scaleSettings.manual.targetNodeCount', 0)
])
# Resize the cluster to execute another job
self.cmd('batchai cluster resize -n cluster -g {0} --target 1'.format(resource_group))
# Create another job
self.cmd('batchai job create -n job2 --cluster-name cluster -g {0} -c {1}'.format(
resource_group, _data_file('custom_toolkit_job.json')))
# Wait for the cluster to finish resizing and job execution
time.sleep(NODE_STARTUP_TIME)
# The job must succeed by this time
self.cmd('batchai job show -n job2 -g {0}'.format(resource_group), checks=[
JMESPathCheck('name', 'job2'),
JMESPathCheck('executionState', 'succeeded'),
JMESPathCheck('executionInfo.exitCode', 0),
JMESPathCheck('executionInfo.errors', None),
])
# Delete the cluster
self.cmd('batchai cluster delete -n cluster -g {0} -y'.format(resource_group))
self.cmd('batchai cluster list -g {0}'.format(resource_group), checks=[JMESPathCheck("length(@)", 0)])
# Delete the jobs
self.cmd('batchai job delete -n job -g {0} -y'.format(resource_group))
self.cmd('batchai job delete -n job2 -g {0} -y'.format(resource_group))
self.cmd('batchai job list -g {0}'.format(resource_group), checks=[JMESPathCheck("length(@)", 0)])
@ResourceGroupPreparer(location='eastus')
@StorageAccountPreparer(location='eastus')
def test_batchai_auto_scale_scenario(self, resource_group, storage_account):
""" Typical usage scenario for auto scale cluster.
1. Create a compute cluster
2. Submit a job
3. The cluster will auto scale to execute the job
4. Examine the job execution results
5. The cluster will down scale
"""
self._configure_environment(resource_group, storage_account)
# Create a file share 'share' to be mounted on the cluster
self.cmd('az storage share create -n share')
# Create a cluster
self.cmd('batchai cluster create -n cluster -g {0} -c {1}'.format(
resource_group, _data_file('auto_scale_cluster_with_azure_files.json')),
checks=[
JMESPathCheck('name', 'cluster'),
JMESPathCheck('allocationState', 'steady'),
JMESPathCheck('location', 'eastus'),
JMESPathCheck('scaleSettings.autoScale.minimumNodeCount', 0),
JMESPathCheck('scaleSettings.autoScale.maximumNodeCount', 1),
JMESPathCheck('vmSize', 'STANDARD_D1'),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].accountName', storage_account),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].azureFileUrl',
'https://{0}.file.core.windows.net/share'.format(storage_account)),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].credentialsInfo.accountKey', None),
JMESPathCheck('userAccountSettings.adminUserName', 'DemoUser'),
JMESPathCheck('userAccountSettings.adminUserPassword', None)])
# Create the job
self.cmd('batchai job create -n job --cluster-name cluster -g {0} -c {1}'.format(
resource_group, _data_file('custom_toolkit_job.json')),
checks=[
JMESPathCheck('name', 'job'),
JMESPathCheck('customToolkitSettings.commandLine',
'echo hi | tee $AZ_BATCHAI_OUTPUT_OUTPUT/result.txt'),
JMESPathCheck('executionState', 'queued')])
# Wait for the cluster to scale up and job completed
time.sleep(CLUSTER_RESIZE_TIME)
# The job must succeed by this time
self.cmd('batchai job show -n job -g {0}'.format(resource_group), checks=[
JMESPathCheck('name', 'job'),
JMESPathCheck('customToolkitSettings.commandLine', 'echo hi | tee $AZ_BATCHAI_OUTPUT_OUTPUT/result.txt'),
JMESPathCheck('executionState', 'succeeded'),
JMESPathCheck('executionInfo.exitCode', 0),
JMESPathCheck('executionInfo.errors', None),
])
# Give cluster a time do down scale
time.sleep(CLUSTER_RESIZE_TIME)
# By this time the cluster should not have any nodes
self.cmd('batchai cluster show -n cluster -g {0}'.format(resource_group),
checks=JMESPathCheck('currentNodeCount', 0))
@ResourceGroupPreparer(location='eastus')
@StorageAccountPreparer(location='eastus')
def test_batchai_cluster_with_nfs_and_azure_file_share(self, resource_group, storage_account):
"""Tests creation of a cluster with file server and Azure file share.
1. Create a file server and verify parameters.
2. Create a cluster and verify parameters.
3. Verify that cluster was able to start nodes.
"""
self._configure_environment(resource_group, storage_account)
# Create a file share 'share' to be mounted on the cluster
self.cmd('az storage share create -n share')
self.cmd('batchai file-server create -n nfs -g {0} -c {1}'.format(
resource_group, _data_file('file_server.json')),
checks=[
JMESPathCheck('name', 'nfs'),
JMESPathCheck('mountSettings.mountPoint', '/mnt/data'),
JMESPathCheck('dataDisks.diskCount', 2),
JMESPathCheck('dataDisks.diskSizeInGb', 10)
])
self.cmd('batchai cluster create -n cluster -g {0} -c {1} --nfs nfs --afs-name share -u alex -k {2}'.format(
resource_group, _data_file('simple_cluster.json'), _data_file('key.txt')),
checks=[
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].accountName', storage_account),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].azureFileUrl',
'https://{0}.file.core.windows.net/share'.format(storage_account)),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].relativeMountPath', 'afs'),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].credentialsInfo.accountKey', None),
JMESPathCheck('userAccountSettings.adminUserName', 'alex'),
JMESPathCheck('userAccountSettings.adminUserPassword', None),
JMESPathCheck('nodeSetup.mountVolumes.fileServers[0].relativeMountPath', 'nfs')
])
# Give file server and cluster to finish preparation.
time.sleep(NODE_STARTUP_TIME * 2)
# Check the node in the cluster successfully started - was able to mount nfs and azure filesystem.
self.cmd('batchai cluster show -n cluster -g {0}'.format(resource_group),
checks=[JMESPathCheck('nodeStateCounts.idleNodeCount', 1)])
# Check the file server reports information about public ip.
self.cmd('batchai file-server show -n nfs -g {0}'.format(resource_group),
checks=[JMESPathCheckExists('mountSettings.fileServerPublicIp')])
@ResourceGroupPreparer(location='eastus')
@StorageAccountPreparer(location='eastus')
def test_batchai_configless_cluster_and_nfs_creation(self, resource_group, storage_account):
"""Test creation of a cluster and nfs without configuration files."""
self._configure_environment(resource_group, storage_account)
self.cmd('az storage share create -n share')
self.cmd('az batchai file-server create -n nfs -g {0} -l eastus --vm-size STANDARD_D1 --storage-sku '
'Standard_LRS --disk-count 2 --disk-size 10 -u alex -p Password_123'.format(resource_group))
self.cmd('az batchai cluster create -n cluster -g {0} -l eastus --afs-name share --nfs nfs '
'-i UbuntuLTS --vm-size STANDARD_D1 --min 1 --max 1 -u alex -p Password_123'.format(resource_group),
checks=[
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].accountName', storage_account),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].azureFileUrl',
'https://{0}.file.core.windows.net/share'.format(storage_account)),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].relativeMountPath', 'afs'),
JMESPathCheck('nodeSetup.mountVolumes.azureFileShares[0].credentialsInfo.accountKey', None),
JMESPathCheck('userAccountSettings.adminUserName', 'alex'),
JMESPathCheck('userAccountSettings.adminUserPassword', None),
JMESPathCheck('nodeSetup.mountVolumes.fileServers[0].relativeMountPath', 'nfs')])
# Give file server and cluster to finish preparation.
time.sleep(NODE_STARTUP_TIME * 2)
# Check the node in the cluster successfully started - was able to mount nfs and azure filesystem.
self.cmd('batchai cluster show -n cluster -g {0}'.format(resource_group),
checks=[JMESPathCheck('nodeStateCounts.idleNodeCount', 1)])
# Check the file server reports information about public ip.
self.cmd('batchai file-server show -n nfs -g {0}'.format(resource_group),
checks=[JMESPathCheckExists('mountSettings.fileServerPublicIp')])
def _configure_environment(self, resource_group, storage_account):
"""Configure storage account related environment variables."""
account_key = self.cmd('storage account keys list -n {} -g {} --query "[0].value" -otsv'.format(
storage_account, resource_group)).output[:-1]
self.set_env('AZURE_STORAGE_ACCOUNT', storage_account)
self.set_env('AZURE_STORAGE_KEY', account_key)
self.set_env('AZURE_BATCHAI_STORAGE_ACCOUNT', storage_account)
self.set_env('AZURE_BATCHAI_STORAGE_KEY', account_key)

Просмотреть файл

@ -0,0 +1,533 @@
"""
"wheel" copyright (c) 2012-2017 Daniel Holth <dholth@fastmail.fm> and
contributors.
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Create a Azure wheel (.whl) distribution (a wheel is a built archive format).
This file is a copy of the official bdist_wheel file from wheel 0.30.0a0, enhanced
of the bottom with some Microsoft extension for Azure SDK for Python
"""
import csv
import hashlib
import os
import subprocess
import warnings
import shutil
import json
import sys
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import pkg_resources
safe_name = pkg_resources.safe_name
safe_version = pkg_resources.safe_version
from shutil import rmtree
from email.generator import Generator
from distutils.core import Command
from distutils.sysconfig import get_python_version
from distutils import log as logger
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag, get_platform
from wheel.util import native, open_for_csv
from wheel.archive import archive_wheelfile
from wheel.pkginfo import read_pkg_info, write_pkg_info
from wheel.metadata import pkginfo_to_dict
from wheel import pep425tags, metadata
from wheel import __version__ as wheel_version
def safer_name(name):
return safe_name(name).replace('-', '_')
def safer_version(version):
return safe_version(version).replace('-', '_')
class bdist_wheel(Command):
description = 'create a wheel distribution'
user_options = [('bdist-dir=', 'b',
"temporary directory for creating the distribution"),
('plat-name=', 'p',
"platform name to embed in generated filenames "
"(default: %s)" % get_platform()),
('keep-temp', 'k',
"keep the pseudo-installation tree around after " +
"creating the distribution archive"),
('dist-dir=', 'd',
"directory to put final built distributions in"),
('skip-build', None,
"skip rebuilding everything (for testing/debugging)"),
('relative', None,
"build the archive using relative paths"
"(default: false)"),
('owner=', 'u',
"Owner name used when creating a tar file"
" [default: current user]"),
('group=', 'g',
"Group name used when creating a tar file"
" [default: current group]"),
('universal', None,
"make a universal wheel"
" (default: false)"),
('python-tag=', None,
"Python implementation compatibility tag"
" (default: py%s)" % get_impl_ver()[0]),
]
boolean_options = ['keep-temp', 'skip-build', 'relative', 'universal']
def initialize_options(self):
self.bdist_dir = None
self.data_dir = None
self.plat_name = None
self.plat_tag = None
self.format = 'zip'
self.keep_temp = False
self.dist_dir = None
self.distinfo_dir = None
self.egginfo_dir = None
self.root_is_pure = None
self.skip_build = None
self.relative = False
self.owner = None
self.group = None
self.universal = False
self.python_tag = 'py' + get_impl_ver()[0]
self.plat_name_supplied = False
def finalize_options(self):
if self.bdist_dir is None:
bdist_base = self.get_finalized_command('bdist').bdist_base
self.bdist_dir = os.path.join(bdist_base, 'wheel')
self.data_dir = self.wheel_dist_name + '.data'
self.plat_name_supplied = self.plat_name is not None
need_options = ('dist_dir', 'plat_name', 'skip_build')
self.set_undefined_options('bdist',
*zip(need_options, need_options))
self.root_is_pure = not (self.distribution.has_ext_modules()
or self.distribution.has_c_libraries())
# Support legacy [wheel] section for setting universal
wheel = self.distribution.get_option_dict('wheel')
if 'universal' in wheel:
# please don't define this in your global configs
val = wheel['universal'][1].strip()
if val.lower() in ('1', 'true', 'yes'):
self.universal = True
@property
def wheel_dist_name(self):
"""Return distribution full name with - replaced with _"""
return '-'.join((safer_name(self.distribution.get_name()),
safer_version(self.distribution.get_version())))
def get_tag(self):
# bdist sets self.plat_name if unset, we should only use it for purepy
# wheels if the user supplied it.
if self.plat_name_supplied:
plat_name = self.plat_name
elif self.root_is_pure:
plat_name = 'any'
else:
plat_name = self.plat_name or get_platform()
if plat_name in ('linux-x86_64', 'linux_x86_64') and sys.maxsize == 2147483647:
plat_name = 'linux_i686'
plat_name = plat_name.replace('-', '_').replace('.', '_')
if self.root_is_pure:
if self.universal:
impl = 'py2.py3'
else:
impl = self.python_tag
tag = (impl, 'none', plat_name)
else:
impl_name = get_abbr_impl()
impl_ver = get_impl_ver()
# PEP 3149
abi_tag = str(get_abi_tag()).lower()
tag = (impl_name + impl_ver, abi_tag, plat_name)
supported_tags = pep425tags.get_supported(
supplied_platform=plat_name if self.plat_name_supplied else None)
# XXX switch to this alternate implementation for non-pure:
assert tag == supported_tags[0], "%s != %s" % (tag, supported_tags[0])
return tag
def get_archive_basename(self):
"""Return archive name without extension"""
impl_tag, abi_tag, plat_tag = self.get_tag()
archive_basename = "%s-%s-%s-%s" % (
self.wheel_dist_name,
impl_tag,
abi_tag,
plat_tag)
return archive_basename
def run(self):
build_scripts = self.reinitialize_command('build_scripts')
build_scripts.executable = 'python'
if not self.skip_build:
self.run_command('build')
install = self.reinitialize_command('install',
reinit_subcommands=True)
install.root = self.bdist_dir
install.compile = False
install.skip_build = self.skip_build
install.warn_dir = False
# A wheel without setuptools scripts is more cross-platform.
# Use the (undocumented) `no_ep` option to setuptools'
# install_scripts command to avoid creating entry point scripts.
install_scripts = self.reinitialize_command('install_scripts')
install_scripts.no_ep = True
# Use a custom scheme for the archive, because we have to decide
# at installation time which scheme to use.
for key in ('headers', 'scripts', 'data', 'purelib', 'platlib'):
setattr(install,
'install_' + key,
os.path.join(self.data_dir, key))
basedir_observed = ''
if os.name == 'nt':
# win32 barfs if any of these are ''; could be '.'?
# (distutils.command.install:change_roots bug)
basedir_observed = os.path.normpath(os.path.join(self.data_dir, '..'))
self.install_libbase = self.install_lib = basedir_observed
setattr(install,
'install_purelib' if self.root_is_pure else 'install_platlib',
basedir_observed)
logger.info("installing to %s", self.bdist_dir)
self.run_command('install')
archive_basename = self.get_archive_basename()
pseudoinstall_root = os.path.join(self.dist_dir, archive_basename)
if not self.relative:
archive_root = self.bdist_dir
else:
archive_root = os.path.join(
self.bdist_dir,
self._ensure_relative(install.install_base))
self.set_undefined_options(
'install_egg_info', ('target', 'egginfo_dir'))
self.distinfo_dir = os.path.join(self.bdist_dir,
'%s.dist-info' % self.wheel_dist_name)
self.egg2dist(self.egginfo_dir,
self.distinfo_dir)
self.write_wheelfile(self.distinfo_dir)
self.write_record(self.bdist_dir, self.distinfo_dir)
# Make the archive
if not os.path.exists(self.dist_dir):
os.makedirs(self.dist_dir)
wheel_name = archive_wheelfile(pseudoinstall_root, archive_root)
# Sign the archive
if 'WHEEL_TOOL' in os.environ:
subprocess.call([os.environ['WHEEL_TOOL'], 'sign', wheel_name])
# Add to 'Distribution.dist_files' so that the "upload" command works
getattr(self.distribution, 'dist_files', []).append(
('bdist_wheel', get_python_version(), wheel_name))
if not self.keep_temp:
if self.dry_run:
logger.info('removing %s', self.bdist_dir)
else:
rmtree(self.bdist_dir)
def write_wheelfile(self, wheelfile_base, generator='bdist_wheel (' + wheel_version + ')'):
from email.message import Message
msg = Message()
msg['Wheel-Version'] = '1.0' # of the spec
msg['Generator'] = generator
msg['Root-Is-Purelib'] = str(self.root_is_pure).lower()
# Doesn't work for bdist_wininst
impl_tag, abi_tag, plat_tag = self.get_tag()
for impl in impl_tag.split('.'):
for abi in abi_tag.split('.'):
for plat in plat_tag.split('.'):
msg['Tag'] = '-'.join((impl, abi, plat))
wheelfile_path = os.path.join(wheelfile_base, 'WHEEL')
logger.info('creating %s', wheelfile_path)
with open(wheelfile_path, 'w') as f:
Generator(f, maxheaderlen=0).flatten(msg)
def _ensure_relative(self, path):
# copied from dir_util, deleted
drive, path = os.path.splitdrive(path)
if path[0:1] == os.sep:
path = drive + path[1:]
return path
def _pkginfo_to_metadata(self, egg_info_path, pkginfo_path):
return metadata.pkginfo_to_metadata(egg_info_path, pkginfo_path)
def license_file(self):
"""Return license filename from a license-file key in setup.cfg, or None."""
metadata = self.distribution.get_option_dict('metadata')
if not 'license_file' in metadata:
return None
return metadata['license_file'][1]
def setupcfg_requirements(self):
"""Generate requirements from setup.cfg as
('Requires-Dist', 'requirement; qualifier') tuples. From a metadata
section in setup.cfg:
[metadata]
provides-extra = extra1
extra2
requires-dist = requirement; qualifier
another; qualifier2
unqualified
Yields
('Provides-Extra', 'extra1'),
('Provides-Extra', 'extra2'),
('Requires-Dist', 'requirement; qualifier'),
('Requires-Dist', 'another; qualifier2'),
('Requires-Dist', 'unqualified')
"""
metadata = self.distribution.get_option_dict('metadata')
# our .ini parser folds - to _ in key names:
for key, title in (('provides_extra', 'Provides-Extra'),
('requires_dist', 'Requires-Dist')):
if not key in metadata:
continue
field = metadata[key]
for line in field[1].splitlines():
line = line.strip()
if not line:
continue
yield (title, line)
def add_requirements(self, metadata_path):
"""Add additional requirements from setup.cfg to file metadata_path"""
additional = list(self.setupcfg_requirements())
if not additional: return
pkg_info = read_pkg_info(metadata_path)
if 'Provides-Extra' in pkg_info or 'Requires-Dist' in pkg_info:
warnings.warn('setup.cfg requirements overwrite values from setup.py')
del pkg_info['Provides-Extra']
del pkg_info['Requires-Dist']
for k, v in additional:
pkg_info[k] = v
write_pkg_info(metadata_path, pkg_info)
def egg2dist(self, egginfo_path, distinfo_path):
"""Convert an .egg-info directory into a .dist-info directory"""
def adios(p):
"""Appropriately delete directory, file or link."""
if os.path.exists(p) and not os.path.islink(p) and os.path.isdir(p):
shutil.rmtree(p)
elif os.path.exists(p):
os.unlink(p)
adios(distinfo_path)
if not os.path.exists(egginfo_path):
# There is no egg-info. This is probably because the egg-info
# file/directory is not named matching the distribution name used
# to name the archive file. Check for this case and report
# accordingly.
import glob
pat = os.path.join(os.path.dirname(egginfo_path), '*.egg-info')
possible = glob.glob(pat)
err = "Egg metadata expected at %s but not found" % (egginfo_path,)
if possible:
alt = os.path.basename(possible[0])
err += " (%s found - possible misnamed archive file?)" % (alt,)
raise ValueError(err)
if os.path.isfile(egginfo_path):
# .egg-info is a single file
pkginfo_path = egginfo_path
pkg_info = self._pkginfo_to_metadata(egginfo_path, egginfo_path)
os.mkdir(distinfo_path)
else:
# .egg-info is a directory
pkginfo_path = os.path.join(egginfo_path, 'PKG-INFO')
pkg_info = self._pkginfo_to_metadata(egginfo_path, pkginfo_path)
# ignore common egg metadata that is useless to wheel
shutil.copytree(egginfo_path, distinfo_path,
ignore=lambda x, y: set(('PKG-INFO',
'requires.txt',
'SOURCES.txt',
'not-zip-safe',)))
# delete dependency_links if it is only whitespace
dependency_links_path = os.path.join(distinfo_path, 'dependency_links.txt')
with open(dependency_links_path, 'r') as dependency_links_file:
dependency_links = dependency_links_file.read().strip()
if not dependency_links:
adios(dependency_links_path)
write_pkg_info(os.path.join(distinfo_path, 'METADATA'), pkg_info)
# XXX deprecated. Still useful for current distribute/setuptools.
metadata_path = os.path.join(distinfo_path, 'METADATA')
self.add_requirements(metadata_path)
# XXX intentionally a different path than the PEP.
metadata_json_path = os.path.join(distinfo_path, 'metadata.json')
pymeta = pkginfo_to_dict(metadata_path,
distribution=self.distribution)
if 'description' in pymeta:
description_filename = 'DESCRIPTION.rst'
description_text = pymeta.pop('description')
description_path = os.path.join(distinfo_path,
description_filename)
with open(description_path, "wb") as description_file:
description_file.write(description_text.encode('utf-8'))
pymeta['extensions']['python.details']['document_names']['description'] = description_filename
# XXX heuristically copy any LICENSE/LICENSE.txt?
license = self.license_file()
if license:
license_filename = 'LICENSE.txt'
shutil.copy(license, os.path.join(self.distinfo_dir, license_filename))
pymeta['extensions']['python.details']['document_names']['license'] = license_filename
with open(metadata_json_path, "w") as metadata_json:
json.dump(pymeta, metadata_json, sort_keys=True)
adios(egginfo_path)
def write_record(self, bdist_dir, distinfo_dir):
from wheel.util import urlsafe_b64encode
record_path = os.path.join(distinfo_dir, 'RECORD')
record_relpath = os.path.relpath(record_path, bdist_dir)
def walk():
for dir, dirs, files in os.walk(bdist_dir):
dirs.sort()
for f in sorted(files):
yield os.path.join(dir, f)
def skip(path):
"""Wheel hashes every possible file."""
return (path == record_relpath)
with open_for_csv(record_path, 'w+') as record_file:
writer = csv.writer(record_file)
for path in walk():
relpath = os.path.relpath(path, bdist_dir)
if skip(relpath):
hash = ''
size = ''
else:
with open(path, 'rb') as f:
data = f.read()
digest = hashlib.sha256(data).digest()
hash = 'sha256=' + native(urlsafe_b64encode(digest))
size = len(data)
record_path = os.path.relpath(
path, bdist_dir).replace(os.path.sep, '/')
writer.writerow((record_path, hash, size))
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
from distutils import log as logger
import os.path
#from wheel.bdist_wheel import bdist_wheel
class azure_bdist_wheel(bdist_wheel):
description = "Create an Azure wheel distribution"
user_options = bdist_wheel.user_options + \
[('azure-namespace-package=', None,
"Name of the deepest nspkg used")]
def initialize_options(self):
bdist_wheel.initialize_options(self)
self.azure_namespace_package = None
def finalize_options(self):
bdist_wheel.finalize_options(self)
if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"):
raise ValueError("azure_namespace_package must finish by -nspkg")
def run(self):
if not self.distribution.install_requires:
self.distribution.install_requires = []
self.distribution.install_requires.append(
"{}>=2.0.0".format(self.azure_namespace_package.replace('_', '-')))
bdist_wheel.run(self)
def write_record(self, bdist_dir, distinfo_dir):
if self.azure_namespace_package:
# Split and remove last part, assuming it's "nspkg"
subparts = self.azure_namespace_package.split('-')[0:-1]
folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))]
for azure_sub_package in folder_with_init:
init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py')
if os.path.isfile(init_file):
logger.info("manually remove {} while building the wheel".format(init_file))
os.remove(init_file)
else:
raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file))
bdist_wheel.write_record(self, bdist_dir, distinfo_dir)
cmdclass = {
'bdist_wheel': azure_bdist_wheel,
}

Просмотреть файл

@ -0,0 +1,3 @@
[bdist_wheel]
universal=1
azure-namespace-package=azure-cli-command_modules-nspkg

Просмотреть файл

@ -0,0 +1,63 @@
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from codecs import open
from setuptools import setup
try:
from azure_bdist_wheel import cmdclass
except ImportError:
from distutils import log as logger
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}
VERSION = "0.1.0"
# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: MIT License',
]
DEPENDENCIES = [
'azure-mgmt-batchai==0.1.0',
'azure-cli-core',
'adal>=0.4.3',
'mock>=2.0.0'
]
with open('README.rst', 'r', encoding='utf-8') as f:
README = f.read()
with open('HISTORY.rst', 'r', encoding='utf-8') as f:
HISTORY = f.read()
setup(
name='azure-cli-batchai',
version=VERSION,
description='Microsoft Azure Batch AI Client Command-Line Tools',
long_description=README + '\n\n' + HISTORY,
license='MIT',
author='Microsoft Corporation',
author_email='ayukha@microsoft.com',
url='https://github.com/Azure/azure-cli',
classifiers=CLASSIFIERS,
packages=[
'azure',
'azure.cli',
'azure.cli.command_modules',
'azure.cli.command_modules.batchai'
],
install_requires=DEPENDENCIES,
cmdclass=cmdclass
)