Skip to content

KNowledgeOnWebScale/solid4media-architecture

Repository files navigation

Architecture

Introduction

This repository contains the implementation of the Solid4Media IDLab Demo Platform as part of the Solid4Media project.

This repository supports different setup cases. Some are only valid during development. The final and publicly available setup of the Solid4Media IDLab Demo Platform relies on Docker containers and Docker Compose and illustrates the decentralized nature of the Solid-based data sharing platform.

Within the platform, we have set up:

  • multiple data providers each publishing their data behind a secure access layer using Solid pods,
  • a baseline setup in which a Viewer executes federated queries directly on these Solid pods,
  • a second setup, which is the main project goal, in which an aggregator and a UMA authorization server are added to support privacy-preserving aggregation. This setup also includes a UMA-compliant Viewer and LOAMA, an application that supports data owners in managing access to their data.

To project collaborators

You may be interested first of all in some quick recipes.

Using the final setup

The final setup is available online and needs no further action prior to usage.

Setup 2

Besides the baseline Viewer setup, this repository also contains a second setup.

In this setup, a Solid Community Server (css2) is combined with a UMA authorization server, an aggregator service, a UMA-compliant Viewer, and a LOAMA frontend.

This setup is the main project goal. It demonstrates the privacy-preserving aggregation scenario shown on the landing page, where a family-level media profile is derived from individual profiles without exposing those individual profiles directly.

Using the included Viewers (Miravi)

To use the included viewers, navigate to https://solid4media.ilabt.imec.be/viewer1/ for the baseline setup or to https://solid4media.ilabt.imec.be/viewer2/ for setup 2.

The list of predefined queries is shown in expandible groups at the left side.

Some queries may require you to login as one of the actors. That is because read permissions to resources may be restricted to specific actors.
Find actors' email addresses and passwords in the overview of actors' WebIDs, emails and passwords.

To login, click on the icon in the top right.

To execute a query, click on it in the dashboard.

Building and running

We split up this section for the different setup cases.

Unless specified otherwise, execute all commands below from a bash shell in the repository root.

The different setup cases depend on common files.

Some common files read environment variables, that need to be set upfront by sourcing the environment variables files.

Some files cannot read environment variables. In these cases derived files are created from common templates.

Prerequisites

For the UMA setup, eye needs to be available

git clone https://github.com/eyereasoner/eye
cd eye
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:swi-prolog/stable
sudo apt-get update
sudo apt-get install swi-prolog
./install.sh --prefix=$HOME/.local
cd ..

For the aggregator: install rust + libclang

curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env-
rustup update

sudo apt update
sudo apt install -y clang libclang-dev llvm-dev pkg-config

Local setup

Environment variables for the localhost setup case

Execute this command in any terminal window, before executing any other command in the remainder of this section:

source env-localhost

Building the localhost setup case

Before continuing, make sure the result of a previous build isn't running. See Stopping the localhost setup case.

Next, execute:

# install node dependencies
yarn install
# all further build actions
./scripts/setup/finalize-setup.sh

Running the localhost setup case

Run with new pod contents (mandatory for first run):

./scripts/local-run/start-csss.sh

Re-run with existing pod contents (requires a previous run and stop):

./scripts/local-run/start-csss.sh -r

The commands above start the pods on the localhost in the background and wait until they are all ready (listening). This takes some time to complete.

The pods log files can be consulted at ./local-run/*.log.

The pods data can be viewed at ./local-run/data/css*/.

Adding pod contents to the localhost setup case

Only in the baseline setup is the CSS hosted in Docker.

This assumes the following additional prerequisites to the localhost setup case:

Execute:

./scripts/stuff-pods/stuff-pods.sh

The localhost setup case

Using the localhost setup case is similar to using the final setup, with the following differences:

  • The included Viewers:
    • needs to be started as follows in a separate terminal windows:

      • for scenario 1 (baseline):
      cd ../applied-in-architecture-miravi-a-linked-data-viewer/main
      node scripts/select-config.cjs ../../../architecture/actors/viewer1/setup
      npm run dev -- --port 5174
      • for setup 2 (project goal):
      cd ../applied-in-architecture-miravi-a-linked-data-viewer-uma-compliant/main
      npm run dev -- --port 5175
    • and can be used at the localhost port reported in the output of above command.

Stopping the localhost setup case

./scripts/local-run/stop-csss.sh

The public Docker based setup case

Prerequisites for the public Docker based setup case

Environment variables for the public Docker based setup case

Execute this command in any terminal window, before executing any other command in the remainder of this section:

source env-docker-public

Building the public Docker based setup case

Before continuing, make sure the result of a previous build isn't running. See Stopping the public Docker based setup case.

Next, execute:

# install node dependencies
yarn install
# all further build actions
./scripts/setup/finalize-setup.sh

Running the public Docker based setup case

Run with new pod contents (mandatory for first run):

docker compose --profile backend --profile frontend up --wait

Re-run with existing pod contents (requires a previous run and stop):

docker compose -f docker-compose-public-restart.yml --profile backend --profile frontend up --wait

The commands above start all services in a Docker environment and and wait until they are all ready (listening). This takes some time to complete.

Optional: if you're interested in what's happening while these commands execute, you may open a new terminal window and in it, execute:

docker compose --profile backend --profile frontend logs -f

Adding pod contents to public Docker based setup case

The following command may be executed on the server or on any other computer fulfilling the prerequisites and having access to the public pods, if all above steps where executed before.

Execute:

./scripts/stuff-pods/stuff-pods.sh

Using the public Docker based setup case

Usage was explained already above in using the final setup. Note that in setup 2, the aggregator, UMA server, and UMA-compliant CSS are not set up in Docker; they are run via PM2 on the server. Also note that in setup 2, granting access to the aggregated family profile is not included in the setup scripts. Access grants still need to be made (for example via LOAMA): each family member (data contributor) must grant access before the aggregated output becomes visible in Viewer2.

Viewer URLs and Cypress target

The viewers are reachable and intended to coexist at different URLs.

For Cypress, the default base URL is controlled by TV_CYPRESS_BASE_URL in the sourced environment file. By default, this points to Viewer (Miravi), so existing yarn run test:viewer usage remains unchanged.

To run Cypress against Viewer2 without changing files, override baseUrl on the command line:

# after sourcing env-localhost or env-docker-public
yarn run test:viewer --config baseUrl=${TV_VIEWER2_BASE_URL}/

Interactive mode for Viewer2:

yarn run test:viewer:interactive --config baseUrl=${TV_VIEWER2_BASE_URL}/

Bonus: local Viewer (Miravi) for querying public pods

There is one pleasant side effect of building the public Docker based setup case: the Viewer (Miravi) described in Running the localhost setup case is also available here at the localhost. This time however it addresses the public pods! This is very convenient for further query experiments on the data in the public pods... For more info, see The modified Viewer (Miravi).

Stopping the public Docker based setup case

docker compose --profile backend --profile frontend down -t 0

Other documentation resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages