{"id":18265138,"url":"https://github.com/nasa-ammos/anms","last_synced_at":"2025-04-04T21:31:32.121Z","repository":{"id":182816915,"uuid":"464942493","full_name":"NASA-AMMOS/anms","owner":"NASA-AMMOS","description":"Asynchronous Network Management System (ANMS)","archived":false,"fork":false,"pushed_at":"2025-04-01T23:16:58.000Z","size":5868,"stargazers_count":1,"open_issues_count":67,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T00:24:26.212Z","etag":null,"topics":["dtn","dtnma"],"latest_commit_sha":null,"homepage":"https://nasa-ammos.github.io/anms-docs/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NASA-AMMOS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-01T15:10:12.000Z","updated_at":"2025-03-31T17:24:22.000Z","dependencies_parsed_at":"2023-07-21T15:25:40.029Z","dependency_job_id":"ad324856-135c-4b70-be00-fe71e44355e3","html_url":"https://github.com/NASA-AMMOS/anms","commit_stats":null,"previous_names":["nasa-ammos/anms"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NASA-AMMOS%2Fanms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NASA-AMMOS%2Fanms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NASA-AMMOS%2Fanms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NASA-AMMOS%2Fanms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NASA-AMMOS","download_url":"https://codeload.github.com/NASA-AMMOS/anms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247252193,"owners_count":20908641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dtn","dtnma"],"created_at":"2024-11-05T11:17:13.509Z","updated_at":"2025-04-04T21:31:32.110Z","avatar_url":"https://github.com/NASA-AMMOS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nCopyright (c) 2023 The Johns Hopkins University Applied Physics\nLaboratory LLC.\n\nThis file is part of the Asynchronous Network Management System (ANMS).\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n    http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nThis work was performed for the Jet Propulsion Laboratory, California\nInstitute of Technology, sponsored by the United States Government under\nthe prime contract 80NM0018D0004 between the Caltech and NASA under\nsubcontract 1658085.\n--\u003e\n#  AMMOS ANMS\n\nThis is a detailed developer-focused documentation for the AMMOS Asynchronous Network Management System (ANMS).\n\n### Copyright\n\nCopyright (C) 2022-2023 The Johns Hopkins University Applied Physics Laboratory LLC.\n\n[[_TOC_]]\n\n# Quick Start\n\nThis section details prerequisites to installing the ANMS from source on a development system and gives a brief explanation of the container configuration.\n\n## Dependencies\n\n### Software and OS Versions\n\nThe setup of ANMS and demos listed in this README have been tested on macOS 11.6.4 (Big Sur) and Ubuntu 20.04.\nTo run the ANMS tool, you must also install Docker Engine version 20.10.10 or newer, and Docker Compose version 1.29.2 or newer. \n\nThe ANMS UI capability has been tested on Firefox version 96.0.1.\nThere is no capability that should preclude operation on other modern browsers. \n\n### Network Setup\n\nIf your computer is behind a network proxy, this may cause issues related to using self-signed certificates when pulling dependencies to build Docker images.\nThough ANMS can be run behind a proxy; building the ANMS Docker images from behind a network proxy may result in errors.\n\nThe first steps in each of the container image `Dockerfile` is to attempt to download an APLNIS root CA to validate the APLNIS HTTPS proxy.\nWhen building images outside of the APLNIS, this download will gracefully fail and the image will not be able to run within the APLNIS.\n\n### Upgrading ANMS\n\nIf upgrading from an earlier version, a few steps are necessary to clear out earlier state.\nThe following command sequence uses standard Docker commands to stop all containers and remove all \"dangling\" images, networks, and volumes.\n\n:warning: The last command in this sequence removes volumes, **which include DB state**.\n  If it is desired to preserve earlier DB state, then a more complex procedure will be needed.\n\n```\ndocker stop $(docker ps -q); docker rm $(docker ps --all -q); docker system prune -f; docker volume prune -f\n```\n\n### Deployment Scenario\n\nThe current ANMS capability is designed to run on `localhost` and on a development virtual machine.\nThis guide presumes that you can either connect via a VMRC remote console or with ssh tunnelling to the machine, hence the use of `localhost` in db connection information and in URLs.\nIf you deploy this to a VM, you will need to replace `localhost` with the hostname of the machine where it is deployed.\n\n## ANMS Docker build and deploy\n\nThe ANMS repository contains a build script which will build and run multiple Docker containers.\nThese containers comprise the ANMS software and services, including demonstration AMP agents running on non-ANMS containers.\n\nTo build the containers, run the `build.sh` script.\nWhen running the ANMS outside an envirionment where the AMMOS Common Access Manager (CAM) is not available, a CAM Gateway emulator is enabled by the `AUTHNZ_EMU` environment; this emulator includes the local accounts and credentials `test:test` and `admin:admin`.\nThis script has a `check` option which will run a docker container inspection after startup to see if all the containers are in working order.\n\nTo establish a docker volume containing PKI configuration (certificate chains and private keys) the `create_volume.sh` script is provided along with test PKI authenticating the DNS name `localhost`.\n\n```\n./create_volume.sh ./puppet/modules/apl_test/files/anms/tls\nAUTHNZ_EMU=1 ./build.sh check\n```\n\n\u003e Note: the build process reaches out to external repositories.\n\u003e This process may be inhibited depending on your network setup, e.g., if you are behind an internet proxy. \n\u003e If this is a prohibitor for your setup, please contact the ANMS team for pre-built Docker images.\n\nThe build command will take several minutes.\nWhen it completes, the build script will perform an ION ping test and output the result of a call to `docker ps`, which lists all containers running on your system.\nAn example of this output is below, where some slower containers show \"health: starting\" while others are already showing \"healthy\".\nYou can manually run `docker-compose ps` at any time to verify the status and health of all ANMS containers.\n\n~~~\nPinging node 1...\nread interval of 0 ad 0.000000\n64 bytes from ipn:1.4  seq=0 time=0.261199 s\n64 bytes from ipn:1.4  seq=1 time=0.288515 s\n64 bytes from ipn:1.4  seq=2 time=0.295226 s\n3 bundles transmitted, 3 bundles received, 0.00% bundle loss, time 1.106324 s\nrtt min/avg/max/sdev = 261.199/281.646/295.226/14.728 ms\n\nPinging node 2...\nread interval of 0 ad 0.000000\n64 bytes from ipn:2.4  seq=0 time=0.135766 s\n64 bytes from ipn:2.4  seq=1 time=0.156283 s\n64 bytes from ipn:2.4  seq=2 time=0.166642 s\n3 bundles transmitted, 3 bundles received, 0.00% bundle loss, time 1.094418 s\nrtt min/avg/max/sdev = 135.766/152.897/166.642/12.830 ms\n\nPinging node 3...\nread interval of 0 ad 0.000000\n64 bytes from ipn:3.4  seq=0 time=0.125470 s\n64 bytes from ipn:3.4  seq=1 time=0.171092 s\n64 bytes from ipn:3.4  seq=2 time=0.169872 s\n3 bundles transmitted, 3 bundles received, 0.00% bundle loss, time 1.082884 s\nrtt min/avg/max/sdev = 125.470/155.478/171.092/21.224 ms\n\nThe following containers are now running:\nCONTAINER ID   IMAGE                                  COMMAND                  CREATED          STATUS                             PORTS\n                                                                                                             NAMES\na4b751ba46d1   ion-agent:4.1.1                        \"/sbin/init\"             22 seconds ago   Up 20 seconds (healthy)            1113/udp, 4556/udp                                                                                                                    ion-agent2\nfc00f2f119f0   ion-agent:4.1.1                        \"/sbin/init\"             22 seconds ago   Up 20 seconds (healthy)            1113/udp, 4556/udp                                                                                                                    ion-agent3\ndd0d441dbd62   authnz-emu                             \"/usr/sbin/httpd -D …\"   29 seconds ago   Up 27 seconds                      0.0.0.0:80-\u003e80/tcp, :::80-\u003e80/tcp                                                                                                     authnz-emu\nefefb956c272   anms-nginx                             \"/docker-entrypoint.…\"   30 seconds ago   Up 28 seconds                      80/tcp\n                                                                                                             nginx\n9db32dda0bcd   anms-ui                                \"docker-entrypoint p…\"   31 seconds ago   Up 29 seconds (health: starting)   0.0.0.0:9030-\u003e9030/tcp, :::9030-\u003e9030/tcp, 0.0.0.0:9443-\u003e9443/tcp, :::9443-\u003e9443/tcp                                                  anms-ui\n4ac5b4b42db9   transcoder                             \"python3 src/main.py\"    35 seconds ago   Up 34 seconds\n                                                                                                             transcoder\ne5be006388bd   ion-manager:4.1.1                      \"/sbin/init\"             36 seconds ago   Up 34 seconds (healthy)            0.0.0.0:8089-\u003e8089/tcp, :::8089-\u003e8089/tcp, 0.0.0.0:49168-\u003e1113/udp, :::49168-\u003e1113/udp, 0.0.0.0:49167-\u003e4556/udp, :::49167-\u003e4556/udp   ion-manager\nf7353e36cfa7   anms-core                              \"python3 run_gunicor…\"   46 seconds ago   Up 44 seconds (health: starting)   0.0.0.0:5555-\u003e5555/tcp, :::5555-\u003e5555/tcp                                                                                             anms-core\nc878a43d46bb   redis:6.0-alpine                       \"docker-entrypoint.s…\"   49 seconds ago   Up 46 seconds (healthy)            0.0.0.0:6379-\u003e6379/tcp, :::6379-\u003e6379/tcp                                                                                             redis\nc83406b1435a   mqtt-broker                            \"/docker-entrypoint.…\"   49 seconds ago   Up 45 seconds (healthy)            0.0.0.0:1883-\u003e1883/tcp, :::1883-\u003e1883/tcp                                                                                             mqtt-broker\nea0c66364d70   grafana/grafana:9.1.3                  \"/run.sh\"                49 seconds ago   Up 45 seconds                      0.0.0.0:3000-\u003e3000/tcp, :::3000-\u003e3000/tcp                                                                                             grafana\n0d6dcb88eaa6   grafana/grafana-image-renderer:3.6.1   \"dumb-init -- node b…\"   49 seconds ago   Up 45 seconds                      0.0.0.0:8081-\u003e8081/tcp, :::8081-\u003e8081/tcp                                                                                             grafana-image-renderer\n6d1137be4eab   postgres:14                            \"docker-entrypoint.s…\"   49 seconds ago   Up 46 seconds (healthy)            0.0.0.0:5432-\u003e5432/tcp, :::5432-\u003e5432/tcp                                                                                             postgres\n2716a68c6617   adminer:latest                         \"entrypoint.sh docke…\"   49 seconds ago   Up 46 seconds                      0.0.0.0:8080-\u003e8080/tcp, :::8080-\u003e8080/tcp                                                                                             adminer\n1a967d58b2dd   js-amp.me                              \"/bin/sh -c 'npm sta…\"   49 seconds ago   Up 45 seconds                      0.0.0.0:3001-\u003e3001/tcp, :::3001-\u003e3001/tcp                                                                                             js-amp.me\n------- Done -------\n~~~\n\nTo further confirm that ANMS is running, open a browser and navigate to `http://localhost/`.\nThere you should see the ANMS login via CAM emulator page (figure below). \n\n![ANMS Login](Screenshots/ANMS-Login.png)\n\nAfter running the `build.sh` script, you can stop all docker containers running on your system with the command `docker stop $(docker ps -q)`, and can start the ANMS system again by running:\n```sh\ndocker-compose -f docker-compose.yml up -d\n```\nfrom within the `anms/` folder.\n\nTo restart the agents forcefully, controlled with a different compose file `agent-compose.yml` run:\n```sh\ndocker-compose -f agent-compose.yml up -d --force-recreate\n```\n\n## Compose Environment and Options\n\nThe top-level `docker-compose.yml` uses the environment defined by the sibling file `.env` which itself is overridden by corresponding environment variables when running `build.sh` script.\n\nTwo principal options of the compose configuration, which are both defaulted to empty text, are:\n\n* `DOCKER_CTR_PREFIX` which controls any container name prefix added to all ANMS containers.\n  This can be used to disambiguate container names on a shared host (specifically for common container names like `nginx` or `postgres`).\n* `DOCKER_IMAGE_PREFIX` which controls any image name prefix added to all ANMS images.\n  For a local build, this can be left empty, but for builds intended to be pushed to a Docker image registry this can be set to the full path on the registry before the image names (e.g. `DOCKER_IMAGE_PREFIX=some.host.example.com:5000/path/to/images`).\n\n\n\n## AMP Database Querying\n\nTo see what is present in the underlying AMP database, you can use the adminer access\npoint. With ANMS running, go to `localhost:8080` and log in to the database with: \n- System: `PostgreSQL`\n- Server: `postgres`\n- Username: `root`\n- Password: `root`\n- Database `amp_core`\n\n## ANMS-UI is not visible at hostname:9030\n\nThis signals that the anms-ui docker container is probably experiencing issues getting HTTP requests, \nwhich is most likely related to the `host` or `bind address` specified in `anms-ui/server/shared/config.py`\nor if there is an environment variable overriding this.\n\n## ANMS-UI is not visible at hostname\n\nIf you go to your browser and hostname:9030 (replace hostname with the server's hostname) and you see the ANMS UI,\nbut http://hostname does not render the same page, then NGinx is having an issue.  You should look at the\ndocker-compose services list and see what it's status is. You may need to restart nginx via \n`docker-compose -f docker-compose.yml restart nginx`. If this fails you may need to look at nginx.conf in the\nroot of the anms-ammos project. You want to make sure that `anms-ui` or `localhost` are specified for port `80` and\nnot an incorrect hostname.\n\n## ADM and Agent Updates\n\nChanges to ADMs are handled on the Manager by uploading a new version of the ADM via the Web UI.\nThe manager will then be able to use the new ADM.\n\nChanges to a test Agent are more complicated, and require auto-generated C sources built into the ION source tree.\n\nThe two output paths for ADM C files are:\n\n- `ion/src/bpv7/nm/` for BP-version-specific ADMs like `ion_bp_admin`\n- `ion/src/nm/` for all other ADMs\n\nTo regenerate agent source, scraping the pre-existing source to avoid clearing out agent implementations, run:\n```sh\nPYTHONPATH=deps/dtnma-ace/src/:deps/anms-camp/src/ python3 -m camp.tools.camp ion/src/nm/doc/adms/ion_bp_admin.json -o ion/src/bpv7/nm/ --only-ch --scrape\n```\n\n## Manual Agent exercising\n\nTo use the local AMP Manager directly via its REST API on the local host run similar to:\n```\necho 'ari:/IANA:ltp_agent/CTRL.reset(UINT.3)' | PYTHONPATH=deps/dtnma-ace/src/ ADM_PATH=deps/dtnma-ace/tests/adms/ python3 -m ace.tools.ace_ari --log-level=warning --outform=cborhex --must-nickname | tr -d '[[:space:]]' | curl -v -XPUT -H 'Content-Type: text/plain' --data-binary @- http://localhost:8089/nm/api/agents/eid/ipn:2.6/hex; echo\n```\n\nA limitation in the current NM REST API disallows multiple controls in a single message, so each ARI must be iterated over for this method.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasa-ammos%2Fanms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnasa-ammos%2Fanms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasa-ammos%2Fanms/lists"}