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
MBS-10322: Drop Fabric #1337
MBS-10322: Drop Fabric #1337
Conversation
|
- 172.17.0.1 is the default gateway of Docker bridge network - 54321 is an arbitrary port for an SSH tunnel that can be created with: ssh -L 172.17.0.1:54321:localhost:65400 pink -N # production slave It depends on metabrainz/musicbrainz-server#1337
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1337 h4x
(Just rebased, no code change.) |
Expanded |
- 172.17.0.1 is the default gateway of Docker bridge network - 54321 is an arbitrary port for an SSH tunnel that can be created with: ssh -L 172.17.0.1:54321:localhost:65400 pink -N # production slave It depends on metabrainz/musicbrainz-server#1337
Replace 'translations' Fabric task with '--commit' option to 'po/update_translations.sh' script. Small changes in behavior: - Prevent incidentally committing pre-existing local changes - No more ask to confirm commit message before committing - Show commit statistics if any, print a notice otherwise
Replace 'tag' Fabric task with new 'script/tag.sh'
Replace 'deploy' Fabric task with new 'script/update_containers.sh'. Improvements: - Automatically find hosts to be updated from docker server configs - Less (1 instead of 3) ssh connections to each host to be updated - Sleep more (30s instead of 15s) after each updated host - Update services using script maintained with docker server configs
The script 'database_exists' assumes that all databases are on the same host by using the database configuration 'SYSTEM' to query the table 'pg_database'. However, this cannot be assumed with the new database configuration 'PROD_STANDBY' which specifically points to another host. This patch makes the script 'database_exists' use the tested database configuration to query the table 'information_schema_catalog_name'. Note: 'pg_database' may not be readable by user other than 'postgres'.
This controls which database in lib/DBDefs.pm is used to extract strings from, defaulting to READWRITE as before.
Replace 'pot' Fabric task with new 'po/update_pot.sh' script and '--commit' option. It is a derivative of 'po/update_translations.sh' and has the same behavior: - Prevent incidentally committing pre-existing local changes - No more ask to confirm commit message before committing - Show commit statistics if any, print a notice otherwise - Test (remote) database connection before querying it Plus, by Michael: Set MB_POT_DB=PROD_STANDBY in update_pot.sh The intent of this script is to update pot files using the production database, so the developer is now required to have a PROD_STANDBY database configured in lib/DBDefs.pm which does that, via SSH tunnel or otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested for a test release, seemed to work fine.
Since metabrainz#1337 replaced Fabric, `extract_pot_db` that requires Locale::PO is no longer run in production, it is run in development setup instead. This patch makes Locale::PO to be installed using cpanm option `--with-develop` instead of `--with-feature=production`.
- 172.17.0.1 is the default gateway of Docker bridge network - 54321 is an arbitrary port for an SSH tunnel that can be created with: ssh -L 172.17.0.1:54321:localhost:65400 pink -N # production slave It depends on metabrainz/musicbrainz-server#1337
- 172.17.0.1 is the default gateway of Docker bridge network - 54321 is an arbitrary port for an SSH tunnel that can be created with: ssh -L 172.17.0.1:54321:localhost:65400 pink -N # production slave It depends on metabrainz/musicbrainz-server#1337
- 172.17.0.1 is the default gateway of Docker bridge network - 54321 is an arbitrary port for an SSH tunnel that can be created with: ssh -L 172.17.0.1:54321:localhost:65400 pink -N # production slave It depends on metabrainz/musicbrainz-server#1337
- 172.17.0.1 is the default gateway of Docker bridge network - 54321 is an arbitrary port for an SSH tunnel that can be created with: ssh -L 172.17.0.1:54321:localhost:65400 pink -N # production slave It depends on metabrainz/musicbrainz-server#1337
This is a database definition for use by official maintainers only. Note that standby/slave/secondary database is read-only anyway, thus setting user to `musicbrainz` or musicbrainz_ro` makes no difference. It is set to `musicbrainz_ro` as a precaution just in case the SSH tunnel mistakenly points to a database other than the standby prod. It relies on metabrainz/musicbrainz-server#1337
This is a database definition for use by official maintainers only. Note that standby/slave/secondary database is read-only anyway, thus setting user to `musicbrainz` or musicbrainz_ro` makes no difference. It is set to `musicbrainz_ro` as a precaution just in case the SSH tunnel mistakenly points to a database other than the standby prod. It relies on metabrainz/musicbrainz-server#1337
Summary
Resolve MBS-10322: Port fabfile
Problem
fabfile.py
was written for Fabric 1/Python 2 which is retiring in 2020. It was the only piece of Python in this repository, that doesn’t favor Fabric 2/Python 3 which is not 100% feature parity anyway. It was missing hosts discovery for deployment.Solution
Rewriting tasks as independent scripts, with a few differences:
HELP
string)TODO
PROD_STANDY
to DBDefs example/defaultMB_POT_DB
toextract_pot_db
update_pot
to check these parameters