Block registry
Copy the Block registry to an HTTPS service of the company and point the Desktop App and the Backend to it.
The Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary and the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary read the Block registryBlock registry — A service from which the Desktop App downloads Blocks. MiLaboratories runs the main one; a company can add its own. Glossary of MiLaboratories,
https://blocks.pl-open.science/. The Desktop App gets the BlocksBlock — A small application for one step of an analysis, for example the import of reads or clustering. It can combine several tools. Glossary, and the Backend gets the
workflowworkflow — The part of a Block that runs in the Backend. It starts the tools on the data and collects the results. Users do not edit it. Glossary template packs of the Blocks. A mirror is necessary when the company does not let the
computers of users or the Backend connect to this host. The mirror is an HTTPS service that gives
the same files at the same paths below its own address. It must serve the Desktop App on each
computer and the Backend.
The Desktop App reads the registry when users add or update a Block, and when it opens a project and does not have the interface of a Block in its cache. Thus keep the mirror available for as long as Platforma runs, and keep its address: a project keeps the address of the registry that each of its Blocks came from.
The registry is a tree of static files:
v2/overview.json: the list of all Blocks and their versions;v2/<organization>/<name>/<version>/manifest.json: the description of one Block version, with the list of its files (files);- the files of each Block version, in the same folder as its
manifest.json; kinds/<organization>/<name>/overview.json: the versions of the Blocks of one kind.
The Desktop App reads files of all the Blocks in v2/overview.json when it shows the list of
Blocks. Thus copy the full registry: a copy of some Blocks only, with the original list, does not
work. The files of a Block version do not change, so a new copy only adds the new versions. For
a registry of the Blocks that the company develops, see
Own Block registry.
-
Make an HTTPS service of the company for the mirror, for example a web server or a bucket behind HTTPS, at an address such as
https://blocks-mirror.example.com/. The computers of users and the Backend must have access to it. -
Copy the registry into a folder, with the same paths.
ExampleA script that copies the registry with
curlandjq:copy-blocks.sh #!/usr/bin/env bash# Copies the Block registry of MiLaboratories into the folder $1, with the same paths.# Run it again to add the new Block versions.set -euo pipefailsrc="https://blocks.pl-open.science"dst="$1"get() { mkdir -p "$(dirname "$dst/$1")"; curl -fsS -o "$dst/$1" "$src/$1"; }new="$(mktemp)"curl -fsS -o "$new" "$src/v2/overview.json"jq -r '.packages[] | "\(.id.organization)/\(.id.name) \(.allVersions | join(" "))"' "$new" |while read -r pkg versions; doget "v2/$pkg/overview.json"for v in $versions; do[ -f "$dst/v2/$pkg/$v/manifest.json" ] && continue # a version does not changemkdir -p "$dst/v2/$pkg/$v"curl -fsS -o "$dst/v2/$pkg/$v/manifest.tmp" "$src/v2/$pkg/$v/manifest.json"for f in $(jq -r '.files[].name' "$dst/v2/$pkg/$v/manifest.tmp"); doget "v2/$pkg/$v/$f"donemv "$dst/v2/$pkg/$v/manifest.tmp" "$dst/v2/$pkg/$v/manifest.json"donekind=$(jq -r '.description.kind // empty' "$dst/v2/$pkg/${versions##* }/manifest.json")if [ -n "$kind" ]; thenk="${kind#@*/}"; k="${k%@*}" # <organization>.<name>.kindget "kinds/${k%%.*}/$(cut -d. -f2 <<<"$k")/overview.json"fidonemkdir -p "$dst/v2"chmod 644 "$new"mv "$new" "$dst/v2/overview.json" # last: the list never points to missing filesThen publish the folder on the HTTPS service, with the same paths below its address. Run the copy again at regular intervals, so that users get the new Block versions.
-
Check that the mirror gives the files:
Terminal window curl -fsS https://blocks-mirror.example.com/v2/overview.json | jq '.packages | length'Result: the number of Blocks is the same as in
https://blocks.pl-open.science/v2/overview.json. -
In the Desktop App on each computer, open the settings, turn off Use Global Access Registry, and set Override Main Registry to the address of the mirror, for example
https://blocks-mirror.example.com/. See Block registries in the Desktop App. -
Point the Backend to the mirror with the option
--blocks-registry-url, for example--blocks-registry-url=https://blocks-mirror.example.com/. In KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary, give it in the Helm valueextraArgsor in the inputbackend_service.extra_argsofplatforma-tf-services. In Single Server modeSingle Server mode — The mode in which the Backend and all its jobs run on one Linux machine, the server, with no Kubernetes cluster. Glossary, give the option or the environment variablePL_BLOCKS_REGISTRY_URL. Then restart the Backend. See Block registry mirror for the Backend. -
Add a Block to a project.
Result: the Desktop App shows the Blocks of the mirror, and the Block opens.
The Blocks run tools on the Backend: the Backend still needs the software images and the assets of the Blocks. See Software images of the tools and Static assets.