diff --git a/octue/cloud/deployment/google/answer_pub_sub_question.py b/octue/cloud/deployment/google/answer_pub_sub_question.py index 502854a84..1d9416f09 100644 --- a/octue/cloud/deployment/google/answer_pub_sub_question.py +++ b/octue/cloud/deployment/google/answer_pub_sub_question.py @@ -3,7 +3,7 @@ from octue.cloud.events.counter import EventCounter from octue.cloud.pub_sub.service import Service from octue.cloud.service_id import create_sruid, get_sruid_parts -from octue.configuration import load_service_and_app_configuration +from octue.configuration import DEFAULT_SERVICE_CONFIGURATION_PATH, load_service_and_app_configuration from octue.resources.service_backends import GCPPubSubBackend from octue.runner import Runner from octue.utils.objects import get_nested_attribute @@ -12,9 +12,6 @@ logger = logging.getLogger(__name__) -DEFAULT_SERVICE_CONFIGURATION_PATH = "octue.yaml" - - def answer_question(question, project_name): """Answer a question sent to an app deployed in Google Cloud. diff --git a/octue/cloud/deployment/google/cloud_run/flask_app.py b/octue/cloud/deployment/google/cloud_run/flask_app.py index 3eb12473a..7cebdea5d 100644 --- a/octue/cloud/deployment/google/cloud_run/flask_app.py +++ b/octue/cloud/deployment/google/cloud_run/flask_app.py @@ -4,16 +4,13 @@ from octue.cloud.deployment.google.answer_pub_sub_question import answer_question from octue.cloud.pub_sub.bigquery import get_events -from octue.configuration import ServiceConfiguration +from octue.configuration import DEFAULT_SERVICE_CONFIGURATION_PATH, ServiceConfiguration logger = logging.getLogger(__name__) app = Flask(__name__) -DEFAULT_SERVICE_CONFIGURATION_PATH = "octue.yaml" - - @app.route("/", methods=["POST"]) def index(): """Receive questions from Google Cloud Run in the form of Google Pub/Sub messages. diff --git a/octue/configuration.py b/octue/configuration.py index 53341d638..716f20992 100644 --- a/octue/configuration.py +++ b/octue/configuration.py @@ -8,6 +8,9 @@ logger = logging.getLogger(__name__) +DEFAULT_SERVICE_CONFIGURATION_PATH = "octue.yaml" + + class ServiceConfiguration: """A class containing the details needed to configure a service.