def read_config()

in source/src/molecule-unfolding/lambda/TaskParametersLambda/app.py [0:0]


def read_config(s3_bucket, s3_prefix):
    config_file = f"{s3_prefix}/config/default.json"
    config = None
    global default_hpc_resources
    global default_model_params
    global default_devices_arns
    global default_opt_params
    global MAX_M
    try:
        config = read_as_json(s3_bucket, config_file)

        if 'hpcResources' in config:
            default_hpc_resources = config['hpcResources']
            log.info(f"set default_hpc_resources={default_hpc_resources} by config")
        if 'modelParams' in config:
            default_model_params = config['modelParams']
            log.info(f"set default_model_params={default_model_params} by config")
        if 'devicesArns' in config:
            default_devices_arns = config['devicesArns']
            log.info(f"set default_devices_arns={default_devices_arns} by config")
        if 'optParams' in config:
            default_opt_params = config['optParams']
            log.info(f"set default_opt_params={default_opt_params} by config")
        if 'MAX_M' in config:
            MAX_M = config['MAX_M']
            log.info(f"set MAX_M={MAX_M} by config")
    except Exception as e:
        log.info(f"cannot find {config_file}")
        pass