def _create_run(): request_message = _get_request_message(CreateRun()) tags = [RunTag(tag.key, tag.value) for tag in request_message.tags] run = _get_store().create_run(experiment_id=request_message.experiment_id, user_id=request_message.user_id, start_time=request_message.start_time, tags=tags) response_message = CreateRun.Response() response_message.run.MergeFrom(run.to_proto()) response = Response(mimetype='application/json') response.set_data(message_to_json(response_message)) return response
def _create_run(): request_message = _get_request_message(CreateRun()) user_id = flask_login.current_user.id tags = [RunTag(tag.key, tag.value) for tag in request_message.tags] run = _get_tracking_store().create_run( experiment_id=request_message.experiment_id, user_id=user_id, start_time=request_message.start_time, tags=tags, ) response_message = CreateRun.Response() response_message.run.MergeFrom(run.to_proto()) response = Response(mimetype="application/json") response.set_data(message_to_json(response_message)) return response
def _create_run(): request_message = _get_request_message(CreateRun()) tags = [RunTag(tag.key, tag.value) for tag in request_message.tags] run = store.create_run(experiment_id=request_message.experiment_id, user_id=request_message.user_id, run_name=request_message.run_name, source_type=request_message.source_type, source_name=request_message.source_name, entry_point_name=request_message.entry_point_name, start_time=request_message.start_time, source_version=request_message.source_version, tags=tags) response_message = CreateRun.Response() response_message.run.MergeFrom(run.to_proto()) response = Response(mimetype='application/json') response.set_data( MessageToJson(response_message, preserving_proto_field_name=True)) return response