-
-
Notifications
You must be signed in to change notification settings - Fork 16
Optimize initial import and update to MusicBrainz schema 30 #24
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
Open
MockingMagician
wants to merge
2
commits into
acoustid:main
Choose a base branch
from
MockingMagician:v30.0.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,5 @@ | |
| mbdata.egg-info/ | ||
| venv/ | ||
| result | ||
| /.idea/ | ||
| /.bin/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| FROM postgres:16 | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| python3 \ | ||
| python3-pip \ | ||
| python3-venv \ | ||
| postgresql-server-dev-16 \ | ||
| gcc \ | ||
| python3-dev \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
MockingMagician marked this conversation as resolved.
|
||
|
|
||
| RUN python3 -m venv /opt/mbslave-venv | ||
| ENV PATH="/opt/mbslave-venv/bin:$PATH" | ||
|
|
||
| WORKDIR /usr/src/app | ||
| COPY . . | ||
|
|
||
| # Install mbslave and its dependencies | ||
| RUN pip install . | ||
|
MockingMagician marked this conversation as resolved.
|
||
|
|
||
| ENV POSTGRES_DB=musicbrainz | ||
| ENV POSTGRES_USER=musicbrainz | ||
| ENV POSTGRES_PASSWORD=musicbrainz | ||
|
|
||
| # Create a default config file for mbslave | ||
| RUN cat <<EOF > /etc/mbslave.conf | ||
| [database] | ||
| host=/var/run/postgresql | ||
| port=5432 | ||
| name=musicbrainz | ||
| user=musicbrainz | ||
| password=musicbrainz | ||
| admin_user=musicbrainz | ||
| EOF | ||
|
|
||
| # Add initialization script | ||
| COPY <<-'INIT_DB' /docker-entrypoint-initdb.d/01-init-mbslave.sh | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # mbslave init expects to be able to connect to the database | ||
| # When scripts in /docker-entrypoint-initdb.d/ are run, the server is running | ||
| # and accepting connections. | ||
| # We use PGUSER=postgres to connect as the superuser that exists during init. | ||
|
|
||
| PGUSER=postgres MBSLAVE_CONFIG=/etc/mbslave.conf mbslave init --empty | ||
| INIT_DB | ||
|
|
||
| RUN chmod +x /docker-entrypoint-initdb.d/01-init-mbslave.sh | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| services: | ||
| db: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.postgres | ||
| environment: | ||
| - POSTGRES_PASSWORD=musicbrainz | ||
| ports: | ||
| - "5432:5432" | ||
| volumes: | ||
| - db_data:/var/lib/postgresql/data | ||
| shm_size: 8gb | ||
| healthcheck: | ||
| test: [ "CMD-SHELL", "pg_isready -U musicbrainz -d musicbrainz" ] | ||
|
MockingMagician marked this conversation as resolved.
|
||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 5 | ||
|
|
||
| mbslave: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.mbslave | ||
| environment: | ||
| - KEEP_ALIVE=true | ||
| volumes: | ||
| - mbslave_config:/etc/mbslave | ||
| depends_on: | ||
| db: | ||
| condition: service_healthy | ||
|
|
||
| volumes: | ||
| db_data: | ||
| mbslave_config: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| if [ "$KEEP_ALIVE" = "1" ] || [ "$KEEP_ALIVE" = "true" ] || [ $# -eq 0 ]; then | ||
| echo "KEEP_ALIVE is set or no command provided, staying up..." | ||
| # Keep the container running | ||
| tail -f /dev/null | ||
| else | ||
| exec "$@" | ||
| fi | ||
|
MockingMagician marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Copyright (C) 2013 Lukas Lalinsky | ||
| # Distributed under the MIT license, see the LICENSE file for details. | ||
|
|
||
| __version__ = "29.1.0" | ||
| __version__ = "30.0.0" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.