Skip to content

Commit

Permalink
reduce INFO logging
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaskoepf committed Feb 4, 2023
1 parent effbde4 commit f02543b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-to-node.yaml
Expand Up @@ -59,6 +59,7 @@ jobs:
${{ vars.WEB_NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN_CAPTCHA }}
WEB_NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN:
${{ vars.WEB_NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN }}
LOGURU_LEVEL: ${{ vars.LOGURU_LEVEL }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions ansible/deploy-to-node.yaml
Expand Up @@ -149,6 +149,9 @@
USER_STATS_INTERVAL_TOTAL:
"{{ lookup('ansible.builtin.env', 'STATS_INTERVAL_TOTAL') |
default('240', true) }}"
LOGURU_LEVEL:
"{{ lookup('ansible.builtin.env', 'LOGURU_LEVEL') | default('INFO',
true) }}"
ports:
- "{{ backend_port }}:8080"

Expand Down
3 changes: 2 additions & 1 deletion backend/oasst_backend/api/v1/tasks.py
Expand Up @@ -104,7 +104,8 @@ def tasks_acknowledge(
pr = PromptRepository(db, api_client, frontend_user=frontend_user)

# here we store the message id in the database for the task
logger.info(f"Frontend acknowledges task {task_id=}, {ack_request=}.")
logger.info(f"Frontend ACK task_id={task_id}")
logger.debug(f"{ack_request=}.")
pr.task_repository.bind_frontend_message_id(task_id=task_id, frontend_message_id=ack_request.message_id)

except OasstError:
Expand Down
4 changes: 2 additions & 2 deletions backend/oasst_backend/config.py
Expand Up @@ -166,8 +166,8 @@ class Settings(BaseSettings):
DATABASE_URI: Optional[PostgresDsn] = None
DATABASE_MAX_TX_RETRY_COUNT: int = 3

DATABASE_POOL_SIZE = 128
DATABASE_MAX_OVERFLOW = 128
DATABASE_POOL_SIZE = 75
DATABASE_MAX_OVERFLOW = 20

RATE_LIMIT: bool = True
MESSAGE_SIZE_LIMIT: int = 2000
Expand Down
15 changes: 10 additions & 5 deletions backend/oasst_backend/tree_manager.py
Expand Up @@ -623,7 +623,8 @@ def next_task(
HTTPStatus.SERVICE_UNAVAILABLE,
)

logger.info(f"Generated {task=}.")
logger.info(f"Generated task (type={task.type}, id={task.id})")
logger.debug(f"Generated {task=}.")

return task, message_tree_id, parent_message_id

Expand All @@ -634,8 +635,9 @@ async def handle_interaction(self, interaction: protocol_schema.AnyInteraction)
match type(interaction):
case protocol_schema.TextReplyToMessage:
logger.info(
f"Frontend reports text reply to {interaction.message_id=} with {interaction.text=} by {interaction.user=}."
f"Frontend reports text reply to message_id={interaction.message_id} by user={interaction.user}."
)
logger.debug(f"with {interaction.text=}")
# here we store the text reply in the database
message = pr.store_text_reply(
text=interaction.text,
Expand Down Expand Up @@ -682,23 +684,26 @@ async def handle_interaction(self, interaction: protocol_schema.AnyInteraction)

case protocol_schema.MessageRating:
logger.info(
f"Frontend reports rating of {interaction.message_id=} with {interaction.rating=} by {interaction.user=}."
f"Frontend reports rating of message_id={interaction.message_id} by user={interaction.user}."
)
logger.debug(f"with {interaction.rating=}")

pr.store_rating(interaction)

case protocol_schema.MessageRanking:
logger.info(
f"Frontend reports ranking of {interaction.message_id=} with {interaction.ranking=} by {interaction.user=}."
f"Frontend reports ranking of message_id={interaction.message_id} by user={interaction.user}."
)
logger.debug(f"with {interaction.ranking=}")

_, task = pr.store_ranking(interaction)
self.check_condition_for_scoring_state(task.message_tree_id)

case protocol_schema.TextLabels:
logger.info(
f"Frontend reports labels of {interaction.message_id=} with {interaction.labels=} by {interaction.user=}."
f"Frontend reports labels of message_id={interaction.message_id} by user={interaction.user}."
)
logger.debug(f"with {interaction.labels=}")

_, task, msg = pr.store_text_labels(interaction)

Expand Down

0 comments on commit f02543b

Please sign in to comment.