Skip to content

Commit

Permalink
Merging hotfix: Error when no volumes are defined in bibigrid.yaml (#587
Browse files Browse the repository at this point in the history
)

* fixed rule setting for security groups

* fixed multiple network is now list causing error bugs.

* trying to figure out why route applying only works once.

* Added more echo's for better debugging.

* updated most tests

* fixed validate_configuration.py tests.

* Updated tests for startup.py

* fixed bug in terminate that caused assume_yes to work as assume_no

* updated terminate_cluster tests.

* fixed formatting improved pylint

* adapted tests

* updated return threading test

* updated provider_handler

* tests not finished yet

* Fixed server regex issue

* test list clusters updated

* fixed too open cluster_id regex

* added missing "to"

* fixed id_generation tests

* renamed configuration handler to please linter

* removed unnecessary tests and updated remaining

* fixed remaining "subnet list gets handled as a single subnet" bug and finalized multiple routes handling.

* updated tests not finished yet

* improved code style

* fixed tests further. One to fix left.

* fixed additional tests

* fixed all tests for ansible configurator

* fixed comment

* fixed multiple tests

* fixed a few tests

* Fixed create

* fixed some issues regarding

* fixing test_provider.py

* removed infrastructure_cloud.yml

* minor fixes

* fixed all tests

* removed print

* changed prints to log

* removed log

* fixed None bug where [] is expected when no sshPublicKeyFile is given.

* removed master from compute if use master as compute is false

* reconstructured role additional in order to make it easier to include. Added quotes for consistency.

