• Stars
    star
    302
  • Rank 138,030 (Top 3 %)
  • Language
    Clojure
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Common Metadata Repository

Visit the CMR at https://earthdata.nasa.gov/about/science-system-description/eosdis-components/common-metadata-repository

About

The Common Metadata Repository (CMR) is an earth science metadata repository for NASA EOSDIS data. The CMR Search API provides access to this metadata.

Client-facing Components

  • Search

    • Allows the user to search by collections, granules, and concepts with a myriad of different query types
    • Search API Docs
  • Ingest

    • Ingest refers to the process of validating, inserting, updating, or deleting metadata in the CMR system. It affects only the metadata for the specific Data Partner. The CMR allows Data Partners to ingest metadata. records through a RESTful API
    • Ingest API Docs
  • Access Control

    • Access Control Lists (ACLs) are the mechanism which grants users access to perform different operations in the CMR. CMR ACLs follow the same design as ECHO ACLs, which are a superset of the generic ACL design pattern used in many other systems. An ACL is a mapping of actors (subjects) to resources (object) to operations (predicate).
    • Two quick examples of a CMR ACL could be:
      • All registered users have READ access to ASTER data
      • A provider's operations team may ingest data for that provider
    • Access Control API Docs

Prerequisites

  • Java 17
  • Leiningen
  • Maven
  • gcc and libc
  • Docker

Obtaining the Code

You can get the CMR source code by cloning the repository from GitHub:

git clone https://github.com/nasa/Common-Metadata-Repository.git cmr

Building and Running the CMR

The CMR is a system consisting of many services. The services can run individually or in a single process. Running in a single process makes local development easier because it avoids having to start many different processes. The dev-system project allows the CMR to run from a single REPL or JAR file. If you are developing a client against the CMR you can build and run the entire CMR with no external dependencies from this JAR file and use that instance for local testing. The sections below contain instructions for running the CMR as a single process or as many processes.

Using the cmr CLI Tool

This project has its own tool that is able to do everything from initial setup to running builds and tests on the CI/CD infrastructure. To use the tool as we do below, be sure to run the following from the top-level CMR directory:

export PATH=$PATH:`pwd`/bin
source resources/shell/cmr-bash-autocomplete

(If you use a system shell not compatible with Bash, we accept Pull Requests for new shells with auto-complete.)

To make this change permanent:

echo "export PATH=\$PATH:`pwd`/bin" >> ~/.profile
echo "source `pwd`/resources/shell/cmr-bash-autocomplete" >> ~/.profile

Building and Running CMR Dev System in a REPL with CMR CLI tool

  1. cmr setup profile and then update the new ./dev-system/profiles.clj file. it will look something like this:

    {:dev-config {:env {:cmr-metadata-db-password "<YOUR PASSWORD HERE>"
                        :cmr-sys-dba-password "<YOUR PASSWORD HERE>"
                        :cmr-bootstrap-password "<YOUR PASSWORD HERE>"
                        :cmr-ingest-password "<YOUR PASSWORD HERE>"
                        :cmr-urs-password "<YOUR PASSWORD HERE>"}}}
  2. cmr setup dev

  3. cmr start repl

  4. Once given a Clojure prompt, run (reset)

Note that the reset action may take a while, not only due to the code reloading for a large number of namespaces, but for bootstrapping services as well as starting up worker threads.

Building and Running CMR Dev System from a JAR

Assuming you have already run the above steps (namely cmr setup dev), to build and run the default CMR development system (dev-system) from a .jar file:

  1. cmr build uberjars
  2. cmr build all
  3. cmr start uberjar dev-system will run the dev-system as a background task

See CMR Development Guide to read about specifying options and setting environment variables

Building and Running separate CMR Applications

The following will build every application but will put each JAR into the appropriate target directory for each application. The command shown in step 3 is an example. For the proper command to start up each application, see the Applications section below. Note: You only need to complete steps 1 and 2 once.

  1. cmr build uberjar APP
  2. cmr run uberjar APP

Where APP is any supported CMR app. You can double-tap the TAB key on your keyboard to get the cmr tool to show you the list of available apps after entering uberjar in each step above.

