PK!6 yoogcpm/__init__.py# -*- coding: utf-8 -*- from .__version__ import __version__ __program__ = "gcpm" from .__main__ import main PK!U=gcpm/__main__.py# -*- coding: utf-8 -*- """ Main module to launch gcpm cli. """ def main(): from .cli import cli cli() if __name__ == "__main__": main() PK!ygcpm/__version__.py__version__ = "0.2.11" PK!ꬂ gcpm/cli.py# -*- coding: utf-8 -*- """ Command line interface for core object """ import sys from .core import Gcpm import fire class CliObject(object): """HTCondor pool manager for Google Cloud Platform.""" def __init__(self, config="", test=False, oneshot=False): self.config = config self.test = test self.oneshot = oneshot def help(self): Gcpm.help() def version(self): Gcpm.version() def show_config(self): Gcpm(config=self.config).show_config() def install(self): """Install service related files.""" Gcpm(config=self.config, service=True).install() def uninstall(self): """Uninstall service related files.""" Gcpm(config=self.config, service=True).uninstall() def run(self): """Main function to run the loop.""" Gcpm(config=self.config, test=self.test).run(oneshot=self.oneshot) def service(self): """Run the loop as service.""" Gcpm(config=self.config, test=self.test, service=True).run() def set_pool_password(self, pool_password): """Set pool_password file in google storage.""" Gcpm(config=self.config).set_pool_password(path=pool_password, is_warn_exist=True) def cli(): if len(sys.argv) <= 1 or sys.argv[1] in ["-h", "--help"]: Gcpm.help() else: fire.Fire(CliObject) PK!#  gcpm/condor.py# -*- coding: utf-8 -*- """ Module to manage HTCondor information """ from .utils import proc class Condor(object): def __init__(self, test=False): self.test = test def q(self, opt=[]): return proc(["condor_q"] + opt) def status(self, opt=[]): if self.test: return (0, "", "") return proc(["condor_status"] + opt) def config_val(self, opt=[]): if self.test: return (-1, "", "") return proc(["condor_config_val"] + opt) def reconfig(self, opt=[]): if self.test: return (-1, "", "") return proc(["condor_reconfig"] + opt) def wn(self): if self.test: return ["gcp-test-wn-1core-000001"] ret, wn_candidates, err = self.status( ["-autoformat", "Name"]) if ret != 0: return ret, [] wn_candidates = [x.split(".")[0] for x in wn_candidates.split()] wn_candidates2 = [] for wn in wn_candidates: if "@" in wn: wn_candidates2.append(wn.split("@")[1]) else: wn_candidates2.append(wn) wn_list = list(set(wn_candidates2)) return ret, wn_list def wn_exist(self, wn_name): if self.test: if wn_name == "gcp-test-wn-1core-000001": return True else: return False if wn_name in self.wn(): return True else: return False def wn_status(self): if self.test: return 0, {"gcp-test-wn-1core-000001": "Claimed"} ret, status, err = self.status(["-autoformat", "Name", "State"]) if ret != 0: return ret, {} status_dict = {} for line in status.splitlines(): name, status = line.split() name = name.split(".")[0] if "@" in name: name = name.split("@")[1] status_dict[name] = status return ret, status_dict def idle_jobs(self, owners=[], exclude_owners=[]): if self.test: return [{1: 1}, {}] qinfo = self.q(["-allusers", "-global", "-autoformat", "JobStatus", "RequestCpus", "RequestMemory", "Owner"])[1] full_idle_jobs = {} selected_idle_jobs = {} if qinfo == "All queues are empty\n": return [full_idle_jobs, selected_idle_jobs] for line in qinfo.splitlines(): status, core, memory, owner = line.split() status = int(status) core = int(core) if status != 1: continue if core not in full_idle_jobs: full_idle_jobs[core] = 0 full_idle_jobs[core] += 1 if len(owners) == 0 and len(exclude_owners) == 0: continue if len(owners) > 0: is_owner = 0 for o in owners: if owner.startswith(o): is_owner = 1 break if is_owner == 0: continue if len(exclude_owners) > 0: is_owner = 1 for o in exclude_owners: if owner.startswith(o): is_owner = 0 break if is_owner == 0: continue if core not in selected_idle_jobs: selected_idle_jobs[core] = 0 selected_idle_jobs[core] += 1 return [full_idle_jobs, selected_idle_jobs] PK!Su5z5z gcpm/core.py# -*- coding: utf-8 -*- """ Core module to provides gcpm functions. """ import os import sys import logging import copy import json import time import ruamel.yaml from time import sleep from pprint import pformat from googleapiclient.errors import HttpError from .__init__ import __version__ from .__init__ import __program__ from .utils import expand, make_startup_script, make_shutdown_script,\ make_startup_script_swap from .files import make_file, make_service, make_logrotate, rm_service,\ rm_logrotate from .condor import Condor from .gce import Gce from .gcs import Gcs from .machine import Machine class Gcpm(object): """HTCondor pool manager for Google Cloud Platform.""" _HTCONDOR_STATUS_FAILED = "Failed to get HTCondor status" def __init__(self, config="", service=False, test=False): self.first_update_config = 0 self.logger = None self.is_service = service if config == "": if self.is_service: self.config = "/etc/gcpm.yml" else: self.config = "~/.config/gcpm/gcpm.yml" else: self.config = config self.config = expand(self.config) self.data = { "config_dir": "", "oauth_file": "", "wn_list": "", "service_account_file": "", "project": "", "zone": "", "max_cores": 0, "machines": [], "static_wns": [], "required_machines": [], "primary_accounts": [], "prefix": "gcp-wn", "instance_max_num": 999999, "preemptible": 0, "off_timer": 0, "network_tag": [], "reuse": 0, "interval": 10, "clean_time": 600, "head_info": "gcp", "head": "", "port": 9618, "domain": "", "admin": "", "owner": "", "wait_cmd": 0, "bucket": "", "storageClass": "REGIONAL", "location": "", "log_file": None, "log_level": logging.INFO, } if self.is_service: self.data["log_file"] = "/var/log/gcpm.log" self.scripts = {"wn": {"startup": {}, "shutdown": {}}, "test_wn": {"startup": {}, "shutdown": {}}} self.prefix_core = {} self.test_prefix_core = {} self.services = {} self.gce = None self.gcs = None self.n_wait = 0 self.create_option = "" self.instances_gce = {} self.wns = {} self.prev_wns = {} self.wn_list = "" self.condor_wns = {} self.condor_wns_exist = {} self.wn_starting = [] self.wn_deleting = [] self.full_idle_jobs = {} self.test_idle_jobs = {} self.total_core_use = [] self.test = test self.condor = Condor(test=self.test) self.update_config() @staticmethod def help(): print(""" Usage: gcpm [--config=] [--test=] [--oneshot=] commands: run : Run user process. service : Run service process. set_pool_password : \ Upload pool_password file to Google Cloud Storage. install : Install service (systemd) \ and logrotate configuration file. uninstall : Uninstall service (systemd) \ and logrotate configuration file. show_config: Show configurations. version : Show version. help : Show this help. options: config : Configuration file for gcpm. Default: ~/.config/gcpm/gcpm.yml for user process. /etc/gcpm.yml for service process. oneshot : Set True to run only one loop. test : Set True to test on machines \ which does not have HTCondor service. """) @staticmethod def version(): print("%s: %s" % (__program__, __version__)) def check_config(self): return True def read_config(self): yaml = ruamel.yaml.YAML() if not os.path.isfile(self.config): print("GCPM setting file: %s does not exist" % self.config) else: with open(self.config) as stream: data = yaml.load(stream) for k, v in data.items(): self.data[k] = v if self.data["config_dir"] == "": if self.is_service: config_dir = "/var/cache/gcpm" else: config_dir = "~/.config/gcpm" self.data["config_dir"] = expand(config_dir) if self.data["oauth_file"] == "": self.data["oauth_file"] = self.data["config_dir"] + "/oauth" if self.data["wn_list"] == "": self.data["wn_list"] = self.data["config_dir"] + "/wn_list.json" self.prefix_core = {} self.test_prefix_core = {} for machine in self.data["machines"]: # memory must be N x 256 (MB) q, mod = divmod(machine["mem"], 256) if mod != 0: machine["mem"] = (q+1) * 256 if "swap" not in machine: machine["swap"] = machine["mem"] self.prefix_core[machine["core"]] = \ "%s-%dcore" % (self.data["prefix"], machine["core"]) self.test_prefix_core[machine["core"]] = \ "%s-test-%dcore" % (self.data["prefix"], machine["core"]) for machine in self.data["required_machines"]: # memory must be N x 256 (MB) q, mod = divmod(machine["mem"], 256) if mod != 0: machine["mem"] = (q+1) * 256 if "swap" not in machine: machine["swap"] = machine["mem"] if "metadata" not in machine: machine["metadata"] = {} machine["metadata"]["items"] = [ {"key": "startup-script", "value": make_startup_script_swap(machine["swap"])}] if self.data["location"] == "": if self.data["storageClass"] == "MULTI_REGIONAL": self.data["location"] = self.data["zone"].split("-")[0] else: self.data["location"] = "-".join( self.data["zone"].split("-")[0:2]) if self.data["bucket"] == "": self.data["bucket"] = self.data["project"] + "_" + "gcpm_bucket" if self.data["bucket"].startswith("gs://"): self.data["bucket"] = self.data["bucket"].replace("gs://", "") if self.data["head"] == "": if self.data["head_info"] == "hostname": self.data["head"] = os.uname()[1] elif self.data["head_info"] == "ip": import socket self.data["head"] = socket.gethostbyname(socket.gethostname()) elif self.data["head_info"] == "gcp": self.data["head"] = os.uname()[1] else: raise ValueError( "Both %s and %s are empty" % ("head", "head_info")) if self.data["domain"] == "": self.data["domain"] = ".".join(os.uname()[1].split(".")[1:]) if self.data["wait_cmd"] == 1: self.n_wait = 100 if type(self.data["log_level"]) is str \ and self.data["log_level"].isdigit(): self.data["log_level"] = int(self.data["log_level"]) if type(self.data["log_level"]) is int: self.data["log_level"] = logging.getLevelName( self.data["log_level"]) self.data["log_level"] = self.data["log_level"].upper() def set_logger(self): if self.logger is None: log_options = { "format": '%(asctime)s %(message)s', "datefmt": '%Y-%m-%d %H:%M:%S', } if self.data["log_file"] is not None: log_options["filename"] = self.data["log_file"] log_options["level"] = self.data["log_level"] logging.basicConfig(**log_options) self.logger = logging.getLogger(__name__) self.logger.setLevel(self.data["log_level"]) if self.data["log_level"] not in ["NOTSET", "DEBUG"]: logging.getLogger("googleapiclient.discovery").setLevel("WARNING") else: logging.getLogger("googleapiclient.discovery").setLevel( self.data["log_level"]) def show_config(self): if self.logger is not None: self.logger.info( "Configurations have been updated:\n" + pformat(self.data)) def make_scripts(self): for wn_type in self.scripts: for machine in self.data["machines"]: self.scripts[wn_type]["startup"][machine["core"]] \ = make_startup_script( core=machine["core"], mem=machine["mem"], swap=machine["swap"], disk=machine["disk"], image=machine["image"], preemptible=self.data["preemptible"], admin=self.data["admin"], head=self.data["head"], port=self.data["port"], domain=self.data["domain"], owner=self.data["owner"], bucket=self.data["bucket"], off_timer=self.data["off_timer"], wn_type=wn_type ) self.scripts[wn_type]["shutdown"][machine["core"]] \ = make_shutdown_script( core=machine["core"], mem=machine["mem"], swap=machine["swap"], disk=machine["disk"], image=machine["image"], preemptible=self.data["preemptible"], ) def after_update_config(self): self.set_logger() self.show_config() self.make_scripts() def update_config(self): orig_data = copy.deepcopy(self.data) self.read_config() self.check_config() if self.first_update_config != 0 and orig_data == self.data: return self.first_update_config = 1 self.after_update_config() def install(self): make_service() make_logrotate(mkdir=False) def uninstall(self): rm_service() rm_logrotate() def get_gce(self): if self.gce is None: self.gce = Gce( oauth_file=self.data["oauth_file"], service_account_file=self.data["service_account_file"], project=self.data["project"], zone=self.data["zone"], ) return self.gce def get_gcs(self): if self.gcs is None: self.gcs = Gcs( oauth_file=self.data["oauth_file"], service_account_file=self.data["service_account_file"], project=self.data["project"], storageClass=self.data["storageClass"], location=self.data["location"], bucket=self.data["bucket"], ) return self.gcs def set_pool_password(self, path="", is_warn_exist=False): if path == "": (ret, out, err) = self.condor.config_val(["SEC_PASSWORD_FILE"]) if ret != 0: return path = out.strip() self.get_gcs().upload_file(path=path, filename="pool_password", is_warn_exist=is_warn_exist) def check_condor_status(self): if self.condor.status()[0] != 0: raise RuntimeError(self._HTCONDOR_STATUS_FAILED) def check_required(self): for machine in self.data["required_machines"]: while True: if machine["name"] in self.instances_gce: status = self.instances_gce[machine["name"]]["status"] if status == "RUNNING": break elif status == "TERMINATED": if not self.get_gce().start_instance(machine["name"], n_wait=100, update=False): raise RuntimeError( "Failed to start required machine: %s" % machine["name"]) else: self.logger.warning( "Required machine %s is unknown stat: %s\n" "Wait 10 sec." % (machine["name"], status)) sleep(10) continue elif not self.new_instance(machine["name"], machine, n_wait=100, update=True, wn_type=None): raise RuntimeError( "Failed to create required machine: %s" % machine["name"]) break def get_instances_gce(self, update=True): if update: self.instances_gce = self.get_gce().get_instances(update=True) return self.instances_gce def get_instances_wns(self, update=True): self.get_instances_gce(update) instances = {} for instance, info in self.instances_gce.items(): is_use = 0 for core, prefix in list(self.prefix_core.items()) \ + list(self.test_prefix_core.items()): if instance.startswith(prefix): is_use = 1 break for static in self.data["static_wns"]: if instance == static: is_use = 1 if is_use: instances[instance] = info return instances def get_instances_running(self, update=True): return {x: y for x, y in self.get_instances_wns(update=update).items() if y["status"] == "RUNNING"} def get_instances_non_terminated(self, update=True): return {x: y for x, y in self.get_instances_wns(update=update).items() if y["status"] != "TERMINATED"} def get_instances_terminated(self, update=True): return {x: y for x, y in self.get_instances_wns(update=update).items() if y["status"] == "TERMINATED"} def get_gce_ip(self, instance, update=True): if instance not in self.get_instances_running(update=update): return instance info = self.get_instances_running(update=False)[instance] if self.data["head_info"] == "gcp": ip = info["networkInterfaces"][0]["networkIP"] else: ip = info["networkInterfaces"][0]["accessConfigs"][0]["natIP"] return ip def add_gce_wns(self, update=True): for instance, info in \ self.get_instances_running(update=update).items(): self.wns[instance] = self.get_gce_ip(instance, update=False) def add_remaining_wns(self): # Check instance which is not running, but in condor_status # (should be in the list until it is removed from the status) self.condor_wns_exist = {} for wn in self.condor_wns: if wn not in self.wns: if wn in self.prev_wns: self.wns[wn] = self.prev_wns[wn] self.logger.debug( "%s is listed in the condor status, " "but instance does not exist, maybe being deleted." % (wn)) else: self.logger.warning( "%s is listed in the condor status, " "but no information can be taken from gce." % (wn)) else: self.condor_wns_exist[wn] = self.condor_wns[wn] def make_wn_list(self): self.wns = {} self.prev_wns = {} if os.path.isfile(self.data["wn_list"]): with open(self.data["wn_list"]) as f: self.prev_wns = json.load(f) for s in self.data["static_wns"]: self.wns[s] = self.get_gce_ip(s, update=False) self.add_gce_wns(update=False) self.add_remaining_wns() self.wn_list = "" for name, ip in self.wns.items(): self.wn_list += \ " condor@$(UID_DOMAIN)/%s condor_pool@$(UID_DOMAIN)/%s" \ % (ip, ip) make_file(filename=self.data["wn_list"], content=json.dumps(self.wns), mkdir=True) def update_condor_collector(self): self.make_wn_list() self.condor.config_val(["-collector", "-set", "WNS = %s" % self.wn_list]) self.condor.reconfig(["-collector"]) def stop_instance(self, instance): machine = Machine(name=instance, start_time=time.time()) self.wn_deleting.append(machine) try: self.get_gce().stop_instance(instance, n_wait=self.n_wait, update=False) except HttpError as e: self.wn_deleting.remove(machine) self.logger.warning(e) def delete_instance(self, instance): machine = Machine(name=instance, start_time=time.time()) self.wn_deleting.append(machine) try: self.get_gce().delete_instance(instance, n_wait=self.n_wait, update=False) except HttpError as e: self.wn_deleting.remove(machine) self.logger.warning(e) def clean_wns(self): self.logger.debug("clean_wns") for wn in self.wn_starting: if wn.get_name() in self.condor_wns: self.wn_starting.remove(wn) if wn.get_running_time() > self.data["clean_time"]: self.logger.warning( "%s is in starting status for more than %d sec, " "maybe problems happened, " "remove it from starting list." % (wn.get_name(), self.data["clean_time"]) ) self.wn_starting.remove(wn) exist_list = self.data["static_wns"] + list(self.condor_wns) \ + self.get_starting_deleting_names() instances = [] # Delete condor_off instances for instance, info in self.get_instances_wns(update=False).items(): if self.data["reuse"] and info["status"] == "TERMINATED": continue instances.append(instance) if instance in exist_list: continue if info["status"] not in ["RUNNING", "TERMINATED"]: continue if self.data["reuse"]: self.stop_instance(instance) else: self.delete_instance(instance) for wn in self.wn_deleting: if wn.get_name() not in instances: self.wn_deleting.remove(wn) if wn.get_running_time() > self.data["clean_time"]: self.logger.warning( "%s is in deleting status for more than %s sec, " "maybe problems happened, " "remove it from deleting list." % (wn.get_name(), self.data["clean_time"]) ) self.wn_starting.remove(wn) def check_terminated(self): if self.data["reuse"] == 1: return for instance, info in self.get_instances_terminated( update=False).items(): if instance in \ self.get_starting_deleting_names(): continue self.delete_instance(instance) def update_total_core_use(self): working = list(self.get_instances_non_terminated(update=False)) \ + self.get_starting_deleting_names() self.total_core_use = 0 for wn in working: for core, prefix in list(self.prefix_core.items()) \ + list(self.test_prefix_core.items()): if wn.startswith(prefix): self.total_core_use += core break def get_starting_deleting_names(self): return [x.get_name() for x in self.wn_starting + self.wn_deleting] def get_full_wns(self): return list(self.instances_gce) + self.get_starting_deleting_names() \ + list(self.condor_wns) def check_wns(self): self.check_terminated() self.update_total_core_use() def update_wns(self): self.get_instances_wns(update=False) ret, self.condor_wns = self.condor.wn_status() if ret != 0: raise RuntimeError(self._HTCONDOR_STATUS_FAILED) self.update_condor_collector() self.clean_wns() self.check_wns() def check_for_core(self, machine, test=False): core = machine["core"] if self.data["max_cores"] > 0 and \ self.total_core_use + core > self.data["max_cores"]: return False if test: n_test_idle_jobs = self.test_idle_jobs[core] \ if core in self.test_idle_jobs else 0 if n_test_idle_jobs == 0: return False test_machines = {x: y for x, y in self.condor_wns_exist.items() if x.startswith(self.test_prefix_core[core])} machine_idle = 0 else: n_test_idle_jobs = 0 test_machines = {} machine_idle = machine["idle"] n_idle_jobs = self.full_idle_jobs[core] \ if core in self.full_idle_jobs else 0 n_primary_idle_jobs = n_idle_jobs - n_test_idle_jobs machines = {x: y for x, y in self.condor_wns_exist.items() if x.startswith(self.prefix_core[core])} unclaimed = {x: y for x, y in machines.items() if y == "Unclaimed"} test_unclaimed = {x: y for x, y in test_machines.items() if y == "Unclaimed"} n_machines = len(machines) + len(test_machines) n_unclaimed = len(unclaimed) for wn in self.wn_starting: if wn.get_name().startswith(self.prefix_core[core]): n_machines += 1 n_unclaimed += 1 n_unclaimed -= n_primary_idle_jobs if test: if n_unclaimed < 0: n_unclaimed = 0 n_unclaimed += len(test_unclaimed) for wn in self.wn_starting: if wn.get_name().startswith(self.test_prefix_core[core]): n_unclaimed += 1 n_unclaimed -= n_test_idle_jobs else: if n_machines >= machine["max"]: return False if n_unclaimed - machine_idle >= 0: return False return True def start_terminated(self, core, prefix): if self.data["reuse"] != 1: return False if type(prefix) is str: prefix = [prefix] for instance in self.get_instances_terminated(update=False): prefixcheck = False for p in prefix: if instance.startswith(p): prefixcheck = True break if not prefixcheck: continue if instance in [x.get_names() for x in self.wn_starting]: continue machine = Machine(name=instance, core=core, start_time=time.time()) self.wn_starting.append(machine) try: self.get_gce().start_instance(instance, n_wait=self.n_wait, update=False) except HttpError as e: self.wn_starting.remove(machine) self.logger.warning(e) return False return True return False def new_instance(self, instance_name, machine, n_wait=0, update=False, wn_type=None): option = { "name": instance_name, "machineType": "custom-%d-%d" % (machine["core"], machine["mem"]), "disks": [ { "type": "PERSISTENT", "boot": True, "autoDelete": True, "initializeParams": { "diskSizeGb": machine["disk"], "sourceImage": "global/images/" + machine["image"], } } ], "serviceAccounts": [{ "email": "default", "scopes": [ "https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/monitoring.write", "https://www.googleapis.com/auth/trace.append", ] }], } if wn_type is not None: option["tags"] = {"items": self.data["network_tag"]} option["metadata"] = { "items": [ {"key": "startup-script", "value": self.scripts[wn_type]["startup"][machine["core"]]}, {"key": "shutdown-script", "value": self.scripts[wn_type]["shutdown"][machine["core"]]}, ] } option["scheduling"] = { "onHostMaintenance": "terminate" \ if "gpu" in machine or"guestAccelerators" in machine \ else "migrate", "automaticRestart": not bool(self.data["preemptible"]), "preemptible": bool(self.data["preemptible"]) } if "ssd" in machine: ssd = machine["ssd"] if type(ssd) is not list: ssd = [ssd] for s in ssd: option["disks"].append({ "type": "SCRATCH", "boot": True, "autoDelete": True, "interface": s, "initializeParams": { "diskType": "zones/%s/diskTypes/local-ssd" % self.data["zone"] } }) for opt in machine: if opt not in ["name", "core", "mem", "swap", "disk", "image", "max", "idle", "ssd"]: option[opt] = machine[opt] m = Machine(name=instance_name, core=machine["core"], mem=machine["mem"], disk=machine["disk"], start_time=time.time(), test=(wn_type == "wn_test")) if wn_type is not None: self.wn_starting.append(m) try: return self.get_gce().create_instance(instance=instance_name, option=option, n_wait=n_wait, update=update) except HttpError as e: if m in self.wn_starting: self.wn_starting.remove(m) if e.resp.status == 409: self.logger.warning(e) return False raise HttpError(e.resp, e.content, e.uri) def prepare_wns(self, test=False): created = False for machine in self.data["machines"]: prefixes = [self.prefix_core[machine["core"]]] if not self.check_for_core(machine, test): continue if test: prefixes.append(self.test_prefix_core[machine["core"]]) prefix = self.test_prefix_core[machine["core"]] wn_type = "test_wn" else: prefix = self.prefix_core[machine["core"]] wn_type = "wn" if self.start_terminated(machine["core"], prefixes): self.total_core_use += machine["core"] created = True continue n = 1 while n < self.data["instance_max_num"]: instance_name = ("%s-%0" + str(len(str(self.data["instance_max_num"]))) + "d").format() % (prefix, n) if instance_name in self.get_full_wns(): n += 1 continue self.new_instance(instance_name, machine, n_wait=self.n_wait, wn_type=wn_type) self.total_core_use += machine["core"] created = True break return created def prepare_wns_wrapper(self): self.logger.debug("prepare_wns_wrapper") self.full_idle_jobs, self.test_idle_jobs \ = self.condor.idle_jobs( exclude_owners=self.data["primary_accounts"]) self.logger.debug("full_idle_jobs:" + pformat(self.full_idle_jobs)) self.logger.debug("test_idle_jobs:" + pformat( self.test_idle_jobs)) while True: if not self.prepare_wns(): break while True: if not self.prepare_wns(test=True): break def series(self): self.logger.debug("series start") self.check_condor_status() self.update_config() self.get_instances_gce(update=True) self.check_required() self.update_wns() self.prepare_wns_wrapper() self.logger.debug("instances:\n" + pformat(list(self.instances_gce))) self.logger.debug("condor_wns:\n" + pformat(self.condor_wns)) self.logger.debug("wns:\n" + pformat(self.wns)) self.logger.debug("wn_starting:\n" + pformat([x.get_name() for x in self.wn_starting])) self.logger.debug("wn_deleting:\n" + pformat([x.get_name() for x in self.wn_deleting])) def run(self, oneshot=False): self.logger.info("Starting") self.set_pool_password() while True: try: self.series() if oneshot: break sleep(self.data["interval"]) except KeyboardInterrupt: break except RuntimeError as e: if e.message == self._HTCONDOR_STATUS_FAILED: self.logger.warning(self._HTCONDOR_STATUS_FAILED) sleep(self.data["interval"]) else: import traceback self.logger.error(traceback.format_exc()) sys.exit(1) except Exception: import traceback self.logger.error(traceback.format_exc()) sys.exit(1) PK!s77 gcpm/files.py# -*- coding: utf-8 -*- """ Module to mange Google Cloud Storage. """ import os from .utils import expand, proc __SERVICE_FILE__ = "/usr/lib/systemd/system/gcpm.service" __LOGROTATE_FILE__ = "/etc/logrotate.d/gcpm.conf" def make_file(filename, content="", mkdir=True): filename = expand(filename) directory = os.path.dirname(filename) if not os.path.isdir(directory): if mkdir: os.makedirs(directory) else: return False with open(filename, mode='w') as f: f.write(content) return True def rm_file(filename): if not os.path.isfile(filename): return os.remove(filename) def make_service(filename=__SERVICE_FILE__, mkdir=True): content = """[Unit] Description = HTCondor pool manager for Google Cloud Platform [Service] Environment = "PATH={path}" ExecStart = /usr/bin/gcpm service ExecStop = /usr/bin/kill -p $MAINPID Restart = always StandardOutput = journal StandardError = journal SyslogIdentifier = gcpm [Install] WantedBy = multi-user.target""".format(path=os.environ["PATH"]) make_file(filename, content, mkdir) proc(["systemctl", "daemon-reload"]) def rm_service(filename=__SERVICE_FILE__): rm_file(filename) def make_logrotate(filename=__LOGROTATE_FILE__, mkdir=True): content = """/var/log/gcpm.log {{ missingok rotate 10 dateext delaycompress daily minsize 100M postrotate systemctl restart gcpm endscript }}""".format() make_file(filename, content, mkdir) def rm_logrotate(filename=__LOGROTATE_FILE__): rm_file(filename) PK!jB gcpm/gce.py# -*- coding: utf-8 -*- """ Module to mange Google Compute Engine. """ import logging from copy import deepcopy from time import sleep from .service import get_compute class Gce(object): def __init__(self, oauth_file="", service_account_file="", project="", zone=""): self.oauth_file = oauth_file self.service_account_file = service_account_file self.project = project self.zone = zone self.instances = {} self.compute_service = None self.n_wait = 100 self.wait_time = 10 self.logger = logging.getLogger(__name__) def compute(self): if self.compute_service is None: self.compute_service = get_compute( service_account_file=self.service_account_file, oauth_file=self.oauth_file, ) return self.compute_service def get_zones(self, **zone_filter): zones = [] for zone in self.compute().zones().list( project=self.project).execute()["items"]: is_ok = 1 for k, v in zone_filter.items(): if zone[k] != v: is_ok = 0 continue if is_ok == 1: zones.append(zone["name"]) return zones def get_instance(self, instance, update=True): if update: try: info = self.compute().instances().get( project=self.project, zone=self.zone, instance=instance).execute() except Exception: info = None else: if instance in self.instances: info = self.instances[instance] else: info = None return info def update_instances(self): instances = self.compute().instances().list(project=self.project, zone=self.zone).execute() if "items" in instances: self.instances = {x["name"]: x for x in instances["items"]} else: self.instances = {} def get_instances(self, update=True, instance_filter={}): if update: self.update_instances() instances = {} for instance, info in self.instances.items(): is_ok = 1 for k, v in instance_filter.items(): if info[k] != v: is_ok = 0 continue if is_ok == 1: instances[instance] = info return instances def check_instance(self, instance, status="RUNNING", n_wait=-1, wait_time=-1, update=True): if n_wait == -1: n_wait = self.n_wait if wait_time == -1: wait_time = self.wait_time if n_wait <= 0: return True wait = n_wait info = self.get_instance(instance, update) while True: if status == "DELETED": if info is None: return True elif status == "INSERTED": if info is not None: return True else: if info is None: continue if info["status"] == status: return True wait = wait - 1 if wait <= 0: break sleep(wait_time) info = self.get_instance(instance) return False def start_instance(self, instance, n_wait=-1, wait_time=-1, update=True): self.logger.info("Starting %s" % (instance)) if not self.check_instance(instance, "TERMINATED", 1, 1, update): self.logger.warning("%s is not TERMINATED status (status=%s)" % (instance, self.instances[instance]["status"])) return False self.compute().instances().start(project=self.project, zone=self.zone, instance=instance).execute() return self.check_instance(instance, "RUNNING", n_wait, wait_time) def stop_instance(self, instance, n_wait=-1, wait_time=-1, update=True): self.logger.info("Stopping %s" % (instance)) if not self.check_instance(instance, "RUNNING", 1, 1, update): self.logger.warning("%s is not RUNNING status (status=%s)" % (instance, self.instances[instance]["status"])) return False self.compute().instances().stop(project=self.project, zone=self.zone, instance=instance).execute() return self.check_instance(instance, "TERMINATED", n_wait, wait_time) def get_source_disk_image(self, family, project=""): if project == "": project = self.project image_response = self.compute().images().getFromFamily( project=project, family=family).execute() return image_response['selfLink'] def insert_instance(self, instance, n_wait=-1, wait_time=-1, option={}, update=True): self.logger.info("Inserting %s" % (instance)) if self.check_instance(instance, "INSERTED", 1, 1, update): self.logger.warning("%s already exists" % instance) return False opt = deepcopy(option) if "name" not in opt: opt["name"] = instance if not opt["machineType"].startswith("zones"): opt["machineType"] = "zones/%s/machineTypes/%s" % ( self.zone, opt["machineType"]) if "disks" not in opt: opt["disks"] = [{}] opt["disks"][0] = { "boot": True, "autoDelete": True, } if "initializeParams" not in opt["disks"][0]: opt["disks"][0]["initializeParams"] = {} if "family" in opt: if "sourceImage" not in opt["disks"][0]["initializeParams"]: if "project" in opt: project = opt["project"] else: project = self.project source_disk_image = self.get_source_disk_image(opt["family"], project) opt["disks"][0]["initializeParams"]["sourceImage"] =\ source_disk_image del opt["family"] if "networkInterfaces" not in opt: opt["networkInterfaces"] = [{ "network": "global/networks/default", "accessConfigs": [ {"type": "ONE_TO_ONE_NAT", "name": "External NAT"} ] }] self.compute().instances().insert(project=self.project, zone=self.zone, body=opt).execute() if opt["disks"][0]["boot"]: return self.check_instance(instance, "RUNNING", n_wait, wait_time) else: return self.check_instance(instance, "INSERTED", n_wait, wait_time) def create_instance(self, instance, n_wait=-1, wait_time=-1, option={}, update=True): return self.insert_instance(instance, n_wait, wait_time, option, update) def delete_instance(self, instance, n_wait=-1, wait_time=-1, update=True): self.logger.info("Deleting %s" % (instance)) if self.check_instance(instance, "DELETED", 1, 1, update): self.logger.warning("%s does not exist)" % instance) return False self.compute().instances().delete( project=self.project, zone=self.zone, instance=instance, ).execute() return self.check_instance(instance, "DELETED", n_wait, wait_time) PK!$t t gcpm/gcs.py# -*- coding: utf-8 -*- """ Module to mange Google Cloud Storage. """ import os import logging import googleapiclient from .service import get_storage from .utils import expand class Gcs(object): def __init__(self, oauth_file="", service_account_file="", project="", storageClass="", location="", bucket=""): self.oauth_file = oauth_file self.service_account_file = service_account_file self.project = project self.storageClass = storageClass self.location = location self.bucket = bucket self.storage_service = None self.logger = logging.getLogger(__name__) def storage(self): if self.storage_service is None: self.storage_service = get_storage( service_account_file=self.service_account_file, oauth_file=self.oauth_file, ) return self.storage_service def get_buckets(self): buckets = self.storage().buckets().list(project=self.project).execute() if "items" not in buckets: return [] return [x["name"] for x in buckets["items"]] def is_bucket(self, bucket): return True if bucket in self.get_buckets() else False def delete_bucket(self): if not self.is_bucket(self.bucket): return self.storage().buckets().delete(bucket=self.bucket).execute() def create_bucket(self): if self.is_bucket(self.bucket): return body = {"name": self.bucket, "sotrageClass": self.storageClass, "location": self.location, } return self.storage().buckets().insert(project=self.project, body=body).execute() def get_files(self): files = self.storage().objects().list(bucket=self.bucket).execute() if "items" not in files: return [] return [x["name"] for x in files["items"]] def is_file(self, filename): return True if filename in self.get_files() else False def upload_file(self, path, filename="", is_warn_exist=False): self.create_bucket() if filename == "": filename = os.path.basename(path) if self.is_file(filename): if is_warn_exist: self.logger.warning("%s already exists on %s" % (filename, self.bucket)) return None with open(expand(path), 'rb') as f: response = self.storage().objects().insert( bucket=self.bucket, media_body=googleapiclient.http.MediaIoBaseUpload( f, 'application/octet-stream'), name=filename).execute() return response def delete_file(self, filename): return self.storage().objects().delete( bucket=self.bucket, object=filename).execute() PK!ygcpm/machine.py# -*- coding: utf-8 -*- """ Machine information """ import time class Machine(object): def __init__(self, name, core=0, mem=0, disk=0, start_time=0, test=False): self.name = name self.core = core self.mem = mem self.disk = disk self.start_time = start_time self.test = test def get_name(self): return self.name def get_core(self): return self.core def get_mem(self): return self.mem def get_disk(self): return self.disk def get_running_time(self): return self.start_time - time.time() def is_test(self): return self.test PK!{鰹 gcpm/service.py# -*- coding: utf-8 -*- """ Module to provide google service management """ import os import sys from .utils import expand from .__init__ import __version__ from .__init__ import __program__ import httplib2 from google.oauth2 import service_account from oauth2client.file import Storage from oauth2client.tools import run_flow from oauth2client.tools import argparser from oauth2client.client import OAuth2WebServerFlow from apiclient.discovery import build __CLIENT_ID__ =\ "154689602688-rmimpcfc5d5th2nb2rbap02sujh0ehtg.apps.googleusercontent.com" __CLIENT_SECRET__ = "LouXW0cr1pkCoi8QtTOweld2" def service_from_oauth(oauth_file, api_name, api_version, scope): oauth_file = expand(oauth_file) oauth_dir = os.path.dirname(oauth_file) if not os.path.isdir(oauth_dir): os.makedirs(oauth_dir) storage = Storage(oauth_file) credentials = storage.get() if credentials is None or credentials.invalid: args, unknown = argparser.parse_known_args(sys.argv) credentials = run_flow( OAuth2WebServerFlow( client_id=__CLIENT_ID__, client_secret=__CLIENT_SECRET__, scope=scope, user_agent=__program__ + '/' + __version__), storage, args) http = httplib2.Http() http = credentials.authorize(http) service = build(api_name, api_version, http=http, cache_discovery=False) return service def service_from_service_account( service_account_file, api_name, api_version, scope): f = expand(service_account_file) credentials = service_account.Credentials.from_service_account_file( f, scopes=scope) service = build(api_name, api_version, credentials=credentials, cache_discovery=False) return service def get_service(service_account_file="", oauth_file="~/.config/gcpm/oauth", scope=["https://www.googleapis.com/auth/cloud-platform"], api_name="compute", api_version="v1"): if service_account_file == "": service = service_from_oauth( oauth_file=oauth_file, api_name=api_name, api_version=api_version, scope=scope) else: service = service_from_service_account( service_account_file=service_account_file, api_name=api_name, api_version=api_version, scope=scope) return service def get_compute(service_account_file="", oauth_file="~/.config/gcpm/oauth"): return get_service(service_account_file=service_account_file, oauth_file=oauth_file, scope=[ "https://www.googleapis.com/auth/compute" ], api_name="compute", api_version="v1") def get_storage(service_account_file="", oauth_file="~/.config/gcpm/oauth"): return get_service(service_account_file=service_account_file, oauth_file=oauth_file, scope=[ "https://www.googleapis.com/auth/cloud-platform" ], api_name="storage", api_version="v1") PK!0 gcpm/utils.py# -*- coding: utf-8 -*- """ Module to provide utilities """ def expand(path): import os return os.path.expandvars(os.path.expanduser(path)) def proc(cmd): import sys import shlex import subprocess if type(cmd) != list: cmd = shlex.split(cmd) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate() if sys.version_info.major > 2: stdout = stdout.decode() stderr = stderr.decode() return (p.returncode, stdout, stderr) def make_startup_script_swap(swap): content = """#!/usr/bin/env bash dd if=/dev/zero of=/swapfile bs=1M count={swap} chmod 600 /swapfile mkswap /swapfile swapon /swapfile echo /swapfile swap swap defaults 0 0 >>/etc/fstab """.format(swap=swap) return content def make_startup_script(core, mem, swap, disk, image, preemptible, admin, head, port, domain, owner, bucket, off_timer=0, wn_type=""): if wn_type == "test_wn": start = "IsPrimaryJob =!= True" else: start = "SlotID == 1" content = """#!/usr/bin/env bash echo "{{\\"date\\": $(date +%s), \\"core\\": {core}, \\"mem\\": {mem}, \ \\"swap\\": {swap}, \\"disk\\": {disk}, \\"image\\": \\"{image}\\", \ \\"preemptible\\": {preemptible} \ }}" >/var/log/nodeinfo.log date +%s > /root/start_date dd if=/dev/zero of=/swapfile bs=1M count={swap} chmod 600 /swapfile mkswap /swapfile swapon /swapfile echo /swapfile swap swap defaults 0 0 >>/etc/fstab sed -i"" 's/FIXME_ADMIN/{admin}/' /etc/condor/config.d/00_config_local.config sed -i"" 's/FIXME_HOST/{head}/' /etc/condor/config.d/10_security.config sed -i"" 's/FIXME_PORT/{port}/' /etc/condor/config.d/10_security.config sed -i"" 's/FIXME_DOMAIN/{domain}/' /etc/condor/config.d/10_security.config sed -i"" "s/FIXME_PRIVATE_DOMAIN/$(hostname -d)/" \ /etc/condor/config.d/10_security.config sed -i"" 's/FIXME_OWNER/{owner}/' /etc/condor/config.d/20_workernode.config sed -i"" 's/FIXME_CORE/{core}/' /etc/condor/config.d/20_workernode.config sed -i"" 's/FIXME_MEM/{mem}/' /etc/condor/config.d/20_workernode.config sed -i"" 's/FIXME_START/{start}/' /etc/condor/config.d/20_workernode.config gsutil cp "gs://{bucket}/pool_password" /etc/condor/ chmod 600 /etc/condor/pool_password systemctl enable condor systemctl start condor while :;do condor_reconfig status="$(condor_status | grep "${{HOSTNAME}}")" if [ -n "$status" ];then break fi sleep 10 done date >> /root/condor_started""".format(core=core, mem=mem, swap=swap, disk=disk, image=image, preemptible=preemptible, admin=admin, head=head, port=port, domain=domain, owner=owner, bucket=bucket, start=start) if off_timer != 0: content += """ sleep {off_timer} condor_off -peaceful -startd date >> /root/condor_off""".format(off_timer=off_timer) return content def make_shutdown_script(core, mem, swap, disk, image, preemptible): content = """#!/usr/bin/env bash unset http_proxy preempted=$(\ curl "http://metadata.google.internal/computeMetadata/v1/instance/preempted" \ -H "Metadata-Flavor: Google") if echo "$preemptible"|grep -q error;then preemptible="-" fi echo "{{\\"date\\": $(date +%s), \\"core\\": {core}, \\"mem\\": {mem}, \ \\"swap\\": {swap}, \\"disk\\": {disk}, \\"image\\": \\"{image}\\", \ \\"preemptible\\": {preemptible}, \\"preempted\\": \\"${{preempted}}\\", \ \\"uptime\\": $(cut -d "." -f1 /proc/uptime) \ }}" >>/var/log/shutdown.log""".format(core=core, mem=mem, swap=swap, disk=disk, image=image, preemptible=preemptible) return content PK!Hy !"&gcpm-0.2.11.dist-info/entry_points.txtN+I/N.,()JO.ȵVy\\PK!#q,q,gcpm-0.2.11.dist-info/LICENSE Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [2019] ["Michiru Kaneda "] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. PK!H|n-WYgcpm-0.2.11.dist-info/WHEEL A н#Z;/" bFF]xzwK;<*mTֻ0*Ri.4Vm0[H, JPK!HpL^j gcpm-0.2.11.dist-info/METADATAXms۶O6҉$N&Kډ/J{|9"!5IphE=>~(Nmza8'Wt*ۏ{e4'`\9W{+<(U3nfRHT\ʌυ \%#0ԣ~E5b4Hx;McQh<^p?YH5bgiHU~~;9O0r.1>U:<_z=^>Q-b^vג ujn$xv=Ȇ$a`T F 6=jvͳ4aVVwWp@Mbvv/va62EKd%{>!EjD_s:gZnh8[=t^)G̳Jn0dC^eŻ@`#VUY !"&F_**0tGL VC>7Vw$;d*a&h}yP=U>E AM(#>9νPuL[c.Q !zCK=Z4OMT4ưu᤺B ~Ǡvq6?dG (>/V-@JpT^U ̈́BAbఠؘNB0 ,(Km|ԷɲPcbrql)2ǖ \H]x@7K소60SnK&[IxG&jO\/d Dάa^\FÃ3nSod%fAR~׭H/՟.0~Sl; м|f|*+l61i.AYC\ w)43\ (c[!3MB,h7$>v%(&geB⤘j-"K3)h=hq&xa`>mVӤچUcGkW>X B>iv=7woʈ $[CUHQTW0(6*BjSw~Ei9b'T !ŏ +)jP{pq6:9A%P޸O΍OE,9sf͓fԖT&pv~vKI'=09f}b߆crZW4_Of <)77ݭs EDXҷ%MXۓO2`ћzؾ[t:L:`]uq-)A7ˆk)R$(mL\ln?#&bZSJ j!-qv5 iHAt 4\ LMnd p5!|NI,:-CPu Ҡfb7`(Sf~Tb/M,޽ؖ Vc؟Q 3Oy- #}v^EC[(dIk`D1 I7~K8Y7{4Ʒis(Y[Aln5ry;g6b tEu6uv~A hyB]-Z [U:+NrOٗOU -@*1l/һKOtg{߽m:P8.晈M"Ӌ#<[eT,\۞Eݫ'?PK!6 yoogcpm/__init__.pyPK!U=gcpm/__main__.pyPK!yigcpm/__version__.pyPK!ꬂ gcpm/cli.pyPK!#  rgcpm/condor.pyPK!Su5z5z gcpm/core.pyPK!s77 gcpm/files.pyPK!jB jgcpm/gce.pyPK!$t t gcpm/gcs.pyPK!y$gcpm/machine.pyPK!{鰹 gcpm/service.pyPK!0 gcpm/utils.pyPK!Hy !"&gcpm-0.2.11.dist-info/entry_points.txtPK!#q,q,_gcpm-0.2.11.dist-info/LICENSEPK!H|n-WY gcpm-0.2.11.dist-info/WHEELPK!HpL^j  gcpm-0.2.11.dist-info/METADATAPK!H[gcpm-0.2.11.dist-info/RECORDPKL