Reg-api-client: helper script for PRR ingestion

Several APEX services and algorithms make use of data hosted in the ESA PRR (Project Results Repository). If you are a PRR Data Provider or planning to become one, you might be interested in the reg-api-client script at reg-api/client/reg-api-client at main · EOEPCA/reg-api · GitHub . The script itself depends on s5cmd and curl, which you might have already installed on your Linux machine, but at reg-api/client at main · EOEPCA/reg-api · GitHub you also have a Docker container and a CWL/OGC Application Package, if you prefer to use the script like that.

If you have the script installed and already have PRR data provider credentials (i.e. username/password) and a PRR STAC collection name, a typical usage will be:

./reg-api-client -u username -p password -c collection_name path-to-stac-item.json

There are two main advantages of using this script. The first one is that the script deals with some of the PRR-specific S3 details (e.g. URL, bucket region), the second one is that you can skip the step of ingesting the data to the PRR S3 stage-in bucket yourself. As per the PRR logic (see Registration Gateway - Swagger UI), you still need to have a JSON file with STAC Item metadata pointing to the location of the file pre-ingestion (which will be overwritten once the item is registered in the PRR catalogue).

Let us know here if you have questions and/or problems using the PRR.

3 Likes

Thank you @psacra for the tip!

We also had some good experiences with the Docker images themselves, allowing the automatic upload to S3 and registration into the ESA PRR through the following command:

docker run --rm -v ${PWD}:/apex eoepca/reg-api-client:latest -C -c <COLLECTION> -u <USER> -p "<PASSWORD>" -b <BUCKET> /apex/<STAC FILE>.json

The only caveat to take into account is that you need to mount the folder where your assets are in your Docker container. In this example, the current working directory is mounted to /apex which means that the asset’s paths in the STAC metadata also need to point to /apex.

1 Like