Skip to content

Latest commit

 

History

History
110 lines (84 loc) · 5.61 KB

QUICK_RECIPES.md

File metadata and controls

110 lines (84 loc) · 5.61 KB

Quick recipes

How to add content to the pods

  • Add a new directory <d> in scripts/stuff-pods.

  • In script/stuff-pods/stuff-pods.sh, add <d> to the list of directories to visit on the line for d in example ; do to also visit your directory: for d in example <d> ; do.

  • Add as many new subdirectories <sdx>, <sdy> in that directory <d> as you want to create new mappings.

  • Copy the script scripts/stuff-pods/example/stuff-pods.sh to your directory: scripts/stuff-pods/<d>/stuff-pods.sh.

  • In that script, modify the line for d in bob ; do to visit your subdirectories: for d in <sdx> <sdy> ; do.

  • Add your input data and mapping files.

  • Convert files into templates where needed.

  • Have a look at scripts/stuff-pods/example/ for a working example.

  • If the platform of your choice is not yet running, proceed by building and running it, including the instructions to add pod contents.

  • If the platform of your choice was already running, you can execute the mappings and send them to the pod(s) as follows.

    Note that, when executed with source env-docker-public, this also works to put contents on the public pods, even when run on your local machine.

    # select your platform by executing one of the next source commands
    source env-localhost
    source env-docker-public 
    
    pushd scripts/stuff-pods/
    ../templates/apply-templates.sh 
    popd
    scripts/stuff-pods/stuff-pods.sh

How to use the Miravi version built in this project for query development

This project clones the Miravi repo to ../applied-in-architecture-miravi-a-linked-data-viewer and copies the configuration files and public files from this project's actors/viewer/setup contents.

We can use that build of Miravi to modify or add queries in the context of our project.

This will obviously work in the case of environment variables file env-localhost, but also in the case of env-docker-public, as described in Bonus: local Viewer (Miravi) for querying public pods.

Develop new queries as follows:

  • go to ../applied-in-architecture-miravi-a-linked-data-viewer/main;
  • modify the configuration file and modify/add files in the public directory;
  • test by running npm run dev and browsing the localhost port this command reports.

Once you're happy with the result, you can add the new or modified files back to the project, so that they persist and can be used in future builds of Miravi.

Do that as follows:

How to convert files into templates

If you add a file <f> that contains one or more URLs whose values are defined in environment variable files env-localhost and env-docker-public, you must rename it into <f>.template, a template file.

  • In <f>.template, replace all such URLs with their environment variables, for example: change http://localhost:3001 or https://solid4media.ilabt.imec.be/css1 into ${TV_CSS1_BASE_URL}.
  • Add <f> to .gitignore. There is a section # files created from a template for that purpose.

Next time you run scripts/templates/apply-templates.sh, each such <f> files will be created from its template file <f>.template.

Note that scripts/templates/apply-templates.sh is called from scripts/setup/finalize-setup.sh, which is listed in the build instructions.

How to switch to a new version of Miravi

In scripts/viewer/build-webclient-contents.sh, modify the version tag vx.y.z in the line

git clone https://github.com/SolidLabResearch/${VIEWER_REPO}.git -b vx.y.z ${VIEWER_CLONE}

How to update what's on the public server

Connect to the iGent VPN and then:

# login to the server
ssh s4m@solid4media.privatedmz
# you are s4m on the server now; continue:
cd ~/architecture
# load the current environment variables
source env-docker-public
# stop the old dockers
docker compose --profile backend --profile frontend down -t 0
# update the clone, optionally from a different branch or a tag
git fetch
git checkout <branch-or-tag>
git pull
# load the new environment variables
source env-docker-public
# update what needs to be updated in general
./scripts/setup/finalize-setup.sh
# start the new dockers
docker compose --profile backend --profile frontend up --wait
# stuff the pods
./scripts/stuff-pods/stuff-pods.sh