The Neuron Morphology Community Portal is a collection of services for managing annotated neuron data.
The application services in docker-compose.services.yml are built from the following repositories, each published as a
versioned container image under ghcr.io/allenneuraldynamics.
- nmcp-api (
apiservice) - GraphQL backend for specimen, neuron, and reconstruction management and search; owns the PostgreSQL and InfluxDB connections, DOI minting, and access requests - nmcp-client (
clientservice) - the user-facing portal web application, including the embedded Neuroglancer viewer - nmcp-export (
exportservice) - exports reconstructions as SWC or Parquet, individually or as ZIP archives with citation metadata - nmcp-precomputed (
precomputed-workerservice, imagenmcp-precomputed-worker) - polls the API and generates Neuroglancer precomputed skeletons for reconstructions - nmcp-qc (
quality-apiservice) - quality control service for reconstruction data
The general, user-facing backend workflow is documented in the nmcp-api publish workflow.
The current implementation uses Docker with Docker Compose to manage the multiple independent services. The containers should also be compatible with Podman however this is untested.
A standard installation of Docker is sufficient.
The databases (PostgreSQL and InfluxDB) use Data Volumes. Starting, stopping, and removing/updating the service containers will not remove database contents.
Copy .env-template to .env and set the following values:
NMCP_DATABASE_PW- password for the PostgreSQL database (required)NMCP_INFLUX_DB_PASSWORD- password for the InfluxDB admin user (required)NMCP_INFLUX_DB_TOKEN- InfluxDB admin token, used to initialize InfluxDB and bynmcp-apito write metricsNMCP_COMPOSE_PROJECT- Docker Compose project/container prefix (defaultnmcp)NMCP_LOG_VOLUME- host path mapped to/var/log/nmcpin service containers (required; can be set to/tmpfor testing)NMCP_SERVICES_FILE- compose file for application services (defaultdocker-compose.services.yml)docker-compose.services.staging.ymlis an alternate that always pulls theleapscientific/*:latestdevelopment images rather than the pinned release images
NMCP_SERVER_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx- a secret key used between services internally, e.g., a random uuid or similar
NMCP_ONTOLOGY_LOCATIONandNMCP_ONTOLOGY_PATHmust be set- can be set to
/tmpfor deployment testing - otherwise, set to actual host locations for the data on the host machine
- can be set to
NMCP_PRECOMPUTED_OUTPUT- a location url supported by the cloud-volume package where
precomputed-workerwrites data sets in the Neuroglancer precomputed format and from whichclientloads them
- a location url supported by the cloud-volume package where
NMCP_QC_SKELETON_OUTPUT- base location for raw reconstruction quality control skeletons (required for raw uploads)- a location url supported by the cloud-volume package; each upload's skeleton is written to
<base>/raw-qc/<qc-tag> - written by the precomputed service and read by the quality control service, so both must be able to reach it
- must not be at or under
NMCP_PRECOMPUTED_OUTPUT, which the precomputed service refuses
- a location url supported by the cloud-volume package; each upload's skeleton is written to
NMCP_QC_BLOB_OUTPUT- host directory for raw upload hand-off files and quality control documents (required)- mapped into
nmcp-apiat the same path; files are written underraw/ - must persist across container restarts so pending quality control can resume
- mapped into
NMCP_AIND_METADATA_URL- AIND metadata portal base url, including any prefix, used to link raw upload quality control results (required for raw uploads)NMCP_AUTHENTICATION_API_APP_ID- Entra application ID of thenmcp-apiapp registration, not that of thenmcp-clientfront endNMCP_AUTHENTICATION_TENANT_ID- Entra directory (tenant) ID the API accepts tokens fromNMCP_DOI_URL- URL of the NMCP website that generated DOI urls will reference, e.g.,https://morphology.allenneuraldynamics.org/NMCP_DOI_HOST- host of the DataCite API server (production or test)NMCP_DOI_PREFIX- DOI prefix (production or test value as appropriate)NMCP_DOI_USER- DataCite API user credentialNMCP_DOI_PASSWORD- DataCite API password credentialNMCP_DOI_HANDLER- DOI handler base URL, e.g.,https://doi.orgfor production orhttps://handle.test.datacite.orgfor testNMCP_ACCESS_REQUEST_SNS_TOPIC_ARN- AWS SNS topicnmcp-apipublishes access request notifications toNMCP_ACCESS_REQUEST_REVIEW_URL- URL included in access request notifications for reviewing the requestNMCP_GOOGLE_ANALYTICS_TAG- Google Analytics tag for the client (optional)NMCP_EXPERIMENTAL_ENV- enables experimental features in services (optional; used only bydocker-compose.services.staging.yml)
Most Docker Compose operations are wrapped in shell scripts to ensure the required flags are correct, e.g., test vs. production.
./up.sh./stop.sh./down.shdestroys existing service containers but does not remove any data volumes. Newer container images can then be pulled and the services restarted with the up script.
./logs.shwill bring up the correct set of Compose logs for this container set (vs. test or any other deployment on the same host).
./dev.shwill start only those services that are not developed as part of the project, e.g., generic database instances. The rest of the services are presumed to be run locally from code, etc.
Precomputed skeletons and other system-generated Neuroglancer data sources that are typically stored in S3 or similar can be
hosted locally via an S3-compatible service, setting NMCP_PRECOMPUTED_OUTPUT for nmcp-client, and configuring nmcp-precomputed
for this service.
One option is to run a local MinIO Docker container as an S3-compatible destination. By default, the MinIO container will run on port 9000.
- Create a bucket in MinIO
- Set the expected env var
NMCP_PRECOMPUTED_OUTPUTtohttp://localhost:9000/<your-bucket>/ngv01when runningnmcp-client - In your Python environment for
nmcp-precomputed, use thecloudfilescommand line interface to configure the MinIO instance as an alias - Configure a minio-secrets.json file for this instance, as described in the
cloudvolumeandcloudfilesdocumentation - Pass the MinIO alias as the output location (
-oargument) when runningnmcp-precomputed
Additional details on using an alias with cloudfiles can be found in the nmcp-precomputed README.