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

Automatic database upgrades #7166

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bin/docker-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ dev_worker() {
}

server() {
echo "Upgrading database..."

Copy link
Member

Choose a reason for hiding this comment

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

Probably doesn't need the blank line between the echo and the manage.py command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is one blank line between echo and exec in scheduler(), dev_scheduler(), worker(), dev_worker(). thought I should just keep up with the neighbors to be consistent 😁

Copy link
Member

@justinclift justinclift Sep 21, 2024

Choose a reason for hiding this comment

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

Oops, my bad. 🤦

Yeah, copying the existing style is the right approach. 😄

Copy link
Member

@justinclift justinclift Sep 21, 2024

Choose a reason for hiding this comment

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

Timing wise, @arikfr is working on a patch to fix the generation of query hashes, and I think might also be adjusting one of the migrations so it takes the auto limit into account as well.

That should turn up in the next few days hopefully, and I'd personally like for us to get that in before this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

/app/manage.py db upgrade

# Recycle gunicorn workers every n-th request. See http://docs.gunicorn.org/en/stable/settings.html#max-requests for more details.
MAX_REQUESTS=${MAX_REQUESTS:-1000}
MAX_REQUESTS_JITTER=${MAX_REQUESTS_JITTER:-100}
Expand Down
3 changes: 2 additions & 1 deletion client/cypress/cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ function buildServer() {
}

function startServer() {
console.log("Creating the database...");
execSync("docker compose -p cypress run server create_db", { stdio: "inherit" });
console.log("Starting the server...");
execSync("docker compose -p cypress up -d", { stdio: "inherit" });
execSync("docker compose -p cypress run server create_db", { stdio: "inherit" });
}

function stopServer() {
Expand Down
Loading