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

Automate deploying internal Mathesar #3076

Closed
mathemancer opened this issue Jul 20, 2023 · 6 comments
Closed

Automate deploying internal Mathesar #3076

mathemancer opened this issue Jul 20, 2023 · 6 comments
Assignees
Labels
ready Ready for implementation type: enhancement New feature or request user reported Reported by a Mathesar user
Milestone

Comments

@mathemancer
Copy link
Contributor

mathemancer commented Jul 20, 2023

Problem

Currently, deploying changes to the develop branch to the internal.mathesar.org instance is a manual process. We want to do it often, and this is burdensome.

Proposed solution

We should automate this deployment.

Additional context

We'd like to use the docker setup to maintain parity with our current recommendations to users. The current deployment process is: Brent logs into internal.mathesar.org via SSH, looks in .bash_history to try to remember what he did last time, and then runs

cd mathesar  # Note that the repo is under /home/brent at the moment. Suboptimal.
git status  # Should be on develop branch. If not, switch to that branch.
git pull
sudo docker build -t mathesar/mathesar-prod:latest --build-arg PYTHON_REQUIREMENTS=requirements-prod.txt .
sudo docker compose -f /etc/mathesar/docker-compose.yml down
sudo docker compose -f /etc/mathesar/docker-compose.yml up

Clearly, there is room for improvement. The goal is to build a local image based on the develop branch, and then run Mathesar in 'prod mode', but using the local image rather than pulling the actual prod image from dockerhub. If tagged properly, this should be the result of the above commands.

Pushing develop builds

As part of this issue, we should also push develop Docker builds of Mathesar to Docker Hub regularly, since there are some users who may want to test it (see #2709 (comment)). This may involve setting up a new DockerHub repo or renaming our current DockerHub repo from mathesar-prod to mathesar.

@mathemancer mathemancer added this to the v0.1.3 milestone Jul 20, 2023
@mathemancer mathemancer added work: other ready Ready for implementation and removed status: triage labels Jul 20, 2023
@dmos62
Copy link
Contributor

dmos62 commented Jul 20, 2023

The instructions seem simple enough to not need automation. Maybe let's document this and call it a day?

Edit: I reread the top post and noticed that "we want to update internal.mathesar.org often"; what is "often"?

If it's no more often than once a week, I think doing it manually is fine. If it's more often (2-3 times a week), I'd want at least a shell script. A cronjob would be nice, but is develop stable enough for automatic updates?

@kgodey
Copy link
Contributor

kgodey commented Jul 20, 2023

@dmos62 This issue is a result of discussion + a decision in Matrix yesterday, starting here. All your points were discussed there, but to summarize:

is develop stable enough for automatic update

This is for us (the core team) to dogfood develop and notice issues early. It may cause us some inconvenience if things break, but it's good for the product. Also, we have regular backups for the DB.

what is "often"?

Ideally every time something is merged into develop

@kgodey
Copy link
Contributor

kgodey commented Jul 27, 2023

I added a section to the main description of the issue to also push develop Docker builds to DockerHub.

@notramo
Copy link

notramo commented Jul 28, 2023

I would like to have DockerHub images too, because #2709 affects our project, and as the resolving of the issue progresses, we want to use the latest fixes in our docker-compose.yml as soon as possible.

@kgodey kgodey added the user reported Reported by a Mathesar user label Jul 28, 2023
@kgodey
Copy link
Contributor

kgodey commented Jul 28, 2023

Adding user reported label to track @notramo's request.

@kgodey
Copy link
Contributor

kgodey commented Dec 19, 2023

Since this is related to internal infrastructure and not Mathesar code, I've moved it to Basecamp here. We'll still be working on this.

@kgodey kgodey closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Ready for implementation type: enhancement New feature or request user reported Reported by a Mathesar user
Projects
No open projects
Development

No branches or pull requests

6 participants