From 342b7fc2e2050d37bcd202d05cc3efe0d4188108 Mon Sep 17 00:00:00 2001 From: Fred Park Date: Tue, 6 Nov 2018 13:09:32 -0800 Subject: [PATCH] Fix various issues - Monitoring SSH login - Grafana update regression with Batch Shipyard Dashboard - Federation job submission --- convoy/fleet.py | 9 ++++++--- convoy/resource.py | 21 ++++++++++++--------- heimdall/docker-compose-nonginx.yml | 2 +- heimdall/docker-compose.yml | 2 +- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/convoy/fleet.py b/convoy/fleet.py index b83f5e4f..7c537f16 100644 --- a/convoy/fleet.py +++ b/convoy/fleet.py @@ -4429,7 +4429,8 @@ def action_monitor_ssh( _check_network_client(network_client) vm_res = settings.monitoring_settings(config) resource.ssh_to_virtual_machine_resource( - compute_client, network_client, vm_res, tty, command) + compute_client, network_client, vm_res, + crypto.get_monitoring_ssh_key_prefix(), tty, command) def action_monitor_suspend(compute_client, config, wait): @@ -4571,7 +4572,8 @@ def action_fed_proxy_ssh( _check_network_client(network_client) vm_res = settings.federation_settings(config) resource.ssh_to_virtual_machine_resource( - compute_client, network_client, vm_res, tty, command) + compute_client, network_client, vm_res, + crypto.get_federation_ssh_key_prefix(), tty, command) def action_fed_proxy_suspend(compute_client, config, wait): @@ -4822,7 +4824,8 @@ def action_fed_jobs_add( batch_client, blob_client, table_client, queue_client, keyvault_client, config, None, _IMAGE_BLOCK_FILE, _BLOBXFER_WINDOWS_FILE if is_windows else _BLOBXFER_FILE, - recreate=False, tail=None, federation_id=federation_id) + _AUTOSCRATCH_FILE, recreate=False, tail=None, + federation_id=federation_id) def action_fed_jobs_list( diff --git a/convoy/resource.py b/convoy/resource.py index 91b6b814..446dd53d 100644 --- a/convoy/resource.py +++ b/convoy/resource.py @@ -728,7 +728,7 @@ def create_virtual_machine( # create vm logger.debug( 'creating virtual machine: {} availset={} zone={}'.format( - vm_name, availset.id, zone)) + vm_name, availset.id if availset is not None else None, zone)) return compute_client.virtual_machines.create_or_update( resource_group_name=vm_resource.resource_group, vm_name=vm_name, @@ -953,10 +953,12 @@ def deallocate_virtual_machine(compute_client, rg_name, vm_name): ) -def get_ssh_info(compute_client, network_client, vm_res, nic=None, pip=None): +def get_ssh_info( + compute_client, network_client, vm_res, ssh_key_prefix=None, nic=None, + pip=None): # type: (azure.mgmt.compute.ComputeManagementClient, # azure.mgmt.network.NetworkManagementClient, - # settings.VmResource, networkmodes.NetworkInterface, + # settings.VmResource, str, networkmodes.NetworkInterface, # networkmodels.PublicIPAddress) -> # Tuple[pathlib.Path, int, str, str] """Get SSH info to a federation proxy @@ -965,6 +967,7 @@ def get_ssh_info(compute_client, network_client, vm_res, nic=None, pip=None): :param azure.mgmt.network.NetworkManagementClient network_client: network client :param settings.VmResource vm_res: resource + :param str ssh_key_prefix: ssh key prefix :param networkmodels.NetworkInterface nic: network interface :param networkmodels.PublicIPAddress pip: public ip :rtype: tuple @@ -998,8 +1001,7 @@ def get_ssh_info(compute_client, network_client, vm_res, nic=None, pip=None): ssh_priv_key = vm_res.ssh.ssh_private_key else: ssh_priv_key = pathlib.Path( - vm_res.ssh.generated_file_export_path, - crypto.get_federation_ssh_key_prefix()) + vm_res.ssh.generated_file_export_path, ssh_key_prefix) if not ssh_priv_key.exists(): raise RuntimeError('SSH private key file not found at: {}'.format( ssh_priv_key)) @@ -1007,21 +1009,22 @@ def get_ssh_info(compute_client, network_client, vm_res, nic=None, pip=None): def ssh_to_virtual_machine_resource( - compute_client, network_client, vm_res, tty, command): + compute_client, network_client, vm_res, ssh_key_prefix, tty, command): # type: (azure.mgmt.compute.ComputeManagementClient, # azure.mgmt.network.NetworkManagementClient, - # settings.VmResource, bool, tuple) -> None - """SSH to a node in federation proxy + # settings.VmResource, str, bool, tuple) -> None + """SSH to a node :param azure.mgmt.compute.ComputeManagementClient compute_client: compute client :param azure.mgmt.network.NetworkManagementClient network_client: network client :param settings.VmResource vm_res: resource + :param str ssh_key_prefix: ssh key prefix :param bool tty: allocate pseudo-tty :param tuple command: command to execute """ ssh_priv_key, port, username, ip = get_ssh_info( - compute_client, network_client, vm_res) + compute_client, network_client, vm_res, ssh_key_prefix=ssh_key_prefix) crypto.connect_or_exec_ssh_command( ip, port, ssh_priv_key, username, tty=tty, command=command) diff --git a/heimdall/docker-compose-nonginx.yml b/heimdall/docker-compose-nonginx.yml index 7dc3e0e0..558d84ce 100644 --- a/heimdall/docker-compose-nonginx.yml +++ b/heimdall/docker-compose-nonginx.yml @@ -42,7 +42,7 @@ services: - "--web.enable-lifecycle" grafana: - image: grafana/grafana:5.3.2 + image: grafana/grafana:5.2.3 container_name: grafana restart: unless-stopped ports: diff --git a/heimdall/docker-compose.yml b/heimdall/docker-compose.yml index 9f991ae1..f0c54d99 100644 --- a/heimdall/docker-compose.yml +++ b/heimdall/docker-compose.yml @@ -60,7 +60,7 @@ services: - "--web.enable-lifecycle" grafana: - image: grafana/grafana:5.3.2 + image: grafana/grafana:5.2.3 container_name: grafana restart: unless-stopped ports: