A heavily over-engineered web application for serving musical scores.
For the scores, this repository relies on https://github.com/ironbars/scores.
You can run the build.sh
script from there to generate the PDFs (requires
lilypond).
Run the following to get JSON representations of the score metadata and the engravings (requires poetry):
poetry install # gives you pymongo
export SCORESVR_SCORES_DIR=/path/to/scores
poetry run python3 data/scores2json.py
You'll need a running instance of MongoDB for the rest. I'd recommend spinning
up a kind cluster with a extra mount for the /data/db
directory. The you can
do the following:
# this defaults to localhost if undefined
export SCORESVR_MONGO_HOST="mongo.url"
# this is the default port; script uses this if this variable is undefined
export SCORESVR_MONGO_PORT=27017
poetry run python3 data/import.py
Before anything else, you'll need to create your cluster with extra mounts and settings for ingress. The configurations can all be found here.
You can use task to deploy the app once your kind cluster is running. The following commands will do it.
Build the images:
task build-all
Load the images into your cluster:
task load-all
Finally deploy the app:
task init-app
Lastly, once the app is deployed, you can use the other configured tasks to make changes. After you've made a change, run the following to deploy:
task deploy
You can change the CLUSTER_NAME
and NAMESPACE
variables at your preference,
as long as they match what you configured for your kind cluster.
You'll need to rebuild the images so that minikube can use them. See here.
You'll also need to mount a directory for Mongo. See this page for instructions.
Lastly, enable ingress:
minikube addons enable ingress
To allow minikube to use locally built Docker images, you need to do the following in each shell that you want to build in:
eval $(minikube -p minikube docker-env)
docker build -t <image_tag> . # for example
Then you can issue the docker build
command however you like.
kubectl create namespace scoreserver
kubectl apply -f manifests/{service,scoreserver,ingress}.yaml -n scoreserver