* Updated all tests (#448)

* updated most tests

* fixed validate_configuration.py tests.

* Updated tests for startup.py

* fixed bug in terminate that caused assume_yes to work as assume_no

* updated terminate_cluster tests.

* fixed formatting improved pylint

* adapted tests

* updated return threading test

* updated provider_handler

* tests not finished yet

* Fixed server regex issue

* test list clusters updated

* fixed too open cluster_id regex

* added missing "to"

* fixed id_generation tests

* renamed configuration handler to please linter

* removed unnecessary tests and updated remaining

* updated tests not finished yet

* improved code style

* fixed tests further. One to fix left.

* fixed additional tests

* fixed all tests for ansible configurator

* fixed comment

* fixed multiple tests

* fixed a few tests

* Fixed create

* fixed some issues regarding

* fixing test_provider.py

* removed infrastructure_cloud.yml

* minor fixes

* fixed all tests

* removed print

* changed prints to log

* removed log

* Introduced yaml lock (#464)

* removed unnecessary close

* simplified update_hosts

* updated logging to separate folder and file based on creation date

* many small changes and introducing locks

* restructured log files again. Removed outdated key warnings from bibigrid.yml

* added a few logs

* further improved logging hierarchy

* Added specific folder places for temporary job storage. This might solve the "SlurmSpoolDir full" bug.

* Improved logging

* Tried to fix temps and tried update to 23.11 but has errors so commented that part out

* added initial space

* added existing worker deletion on worker startup if worker already exists as no worker would've been started if Slurm would've known about the existing worker. This is not the best solution. (#468)

* made waitForServices a cloud specific key (#465)

* Improved log messages in validate_configuration.py to make fixing your configuration easier when using a hybrid-/multi-cloud setup (#466)

* removed unnecessary line in provider.py and added cloud information to every log in validate_configuration.py for easier fixing.

* track resources for providers separately to make quota checking precise

* switched from low level cinder to high level block_storage.get_limits()

* added keyword for ssh_timeout and improved argument passing for ssh.

* Update issue templates

* fixed a missing LOG

* removed overwritten variable instantiation

* Update bug_report.md

* removed trailing whitespaces

* added comment about sshTimeout key

* Create dependabot.yml (#479)

* Code cleanup and minor improvement (#482)

* fixed :param and :return to @param and @return

* many spelling mistakes fixed

* added bibigrid_version to common configuration

* added timeout to common_configuration

* removed debug verbosity and improved log message wording

* fixed is_active structure

* fixed pip dependabot.yml

* added documentation. Changed timeout to 2**(2+attempts) to decrease number of unlikely to work attempts

* 474 allow non on demandpermanent workers (#487)

* added worker server start without anything else

* added host entry for permanent workers

* added state unknown for permanent nodes

* added on_demand key for groups and instances for ansible templating

* fixed wording

* temporary solution for custom execute list

* added documentation for onDemand

* added ansible.cfg replacement

* fixed path. Added ansible.cfg to the gitignore

* updated default creation and gitignore. Fixed non-vital bug that didn't reset hosts for new cluster start.

* Code cleanup (#490)

* fixed :param and :return to @param and @return

* many spelling mistakes fixed

* added bibigrid_version to common configuration

* attempted zabbix linting fix. Needs testing.

* fixed double import

* Slurm upgrade fixes (#473)

* removed slurm errors

* added bibilog to show output log of most recent worker start. Tried fixing the slurm23.11 bug.

* fixed a few vpnwkr -> vpngtw remnants. Excluded vpngtw from slurm setup

* improved comments regarding changes and versions

* removed cgroupautomount as it is defunct

* Moved explicit slurm start to avoid errors caused by resume and suspend programs not being copied to their final location yet

* added word for clarification

* Fixed non-fatal bug that lead to non 0 exits on runs without any error.

* changed slurm apt package to slurm-bibigrid

* set version to 23.11.*

* added a few more checks to make sure everything is set up before installing packages

* Added configuration pinning

* changed ignore_error to failed_when false

* fixed or ignored lint fatals

* Update tests (#493)

* updated tests

* removed print

* updated tests

* updated tests

* fixed too loose condition

* updated tests

* added cloudScheduling and userRoles in bibigrid.yml

* added userRoles in documentation

* added varsFiles and comments

* added folder path in documentation

* fixed naming

* added that vars are optional

* polished userRoles documentation

* 439 additional ansible roles (#495)

* added roles structure

* updated roles_path

* fixed upper lower case

* improved customRole implementation

* minor fixes regarding role_paths

* improved variable naming of user_roles

* added documentation for other configurations

* added new feature keys

* fixed template files not being j2

* added helpful comments and removed no longer used roles/additional/

* userRoles crashes if no role set

* fixed ansible.cfg path '"'

* implemented partition system

* added keys customAnsibleCfg and customSlurmConf as keys that stop the automatic copying

* improved spacing

* added logging

* updated documentation

* updated tests. Improved formatting

* fix for service being too fast for startup

* fixed remote src

* changed RESUME to POWER_DOWN and removed delete call which is now handled via Slurm that calls terminate.sh (#503)

* Update check (#499)

* updated validate_configuration.py in order to provide schema validation. Moved cloud_identifier setting even closer to program start in order to be able to log better when performing other actions than create.

* small log change and fix of schema key vpnInstance

* updated tests

* removed no longer relevant test

* added schema validation tests

* fixed ftype. Errors with multiple volumes.

* made automount bound to defined mountPoints and therefore customizable

* added empty line and updated bibigrid.yml

* fixed nfsshare regex error and updated check to fit to the new name mountpoint pattern

* hotfix: folder creation now before accessing hosts.yml

* fixed tests

* moved dnsmasq installation infront of /etc/resolv removal

* fixed tests

* fixed nfs exports by removing unnecessary "/" at the beginning

* fixed master running slurmd but not being listed in slurm.conf. Now set to drained.

* improved logging

* increased timeout. Corrected comment in slurm.j2

* updated info regarding timeouts (changed from 4 to 5).

* added SuspendTimeout as optional to elastic_scheduling

* updated documentation

* permission fix

* fixes #394

* fixes #394 (also for hybrid cluster)

* increased ResumeTimeout by 5 minutes. yml to yaml

* changed all yml to yaml (as preferred by yaml)

* updated timeouts. updated tests

* fixes #394 - remove host from zabbix when terminated

* zabbix api no longer used when not set in configuration

* pleased linting by using false instead of no

* added logging of traceroute even if debug flag is not set when error is not known. Added a few other logs

* Update action 515 (#516)

* configuration update possible 515

* added experimental

* fixed indentation

* fixed missing newline at EOF. Summarized restarts.

* added check for running workers

* fixed multiple workers due to faulty update

* updated tests and removed done todos

* updated documentation

* removed print

* Added apt-reactivate-auto-update to reactivate updates at the end of the playbook run (#518)

* changed theia to 900. Added apt-reactivate-auto-update as new 999.

* added new line at end of file

* changed list representation

* added multiple configuration keys for boot volume handling

* updated documentation

* updated documentation for new volumes and for usually ignored keys

* updated and added tests

* Pleasing Dependabot

* Linting now uses python 3.10

* added early termination when configuration file not found

* added dontUploadCredentials documentation

* fixed broken links

* added dontUploadCredentials to schema valiation

* fixed dontUploadCredential ansible start bug

* prevented BiBiGrid from looking for other keys if created key doesn't work to spot key issues earlier

* prevented BiBiGrid from looking for other keys if created key doesn't work to spot key issues earlier

* updated requirements.txt

* restricted clouds.yaml access

* moved openstack credentials permission change to server only

* added '' to 3.10

* converted implicit to explicit octet notation

* added "" and fixed a few more implicit octets

* added ""

* added missing "

* added allow_agent=False to further prevent BiBiGrid from looking for keys

* removed hardcoded /vol/

* updated versions

* removed unnecessary comments and commented out Workflow execution

* 545 allow attached volumes (#562)

* renamed volumeSize to bootVolumeSize to avoid name issues

* added implementation for adding volumes to permanent workers (they are not deleted)

* implemented creating and terminating volumes without filesystem for permanent workers

* fully working for permanent workers. masterMount is broken now, but also replaced. Will be fixed.

* Added volume creation to create_server. Not yet working.

* hostvar for each host

* Fixed information handling and naming issues

* fixed host yaml creation

* removed unnecessary prints

* improved readability fixed minor bugs

* added volume deletion and set volume_ap_version explicitly

* removed prints from test_provider.py

* improved readability greatly. Fixed overwriting host vars bug

* snapshot and existing volumes can now be attached to master and workers on startup

* snapshot and existing volumes can now be attached to master and workers on startup

* removed mountPoint from a log message in case no mount point is specified

* fixed lsblk not finding item.device due to race condition

* improved comments and naming

* removed server automount. This is now handled by a single automount task for both master and workers

* allows nor to start new permanent volumes if a name is given. One could consider adding tmp to not named volumes for additional clarity

* fixed wrong function call

* renamed nfs_mount to nfs_shares

* added semipermanent as an option

* fixed wrong method of default values for Ansible

* started reworking

* added volumes and changed bootVolumes

* updated bibigrid.yaml and aligned naming of bootVolume and volume

* added newline at end of file

* removed superfluous provider paramter

* pleased linting

* removed argument from function call

* moved host vars creation, vars deletion, added comments

* largely reworked how volumes are attached to servers to be more explicit

* small naming fixes

* updated priority order of permanent and semiPermanent. Updated documentation to new explicit bool setup. Added type as a key.

* fixed bug regarding dontUploadCredentials

* updated schema validation

* Update linting.yml

* Update linting.yml

* Update linting.yml

* Update linting.yml

* added __init__.py where appropriate

* update bibigrid.yaml for more explicit volumes documentation

* volumes are now validated and fixed old state of masterInstance in validate_schema.py

* Update linting.yml

* Update linting.yml

* fixed longtime naming bug for unknown openstack exceptions

* saves more info in .mem file

* moved structure of tests and added a basic integration_test file that needs to be expanded and improved

* moved tests

* added "not ready yet"

* updated bootVolume documentation

* moved tests added __init__.py files for better discovery. minor fixes

* updated tests and comments

* updated tests and comments

* updated tests, code and comments for ansible_configuration

* updated tests for ansible_configurator

* fixed test_ansible_configurator.py

* fixed test_configuration_handler.py

* improved exception messages

* pleased ansible linter

* fixed terminate return values test

* improved naming

* added tests to make sure that server regex only deletes bibigrid servers with fitting cluster id and same for volumes

* pleased pylint

* fixed validation issue when using exists in master

* removed forgotten print

* fixed description bug

* final bugfixes

* pleased linter

* fixed too many positional arguments

* Hot fix dev: Error on empty volume list (#585)

* fixed non-existing field "group_instances" when volume not set

* added debug log message for server creation

* fixed vars missing in validate_schema.py

* moved rest models to separate file

* Fixes cyclic imports, Improved Logging, Minor logging bug in terminate (#588)

* moved constants from create to separate file, fixed minor bugs in logging

* improved security group handling

* fixed tests

* explicified generic import

* switched to generators

* fixed typo, improved logging and style

---------

Co-authored-by: Jan Krueger <jkrueger@cebitec.uni-bielefeld.de>
  • Loading branch information
XaverStiensmeier and jkrue authored Jan 15, 2025
1 parent fd94564 commit c36287d
Show file tree
Hide file tree
Showing 19 changed files with 320 additions and 237 deletions.
61 changes: 15 additions & 46 deletions bibigrid/core/actions/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
The cluster creation (master's creation, key creation, ansible setup and execution, ...) is done here
"""

import os
import shutil
import subprocess
import threading
import traceback
from functools import partial
import os

import paramiko
import sympy
Expand All @@ -18,46 +17,13 @@
from bibigrid.core.utility import id_generation
from bibigrid.core.utility import image_selection
from bibigrid.core.utility.handler import ssh_handler
from bibigrid.core.utility.paths import ansible_resources_path as a_rp
from bibigrid.core.utility.paths import bin_path
from bibigrid.models import exceptions
from bibigrid.models import return_threading
from bibigrid.models.exceptions import ExecutionException, ConfigurationException

PREFIX = "bibigrid"
SEPARATOR = "-"
PREFIX_WITH_SEP = PREFIX + SEPARATOR
FILEPATHS = [(a_rp.PLAYBOOK_PATH, a_rp.PLAYBOOK_PATH_REMOTE), (bin_path.BIN_PATH, bin_path.BIN_PATH_REMOTE)]


def get_identifier(identifier, cluster_id, additional=""):
"""
This method does more advanced string formatting to generate master, vpngtw and worker names
@param identifier: master|vpngtw|worker
@param cluster_id: id of cluster
@param additional: an additional string to be added at the end
@return: the generated string
"""
general = PREFIX_WITH_SEP + identifier + SEPARATOR + cluster_id
if additional or additional == 0:
return general + SEPARATOR + str(additional)
return general


MASTER_IDENTIFIER = partial(get_identifier, identifier="master", additional="")
WORKER_IDENTIFIER = partial(get_identifier, identifier="worker")
VPN_WORKER_IDENTIFIER = partial(get_identifier, identifier="vpngtw")

KEY_PREFIX = "tempKey_bibi"
CONFIG_FOLDER = os.path.expanduser("~/.config/bibigrid/")
KEY_FOLDER = os.path.join(CONFIG_FOLDER, "keys/")
AC_NAME = "ac" + SEPARATOR + "{cluster_id}"
KEY_NAME = KEY_PREFIX + SEPARATOR + "{cluster_id}"
CLUSTER_MEMORY_FOLDER = KEY_FOLDER
CLUSTER_MEMORY_FILE = ".bibigrid.mem"
CLUSTER_MEMORY_PATH = os.path.join(CONFIG_FOLDER, CLUSTER_MEMORY_FILE)
DEFAULT_SECURITY_GROUP_NAME = "default" + SEPARATOR + "{cluster_id}"
WIREGUARD_SECURITY_GROUP_NAME = "wireguard" + SEPARATOR + "{cluster_id}"
from bibigrid.core.utility.paths import ansible_resources_path as a_rp
from bibigrid.core.utility.statics.create_statics import AC_NAME, KEY_NAME, DEFAULT_SECURITY_GROUP_NAME, \
WIREGUARD_SECURITY_GROUP_NAME, KEY_FOLDER, CLUSTER_MEMORY_PATH, MASTER_IDENTIFIER, WORKER_IDENTIFIER, \
VPNGTW_IDENTIFIER, UPLOAD_FILEPATHS


class Create: # pylint: disable=too-many-instance-attributes,too-many-arguments
Expand Down Expand Up @@ -214,6 +180,7 @@ def start_vpn_or_master(self, configuration, provider): # pylint: disable=too-m
volumes = self.create_server_volumes(provider=provider, instance=instance, name=name)

# create a server and block until it is up and running
self.log.debug("Creating server...")
boot_volume = instance.get("bootVolume", configuration.get("bootVolume", {}))
server = provider.create_server(name=name, flavor=flavor, key_name=self.key_name, image=image, network=network,
volumes=volumes, security_groups=configuration["security_groups"], wait=True,
Expand All @@ -237,7 +204,7 @@ def start_vpn_or_master(self, configuration, provider): # pylint: disable=too-m
raise ConfigurationException(f"MAC address for ip {configuration['private_v4']} not found.")

# pylint: disable=comparison-with-callable
if identifier == VPN_WORKER_IDENTIFIER or (identifier == MASTER_IDENTIFIER and self.use_master_with_public_ip):
if identifier == VPNGTW_IDENTIFIER or (identifier == MASTER_IDENTIFIER and self.use_master_with_public_ip):
configuration["floating_ip"] = \
provider.attach_available_floating_ip(network=external_network, server=server)["floating_ip_address"]
if identifier == MASTER_IDENTIFIER:
Expand Down Expand Up @@ -302,12 +269,13 @@ def create_server_volumes(self, provider, instance, name):
@param name: sever name
@return:
"""
self.log.info("Creating volumes ...")
self.log.info(f"Creating volumes for {name}...")
return_volumes = []
group_instance = {"volumes": []}
instance["group_instances"] = {name: group_instance}

for i, volume in enumerate(instance.get("volumes", [])):
group_instance = {"volumes": []}
instance["group_instances"] = {name: group_instance}
self.log.debug(f"Volume {i}: {volume}")
if not volume.get("exists"):
if volume.get("permanent"):
infix = "perm"
Expand All @@ -331,10 +299,10 @@ def create_server_volumes(self, provider, instance, name):
if not return_volume:
raise ConfigurationException(f"Snapshot {volume['snapshot']} not found!")
else:
self.log.debug("Creating volume...")
return_volume = provider.create_volume(name=volume_name, size=volume.get("size", 50),
volume_type=volume.get("type"),
description=f"Created for {name}")
self.log.info(f"Volumes {i} created for {name}...")
return_volumes.append(return_volume)
return return_volumes

Expand Down Expand Up @@ -381,7 +349,7 @@ def prepare_vpn_or_master_args(self, configuration):
identifier = MASTER_IDENTIFIER
elif configuration.get("vpnInstance"):
instance_type = configuration["vpnInstance"]
identifier = VPN_WORKER_IDENTIFIER
identifier = VPNGTW_IDENTIFIER
else:
self.log.warning(
f"Configuration {configuration['cloud_identifier']} "
Expand Down Expand Up @@ -463,7 +431,8 @@ def upload_data(self, private_key, clean_playbook=False):
ssh_handler.execute_ssh(ssh_data=ssh_data, log=self.log)
self.log.info("Uploading Data")
ssh_data = {"floating_ip": self.master_ip, "private_key": private_key, "username": self.ssh_user,
"commands": commands, "filepaths": FILEPATHS, "gateway": self.configurations[0].get("gateway", {}),
"commands": commands, "filepaths": UPLOAD_FILEPATHS,
"gateway": self.configurations[0].get("gateway", {}),
"timeout": self.ssh_timeout}
ssh_handler.execute_ssh(ssh_data=ssh_data, log=self.log)

Expand Down
4 changes: 2 additions & 2 deletions bibigrid/core/actions/list_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pprint
import re

from bibigrid.core.actions import create
from bibigrid.core.utility.statics.create_statics import MASTER_IDENTIFIER

SERVER_REGEX = re.compile(r"^bibigrid-((master)-([a-zA-Z0-9]+)|(worker|vpngtw)-([a-zA-Z0-9]+)-\d+)$")

Expand Down Expand Up @@ -148,7 +148,7 @@ def get_master_access_ip(cluster_id, master_provider, log):
"""
# TODO: maybe move the method from list_clusters as it is now independent of list_clusters
log.info("Finding master ip for cluster %s...", cluster_id)
master = create.MASTER_IDENTIFIER(cluster_id=cluster_id)
master = MASTER_IDENTIFIER(cluster_id=cluster_id)
server = master_provider.get_server(master)
if server:
return server.get("public_v4") or server.get("public_v6") or server.get("private_v4")
Expand Down
27 changes: 14 additions & 13 deletions bibigrid/core/actions/terminate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import re
import time

from bibigrid.core.actions import create
from bibigrid.core.utility.statics.create_statics import DEFAULT_SECURITY_GROUP_NAME, WIREGUARD_SECURITY_GROUP_NAME, \
KEY_NAME, KEY_FOLDER, AC_NAME
from bibigrid.models.exceptions import ConflictException


Expand All @@ -26,14 +27,14 @@ def terminate(cluster_id, providers, log, debug=False, assume_yes=False):
if not input(f"DEBUG MODE: Any non-empty input to shutdown cluster {cluster_id}. "
"Empty input to exit with cluster still alive:"):
return 0
security_groups = [create.DEFAULT_SECURITY_GROUP_NAME]
security_groups = [DEFAULT_SECURITY_GROUP_NAME]
if len(providers) > 1:
security_groups.append(create.WIREGUARD_SECURITY_GROUP_NAME)
security_groups.append(WIREGUARD_SECURITY_GROUP_NAME)
cluster_server_state = []
cluster_keypair_state = []
cluster_security_group_state = []
cluster_volume_state = []
tmp_keyname = create.KEY_NAME.format(cluster_id=cluster_id)
tmp_keyname = KEY_NAME.format(cluster_id=cluster_id)
local_keypairs_deleted = delete_local_keypairs(tmp_keyname, log)
if assume_yes or local_keypairs_deleted or input(
f"WARNING: No local temporary keyfiles found for cluster {cluster_id}. "
Expand Down Expand Up @@ -117,7 +118,7 @@ def delete_local_keypairs(tmp_keyname, log):
"""
success = False
log.info("Deleting Keypair locally...")
tmp_keypath = os.path.join(create.KEY_FOLDER, tmp_keyname)
tmp_keypath = os.path.join(KEY_FOLDER, tmp_keyname)
pub_tmp_keypath = tmp_keypath + ".pub"
if os.path.isfile(tmp_keypath):
os.remove(tmp_keypath)
Expand Down Expand Up @@ -148,14 +149,14 @@ def delete_security_groups(provider, cluster_id, security_groups, log, timeout=5
for security_group_format in security_groups:
security_group_name = security_group_format.format(cluster_id=cluster_id)
attempts = 0
tmp_success = False
tmp_success = not provider.get_security_group(security_group_name)
while not tmp_success:
try:
not_found = not provider.get_security_group(security_group_name)
tmp_success = provider.delete_security_group(security_group_name)
except ConflictException:
log.info(f"ConflictException on deletion attempt on {provider.cloud_specification['identifier']}.")
tmp_success = False
if tmp_success or not_found:
if tmp_success:
break
if attempts < timeout:
attempts += 1
Expand All @@ -166,7 +167,7 @@ def delete_security_groups(provider, cluster_id, security_groups, log, timeout=5
log.error(f"Attempt to delete security group {security_group_name} on "
f"{provider.cloud_specification['identifier']} failed.")
break
log.info(f"Delete security_group {security_group_name} -> {tmp_success or not_found} on "
log.info(f"Delete security_group {security_group_name} -> {tmp_success} on "
f"{provider.cloud_specification['identifier']}.")
success = success and tmp_success
return success
Expand All @@ -183,7 +184,7 @@ def delete_application_credentials(master_provider, cluster_id, log):
# implement deletion
auth = master_provider.cloud_specification["auth"]
if not auth.get("application_credential_id") or not auth.get("application_credential_secret"):
return master_provider.delete_application_credential_by_id_or_name(create.AC_NAME.format(cluster_id=cluster_id))
return master_provider.delete_application_credential_by_id_or_name(AC_NAME.format(cluster_id=cluster_id))
log.info("Because you used application credentials to authenticate, "
"no created application credentials need deletion.")
return True
Expand All @@ -197,7 +198,7 @@ def delete_non_permanent_volumes(provider, cluster_id, log):
@param log:
@return: a list of the servers' (that were to be terminated) termination states
"""
log.info("Deleting tmp volumes on provider %s...", provider.cloud_specification['identifier'])
log.info("Deleting non permanent volumes on provider %s...", provider.cloud_specification['identifier'])
volume_list = provider.list_volumes()
cluster_volume_state = []
volume_regex = re.compile(
Expand Down Expand Up @@ -228,7 +229,7 @@ def terminate_output(*, cluster_server_state, cluster_keypair_state, cluster_sec
cluster_server_terminated = all(cluster_server_state)
cluster_keypair_deleted = all(cluster_keypair_state)
cluster_security_group_deleted = all(cluster_security_group_state)
cluster_volume_deleted = all(cluster_volume_state)
cluster_volume_deleted = all(all(instance_volume_states) for instance_volume_states in cluster_volume_state)
if cluster_existed:
if cluster_server_terminated:
log.info("Terminated all servers of cluster %s.", cluster_id)
Expand All @@ -254,7 +255,7 @@ def terminate_output(*, cluster_server_state, cluster_keypair_state, cluster_sec
"\nAll servers terminated: %s"
"\nAll keys deleted: %s"
"\nAll security groups deleted: %s"
"\nAll security groups deleted: %s", cluster_id, cluster_server_terminated,
"\nAll volumes deleted: %s", cluster_id, cluster_server_terminated,
cluster_keypair_deleted, cluster_security_group_deleted, cluster_volume_deleted)
if ac_state:
log.info("Successfully handled application credential of cluster %s.", cluster_id)
Expand Down
3 changes: 1 addition & 2 deletions bibigrid/core/actions/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Module that contains methods to update the master playbook
"""

from bibigrid.core.actions import create
from bibigrid.core.actions.list_clusters import dict_clusters
from bibigrid.core.utility.handler import cluster_ssh_handler

Expand All @@ -19,7 +18,7 @@ def update(creator, log):
log.warning(f"There are still workers up! {workers}")
return 1
if master_ip and ssh_user and used_private_key:
master = create.MASTER_IDENTIFIER(cluster_id=creator.cluster_id)
master = creator.MASTER_IDENTIFIER(cluster_id=creator.cluster_id)
server = creator.providers[0].get_server(master)
creator.master_ip = master_ip
creator.configurations[0]["private_v4"] = server["private_v4"]
Expand Down
Empty file added bibigrid/core/rest/__init__.py
Empty file.
Loading

0 comments on commit c36287d

Please sign in to comment.