Note: building uberjars will interfere with your repl. If you want to use your repl post-build you will need to, rm -f ./dev-system/target/

Checking Dependencies, Static Analysis, and Tests

There are several lein plugins within the CMR for performing various tasks either at individual subproject levels or at the top-level for all subprojects.

Dependency Versions

To check for up-to-date versions of all project dependencies, you can use cmr test versions PROJ, where PROJ is any CMR sub-project under the top-level directory.

You may run the same command without a project to check for all projects: cmr test versions.

Note that this command fails with the first project that fails. If many subprojects are failing their dependency version checks and you wish to see them all, you may use your system shell:

for PROJ in `ls -1d */project.clj|xargs dirname`
do
  "Checking $PROJ ..."
  cmr test versions $PROJ
  cd - &> /dev/null
done

Dependency Ambiguities and .jar File Conflicts

To see if the JVM is having problems resolving which version of a dependency to use, you can run cmr test dep-tree PROJ. To perform this against all projects: cmr test dep-trees.

Static Analysis and Linting

To perform static analysis and linting for a project, you can run cmr test lint PROJ. As above with dependency version checking, by not passing a project, you can run for all projects: cmr test lint.

Dependency Vulnerability Scanning

You can see if your currently installed version of CMR has any reported Common Vulnerabilities and Exploits (CVEs) by running the helpful alias lein check-sec that you can use in each application, or at the root folder to scan all CMR apps together.

You will find the vulnerability summary in ./target/dependency-check-report.html in each application.

Testing CMR

Test files in CMR should follow the naming convention of ending in -test.

There are two modes of testing the CMR:

  • From the REPL
  • Utilizing the CI/CD script to run against an Oracle database

For the first, the steps are as follows:

  1. Ensure you have set up your development environment in dev-system
  2. If you have built any .jar files, run cmr clean PROJ (for a given project) or cmr clean to clean all projects.
  3. Start the REPL: cmr start repl
  4. Once in the REPL, start the in-memory services: (reset)
  5. Run the tests: (run-all-tests) or (run-all-tests-future)

You have the option of substituting the last step with (run-suites). This uses a third-party tool to display clear test results which are easier copy/paste should you want to run them on an individual basis. These results also contain easier to read exception messages/stacktraces. Here's an excerpt:

   cmr.system-int-test.ingest.provider-ingest-test
     update-provider-test
       assertion 1 ........................................................ [OK]
       assertion 2 ........................................................ [OK]
       assertion 3 ........................................................ [OK]
       assertion 4 ........................................................ [OK]
     delete-provider-test
       assertion 1 ........................................................ [OK]
       assertion 2 ........................................................ [OK]
       assertion 3 ........................................................ [OK]
       assertion 4 ........................................................ [OK]
       assertion 5 ........................................................ [OK]
       assertion 6 ........................................................ [OK]
       assertion 7 ........................................................ [OK]
       assertion 8 ........................................................ [OK]
       assertion 9 ........................................................ [OK]

For non-terminal based dev, depending upon your IDE/editor, you may have shortcuts available to you for starting/restarting the services and/or running the tests. To find out what these are you can contact a CMR core dev.

To run the tests against an Oracle database, we recommend that you use an Oracle VM built for this purpose. You will also need configuration and authentication information that will be set as environment variables. Be sure to contact a CMR core dev for this information.

To run only certain types of tests, you may run the following:

Unit Tests
lein modules utest
Integration Tests

If running CMR with the in-memory database (default)

lein modules itest --skip-meta :oracle

If running CMR with an external database

lein modules itest --skip-meta :in-memory-db

If you want to run tests against Oracle, bring up the Oracle VM and execute the following to create the users and run the migrations:

cmr setup db

Then, in the CMR REPL:

user=> (reset :db :external)
...
user=> (run-all-tests)
...

Those tests will take much longer to run than when done with the in-memory database (~25m vs. ~6m). To switch back to using the in-memory database, call (reset :db :in-memory).

There is also a different, optional test runner you can use. For more details see the docstring for run-suites in dev-system/dev/user.clj. It will contain usage instructions

