Skip to content

Commit

Permalink
REF: Factor out DEFAULT_SERVICE_CONFIGURATION_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Jun 25, 2024
1 parent f3b8557 commit 1f443d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions octue/cloud/deployment/google/answer_pub_sub_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
5 changes: 1 addition & 4 deletions octue/cloud/deployment/google/cloud_run/flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions octue/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1f443d9

Please sign in to comment.