PK!<<cc_faice/__init__.pyfrom cc_faice.version import VERSION __version__ = VERSION PK!|MMcc_faice/__main__.pyfrom cc_faice.main import main if __name__ == '__main__': exit(main()) PK!cc_faice/agent/__init__.pyPK!|D.SScc_faice/agent/__main__.pyfrom cc_faice.agent.main import main if __name__ == '__main__': exit(main()) PK!cc_faice/agent/cwl/__init__.pyPK!kWWcc_faice/agent/cwl/__main__.pyfrom cc_faice.agent.cwl.main import main if __name__ == '__main__': exit(main()) PK!=cc_faice/agent/cwl/main.pyimport os from uuid import uuid4 from argparse import ArgumentParser from cc_core.commons.files import load_and_read, dump, dump_print, file_extension, is_local from cc_core.commons.cwl import cwl_validation from cc_core.commons.exceptions import exception_format, print_exception from cc_core.commons.mnt_core import module_dependencies, interpreter_dependencies from cc_core.commons.mnt_core import module_destinations, interpreter_destinations, interpreter_command from cc_faice.commons.docker import dump_job, input_volume_mappings, DockerManager, docker_result_check, env_vars DESCRIPTION = 'Run a CommandLineTool as described in a CWL_FILE and its corresponding JOB_FILE with ccagent cwl in a ' \ 'container.' def attach_args(parser): parser.add_argument( 'cwl_file', action='store', type=str, metavar='CWLFILE', help='CWLFILE containing a CLI description (json/yaml) as local PATH or http URL.' ) parser.add_argument( 'job_file', action='store', type=str, metavar='JOBFILE', help='JOBFILE in the CWL job format (json/yaml) as local PATH or http URL.' ) parser.add_argument( '-d', '--debug', action='store_true', help='Write debug info, including detailed exceptions, to stdout.' ) parser.add_argument( '--format', action='store', type=str, metavar='FORMAT', choices=['json', 'yaml', 'yml'], default='yaml', help='Specify FORMAT for generated data as one of [json, yaml, yml]. Default is yaml.' ) parser.add_argument( '--disable-pull', action='store_true', help='Do not try to pull Docker images.' ) parser.add_argument( '--leave-container', action='store_true', help='Do not delete Docker container used by jobs after they exit.' ) parser.add_argument( '--preserve-environment', action='append', type=str, metavar='ENVVAR', help='Preserve specific environment variables when running container. May be provided multiple times.' ) parser.add_argument( '--prefix', action='store', type=str, metavar='PREFIX', default='faice_', help='PREFIX for files dumped to storage, default is "faice_".' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() result = run(**args.__dict__) format = args.__dict__['format'] debug = args.__dict__['debug'] if debug: dump_print(result, format) if result['state'] == 'succeeded': return 0 return 1 def run(cwl_file, job_file, format, disable_pull, leave_container, preserve_environment, prefix, **_ ): result = { 'container': { 'command': None, 'name': None, 'volumes': { 'readOnly': None, 'readWrite': None }, 'ccagent': None }, 'debugInfo': None, 'state': 'succeeded' } try: import cc_core.agent.cwl.__main__ source_paths, c_source_paths = module_dependencies([cc_core.agent.cwl.__main__]) module_mounts = module_destinations(source_paths) interpreter_deps = interpreter_dependencies(c_source_paths) interpreter_mounts = interpreter_destinations(interpreter_deps) cwl_data = load_and_read(cwl_file, 'CWLFILE') job_data = load_and_read(job_file, 'JOBFILE') cwl_validation(cwl_data, job_data, docker_requirement=True) ext = file_extension(format) input_dir = os.path.split(os.path.expanduser(job_file))[0] outputs_dir = 'outputs' dumped_job_file = '{}job.{}'.format(prefix, ext) dumped_cwl_file = '{}.cwl'.format(prefix) if not is_local(cwl_file): dump(cwl_data, format, dumped_cwl_file) cwl_file = dumped_cwl_file mapped_input_dir = '/cwl/inputs' mapped_outputs_dir = '/cwl/outputs' mapped_cwl_file = '/cwl/cli.cwl' mapped_job_file = '/cwl/job.{}'.format(ext) dumped_job_data = dump_job(job_data, mapped_input_dir) ro_mappings = input_volume_mappings(job_data, dumped_job_data, input_dir) ro_mappings += [ [os.path.abspath(cwl_file), mapped_cwl_file], [os.path.abspath(dumped_job_file), mapped_job_file] ] ro_mappings += module_mounts ro_mappings += interpreter_mounts rw_mappings = [[os.path.abspath(outputs_dir), mapped_outputs_dir]] result['container']['volumes']['readOnly'] = ro_mappings result['container']['volumes']['readWrite'] = rw_mappings container_name = str(uuid4()) result['container']['name'] = container_name docker_manager = DockerManager() image = cwl_data['requirements']['DockerRequirement']['dockerPull'] if not disable_pull: docker_manager.pull(image) command = interpreter_command() command += [ '-m', 'cc_core.agent.cwl', mapped_cwl_file, mapped_job_file, '--debug', '--format=json', '--leave-directories' ] command = ' '.join([str(c) for c in command]) command = "/bin/sh -c '{}'".format(command) result['container']['command'] = command if not os.path.exists(outputs_dir): os.makedirs(outputs_dir) dump(dumped_job_data, format, dumped_job_file) environment = env_vars(preserve_environment) ccagent_data = docker_manager.run_container( container_name, image, command, ro_mappings, rw_mappings, mapped_outputs_dir, leave_container, None, environment ) result['container']['ccagent'] = ccagent_data[0] docker_result_check(ccagent_data) except Exception as e: result['debugInfo'] = exception_format() result['state'] = 'failed' print_exception(e) return result PK!%cc_faice/agent/main.pyfrom collections import OrderedDict from cc_faice.agent.cwl.main import main as cwl_main from cc_faice.agent.red.main import main as red_main from cc_faice.agent.cwl.main import DESCRIPTION as CWL_DESCRIPTION from cc_faice.agent.red.main import DESCRIPTION as RED_DESCRIPTION from cc_core.commons.cli_modes import cli_modes SCRIPT_NAME = 'faice agent' TITLE = 'modes' DESCRIPTION = 'Run a RED experiment or a CWL CommandLineTool.' MODES = OrderedDict([ ('cwl', {'main': cwl_main, 'description': CWL_DESCRIPTION}), ('red', {'main': red_main, 'description': RED_DESCRIPTION}) ]) def main(): cli_modes(SCRIPT_NAME, TITLE, DESCRIPTION, MODES) PK!cc_faice/agent/red/__init__.pyPK!WWcc_faice/agent/red/__main__.pyfrom cc_faice.agent.red.main import main if __name__ == '__main__': exit(main()) PK!/XG/G/cc_faice/agent/red/main.pyimport os import stat from uuid import uuid4 from argparse import ArgumentParser from cc_core.commons.files import load_and_read, dump, dump_print, file_extension, is_local from cc_core.commons.exceptions import exception_format, RedValidationError, print_exception, ArgumentError from cc_core.commons.red import red_validation, red_get_mount_connectors from cc_core.commons.templates import fill_validation, fill_template, inspect_templates_and_secrets from cc_core.commons.engines import engine_validation, engine_to_runtime from cc_core.commons.gpu_info import get_gpu_requirements, match_gpus, get_devices from cc_core.commons.mnt_core import module_dependencies, interpreter_dependencies from cc_core.commons.mnt_core import module_destinations, interpreter_destinations, interpreter_command from cc_faice.commons.docker import DockerManager, docker_result_check, env_vars DESCRIPTION = 'Run an experiment as described in a REDFILE with ccagent red in a container.' def attach_args(parser): parser.add_argument( 'red_file', action='store', type=str, metavar='REDFILE', help='REDFILE (json or yaml) containing an experiment description as local PATH or http URL.' ) parser.add_argument( '-v', '--variables', action='store', type=str, metavar='VARFILE', help='VARFILE (json or yaml) containing key-value pairs for variables in REDFILE as ' 'local PATH or http URL.' ) parser.add_argument( '-o', '--outputs', action='store_true', help='Enable connectors specified in the RED FILE outputs section.' ) parser.add_argument( '-d', '--debug', action='store_true', help='Write debug info, including detailed exceptions, to stdout.' ) parser.add_argument( '--format', action='store', type=str, metavar='FORMAT', choices=['json', 'yaml', 'yml'], default='yaml', help='Specify FORMAT for generated data as one of [json, yaml, yml]. Default is yaml.' ) parser.add_argument( '--disable-pull', action='store_true', help='Do not try to pull Docker images.' ) parser.add_argument( '--leave-container', action='store_true', help='Do not delete Docker container used by jobs after they exit.' ) parser.add_argument( '--preserve-environment', action='append', type=str, metavar='ENVVAR', help='Preserve specific environment variables when running container. May be provided multiple times.' ) parser.add_argument( '--non-interactive', action='store_true', help='Do not ask for RED variables interactively.' ) parser.add_argument( '--insecure', action='store_true', help='Enable SYS_ADMIN capabilities in container, if REDFILE contains connectors performing FUSE mounts.' ) parser.add_argument( '--prefix', action='store', type=str, metavar='PREFIX', default='faice_', help='PREFIX for files dumped to storage, default is "faice_".' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() result = run(**args.__dict__) format = args.__dict__['format'] debug = args.__dict__['debug'] if debug: dump_print(result, format) if result['state'] == 'succeeded': return 0 return 1 def run(red_file, variables, outputs, format, disable_pull, leave_container, preserve_environment, non_interactive, prefix, insecure, **_ ): result = { 'containers': [], 'debugInfo': None, 'state': 'succeeded' } secret_values = None ext = file_extension(format) dumped_variables_file = '{}variables.{}'.format(prefix, ext) dumped_red_file = '{}red.{}'.format(prefix, ext) try: import cc_core.agent.red.__main__ source_paths, c_source_paths = module_dependencies([cc_core.agent.red.__main__]) module_mounts = module_destinations(source_paths) interpreter_deps = interpreter_dependencies(c_source_paths) interpreter_mounts = interpreter_destinations(interpreter_deps) red_data = load_and_read(red_file, 'REDFILE') ignore_outputs = not outputs red_validation(red_data, ignore_outputs, container_requirement=True) mount_connectors = red_get_mount_connectors(red_data, ignore_outputs) is_mounting = False if mount_connectors: if not insecure: raise Exception('The following inputs are mounting directories {}.\nTo enable mounting inside ' 'a docker container run faice with --insecure (see --help).\n' 'Be aware that this will enable SYS_ADMIN capabilities in order to enable FUSE mounts.' .format(mount_connectors)) is_mounting = True engine_validation(red_data, 'container', ['docker', 'nvidia-docker'], 'faice agent red') # delete unused keys to avoid unnecessary variables handling if 'execution' in red_data: del red_data['execution'] if disable_pull and 'auth' in red_data['container']['settings']['image']: del red_data['container']['settings']['image']['auth'] if not outputs: if 'outputs' in red_data: del red_data['outputs'] for batch in red_data.get('batches', []): if 'outputs' in batch: del batch['outputs'] else: # check if outputs section is available if 'inputs' in red_data: if 'outputs' not in red_data: raise ArgumentError( '-o/--outputs argument is set, but no outputs section with RED connector settings is defined ' 'in REDFILE' ) else: for i, batch in enumerate(red_data['batches']): if 'outputs' not in batch: raise ArgumentError( '-o/--outputs argument is set, but no outputs section with RED connector settings is ' 'defined in batch {} of REDFILE'.format(i) ) variables_data = None if variables is not None: variables_data = load_and_read(variables, 'VARFILE') fill_validation(variables_data) template_keys_and_values, secret_values, incomplete_variables_file = inspect_templates_and_secrets( red_data, variables_data, non_interactive ) if incomplete_variables_file: dump(template_keys_and_values, format, dumped_variables_file) variables = dumped_variables_file elif variables is not None and not is_local(variables): dump(variables_data, format, dumped_variables_file) variables = dumped_variables_file if not is_local(red_file): dump(red_data, format, dumped_red_file) red_file = dumped_red_file docker_manager = DockerManager() runtime = engine_to_runtime(red_data['container']['engine']) gpu_requirements = get_gpu_requirements(red_data['container']['settings'].get('gpus')) gpu_devices = get_devices(red_data['container']['engine']) gpus = match_gpus(gpu_devices, gpu_requirements) ram = red_data['container']['settings'].get('ram') image = red_data['container']['settings']['image']['url'] registry_auth = red_data['container']['settings']['image'].get('auth') registry_auth = fill_template(registry_auth, template_keys_and_values, True, True) if not disable_pull: docker_manager.pull(image, auth=registry_auth) except RedValidationError as e: result['debugInfo'] = exception_format(secret_values=secret_values) result['state'] = 'failed' print_exception(e, secret_values) return result except Exception as e: result['debugInfo'] = exception_format() result['state'] = 'failed' print_exception(e, secret_values) return result batches = [None] if 'batches' in red_data: batches = list(range(len(red_data['batches']))) for batch in batches: container_result = { 'command': None, 'name': None, 'volumes': { 'readOnly': None, 'readWrite': None }, 'ccagent': None, 'debugInfo': None, 'state': 'succeeded' } result['containers'].append(container_result) try: if batch is None: outputs_dir = 'outputs' else: outputs_dir = 'outputs_{}'.format(batch) mapped_outputs_dir = '/red/outputs' mapped_red_file = '/red/red.{}'.format(ext) mapped_variables_file = '/red/variables.{}'.format(ext) container_name = str(uuid4()) container_result['name'] = container_name command = interpreter_command() command += [ '-m', 'cc_core.agent.red', mapped_red_file, '--debug', '--format=json', '--leave-directories' ] if batch is not None: command.append('--batch={}'.format(batch)) if outputs: command.append('--outputs') if template_keys_and_values and variables is not None: command.append('--variables={}'.format(mapped_variables_file)) command = ' '.join([str(c) for c in command]) command = "/bin/sh -c '{}'".format(command) container_result['command'] = command ro_mappings = [ [os.path.abspath(red_file), mapped_red_file], ] ro_mappings += module_mounts ro_mappings += interpreter_mounts rw_mappings = [] work_dir = None old_outputs_dir_permissions = None if not outputs: rw_mappings.append([os.path.abspath(outputs_dir), mapped_outputs_dir]) work_dir = mapped_outputs_dir if not os.path.exists(outputs_dir): os.makedirs(outputs_dir) if os.getuid() != 1000: old_outputs_dir_permissions = os.stat(outputs_dir).st_mode os.chmod(outputs_dir, old_outputs_dir_permissions | stat.S_IWOTH) if template_keys_and_values and variables is not None: ro_mappings.append([os.path.abspath(variables), mapped_variables_file]) container_result['volumes']['readOnly'] = ro_mappings container_result['volumes']['readWrite'] = rw_mappings environment = env_vars(preserve_environment) ccagent_data = docker_manager.run_container( name=container_name, image=image, command=command, ro_mappings=ro_mappings, rw_mappings=rw_mappings, work_dir=work_dir, leave_container=leave_container, ram=ram, runtime=runtime, gpus=gpus, environment=environment, enable_fuse=is_mounting ) if old_outputs_dir_permissions is not None: os.chmod(outputs_dir, old_outputs_dir_permissions) container_result['ccagent'] = ccagent_data[0] docker_result_check(ccagent_data) except Exception as e: container_result['debugInfo'] = exception_format() container_result['state'] = 'failed' result['state'] = 'failed' print_exception(e, secret_values) break if os.path.exists(dumped_variables_file): os.remove(dumped_variables_file) return result PK!cc_faice/commons/__init__.pyPK!)!cc_faice/commons/compatibility.pyimport cc_core.version import cc_faice.version from cc_core.commons.files import wrapped_print def version_validation(): compatible = True if not cc_core.version.RED_VERSION == cc_faice.version.RED_VERSION: compatible = False if not cc_core.version.CC_VERSION == cc_faice.version.CC_VERSION: compatible = False if not compatible: wrapped_print([ 'WARNING: cc-faice {0}.{1}.{2} is not compatible with cc-core {3}.{4}.{5}. ' 'Install cc-core {0}.{1}.x or cc-faice {3}.{4}.y'.format( cc_faice.version.RED_VERSION, cc_faice.version.CC_VERSION, cc_faice.version.PACKAGE_VERSION, cc_core.version.RED_VERSION, cc_core.version.CC_VERSION, cc_core.version.PACKAGE_VERSION ) ], error=True) PK!HI\jjcc_faice/commons/docker.pyimport os import docker from docker.errors import DockerException from cc_core.commons.cwl import location from cc_core.commons.files import read from cc_core.commons.exceptions import AgentError from cc_core.commons.engines import DEFAULT_DOCKER_RUNTIME, NVIDIA_DOCKER_RUNTIME from cc_core.commons.gpu_info import set_nvidia_environment_variables DOCKER_SOCKET = 'unix://var/run/docker.sock' def docker_result_check(ccagent_data): if ccagent_data[0]['state'] != 'succeeded': raise AgentError('ccagent did not succeed\n\nError of Agent:\n{}'.format(ccagent_data[1])) def dump_job(job_data, mapped_input_dir): job = {} for key, arg in job_data.items(): val = arg if isinstance(arg, list): val = [] for index, i in enumerate(arg): if isinstance(i, dict): if (i.get('class') == 'File') or (i.get('class') == 'Directory'): path = os.path.join(mapped_input_dir, '{}_{}'.format(key, index)) elem = { 'class': i['class'], 'path': path } listing = i.get('listing') if listing: elem['listing'] = listing val.append(elem) else: val.append(i) elif isinstance(arg, dict): if (arg.get('class') == 'File') or (arg.get('class') == 'Directory'): path = os.path.join(mapped_input_dir, key) val = { 'class': arg['class'], 'path': path } listing = arg.get('listing') if listing: val['listing'] = listing job[key] = val return job def input_volume_mappings(job_data, dumped_job_data, input_dir): volumes = [] for key, val in job_data.items(): if isinstance(val, list) and len(val) > 0 and isinstance(val[0], dict): for i, e in enumerate(val): file_path = location(key, e) if not os.path.isabs(file_path): file_path = os.path.join(os.path.expanduser(input_dir), file_path) container_file_path = dumped_job_data[key][i]['path'] volumes.append([os.path.abspath(file_path), container_file_path]) if isinstance(val, dict): file_path = location(key, val) if not os.path.isabs(file_path): file_path = os.path.join(os.path.expanduser(input_dir), file_path) container_file_path = dumped_job_data[key]['path'] volumes.append([os.path.abspath(file_path), container_file_path]) return volumes def env_vars(preserve_environment): if preserve_environment is None: return {} environment = {} for var in preserve_environment: if var in os.environ: environment[var] = os.environ[var] return environment class DockerManager: def __init__(self): try: self._client = docker.DockerClient( base_url=DOCKER_SOCKET, version='auto' ) except DockerException as e: raise DockerException('Could not connect to docker daemon at "{}". Is the docker daemon running?' .format(DOCKER_SOCKET)) def pull(self, image, auth=None): self._client.images.pull(image, auth_config=auth) def run_container(self, name, image, command, ro_mappings, rw_mappings, work_dir, leave_container, ram, runtime=DEFAULT_DOCKER_RUNTIME, gpus=None, environment=None, enable_fuse=False ): binds = {} if environment is None: environment = {} if gpus is None: gpus = [] for host_vol, container_vol in ro_mappings: binds[host_vol] = { 'bind': container_vol, 'mode': 'ro' } for host_vol, container_vol in rw_mappings: binds[host_vol] = { 'bind': container_vol, 'mode': 'rw' } mem_limit = None if ram is not None: mem_limit = '{}m'.format(ram) if runtime == NVIDIA_DOCKER_RUNTIME: set_nvidia_environment_variables(environment, map(lambda gpu: gpu.device_id, gpus)) devices = [] capabilities = [] if enable_fuse: devices.append('/dev/fuse') capabilities.append('SYS_ADMIN') c = self._client.containers.create( image, command, volumes=binds, name=name, user='1000:1000', working_dir=work_dir, mem_limit=mem_limit, memswap_limit=mem_limit, runtime=runtime, environment=environment, devices=devices, cap_add=capabilities ) c.start() c.wait() std_out = c.logs(stdout=True, stderr=False) std_err = c.logs(stdout=False, stderr=True) if not leave_container: c.remove() std_out = std_out.decode('utf-8') std_err = std_err.decode('utf-8') try: std_out = read(std_out, 'CCAGENT_OUTPUT') except Exception: raise AgentError(std_err) return std_out, std_err PK!cc_faice/convert/__init__.pyPK!WUUcc_faice/convert/__main__.pyfrom cc_faice.convert.main import main if __name__ == '__main__': exit(main()) PK!$cc_faice/convert/batches/__init__.pyPK!#1:]]$cc_faice/convert/batches/__main__.pyfrom cc_faice.convert.batches.main import main if __name__ == '__main__': exit(main()) PK!Xpw cc_faice/convert/batches/main.pyfrom argparse import ArgumentParser from cc_core.commons.files import load_and_read, file_extension, wrapped_print, dump from cc_core.commons.red import red_validation, convert_batch_experiment DESCRIPTION = 'Convert batches from a single REDFILE into separate files containing only one batch each.' def attach_args(parser): parser.add_argument( 'red_file', action='store', type=str, metavar='REDFILE', help='REDFILE (json or yaml) containing an experiment description as local PATH or http URL.' ) parser.add_argument( '--format', action='store', type=str, metavar='FORMAT', choices=['json', 'yaml', 'yml'], default='yaml', help='Specify FORMAT for generated data as one of [json, yaml, yml]. Default is yaml.' ) parser.add_argument( '--prefix', action='store', type=str, metavar='PREFIX', default='faice_', help='PREFIX for files dumped to storage, default is "faice_".' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() return run(**args.__dict__) def run(red_file, format, prefix): ext = file_extension(format) red_data = load_and_read(red_file, 'REDFILE') red_validation(red_data, False) if 'batches' not in red_data: wrapped_print([ 'ERROR: REDFILE does not contain batches.' ], error=True) return 1 for batch in range(len(red_data['batches'])): batch_data = convert_batch_experiment(red_data, batch) dumped_batch_file = '{}batch_{}.{}'.format(prefix, batch, ext) dump(batch_data, format, dumped_batch_file) return 0 PK! cc_faice/convert/cwl/__init__.pyPK!IYY cc_faice/convert/cwl/__main__.pyfrom cc_faice.convert.cwl.main import main if __name__ == '__main__': exit(main()) PK!9!cc_faice/convert/cwl/main.pyfrom argparse import ArgumentParser from jsonschema import validate from jsonschema.exceptions import ValidationError from cc_core.commons.files import dump_print, load_and_read, wrapped_print from cc_core.commons.schemas.cwl import cwl_schema DESCRIPTION = 'Read cli section of a REDFILE and write it to stdout in the specified format.' def attach_args(parser): parser.add_argument( 'red_file', action='store', type=str, metavar='REDFILE', help='REDFILE (json or yaml) containing an experiment description as local PATH or http URL.' ) parser.add_argument( '--format', action='store', type=str, metavar='FORMAT', choices=['json', 'yaml', 'yml'], default='yaml', help='Specify FORMAT for generated data as one of [json, yaml, yml]. Default is yaml.' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() return run(**args.__dict__) def run(red_file, format): red_data = load_and_read(red_file, 'REDFILE') if 'cli' not in red_data: wrapped_print([ 'ERROR: REDFILE does not contain cli section.' ], error=True) return 1 cli = red_data['cli'] try: validate(cli, cwl_schema) except ValidationError as e: wrapped_print([ 'ERROR: REDFILE does not comply with jsonschema.', e.context ], error=True) return 1 dump_print(cli, format) PK!#cc_faice/convert/format/__init__.pyPK!\\#cc_faice/convert/format/__main__.pyfrom cc_faice.convert.format.main import main if __name__ == '__main__': exit(main()) PK! Gcc_faice/convert/format/main.pyfrom argparse import ArgumentParser from cc_core.commons.files import dump_print, load_and_read DESCRIPTION = 'Read an arbitrary JSON or YAML file and convert it into the specified format.' def attach_args(parser): parser.add_argument( 'file', action='store', type=str, metavar='FILE', help='FILE (json or yaml) to be converted into specified FORMAT as local path or http url.' ) parser.add_argument( '--format', action='store', type=str, metavar='FORMAT', choices=['json', 'yaml', 'yml'], default='yaml', help='Specify FORMAT for generated data as one of [json, yaml, yml]. Default is yaml.' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() run(**args.__dict__) return 0 def run(file, format): data = load_and_read(file, 'FILE') dump_print(data, format) PK!i/wwcc_faice/convert/main.pyfrom collections import OrderedDict from cc_faice.convert.batches.main import main as batches_main from cc_faice.convert.format.main import main as format_main from cc_faice.convert.cwl.main import main as cwl_main from cc_faice.convert.batches.main import DESCRIPTION as BATCHES_DESCRIPTION from cc_faice.convert.format.main import DESCRIPTION as FORMAT_DESCRIPTION from cc_faice.convert.cwl.main import DESCRIPTION as CWL_DESCRIPTION from cc_core.commons.cli_modes import cli_modes SCRIPT_NAME = 'faice convert' TITLE = 'modes' DESCRIPTION = 'File conversion utilities.' MODES = OrderedDict([ ('batches', {'main': batches_main, 'description': BATCHES_DESCRIPTION}), ('format', {'main': format_main, 'description': FORMAT_DESCRIPTION}), ('cwl', {'main': cwl_main, 'description': CWL_DESCRIPTION}), ]) def main(): cli_modes(SCRIPT_NAME, TITLE, DESCRIPTION, MODES) PK!cc_faice/exec/__init__.pyPK!mbRRcc_faice/exec/__main__.pyfrom cc_faice.exec.main import main if __name__ == '__main__': exit(main()) PK!|ȼ cc_faice/exec/main.pyfrom argparse import ArgumentParser import requests from cc_core.commons.files import load_and_read, wrapped_print, dump_print from cc_core.commons.red import red_validation from cc_core.commons.templates import inspect_templates_and_secrets, fill_template, fill_validation from cc_core.commons.engines import engine_validation from cc_faice.agent.red.main import run as run_faice_agent_red DESCRIPTION = 'Execute experiment according to execution engine defined in REDFILE.' def attach_args(parser): parser.add_argument( 'red_file', action='store', type=str, metavar='REDFILE', help='REDFILE (json or yaml) containing an experiment description as local PATH or http URL.' ) parser.add_argument( '-v', '--variables', action='store', type=str, metavar='VARFILE', help='VARFILE (json or yaml) containing key-value pairs for variables in REDFILE as ' 'local PATH or http URL.' ) parser.add_argument( '--non-interactive', action='store_true', help='Do not ask for RED variables interactively.' ) parser.add_argument( '--format', action='store', type=str, metavar='FORMAT', choices=['json', 'yaml', 'yml'], default='yaml', help='Specify FORMAT for generated data as one of [json, yaml, yml]. Default is yaml.' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() return run(**args.__dict__) def run(red_file, variables, non_interactive, format): red_data = load_and_read(red_file, 'REDFILE') red_validation(red_data, False) engine_validation(red_data, 'execution', ['ccfaice', 'ccagency'], 'faice exec') # exec via CC-FAICE # equivalent to `faice agent red --debug --outputs` if red_data['execution']['engine'] == 'ccfaice': insecure = red_data['execution']['settings'].get('insecure') result = run_faice_agent_red(red_file, variables, True, format, None, None, None, None, None, insecure) dump_print(result, 'yaml') if result['state'] == 'succeeded': return 0 return 1 # exec via CC-Agency fill_data = None if variables: fill_data = load_and_read(variables, 'VARFILE') fill_validation(fill_data) template_keys_and_values, secret_values, _ = inspect_templates_and_secrets(red_data, fill_data, non_interactive) red_data = fill_template(red_data, template_keys_and_values, False, False) red_data_removed_underscores = fill_template(red_data, template_keys_and_values, False, True) if 'access' not in red_data['execution']['settings']: wrapped_print([ 'ERROR: cannot send RED data to CC-Agency if access settings are not defined.' ], error=True) return 1 if 'auth' not in red_data['execution']['settings']['access']: wrapped_print([ 'ERROR: cannot send RED data to CC-Agency if auth is not defined in access settings.' ], error=True) return 1 access = red_data_removed_underscores['execution']['settings']['access'] r = requests.post( '{}/red'.format(access['url'].strip('/')), auth=( access['auth']['username'], access['auth']['password'] ), json=red_data ) try: r.raise_for_status() except: wrapped_print(r.text.split('\n'), error=True) return 1 dump_print(r.json(), format) return 0 PK! cc_faice/file_server/__init__.pyPK!VaYY cc_faice/file_server/__main__.pyfrom cc_faice.file_server.main import main if __name__ == '__main__': exit(main()) PK!@u u cc_faice/file_server/main.pyimport os from argparse import ArgumentParser from flask import Flask, send_from_directory, request from werkzeug.utils import secure_filename DESCRIPTION = 'Run a simple http file server for debugging purposes. USE CAREFULLY: this server does not enable ' \ 'encryption and does not verify credentials for authorization.' def attach_args(parser): parser.add_argument( '--bind-host', action='store', type=str, metavar='HOST', default='0.0.0.0', help='Bind server to a network interface like "172.17.0.1" (docker) or "127.0.0.1" (localhost). ' 'Default is "0.0.0.0" (all interfaces).' ) parser.add_argument( '--bind-port', action='store', type=int, metavar='PORT', default=5000, help='Bind server to a tcp port. Default is 5000.' ) parser.add_argument( '-u', '--updir', action='store', type=str, metavar='UPDIR', default=os.getcwd(), help='Specify a directory for file uploads. Default is current working directory.' ) parser.add_argument( '-d', '--downdir', action='store', type=str, metavar='DOWNDIR', default=os.getcwd(), help='Specify a directory for file downloads. Default is current working directory.' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() return run(**args.__dict__) def run(bind_host, bind_port, updir, downdir): app = Flask('faice file-server') @app.route('/', methods=['GET']) def get_file(file_name): """ .. :quickref: API; Download file Download a file specified as from DOWNDIR. .. sourcecode:: http GET / HTTP/1.1 """ file_name = secure_filename(file_name) return send_from_directory(os.path.expanduser(downdir), file_name, as_attachment=True) @app.route('/', methods=['POST']) def post_file(file_name): """ .. :quickref: API; Upload file Upload a file specified as to UPDIR. .. sourcecode:: http POST / HTTP/1.1 """ file_name = secure_filename(file_name) file_path = os.path.join(os.path.expanduser(updir), file_name) with open(file_path, 'wb') as f: f.write(request.data) return '' app.run(host=bind_host, port=bind_port) PK!g3cc_faice/main.pyfrom collections import OrderedDict from cc_faice.version import VERSION from cc_faice.commons.compatibility import version_validation from cc_faice.agent.main import main as agent_main from cc_faice.exec.main import main as exec_main from cc_faice.schema.main import main as schema_main from cc_faice.file_server.main import main as file_server_main from cc_faice.convert.main import main as convert_main from cc_faice.agent.main import DESCRIPTION as AGENT_DESCRIPTION from cc_faice.exec.main import DESCRIPTION as EXEC_DESCRIPTION from cc_faice.schema.main import DESCRIPTION as SCHEMA_DESCRIPTION from cc_faice.file_server.main import DESCRIPTION as FILE_SERVER_DESCRIPTION from cc_faice.convert.main import DESCRIPTION as CONVERT_DESCRIPTION from cc_core.commons.cli_modes import cli_modes SCRIPT_NAME = 'faice' TITLE = 'tools' DESCRIPTION = 'FAICE Copyright (C) 2018 Christoph Jansen. This software is distributed under the AGPL-3.0 ' \ 'LICENSE and is part of the Curious Containers project (https://www.curious-containers.cc).' MODES = OrderedDict([ ('agent', {'main': agent_main, 'description': AGENT_DESCRIPTION}), ('exec', {'main': exec_main, 'description': EXEC_DESCRIPTION}), ('schema', {'main': schema_main, 'description': SCHEMA_DESCRIPTION}), ('convert', {'main': convert_main, 'description': CONVERT_DESCRIPTION}), ('file-server', {'main': file_server_main, 'description': FILE_SERVER_DESCRIPTION}) ]) def main(): version_validation() cli_modes(SCRIPT_NAME, TITLE, DESCRIPTION, MODES, VERSION) PK!cc_faice/schema/__init__.pyPK!:!TTcc_faice/schema/__main__.pyfrom cc_faice.schema.main import main if __name__ == '__main__': exit(main()) PK! cc_faice/schema/list/__init__.pyPK!YY cc_faice/schema/list/__main__.pyfrom cc_faice.schema.list.main import main if __name__ == '__main__': exit(main()) PK!x icc_faice/schema/list/main.pyfrom argparse import ArgumentParser from cc_core.commons.schema_map import schemas from cc_core.commons.files import dump_print DESCRIPTION = 'List of all available jsonschemas defined in cc-core.' def attach_args(parser): parser.add_argument( '--format', action='store', type=str, metavar='FORMAT', choices=['json', 'yaml', 'yml'], default='yaml', help='Specify FORMAT for generated data as one of [json, yaml, yml]. Default is yaml.' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() run(**args.__dict__) return 0 def run(format): dump_print({'schemas': list(schemas.keys())}, format) PK!w^cc_faice/schema/main.pyfrom collections import OrderedDict from cc_faice.schema.list.main import main as list_main from cc_faice.schema.show.main import main as show_main from cc_faice.schema.validate.main import main as validate_main from cc_faice.schema.list.main import DESCRIPTION as LIST_DESCRIPTION from cc_faice.schema.show.main import DESCRIPTION as SHOW_DESCRIPTION from cc_faice.schema.validate.main import DESCRIPTION as VALIDATE_DESCRIPTION from cc_core.commons.cli_modes import cli_modes SCRIPT_NAME = 'faice schema' TITLE = 'modes' DESCRIPTION = 'List or show jsonschemas defined in cc-core.' MODES = OrderedDict([ ('list', {'main': list_main, 'description': LIST_DESCRIPTION}), ('show', {'main': show_main, 'description': SHOW_DESCRIPTION}), ('validate', {'main': validate_main, 'description': VALIDATE_DESCRIPTION}) ]) def main(): cli_modes(SCRIPT_NAME, TITLE, DESCRIPTION, MODES) PK! cc_faice/schema/show/__init__.pyPK!oYY cc_faice/schema/show/__main__.pyfrom cc_faice.schema.show.main import main if __name__ == '__main__': exit(main()) PK!0ģcc_faice/schema/show/main.pyimport sys from argparse import ArgumentParser from cc_core.commons.schema_map import schemas from cc_core.commons.files import dump_print DESCRIPTION = 'Write a jsonschema to stdout.' def attach_args(parser): parser.add_argument( 'schema', action='store', type=str, metavar='SCHEMA', help='SCHEMA as in "faice schemas list".' ) parser.add_argument( '--format', action='store', type=str, metavar='FORMAT', choices=['json', 'yaml', 'yml'], default='yaml', help='Specify FORMAT for generated data as one of [json, yaml, yml]. Default is yaml.' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() return run(**args.__dict__) def run(schema, format): if schema not in schemas: print('Schema "{}" not found. Use "faice schema list" for available schemas.'.format(schema), file=sys.stderr) return 1 dump_print(schemas[schema], format) return 0 PK!$cc_faice/schema/validate/__init__.pyPK!J]]$cc_faice/schema/validate/__main__.pyfrom cc_faice.schema.validate.main import main if __name__ == '__main__': exit(main()) PK! 9 cc_faice/schema/validate/main.pyimport sys import jsonschema from argparse import ArgumentParser from cc_core.commons.schema_map import schemas from cc_core.commons.files import load_and_read DESCRIPTION = 'Validate data against schema. Returns code 0 if data is valid.' def attach_args(parser): parser.add_argument( 'schema', action='store', type=str, metavar='SCHEMA', help='SCHEMA as in "faice schemas list".' ) parser.add_argument( 'file', action='store', type=str, metavar='FILE', help='FILE (json or yaml) to be validated as local path or http url.' ) def main(): parser = ArgumentParser(description=DESCRIPTION) attach_args(parser) args = parser.parse_args() return run(**args.__dict__) def run(schema, file): if schema not in schemas: print('Schema "{}" not found. Use "faice schema list" for available schemas.'.format(schema), file=sys.stderr) return 1 data = load_and_read(file, 'FILE') jsonschema.validate(data, schemas[schema]) return 0 PK!ecc_faice/version.pyRED_VERSION = '6' CC_VERSION = '1' PACKAGE_VERSION = '0' VERSION = '{}.{}.{}'.format(RED_VERSION, CC_VERSION, PACKAGE_VERSION) PK!H (,)cc_faice-6.1.0.dist-info/entry_points.txtN+I/N.,()JKLNMN3r3@PK!ۆۆ cc_faice-6.1.0.dist-info/LICENSE GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . PK!HnHTUcc_faice-6.1.0.dist-info/WHEEL A н#Z;/"d&F[xzw@Zpy3Fv]\fi4WZ^EgM_-]#0(q7PK!HszCh!cc_faice-6.1.0.dist-info/METADATAT]sF}ׯ Zh;Sj$Ӈeu]uwpp츓k@{=~^ w<ZEp 1!”Kڬܕy!`6@᎐UrB ĥRKE0 WQQU ZFl@Rm H\ Eܤ8P%CLI'`1M?ScX5eqQ8 &̩(v0*ɠtm"7|bqBs.׍ۇ+4T,`roĢznK qƭDRyЇ(?f0((F'70HS4&Hy*Duĺ5zmxK9W뒊-_Ƴo_轚 wE-_Q >\7.zsdzȷ>I#hs/ X,x=`AjBH;"{uJ ./͓^y ,NC4k6 7\F~CUP8nE&z 8NC.D0|Eq^?f^b] V}+A|Ywa J;gbK4P.?°!+* |wI u'$*[kZ, mV* Rm1ϵT Us:Eth qOS/ VTW}[V{[oT8g!7` n&ϔZ]z۫O`>÷;iߚիW9:4PK!H -;cc_faice-6.1.0.dist-info/RECORD׹m!p  =U_uٷvjWE~QM>nk_hz,[n]̚YJo<䗠܇  ?_T̉:r:YFP"VhHdI3~VFrзqMfr,k\w{ѫuzzjM2!(ɾngcG&ԏAs'J(ˋz-X{HNy e.FkM *JS5zԒ,eb.x(88_>y,ʆ0]G838PAWz$$67I2]bA+ $UCݐ _O-PZ]w 5|Tݠ9A'wz15+#0eu _cU>/Ū}-u^˓\ژZɘܟHqI"^pۻ\d xM$3:z1iIz%)7moۙ;8g?MF%އ1@Ny-ctMUhgp;.e ^A2a'jl%@vlŮR3eK"ךZ~λ1Ck ⓖ}nO,''XԅHg. /™Fdyy>s-v'g[66#s=kļx1}{')' =nu?1i7(lhShHmfV~M>s_I+Fyd)h޲oPj>va;EPId= LA&@dI/nb-`h0ݙ,l ةwʍ͉k'^3LهW;>$eGse¬즔$W4=Q]/G`ysiW%g4ZJf1¬Չz oзI?o~6o۸?U̜̽,/eDlj̮I{_Y^,w J'<)gU oMd"sLP߲J