Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add /verifydb command #43

Merged
merged 1 commit into from
Dec 8, 2024
Merged

add /verifydb command #43

merged 1 commit into from
Dec 8, 2024

Conversation

b9r5
Copy link
Collaborator

@b9r5 b9r5 commented Dec 8, 2024

Description

This change adds a /verifydb command that:

  • reads the DATABASE_URL environment variable
  • attempts to establish a database connection and get a cursor
  • executes select random()
  • sends a response with the random value

image

Checklist

Before submitting this PR, ensure the following steps have been completed:

  • Run the smoke test on your own server.
    • Run the cluster bot on your server:
      python discord-bot.py
    • Start a training run by with the slash command /run.
      You may need to exercise some judgement about the script and GPU type.
    • Wait for the training run to complete.
    • Copy the URL for the thread started by the cluster bot in response to
      your /run message ("Cluster Bot started a thread: ..."):
      • Click on the 3 dots (...) to the cluster bot's message.
      • Select Copy Message Link.
    • Using the copied URL, run the smoke test:
      python discord-bot-smoke-test.py copied_url
    • Verify that the smoke test script responds with:
      All tests passed!
      
    For more information on running a cluster bot on your own server, see
    README.md.

@@ -52,3 +52,4 @@ class ModalGPU(Enum):
POSTGRES_USER = os.getenv("POSTGRES_USER")
POSTGRES_PASSWORD = os.getenv("POSTGRES_PASSWORD")
POSTGRES_PORT = os.getenv("POSTGRES_PORT")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably won't need the POSTGRES_* constants, but I wanted to leave them for now in order to verify we can connect to the database on Heroku. Once we verify that, we should be able to remove these constants.

Copy link
Member

@msaroufim msaroufim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool! feel free to merge when ready

@b9r5 b9r5 merged commit 2aad655 into main Dec 8, 2024
2 checks passed
@b9r5 b9r5 deleted the benh/check-db-connection branch December 8, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants