def preinstalls(): message = flask.request.get_json(force=True, silent=True) if message and not isinstance(message, dict): return error() runtime = message['runtime'] localhost_handler = LocalhostHandler(message) runtime_meta = localhost_handler.create_runtime(runtime) response = flask.jsonify(runtime_meta) response.status_code = 200 return response
def preinstalls(): message = flask.request.get_json(force=True, silent=True) if message and not isinstance(message, dict): return error() runtime = message['runtime'] logger.info("Extracting preinstalled Python modules from {}".format(runtime)) localhost_handler = LocalhostHandler(message) runtime_meta = localhost_handler.create_runtime(runtime) response = flask.jsonify(runtime_meta) response.status_code = 200 return response
def preinstalls(): message = flask.request.get_json(force=True, silent=True) if message and not isinstance(message, dict): return error('The action did not receive a dictionary as an argument.') try: runtime = message['runtime'] verify_runtime_name(runtime) except Exception as e: return error(str(e)) localhost_handler = LocalhostHandler(message) runtime_meta = localhost_handler.create_runtime(runtime) response = flask.jsonify(runtime_meta) response.status_code = 200 return response
def preinstalls(): payload = flask.request.get_json(force=True, silent=True) if payload and not isinstance(payload, dict): return error('The action did not receive a dictionary as an argument.') try: runtime = payload['runtime'] verify_runtime_name(runtime) except Exception as e: return error(str(e)) pull_runtime = STANDALONE_CONFIG.get('pull_runtime', False) localhost_handler = LocalhostHandler({'runtime': runtime, 'pull_runtime': pull_runtime}) runtime_meta = localhost_handler.create_runtime(runtime) response = flask.jsonify(runtime_meta) response.status_code = 200 return response
def preinstalls(): payload = flask.request.get_json(force=True, silent=True) if payload and not isinstance(payload, dict): return error('The action did not receive a dictionary as an argument.') try: runtime = payload['runtime'] verify_runtime_name(runtime) except Exception as e: return error(str(e)) pull_runtime = standalone_config.get('pull_runtime', False) lh = LocalhostHandler({'runtime': runtime, 'pull_runtime': pull_runtime}) runtime_meta = lh.create_runtime(runtime) if 'lithops_version' in runtime_meta: logger.debug("Runtime metdata extracted correctly: Lithops " f"{runtime_meta['lithops_version']}") response = flask.jsonify(runtime_meta) response.status_code = 200 return response