Skip to content

Commit

Permalink
Update HISTORY and versions (#113)
Browse files Browse the repository at this point in the history
* Missed setup.py and history

* fix for tests

* remove orig file

* retrigger test

* Update supported versions

* retry tests with more debug

* update script

* try homebrew edge build:

* try homebrew

* update devsetup

* no https

* revert homebrew experiments since 2.0.69 released

* rerecord tests on 2.0.69

*  remove keys (and reset client side)

* re-record tests

* minor
  • Loading branch information
bgklein authored Jul 18, 2019
1 parent 4abc911 commit b6bc067
Show file tree
Hide file tree
Showing 9 changed files with 8,582 additions and 8,089 deletions.
4 changes: 2 additions & 2 deletions batch-cli-extensions/azext_batch/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from argcomplete.completers import FilesCompleter

from azure.cli.core.commands.parameters import file_type
from azure.cli.command_modules.batch._completers import load_node_agent_skus
from azure.cli.command_modules.batch._completers import load_supported_images
from azure.cli.command_modules.batch._validators import (
metadata_item_format, certificate_reference_format, validate_json_file,
environment_setting_format, resource_file_format)
Expand All @@ -30,7 +30,7 @@ def load_arguments(self, _):
c.argument('os_family', arg_group="Pool: Cloud Service Configuration",
help='The Azure Guest OS family to be installed on the virtual machines in the pool. Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). Allowed values: 2, 3, 4, 5.')
c.argument('node_agent_sku_id', arg_group="Pool: Virtual Machine Configuration", help='The SKU of the Batch node agent to be provisioned on compute nodes in the pool. The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the \'List supported node agent SKUs\' operation.')
c.argument('image', completer=load_node_agent_skus, arg_group="Pool: Virtual Machine Configuration",
c.argument('image', completer=load_supported_images, arg_group="Pool: Virtual Machine Configuration",
help="OS image reference. This can be either 'publisher:offer:sku[:version]' format, or a fully qualified ARM image id of the form '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}'. If 'publisher:offer:sku[:version]' format, version is optional and if omitted latest will be used. Valid values can be retrieved via 'az batch pool node-agent-skus list'. For example: 'MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest'")

with self.argument_context('batch job create') as c:
Expand Down
2 changes: 1 addition & 1 deletion batch-cli-extensions/azext_batch/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.minCliCoreVersion": "2.0.67",
"azext.minCliCoreVersion": "2.0.69",
"azext.maxCliCoreVersion": "2.1.0"
}
4 changes: 2 additions & 2 deletions batch-cli-extensions/azext_batch/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@


logger = get_logger(__name__)
MINIMUM_UNSUPPORTED_BATCH_VERSION = "6.1"
MINIMUM_UNSUPPORTED_BATCH_VERSION = "7.1"
MINIMUM_UNSUPPORTED_BMGMT_VERSION = "6.1"
MINIMUM_UNSUPPORTED_BATCH_EXT_VERSION = "5.1"
MINIMUM_UNSUPPORTED_BATCH_EXT_VERSION = "6.1"


def confirm_version(current, supported, package):
Expand Down
17 changes: 14 additions & 3 deletions scripts/automation/tests/verify_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,17 @@ def build_package(path_to_package, dist_dir):
print_heading('Built {}'.format(path_to_package))


def install_pip_package(package_name):
def install_pip_package(package_name, preview=False, extra_link=None):
print_heading('Installing {}'.format(package_name))
cmd = 'python -m pip install {}'.format(package_name)
preview_str = "--pre" if preview else ""
if extra_link:
extra_link_str = "--extra-index-url extra_link --no-cache-dir"
else:
extra_link_str = ""
cmd = 'python -m pip install {} {} {}'.format(
preview_str,
package_name,
extra_link_str)
cmd_success = exec_command(cmd)
if not cmd_success:
print_heading('Error installing {}!'.format(package_name), f=sys.stderr)
Expand Down Expand Up @@ -109,7 +117,10 @@ def verify_packages():
all_modules = automation_path.get_all_module_paths()

# STEP 1:: Install the CLI and dependencies by pip
install_pip_package('azure-cli')
install_pip_package(
'azure-cli',
True,
"https://azurecliprod.blob.core.windows.net/edge --no-cache-dir")

# STEP 2:: Build the packages
for name, path in all_modules:
Expand Down
3 changes: 3 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ set -e
scripts_root=$(cd $(dirname $0); pwd)

export PYTHONPATH=$PATHONPATH:./src
python -m azure.cli --version
python -m azure.cli -h --debug
python -m azure.cli batch -h --debug
az --version
pip freeze
python -m azure.cli batch job create -h --debug

# Check readme formatting for PyPI
Expand Down
1 change: 1 addition & 0 deletions tests/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
##To Record Tests:

* Set environment variable AZURE_EXTENSION_DIR=./.azure/devcliextensions and
* Delete all previous recordings located at tests/recordings (but not the folder)
* Create the accounts below and set the respective values:
* AZURE_BATCH_ACCOUNT
Expand Down
15,591 changes: 8,038 additions & 7,553 deletions tests/recordings/test_batch_extensions_live.yaml

Large diffs are not rendered by default.

976 changes: 488 additions & 488 deletions tests/recordings/test_batch_upload_live.yaml

Large diffs are not rendered by default.

73 changes: 33 additions & 40 deletions tests/test_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import json
import datetime

from azext.batch.models import BatchErrorException, AllocationState, ComputeNodeState, TaskState
from azext.batch.models import BatchErrorException, AllocationState, ComputeNodeState, TaskState, VerificationType
import azure.batch.batch_auth as batchauth
import azext.batch as batch
from tests.vcr_test_base import VCRTestBase
Expand Down Expand Up @@ -281,7 +281,7 @@ def create_basic_spec_alt(self, job_id, pool_id, task_id, text, is_windows): #

def create_pool_if_not_exist(self, pool_id, flavor):
print('Creating pool: {}'.format(pool_id))
sku_results = self.batch_client.account.list_node_agent_skus()
sku_results = self.batch_client.account.list_supported_images()

publisher = None
offer = None
Expand All @@ -290,47 +290,40 @@ def create_pool_if_not_exist(self, pool_id, flavor):

def sku_filter_function(skus):
for sku in skus:
result = [x for x in sku.verified_image_references
if x.publisher == publisher and x.offer == offer and x.sku == sku_id]
if len(result) > 0:
return sku.id
if (sku.verification_type == VerificationType.verified and
sku.image_reference.publisher == publisher and
sku.image_reference.offer == offer and
sku.image_reference.sku == sku_id):
return sku.node_agent_sku_id
return None

if flavor == 'ubuntu14':
publisher = 'Canonical'
offer = 'UbuntuServer'
sku_id = '14.04.5-LTS'
elif flavor == 'ubuntu16':
publisher = 'Canonical'
offer = 'UbuntuServer'
sku_id = '16.04.0-LTS'
if flavor == 'ubuntu16':
publisher = 'canonical'
offer = 'ubuntuserver'
sku_id = '16.04-lts'
elif flavor == 'centos':
publisher = 'OpenLogic'
offer = 'CentOS'
publisher = 'openlogic'
offer = 'centos'
sku_id = '7.0'
elif flavor == 'debian':
publisher = 'Credativ'
offer = 'Debian'
publisher = 'credativ'
offer = 'debian'
sku_id = '8'
elif flavor == 'suse-sles':
publisher = 'SUSE'
offer = 'SLES'
sku_id = '12-SP1'
elif flavor == 'windows-2012':
publisher = 'MicrosoftWindowsServer'
offer = 'WindowsServer'
sku_id = '2012-Datacenter'
publisher = 'microsoftwindowsserver'
offer = 'windowsserver'
sku_id = '2012-datacenter'
elif flavor == 'windows-2012-r2':
publisher = 'MicrosoftWindowsServer'
offer = 'WindowsServer'
sku_id = '2012-R2-Datacenter'
publisher = 'microsoftwindowsserver'
offer = 'windowsserver'
sku_id = '2012-r2-datacenter'
elif flavor == 'windows-2016':
publisher = 'MicrosoftWindowsServer'
offer = 'WindowsServer'
sku_id = '2016-Datacenter'
publisher = 'microsoftwindowsserver'
offer = 'windowsserver'
sku_id = '2016-datacenter'
node_agent_sku_id = sku_filter_function(sku_results)

is_windows = True if publisher == 'MicrosoftWindowsServer' else False
is_windows = True if publisher.lower() == 'microsoftwindowsserver' else False
print('Allocating pool {}, {}, {} with agent {}'.
format(publisher, offer, sku_id, node_agent_sku_id))

Expand Down Expand Up @@ -404,12 +397,12 @@ def file_upload_helper(self, job_id, pool_id, task_id, pool_flavor,
self.batch_client.job.delete(job_id=job_id)

def body(self):
# file egress should work on ubuntu 14.04
# file egress should work on ubuntu 16.04
self.clear_container(self.output_blob_container)
job_id = 'ncj-ubuntu1404'
pool_id = 'ncj-ubuntu1404'
job_id = 'ncj-ubuntu1604'
pool_id = 'ncj-ubuntu1604'
task_id = 'myTask'
self.file_upload_helper(job_id, pool_id, task_id, 'ubuntu14', False)
self.file_upload_helper(job_id, pool_id, task_id, 'ubuntu16', False)

# should work on Windows 2012 R2
self.clear_container(self.output_blob_container)
Expand All @@ -418,12 +411,12 @@ def body(self):
task_id = 'myTask'
self.file_upload_helper(job_id, pool_id, task_id, 'windows-2012-r2', False)

# file egress should work on ubuntu 14.04
# file egress should work on ubuntu 16.04
self.clear_container('fgrp-output')
job_id = 'ncj-ubuntu1404-1'
pool_id = 'ncj-ubuntu1404'
job_id = 'ncj-ubuntu1604-1'
pool_id = 'ncj-ubuntu1604'
task_id = 'myTask'
self.file_upload_helper(job_id, pool_id, task_id, 'ubuntu14', True)
self.file_upload_helper(job_id, pool_id, task_id, 'ubuntu16', True)

# should work on Windows 2012 R2
self.clear_container('fgrp-output')
Expand Down

0 comments on commit b6bc067

Please sign in to comment.