Usage: macrostrat <subcommand> [options]
db
- Manage the Macrostrat databaseenv
- Manage Macrostrat environmentsmaps
- Manage Macrostrat's mapsself
- Inspect the command-line application
...and others yet to be implemented
macrostrat db dump [database?]
: Create a custom-format dump of the databasemacrostrat db restore <dumpfile> [database?]
: Restore a database from a dumpfilemacrostrat db psql [database?]
: Open a psql shell to the database. Also supports piping SQL from stdin.macrostrat db update-schema
: run idempotent schema updates
macrostrat env
: Switch to another environment
The following commands require certain keys to be defined in the
macrostrat.toml
configuration file. Refer to the template file in
map-integration.
In order to load a new map into Macrostrat, the basic flow is:
-
macrostrat maps pipeline upload-file
: Upload a local archive file for a map to the object store.To add a new map to Macrostrat, or to update an existing one, the first step is to upload the required files to the object store.
This command has two required arguments: a "slug", something that can serve as a human-readable identifier for the map, and a path to a local archive file, which should be an archive that contains with GIS data.
-
macrostrat maps pipeline ingest-map
: Ingest a map from its already uploaded files.Once the required files for a map have been uploaded to the object store, the map can be ingested.
This command has one required argument: a "slug", the human-readable identifier for the map. (Technically, the internal "source ID" can also be used.)
In order to load many new maps intos Macrostrat:
-
macrostrat maps pipeline ingest-csv
: Ingest multiple maps from their descriptions in a CSV file.Use the
--help
option to view the documentation for this command. -
macrostrat maps run-polling-loop
: Poll for and process pending maps.This command will periodically poll Macrostrat's database for "pending ingest process" records, which typically indicate that a map has been uploaded to Macrostrat's S3 storage via the web application and is ready to be processed.
macrostrat secrets <name>
: Gets a secret in the active Kubernetes namespace (ifkube_namespace
is defined in the config)
macrostrat self
: Inspect the command-line application
# Replace a knowledge graph
macrostrat env development
macrostrat db psql -c "DROP SCHEMA macrostrat_kg CASCADE; CREATE SCHEMA macrostrat_kg;"
cat "2024_02_10.sql" | macrostrat db psql
macrostrat db update-schema --subsystems knowledge-graph