m.amanullah7: look at the other files in the `listenbrainz/db` directory. we are not using orm in most cases.
plain sql queries.
mamanullah7[m]
lucifer:Sure let me check i'll try not to use then!
lucifer[m]
holycow23: let's rename time_bracket to hour and also the data type from string to integer.
holycow23[m]
cool
will do that
what's the next step though?
lucifer[m]
then update the api to read from couchdb.
and the frontend to render the chart using the api data.
holycow23[m]
Just the last step of StatsDB to Webserver is left right over [here](https://listenbrainz.readthedocs.io/en/latest/developers/spark-architecture.html)
lucifer[m]
that is the api serving the stats after reading it from couchdb.
holycow23[m]
Yeah but that's the only step left right mainly?
lucifer[m]
yes
holycow23[m]
Also I was trying to import listenbrainz.db.stats as db_stats in the terminal but gives an import error of psycopg2 and while installing it gives an error
lucifer[m]
try pip install psycopg2-binary
holycow23[m]
which I feel needs certain sudo installs should I go ahead with them?
Did that but still the same import issue
lucifer[m]
i checked and its an issue with the pip installation on wolf. this worked, python3.12 -m pip install psycopg2-binary --break-system-packages.
holycow23[m]
psycopg2-binary installed without any error for me
but the import of import listenbrainz.db.stats as db_stats still gives an error
lucifer[m]
what's the error?
holycow23[m]
ModuleNotFoundError: No module named 'psycopg2'
lucifer[m]
okay, there's an issue with the python installed on wolf. but anyway. you should create a virtual environment and use python in that.
python3.12 -m venv venv
.venv/bin/activate
pip install -r requirements.txt
should work fine then
* . venv/bin/activate
pite has quit
holycow23[m]
inside the environment do I start the shell using the same docker exec -it listenbrainzspark-request_consumer-1 pyspark --driver-memory 16g?
lucifer[m]
if you use docker then the environment won't be used
it only matters if you are running commands outside docker
pite joined the channel
holycow23[m]
yes that's what I assumed
Also the pip install gave an error
uWSGI gave an error
lucifer[m]
what's the error?
holycow23[m]
ERROR: Could not build wheels for uWSGI, which is required to install pyproject.toml-based projects
holycow23: can you please update your wolf setup to expose ports only on 127.0.0.1 ?
that should be the default in docker compose files iirc.
holycow23[m]
- "127.0.0.1:9000:9000"
- "127.0.0.1:9870:9870"
this is what I have
lucifer[m]
in the other docker-compose.yml
for listenbrainz web/websockets etc.
holycow23[m]
Everything is on 127.0.0.1
lucifer[m]
hmm
holycow23: i see the docker file was missing the default host for some containers, and the default is 0.0.0.0 so the issue. i have updated the docker compose file on your setup. just stop and start the containers when ready
m.amanullah7: create a unique index on user_id and funkwhale_server_id.
mamanullah7[m]
okay!
lucifer: Thanks it woking now!
lucifer: last time i tried to upload one song on fw but it failed to upload! is there any way to add songs? i wants to test fw in brainzplayer! should i push changes can u look into?
lucifer[m]
m.amanullah7: try again now and if it doesn't work, share the error you see.