appyter-catalog
appyter-catalog copied to clipboard
Dynamic appyter-catalog appyter injection
Currently, we construct a static docker-compose with a static ui page. One convenient modification was made when we added traefik
which allows us to detect new containers and mount them without needing to stop the ingest. It would be very convenient if the same could be done with the catalog -- that-is, appyters (which have their catalog metadata in a predictable place in each of the docker images) can be automatically added/removed from the catalog when the docker container gets added or removed.
Technically all we'd have to do is detect updates to the docker containers and re-construct public/appyters.json
which can be done with
docker ps -q \ # list all docker containers
| xargs -I'{}' \ # execute for each docker container
docker exec -it '{}' \ # run in container
cat /app/appyter.json \ # produce appyter metadata
2> /dev/null \ # ignore missing file in non-appyter containers
| jq -rcs \ # collect json into a compact list
> static/appyters.json # update appyters.json
fetch with {cache: 'no-cache'}
will still allow us to cache public/appyters.json
Alternatively we can probably use appyter-catalog-helper
to register the appyter on postgrest
and use the database for content.