Thanks for the feedback and information everybody!
I can now be fairly certain that this would not be a project I would enjoy much, nor could bring to a happy end.
Hello there,
I am really not a usual reader of this category (which is actually one of my muted categories - but I will remove it now!).
This topic title is exactly what I was looking for.
The topic answered @hiccup’s situation but not mine yet, and it seems I could get good advice here.
So I cherry-picked some of your questions and let me describe my situation:
I very rarely submit ultra minimalist code changes (PR) to MBS.
Usually it’s just some StyleSheet (CSS) changes, not even JavaScript.
Those two can be tested easily with user CSS and user scripts run directly on MusicBrainz.org in any browser.
But sometimes I would like to fix this or that server code bug that requires a running server to test if my change solves the issue or not (most specifically as I don’t know the language used in MBS so it’s very step by step try and adapt until it works).
I used to have a celes.mbsandbox.org for this kind of changes.
It was great as it allowed me testing my patches by simple git checkout
to my branch, on my sand box.
But now I understand they won’t be brought back.
Oh, that is what I want indeed.
I don’t really care about the database data freshness.
From your linked page, however, it seems there is a well documented install procedure for development, that looks really easier to follow (Docker? / Compose?).
And, uh oh, this is my exact situation (4 GB RAM and 2 Cores).
So I have:
- a 4 GB RAM and 2 Cores Linux (Debian 10 Xfce) main PC,
- a Raspberry Pi 3B and a 3B+ with Raspbian (Raspberry Pi OS) 10, and also
- an office laptop under Windows 10.
I would like to use one of my home computers rather than the office laptop (even if I know Windows better than Linux too).
Installing Docker (and Compose?) on Debian seems little more complex than normal package install.
It seems possible on Raspbian, with a helper script of theirs.
At this point, I forget about Windows. It seems I would prefer trying this stuff on the RPi, to not pollute the real computers.
Do you think that my memory and CPU config and no Docker knowledge is really a blocker?
To be honest: If you don’t want to invest hours of reading online documentations and willing to spend even more hours for a very steep learning curve, the answer is: Yes, this combination with your hardware is (almost) a blocker.
A side note:
That’s the point where you should start using some form of virtualization (VMware, VirtualBox, Hyper-V…)
I thought using Docker was about doing that.
I remember once trying virtualisation (I don’t remember which program but not Docker) under Windows XP with that same computer, it was slow as when you look at a video image per image, almost not usable.
But as my PC is not really that slow.
So it was maybe because of Windows XP (I tried 10 it’s faster) or because of the virtualisation program, or because of what I tried to do in there (Impulse Tracker 2).
I have an Intel Core 2 Duo E6300 as I assembled my PC around 2006.
We get off-topic, just a short copy & paste (replace “VMware” with other virtualization software then Docker)
VMware emulates machine hardware whereas Docker emulates the operating system in which your application runs. Docker is a much more lightweight virtualization technology since it does not have to emulate server hardware resources. The focus is on abstracting the environment required by the app, rather than the physical server. VMware, just like actual machine hardware, lets you install operating systems and other tasks that require a full server.
The speed highly depends on your CPU und RAM. The more the faster. Your machine from 2006 is really old and not suited to run any form of virtualization, not Docker or anything else. Sorry.
Challenge accepted!
My 2006 PC has always been able to do anything I wanted.
I’ve read somewhere that Docker was able to run on Raspberry Pi 2B.
So I may have 3 machines able to run MBS.
I’ll report here.
I also run ancient kit, but a big tip is go look on EBay or similar - read up what your motherboard can take, then max it out via EBay for cheap. You’ll find a Quad core on there for peanuts, and that extra 4GB of RAM. You can keep that steam power kit, but at least this way you can max it out in an way you could never afford in 2006.
Docker is relatively easy to use and understand but there is a learning curve but you should be able to work things out.
Installing docker on debian / ubuntu is straight forward, there are older packages in the normal os archive but you should go to docker.com and use the docker provided apt sources to get a more up to date docker.
Docker runs fine on windows especially once you have windows build 2004 (or an up to date older build) and have windows subsystem for linux version 2 installed.
This offers great performance without the overhead of an emulator * so it should run with similar performance to running docker on linux.
Follow the instructions at the following to install wsl2 then install ubuntu (recommended but not required) and docker desktop.
I would not use the raspberry pi to run docker and musicbrainz.
The docker containers are built for x86_64 so you need to recompile everything to get this running on a raspberry pi.
The way the docker containers have been built there are lots and lots of layers so you need to recompile all these layers to get a running container. I have done this myself and had it running on an arm based nas.
* Docker on windows does use parts of the emulator for virtual IO to store a linux file system image but there is a linux kernel running as a binary under windows.
Wow thanks very much @dns_server for this huge post, there is so much we can learn everyday!
Thanks too @InvisibleMan78, but I don’t really understand why Docker wouldn’t work on my machine (I don’t need hardware emulation like VMWare).
I have to see it working or not, to make sure.
Wow I did not know that Linux for Windows thing!
Oh but my office PC does not meet the build requirement for version 2.
And I don’t have admin rights anyway. I shouldn’t install any funny stuff.
Oh that’s definitely a no go for me, it sounds terrible.
So I will stay on my Debian and install Docker then install Docker Compose on my Debian PC then install the development MusicBrainz server.
I preferred Raspberry Pi because I can reflash its SD when I want.
I was not sure I would know how to completely uninstall this stuff from Debian, as it’s not simple packages, if it doesn’t work.
It’s quite magic and impressive all that install procedure does on screen.
I did these commands (from my previous post last link):
1. git clone --recursive https://github.com/metabrainz/musicbrainz-server.git
2. MUSICBRAINZ_SERVER_LOCAL_ROOT=$PWD/musicbrainz-server
3. git clone https://github.com/metabrainz/musicbrainz-docker.git
4. cd musicbrainz-docker
5. echo MUSICBRAINZ_SERVER_LOCAL_ROOT="$MUSICBRAINZ_SERVER_LOCAL_ROOT" >> .env
6. admin/configure add musicbrainz-dev
7. sudo docker-compose up -d
8. sudo docker-compose run --rm musicbrainz createdb.sh -sample -fetch
Step 7 is long. I think it goes inside the container and extracts everything (I hope it does not all this in my filesystem).
Then at step 8, I get some errors like:
Can't locate JSON.pm in @INC (you may need to install the JSON module)
[...]
Compilation failed in require at /musicbrainz-server/admin/InitDb.pl line 34.
BEGIN failed--compilation aborted at /musicbrainz-server/admin/InitDb.pl line 34
But it seems the MB server is launched because my CPU is working more than usual and htop
shows me cpanm
(don’t know what it is but seems new) and perl
are taking much of my CPU power.
Now I don’t know how to proceed:
- How do I browse to this MB server in my browser?
- How do I stop the server?
- How do I make the server run my forked git repository checkout instead of its version?
- How do I remove all this when done?
I will also search existing forum topics and docs for answers.
Step 7 will build the containers and assemble everything it needs automatically so this may take some time.
What should happen is you have the source code for the musicbrainz server in the musicbrainz-server folder and the config for the docker containers in the musicbrainz-docker folder. So modify files in musicbrainz-server as needed.
You might have some containers running but not the main musicbrainz server.
Can you run docker ps to see what is running and confirm there are 7 containers and the status is running.
~/musicbrainz-docker$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7521299bd089 musicbrainz-docker_indexer "/sbin/my_init" 4 seconds ago Up 3 seconds musicbrainz-docker_indexer_1 18560db044c0 musicbrainz-docker_musicbrainz "docker-entrypoint.s…" 4 seconds ago Up 3 seconds 0.0.0.0:5000->5000/tcp musicbrainz-docker_musicbrainz_1 30fa91bc6e58 musicbrainz-docker_search:3.3.0 "docker-entrypoint.s…" 6 seconds ago Up 5 seconds 8983/tcp musicbrainz-docker_search_1 5cfda9c5d050 redis:3-alpine "docker-entrypoint.s…" 6 seconds ago Up 5 seconds 6379/tcp musicbrainz-docker_redis_1 cc3b386f2479 musicbrainz-docker_db:12 "docker-entrypoint.s…" 6 seconds ago Up 4 seconds 5432/tcp musicbrainz-docker_db_1 f831f1b0d3b1 validator/validator:20.3.16 "/bin/bash -o pipefa…" 6 seconds ago Up 5 seconds 8888/tcp musicbrainz-docker_validator_1 f9a18ec18e19 musicbrainz-docker_mq "/docker-entrypoint-…" 6 seconds ago Up 4 seconds 4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 25672/tcp musicbrainz-docker_mq_1
To stop everything run docker-compose down
If everything is working you should see the following:
docker-compose up -d
Starting musicbrainz-docker_mq_1 … done
Starting musicbrainz-docker_validator_1 … done
Starting musicbrainz-docker_redis_1 … done
Starting musicbrainz-docker_db_1 … done
Starting musicbrainz-docker_search_1 … done
Starting musicbrainz-docker_musicbrainz_1 … done
Starting musicbrainz-docker_indexer_1 … done
If everything is working you should be able to go to http://localhost:5000
For your step 8 problem “Can’t locate JSON.pm in @INC” there is an open issue:
Wow, super.
Now I restarted my PC, the day after.
I guessed how to restart local MBS:
sudo docker-compose up
[...]
db_1 | 2020-12-04 10:41:01.382 UTC [65] FATAL: database "musicbrainz_db" does not exist
[...]
So I have a database error (maybe because of yesterday’s JSON.pm error).
If I go to http://localhost:5000 it’s magic, I do see MB website!
But an Internal Server Error page, saying:
DBI connect(‘dbname=musicbrainz_db;host=db;port=5432’,‘musicbrainz’,…) failed: FATAL: database “musicbrainz_db” does not exist at lib/MusicBrainz/Server/Connector.pm line 50
And if I do the process list command:
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
10fcdfee684d musicbrainz-docker_musicbrainz "docker-entrypoint.s…" 12 hours ago Up 37 minutes 0.0.0.0:5000->5000/tcp musicbrainz-docker_musicbrainz_1
b5b5513006ca musicbrainz-docker_indexer "/sbin/my_init" 12 hours ago Up 5 minutes musicbrainz-docker_indexer_1
1b3675694bed musicbrainz-docker_db:12 "docker-entrypoint.s…" 12 hours ago Up 37 minutes 5432/tcp musicbrainz-docker_db_1
c8f1aee68c52 validator/validator:20.3.16 "/bin/bash -o pipefa…" 12 hours ago Up 37 minutes 8888/tcp musicbrainz-docker_validator_1
c91ab85eac5a musicbrainz-docker_mq "/docker-entrypoint-…" 12 hours ago Up 37 minutes 4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 25672/tcp musicbrainz-docker_mq_1
5c45afe04318 redis:3-alpine "docker-entrypoint.s…" 12 hours ago Up 37 minutes 6379/tcp musicbrainz-docker_redis_1
fd82277cda25 musicbrainz-docker_search:3.3.0 "docker-entrypoint.s…" 12 hours ago Up 37 minutes 8983/tcp musicbrainz-docker_search_1
It’s strange, the MBS does run, I think, because localhost:5000 responds but I don’t see in this ps
above, anything that shows that anything is reunning now and not only yesterday, 12 hours ago.
Update
Oh I see, the ps
list is not empty, which means stuff is running.
I did Ctrl+C my docker-compose and now the docker ps
list is empty.
And I didn’t see your sudo docker-compse up
with -d
option.
I tried sudo docker-compose up --detach
(I prefer long options) and I see done for everything now (it is less verbose, no logs, this way).
So without --detach/-d
we can see errors sooner, but with it, it’s more convenient once you reached a point when everything works.
Notice, when not using --detach/-d
things are done very nicely, when I press Ctrl+C, I see the same unloading screen as with sudo docker-compose down
.
Sorry to say, but if you get an HTML-answer from localhost:5000
it doesn’t mean that much…
Especially the error above give you a strong hint about your current problem: You don’t have a database builded nor filled it with data or indexed the data yet. I assume, you are stuck at your step 8 at the moment.
Unfortunately I don’t know how to fix that other then @loujin already wrote in the issue:
Looks it’s fixed if I use “
-Mlocal::lib -Mlocal::lib="${MUSICBRAINZ_PERL_LOCAL_LIB}
”
to the perl eval command in the createdb.sh script.
In fact, @loujin’s fix seems not enough: He cancelled his pull request and his bug ticket is still open for @yvanzo who proposed to fix it.
And by the way, I don’t even have this eval
call in my yesterday’s cloned musicbrainz-docker
's /build/musicbrainz-dev/scripts/createdb.sh
script.
I will subscribe to the bug ticket (github issue) and wait a little time.
You have 7 containers running which is good.
Starting the containers does not populate the database.
You have a postgres database without any tables so you need to populate this with something.
You should just need to run the create database step to populate with a sample data set.
sudo docker-compose run --rm musicbrainz createdb.sh -sample -fetch
Wow, how do you know so many stuff?
Now the server works! – No performance issues, @InvisibleMan78
The change I want to test is about Cover Arts, I cannot find a release with Cover Arts, though.
Do you know one? Or a way to search for one?
Or maybe none are included in the sample data…
I found a release with Add cover art edit in its history but the Cover Art tab is empty, despite the cover showing OK in the edit history.
There must be a way to test CAA tab code in development local MBS, no?
Is it the same problem as Do[es] not download the covers from picard with a development server, maybe?
Direct database search works so put a letter such as “a” in the search box then click direct database search option and search again.
You should be able to find a few sample artist and albums, try the following.
http://127.0.0.1:5000/artist/0eedfc95-e79a-4fd9-832a-cd816a0b3fda
http://127.0.0.1:5000/release/25959c11-aac6-4bdd-bab9-5e6eba4e9c70
Thanks everyone for your great help!
Everything works now.
Just some missing answers.
I knew I could search with direct search but the Add cover art edits I found would never lead me to release with CAA data.
I think I did that and it worked!
I wonder why I had to do this, maybe because of the JSON bug.
Changing my CPU would be too troublesome, and I don’t want to have my old CPU lying somewhere or in the trash bin.
I already upgraded my RAM to the the max (4 Gb max is possible on the P5B-BN mainboard of my Asus T3-P5G965). Apparently it’s from 2007, not 2006.
Your welcome.
Just for the record:
@jesus2099 is currently using the static test sample data dump in a standalone mode development server. The technical requirements are not the same as for an up-to-date fully replicated and indexed MB mirror server in “slave” mode.