Testing in the CI Environment

Throughout the modules, in the project.clj files there are additional lein aliases for executing the tests in the CI/CD environment. They are

  • ci-itest
  • ci-utest

These run the integration and unit tests, respectively, in the CI environment. The difference between itest and ci-itest or utest and ci-utest are the settings passed to the kaocha test runner.

In the CI environment, color is omitted, and certain tests that require an internal memory database are excluded. The aliases may be used locally as well.

To see the difference in detail, inspect the tests.edn files for each module to see the profile in use in the CI environment. Kaocha supports the use of profiles so more may be added as necessary.

Test Development

CMR uses the Kaocha test library. It provides plugins and grouping capabilities. Tests are organized in each module with the standard being :unit and :integration.

Not all modules will contain :integration tests.

Code structure

The CMR comprises several small services called microservices. These are small purposed-based services that do a small set of things well.

The Microservices

Each microservice has a README file in its root directory, which provides a short overview of the service's functionality. There are many main applications, as well as several libraries and support applications.

Applications:

  • access-control-app

    • The mechanism which grants users access to perform different operations in the CMR. It also maintains groups and access control rules. Note that ECHO and URS provide user access as an external dependency. The mock-echo application implements both of the necessary interfaces for local testing.
    • Main method: cmr.access_control.runner
  • bootstrap-app

    • Contains APIs for performing various bulk actions in the CMR
    • Main method: cmr.bootstrap.runner
    • See /bootstrap-app/README.md for a list of lein and uberjar commands
  • dev-system

    • An app that combines the separate microservices of the CMR into a single application. We use this to simplify development
    • Main method: cmr.dev_system.runner
  • indexer-app

    • This handles indexing collections, granules, and tags in Elasticsearch
    • Maintains the set of indexes in Elasticsearch for each concept
    • Main method: cmr.indexer.runner
  • ingest-app

    • The Ingest app handles collaborating with metadata db and indexer systems. This maintains the lifecycle of concepts coming into the CMR
    • Main method: cmr.ingest.runner
  • search-app

    • Provides a public search API for concepts in the CMR
    • Main method: cmr.search.runner
  • search-relevancy-test

    • Tests to measure and report the effectiveness of CMR's search relevancy algorithm
  • system-int-test

    • Black-box, system-level tests to ensure functionality of the CMR
  • virtual-product-app

    • Adds the concept of Virtual Products to the CMR. Virtual Products represent products that a provider generates on demand from users. This takes place when a user places an order or downloads a product through a URL
    • Main method: cmr.virtual_product.runner
  • metadata-db-app

    • A database that maintains revisioned copies of metadata for the CMR
    • Main method: cmr.metadata_db.runner
  • mock-echo-app

    • This mocks out the ECHO REST API and the URS API as well. Its purpose is to make it easier to integration test the CMR system without having to run a full instance of ECHO. It will only provide the parts necessary to enable integration testing. You should not expect a perfect or complete implementation of ECHO.
    • Main method: cmr.mock_echo.runner

Libraries:

  • acl-lib

    • Contains utilities for retrieving and working with ACLs
  • common-app-lib

    • Contains utilities used within many CMR applications
  • common-lib

    • Provides common utility code for CMR projects
  • elastic-utils-lib

    • A library that handles most of the interfacing with Elasticsearch
  • es-spatial-plugin

    • An Elasticsearch plugin that enables spatial search within elastic
  • oracle-lib

    • Contains utilities for connecting to and manipulating data in Oracle
  • orbits-lib

    • Clojure wrapper of a Ruby implementation of the Backtrack Orbit Search Algorithm (BOSA)
  • message-queue-lib

    • A library for interfacing with RabbitMQ, AWS SQS, and an in-memory message queue
  • spatial-lib

    • The spatial libraries provide utilities for working with spatial areas in the CMR
  • transmit-lib

    • The Transmit Library defines functions for invoking CMR services
  • umm-lib

    • This is the old source of UMM schemas and translation code. Since the advent of umm-spec-lib we are planning to remove it
  • umm-spec-lib

    • The UMM Spec lib contains JSON schemas that define the Unified Metadata Model, as well as mappings to other supported formats, and code to migrate collections between any supported formats.

