Ejemplo n.º 1
0
except:
    print("Creating new compute target: {}".format(aml_compute_target))

    provisioning_config = AmlCompute.provisioning_configuration(
        vm_size="STANDARD_D2_V2", min_nodes=1, max_nodes=4)
    aml_compute = ComputeTarget.create(workspace, aml_compute_target,
                                       provisioning_config)
    aml_compute.wait_for_completion(show_output=True,
                                    min_node_count=None,
                                    timeout_in_minutes=20)

# In[ ]:

# load datasets
github_yaml = "https://github.com/sherry1989/sample_modules/blob/master/3_basic_module/basic_module.yaml"
github_module = Module.from_yaml(workspace, yaml_file=github_yaml)
blob_input_data = get_global_dataset_by_path(
    workspace, 'Automobile_price_data',
    'GenericCSV/Automobile_price_data_(Raw)')

hello_world = Module.from_yaml(workspace,
                               yaml_file=os.path.join('modules', 'hello_world',
                                                      'module_spec.yaml'))

hello_world_demo1 = Module.from_yaml(workspace,
                                     yaml_file=os.path.join(
                                         'modules', 'hello_world',
                                         'module_replacement_demo1.yaml'))
hello_world_demo2 = Module.from_yaml(workspace,
                                     yaml_file=os.path.join(
                                         'modules', 'hello_world',
from datetime import datetime
from azureml.core import Workspace, Dataset
from azureml.pipeline.wrapper import Module, dsl
from azureml.pipeline.wrapper._dataset import get_global_dataset_by_path

# In[ ]:

ws = Workspace.from_config()
#ws = Workspace.get(name='itp-pilot', subscription_id='4aaa645c-5ae2-4ae9-a17a-84b9023bc56a', resource_group='itp-pilot-ResGrp')
print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep='\n')

# In[ ]:

# Module
modulefunc = Module.from_yaml(ws,
                              yaml_file=os.path.join('modules', 'noop',
                                                     '1in2out.spec.yaml'))

# Dataset
data = get_global_dataset_by_path(ws, 'Automobile_price_data',
                                  'GenericCSV/Automobile_price_data_(Raw)')

# In[ ]:


@dsl.pipeline(
    name='A huge pipeline composed with nodes 1 in 2 outs',
    description='A sample',
    default_compute_target='aml-compute'  # 'k80-16-a'
)
def cell_division():