Skip to content

Commit

Permalink
merge integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Dec 2, 2024
2 parents f99a10c + bf29784 commit 9e9f6eb
Show file tree
Hide file tree
Showing 59 changed files with 4,419 additions and 330 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -26,7 +26,7 @@ jobs:
run: scripts/testall.docker python

- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -27,7 +27,7 @@ jobs:
run: scripts/testall.docker python

- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -30,7 +30,7 @@ jobs:
run: scripts/testall.docker python

- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-artifacts
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/testall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -29,3 +29,9 @@ jobs:
- name: Build & Run Python Tests via Docker
run: scripts/testall.docker python

- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-artifacts
path: python/build/test-artifacts/
19 changes: 0 additions & 19 deletions .vscode/launch.json

This file was deleted.

30 changes: 21 additions & 9 deletions docker/midasserver/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
# MIDAS Web Services (for development mode)

The intention of this Docker container is to run a fully functional MIDAS web service
suite<sup>*</sup> primarily for development and purposes. It can be launched via the
[`midasserver` script](https://github.com/usnistgov/oar-pdr-py/tree/feature/draft-service/scripts/midasserver)
in the [`scripts` directory](https://github.com/usnistgov/oar-pdr-py/tree/feature/draft-service/scripts).
suite primarily for development purposes. It can be launched via the
[`midasserver` script](../scripts/midasserver) in the [`scripts` directory](../scripts).

By default, the server operates with a storage backend in which records are stored in JSON
files beneath a specified data directory. This makes it easy to inspect the current contents
of the stored records during development. However, the server can optionally be run using a
MongoDB backend.

<sup>*</sup>_Note: While the server is designed to provided the full suite of MIDAS APIs,
as of this writing, only the DMP project service is available._

## Prerequisites for running the server

To run this server "out of the box" requires:

* Python 3 (>= 3.8.X)
* Python 3 (>= 3.10.X)
* Docker Engine with command-line tools
* if you want to use the option MongoDB backend, you will also need the [docker compose
plugin](https://docs.docker.com/get-started/08_using_compose/). This is included with
Docker Desktop (typical for Mac installs); to check to see if you already have it, type,
`docker compose version`.
* The [oar-pdr-py repository](https://github.com/usnistgov/oar-pdr-py) cloned onto your machine.

It is not necessary to build the python software separately; this can be done on-the-fly the first
time your script run the server script.

## Starting and stopping the server

To run the server, you should open a terminal and change into you local clone of the `oar-pdr-py`
To run the server, you should open a terminal and change into your local clone of the `oar-pdr-py`
repository. The server is launched using the `midasserver` script located in the `scripts`
directory. Note when you run the script for the first time, it will automatically build all of
the python code and docker images (producing a lot of output to the screen); these are not rebuilt
Expand All @@ -37,7 +36,7 @@ To start the server, you provide the name of the directory where you want the ba
For example, you can type:

```bash
scripts/midasserver midasdata
scripts/midasserver midasdata --bg
```

This will create a `midasdata` subdirectory in the current directory. The actual record data will
Expand Down Expand Up @@ -78,6 +77,19 @@ shutdown as well:
scripts/midasserver -M stop
```

### Launching with staff directory APIs included

If the server is started with the `-P` (or `--add-people-service`) option, the staff directory
service APIs will be included among the MIDAS APIs.

```bash
scripts/midasserver -M -P midasdata
```

These will be available under the `http://localhost:9091/nsd` endpoint. See the
[peopleservice README documentation](../peopleserver/README.md) for details about using these
APIs.

## Using the service

The base URLs for the MIDAS services are as follows:
Expand Down
17 changes: 17 additions & 0 deletions docker/midasserver/midas-dmpdap_conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,20 @@ services:
describedBy: "http://localhost:9091/docs/dmpsvc-elements.html"
href: "http://localhost:9091/midas/dmp/mdm1"
version: mdm1

nsdi:
about:
message: "NSD Indexing Service"
title: "NIST Staff Directory Indexing API"
describedBy: "http://localhost:9091/docs/nsdisvc-elements.html"
href: "http://localhost:9091/midas/nsdi"
default_convention: v1
conventions:
v1:
nsd:
service_endpoint: http://peopleserver:9092/
about:
title: "NIST Staff Directory Indexing API (version 1)"
describedBy: "http://localhost:9091/docs/nsdisvc-elements.html"
href: "http://localhost:9091/midas/nsdi/v1"
version: v1
109 changes: 109 additions & 0 deletions docker/midasserver/midas-dmpdapnsd_conf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
logfile: midas.log
loglevel: DEBUG
dbio:
factory: fsbased
about:
title: "MIDAS Authoring Services"
describedBy: "http://localhost:9091/midas/docs"
href: "http://localhost:9091/midas/"
services:
dap:
about:
message: "DMP Service is available"
title: "Digital Asset Publication (DAP) Authoring API"
describedBy: "http://localhost:9091/docs/dapsvc-elements.html"
href: "http://localhost:9091/midas/dap"

clients:
midas:
default_shoulder: mds3
default:
default_shoulder: mds3

dbio:
superusers: [ "rlp3" ]
allowed_project_shoulders: ["mdsx", "mds3", "mds0", "pdr0"]
default_shoulder: mdsx

include_headers:
"Access-Control-Allow-Origin": "*"

default_convention: mds3
conventions:
mdsx:
about:
title: "Digital Asset Publication (DAP) Authoring API (experimental)"
describedBy: "http://localhost:9091/docs/dapsvc-elements.html"
href: "http://localhost:9091/midas/dap/mdsx"
version: mdsx
assign_doi: always
doi_naan: "10.18434"
mds3:
about:
title: "Digital Asset Publication (DAP) Authoring API (mds3 convention)"
describedBy: "http://localhost:9091/docs/dapsvc-elements.html"
href: "http://localhost:9091/midas/dap/mds3"
version: mds3
assign_doi: always
doi_naan: "10.18434"
nerdstorage:
type: fsbased
store_dir: /data/midas/nerdm

dmp:
about:
message: "DMP Service is available"
title: "Data Management Plan (DMP) Authoring API"
describedBy: "http://localhost:9091/docs/dmpsvc-elements.html"
href: "http://localhost:9091/midas/dmp"

clients:
midas:
default_shoulder: mdm1
default:
default_shoulder: mdm1

dbio:
superusers: [ "rlp3" ]
allowed_project_shoulders: ["mdm0", "mdm1"]
default_shoulder: mdm1

include_headers:
"Access-Control-Allow-Origin": "*"

default_convention: mdm1
conventions:
mdm1:
about:
title: "Data Management Plan (DMP) Authoring API (mdm1 convention)"
describedBy: "http://localhost:9091/docs/dmpsvc-elements.html"
href: "http://localhost:9091/midas/dmp/mdm1"
version: mdm1

nsd:
about:
message: "NSD Service"
title: "NIST Staff Directory Service API"
describedBy: "http://localhost:9091/docs/nsdsvc-elements.html"
href: "http://localhost:9091/midas/nsd"
include_headers:
"Access-Control-Allow-Origin": "*"
default_convention: nsd1
db_url: "mongodb://oarop:oarop@mongodb:27017/midas"
data:
dir: /data/nsd
person_file: person.json
org_file: orgs.json
conventions:
nsd1:
about:
title: "NIST Staff Directory Service API (NSD version 1)"
describedBy: "http://localhost:9091/docs/nsdsvc-elements.html"
href: "http://localhost:9091/midas/nsd/nsd1"
version: nsd1
oar1:
about:
title: "NIST Staff Directory Service API (OAR version 1)"
describedBy: "http://localhost:9091/docs/nsdsvc-elements.html"
href: "http://localhost:9091/midas/nsd/oar1"
version: oar1
2 changes: 1 addition & 1 deletion docker/midasserver/mongo/mongo-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ echo '
roles: [ "readWrite" ]
}
)
exit' | mongo -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD
exit' | mongosh -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD
Loading

0 comments on commit 9e9f6eb

Please sign in to comment.