Further Reading

License

Copyright Β© 2014-2023 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.

More Repositories

1

openmct

A web based mission control framework.
JavaScript
11,117
star
2

fprime

FΒ΄ - A flight software and embedded systems framework
C++
10,048
star
3

NASA-3D-Resources

Here you'll find a growing collection of 3D models, textures, and images from inside NASA.
Mathematica
2,804
star
4

apod-api

Astronomy Picture of the Day API service
Python
824
star
5

astrobee

NASA Astrobee Robot Software
C++
811
star
6

earthdata-search

Earthdata Search is a web application developed by NASA EOSDIS to enable data discovery, search, comparison, visualization, and access across EOSDIS' Earth Science data holdings.
JavaScript
745
star
7

trick

Trick Simulation Environment. Trick provides a common set of simulation capabilities and utilities to build simulations automatically.
C++
685
star
8

Transform-to-Open-Science

Transformation to Open Science
639
star
9

cFS

The Core Flight System (cFS)
CMake
537
star
10

XPlaneConnect

The X-Plane Communications Toolbox is a research tool used to interact with the X-Plane flight simulator
C
536
star
11

osal

The Core Flight System (cFS) Operating System Abstraction Layer (OSAL)
C
486
star
12

api-docs

api.nasa.gov
SCSS
448
star
13

NASTRAN-95

Fortran
393
star
14

spaceapps

363
star
15

cFE

The Core Flight System (cFS) Core Flight Executive (cFE)
C
343
star
16

instructions

https://github.com/nasa/nasa.github.io/blob/master/docs/INSTRUCTIONS.md
HTML
336
star
17

World-Wind-Java

World Wind, an open source 3D interactive world viewer, was created by NASA's Learning Technologies project, and released in mid-2004. It is now developed by NASA staff and open source community developers.
C++
328
star
18

ogma

Haskell
327
star
19

VICAR

291
star
20

CFL3D

Fortran
267
star
21

Open-Source-Catalog

Contains the NASA open source software catalog for automatic deployment to code.nasa.gov
JavaScript
259
star
22

openmct-tutorial

A tutorial for OpenMCT that guides you through integrating historical and realtime telemetry.
JavaScript
242
star
23

code-nasa-gov

code.nasa.gov site leveraging the Open Source Catalog on github.com, powered by Polymer
CSS
236
star
24

eefs

EEPROM File System
C
232
star
25

cumulus

Cumulus Framework + Cumulus API
JavaScript
230
star
26

T-MATS

An open source thermodynamic modeling package completed on behalf of NASA. The Toolbox for the Modeling and Analysis of Thermodynamic Systems (T-MATS) package offers a MATLAB/Simulink toolbox that gives a developer the ability to create simulations of such thermodynamic systems as turbomachinery and gas turbines. Keywords: TMATS, Control System, Numerical Methods, Newton-Raphson, Jacobian Calculation, Propulsion, Aircraft Engine, Jet, Turbofan, Turbojet, Compressor, Turbine, Nozzle, Inlet, open source
HTML
216
star
27

isle

JavaScript
213
star
28

europa

C++
207
star
29

nasa-latex-docs

An easy and convenient package to create technical LaTeX documents.
TeX
197
star
30

pvslib

NASA PVS Library of Formal Developments
Common Lisp
186
star
31

delta

Deep Learning for Satellite Imagery
Python
184
star
32

CrisisMappingToolkit

NASA Ames Crisis Mapping Toolkit
Python
183
star
33

nos3

NASA Operational Simulator for Small Satellites
C
167
star
34

icarous

ICAROUS is a software architecture for the development of UAS applications
C
147
star
35

DERT

DERT is an open source software tool for exploring NASA's digital terrain models in 3D
Java
142
star
36

NASTRAN-93

NASTRAN is the NASA Structural Analysis System, a finite element analysis program (FEA)
Fortran
134
star
37

ow_simulator

Python
129
star
38

