Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 342b7fc

Browse files
committed
Fix various issues
- Monitoring SSH login - Grafana update regression with Batch Shipyard Dashboard - Federation job submission
1 parent 95dec30 commit 342b7fc

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

convoy/fleet.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4429,7 +4429,8 @@ def action_monitor_ssh(
44294429
_check_network_client(network_client)
44304430
vm_res = settings.monitoring_settings(config)
44314431
resource.ssh_to_virtual_machine_resource(
4432-
compute_client, network_client, vm_res, tty, command)
4432+
compute_client, network_client, vm_res,
4433+
crypto.get_monitoring_ssh_key_prefix(), tty, command)
44334434

44344435

44354436
def action_monitor_suspend(compute_client, config, wait):
@@ -4571,7 +4572,8 @@ def action_fed_proxy_ssh(
45714572
_check_network_client(network_client)
45724573
vm_res = settings.federation_settings(config)
45734574
resource.ssh_to_virtual_machine_resource(
4574-
compute_client, network_client, vm_res, tty, command)
4575+
compute_client, network_client, vm_res,
4576+
crypto.get_federation_ssh_key_prefix(), tty, command)
45754577

45764578

45774579
def action_fed_proxy_suspend(compute_client, config, wait):
@@ -4822,7 +4824,8 @@ def action_fed_jobs_add(
48224824
batch_client, blob_client, table_client, queue_client, keyvault_client,
48234825
config, None, _IMAGE_BLOCK_FILE,
48244826
_BLOBXFER_WINDOWS_FILE if is_windows else _BLOBXFER_FILE,
4825-
recreate=False, tail=None, federation_id=federation_id)
4827+
_AUTOSCRATCH_FILE, recreate=False, tail=None,
4828+
federation_id=federation_id)
48264829

48274830

48284831
def action_fed_jobs_list(

convoy/resource.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ def create_virtual_machine(
728728
# create vm
729729
logger.debug(
730730
'creating virtual machine: {} availset={} zone={}'.format(
731-
vm_name, availset.id, zone))
731+
vm_name, availset.id if availset is not None else None, zone))
732732
return compute_client.virtual_machines.create_or_update(
733733
resource_group_name=vm_resource.resource_group,
734734
vm_name=vm_name,
@@ -953,10 +953,12 @@ def deallocate_virtual_machine(compute_client, rg_name, vm_name):
953953
)
954954

955955

956-
def get_ssh_info(compute_client, network_client, vm_res, nic=None, pip=None):
956+
def get_ssh_info(
957+
compute_client, network_client, vm_res, ssh_key_prefix=None, nic=None,
958+
pip=None):
957959
# type: (azure.mgmt.compute.ComputeManagementClient,
958960
# azure.mgmt.network.NetworkManagementClient,
959-
# settings.VmResource, networkmodes.NetworkInterface,
961+
# settings.VmResource, str, networkmodes.NetworkInterface,
960962
# networkmodels.PublicIPAddress) ->
961963
# Tuple[pathlib.Path, int, str, str]
962964
"""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):
965967
:param azure.mgmt.network.NetworkManagementClient network_client:
966968
network client
967969
:param settings.VmResource vm_res: resource
970+
:param str ssh_key_prefix: ssh key prefix
968971
:param networkmodels.NetworkInterface nic: network interface
969972
:param networkmodels.PublicIPAddress pip: public ip
970973
:rtype: tuple
@@ -998,30 +1001,30 @@ def get_ssh_info(compute_client, network_client, vm_res, nic=None, pip=None):
9981001
ssh_priv_key = vm_res.ssh.ssh_private_key
9991002
else:
10001003
ssh_priv_key = pathlib.Path(
1001-
vm_res.ssh.generated_file_export_path,
1002-
crypto.get_federation_ssh_key_prefix())
1004+
vm_res.ssh.generated_file_export_path, ssh_key_prefix)
10031005
if not ssh_priv_key.exists():
10041006
raise RuntimeError('SSH private key file not found at: {}'.format(
10051007
ssh_priv_key))
10061008
return ssh_priv_key, 22, vm.os_profile.admin_username, ip_address
10071009

10081010

10091011
def ssh_to_virtual_machine_resource(
1010-
compute_client, network_client, vm_res, tty, command):
1012+
compute_client, network_client, vm_res, ssh_key_prefix, tty, command):
10111013
# type: (azure.mgmt.compute.ComputeManagementClient,
10121014
# azure.mgmt.network.NetworkManagementClient,
1013-
# settings.VmResource, bool, tuple) -> None
1014-
"""SSH to a node in federation proxy
1015+
# settings.VmResource, str, bool, tuple) -> None
1016+
"""SSH to a node
10151017
:param azure.mgmt.compute.ComputeManagementClient compute_client:
10161018
compute client
10171019
:param azure.mgmt.network.NetworkManagementClient network_client:
10181020
network client
10191021
:param settings.VmResource vm_res: resource
1022+
:param str ssh_key_prefix: ssh key prefix
10201023
:param bool tty: allocate pseudo-tty
10211024
:param tuple command: command to execute
10221025
"""
10231026
ssh_priv_key, port, username, ip = get_ssh_info(
1024-
compute_client, network_client, vm_res)
1027+
compute_client, network_client, vm_res, ssh_key_prefix=ssh_key_prefix)
10251028
crypto.connect_or_exec_ssh_command(
10261029
ip, port, ssh_priv_key, username, tty=tty, command=command)
10271030

heimdall/docker-compose-nonginx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ services:
4242
- "--web.enable-lifecycle"
4343

4444
grafana:
45-
image: grafana/grafana:5.3.2
45+
image: grafana/grafana:5.2.3
4646
container_name: grafana
4747
restart: unless-stopped
4848
ports:

heimdall/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ services:
6060
- "--web.enable-lifecycle"
6161

6262
grafana:
63-
image: grafana/grafana:5.3.2
63+
image: grafana/grafana:5.2.3
6464
container_name: grafana
6565
restart: unless-stopped
6666
ports:

0 commit comments

Comments
 (0)