meshNetwork

C++
127
star
39

prog_models

The NASA Prognostic Model Package is a Python framework focused on defining and building models for prognostics (computation of remaining useful life) of engineering systems, and provides a set of prognostics models for select components developed within this framework, suitable for use in prognostics applications for these components.
122
star
40

QuIP

QuIP provides an interactive environment for computing and presenting images and image sequences, manipulating and storing arbitrary data, and general scientific computing and plotting. The current release supports unix-like operating systems (tested on Linux and Mac OSX), and Apple's iOS mobile operating system. GPU acceleration is supported with either CUDA or OpenCL. There is built-in support for psychophysical experimentation, with general-purpose staircase routines and analysis of psychometric functions.
C
118
star
41

autodoc

Create Microsoft Documents automatically using Text and Template files
106
star
42

Kodiak

Library for rigorous verification of non-linear arithmetic
C++
103
star
43

PrognosticsAlgorithmLibrary

MATLAB
103
star
44

EMIT-Data-Resources

This repository provides guides, short how-tos, and tutorials to help users access and work with data from the Earth Surface Mineral Dust Source Investigation (EMIT) mission.
HTML
102
star
45

CompDam_DGD

Fortran
99
star
46

astrobee_android

NASA Astrobee Robot Software, Android
Java
96
star
47

OpenSPIFe

The Open Scheduling and Planning Interface for Exploration (OpenSPIFe) is an integrated planning and scheduling toolkit based on hundreds of hours of expert observation, use, and refinement of state-of-the-art planning and scheduling technology for several applications within NASA.
Java
95
star
48

HDTN

High-rate Delay Tolerant Network (HDTN) Software
C++
90
star
49

PrognosticsModelLibrary

MATLAB
89
star
50

mmt

NASA's Metadata Management Tool.
Ruby
86
star
51

kepler-pipeline

Kepler Science Data Processing Pipeline
C
84
star
52

IDF

C++
80
star
53

nasapress

A WordPress theme built on the NASA Web Design Standards
PHP
79
star
54

PyTDA

Python Turbulence Detection Algorithm (PyTDA)
Jupyter Notebook
78
star
55

harmony

Application for providing services for Earth observation data in the cloud using standards-based APIs
TypeScript
74
star
56

RHEAS

Regional Hydrologic Extremes Assessment System
Python
73
star
57

astrobot

A slack bot integration with NASA data
JavaScript
73
star
58

podaacpy

A python utility library for interacting with NASA JPL's PO.DAAC
Python
73
star
59

CCDD

CFS Command and Data Dictionary Tool (CCDDT)
Java
72
star
60

SMCPy

Python module for uncertainty quantification using a parallel sequential Monte Carlo sampler
Python
71
star
61

NASA-Acronyms

JavaScript
71
star
62

PointCloudsVR

C++
68
star
63

channel-emulator

C++
66
star
64

cFS-GroundSystem

The Core Flight System (cFS) Ground System Lab Tool (cFS-GroundSystem)
Python
65
star
65

CFS-101

63
star
66

AprilNav

C++
61
star
67

common-mapping-client

CMC is a starter-kit for creating web-based mapping applications
JavaScript
60
star
68

PSP

The Core Flight System (cFS) Platform Support Package (PSP)
C
60
star
69

NASAaccess

NASAaccess is R package that can generate gridded ascii tables of climate (CIMP5) and weather data (GPM, TRMM, GLDAS) needed to drive various hydrological models (e.g., SWAT, VIC, RHESSys, ..etc)
R
60
star
70

CryptoLib

Provide a software-only solution using the CCSDS Space Data Link Security Protocol - Extended Procedures (SDLS-EP) to secure communications between a spacecraft running the core Flight System (cFS) and a ground station.
C
60
star
71

GTM_DesignSim

MATLAB
59
star
72

dictionaries

A collection of NASA "dictionaries", including thesauri, taxonomies and ontologies.
HTML
58
star
73

progpy

The NASA Prognostic Python Packages is a Python framework focused on defining and building models and algorit for prognostics (computation of remaining useful life) of engineering systems, and provides a set of models and algorithms for select components developed within this framework, suitable for use in prognostic applications.
Python
57
star
74

libSPRITE

libSPRITE is a set of libraries that have been used on several past projects including flight, technology demonstration, and simulation projects. libSPRITE provides a diverse set of functions to attempt to simplify coding and reduce code errors. For example, libSPRITE defines engineering units as types (i.e., Meters or Radians instead of double or int). It includes an engineering unit aware math library. libSPRITE includes a task scheduling system that abstracts pthreads and includes a publish subscribe data system for data routing. In addition, libSPRITE includes an optional binding to the Lua scripting language for configuring the program, setting parameters, running Lua scripts within C++ tasks and even interacting with the application during runtime.
C++
57
star
75

prog_algs

The Prognostic Algorithm Package is a python framework for model-based prognostics (computation of remaining useful life) of engineering systems, and provides a set of algorithms for state estimation and prediction, including uncertainty propagation. The algorithms take as inputs prognostic models (from NASA's Prognostics Model Package), and perform estimation and prediction functions. The library allows the rapid development of prognostics solutions for given models of components and systems. Different algorithms can be easily swapped to do comparative studies and evaluations of different algorithms to select the best for the application at hand.
57
star
76

utm-apis

The collection of APIs for NASA's UTM project in the form of OpenAPI documents.
55
star
77

cumulus-dashboard

Cumulus API Dashboard
JavaScript
55
star
78

hybridq

HybridQ is a highly extensible platform designed to provide a common framework to integrate multiple state-of-the-art techniques to simulate large scale quantum circuits on a variety of hardware. HybridQ provides tools to manipulate, develop, and extend noiseless and noisy circuits for different hardware architectures. HybridQ also supports large-scale high-performance computing (HPC) simulations, automatically balancing workload among different processor nodes and enabling the use of multiple backends to maximize parallel efficiency. Everything is then glued together by a simple and expressive language that allows seamless switching from one technique to another as well as from one hardware to the next, without the need to write lengthy translations, thus greatly simplifying the development of new hybrid algorithms and techniques.
Python
55
star
79

pretrained-microscopy-models

Python
54
star
80

GFR

GFR (Glenn Flux Reconstruction) software (LEW-19709-1) has been approved for an open source release
Fortran
54
star
81

refine

C
53
star
82

NASA-Space-Weather-Media-Viewer

Space Weather and the Sun.
52
star
83

giant

Goddard Image Analysis and Navigation Tool
Python
51
star
84

EADINLite

EADIN_Lite Network Protocol
C++
51
star
85

SingleDop

Single Doppler Retrieval Toolkit (SingleDop)
Jupyter Notebook
50
star
86

multipath-tcp-tools

C++
49
star
87

OnAIR

The On-board Artificial Intelligence Research (OnAIR) Platform is a framework that enables AI algorithms written in Python to interact with NASA's cFS. It is intended to explore research concepts in autonomous operations in a simulated environment.
Python
48
star
88

bingo

Python
48
star
89

MMM-Py

Marshall MRMS Mosaic Python Toolkit
Jupyter Notebook
48
star
90

CF

The Core Flight System (cFS) CFDP application.
C
47
star
91

ipv6_python

Python
47
star
92

MLMCPy

Python
47
star
93

TTECTrA

An open source, semi-automated, control design tool for subsonic aircraft engine simulations written in the MATLAB/Simulink environment. The Tool for Turbine Engine Closed-loop Transient Analysis provides the user a preliminary estimate of the closed-loop transient performance of an engine model.
47
star
94

WellClear

Well-Clear Boundary Models for Integration of UAS in the NAS
HTML
46
star
95

CertWare

Java
46
star
96

fpp

F Prime Prime: A modeling language for F Prime
C++
46
star
97

podaac_tools_and_services

A meta-repository which essentially lists code related to all tools and services software for NASA JPL's PO.DAAC
Python
45
star
98

cmr-stac

TypeScript
44
star
99

RtRetrievalFramework

C++
43
star
100

mplStyle

Matplotlib object oriented style system
Python
43
star