Skip to content

Commit d6573b4

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/anms-ui/public/axios-1.12.0
2 parents 1badb90 + 5ba1186 commit d6573b4

File tree

36 files changed

+503
-286
lines changed

36 files changed

+503
-286
lines changed

.env

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# This .env file is used by all compose commands for test and development usage.
2+
# NOTE: Production deployments via Puppet use an alternative version of this file generated by the tools.
3+
4+
# Choose which profile(s) to run.
5+
# If no profiles are set, a 'light' configuration will be started without the UI components
6+
# Available profiles include 'full' (UI) and 'dev' (aeveloper tools such as adminer)
7+
COMPOSE_PROFILES=full,dev
8+
19
# Port Services; Uncomment below lines to override default mappings
210
#AUTHNZ_PORT=8084
311
#AUTHNZ_HTTPS_PORT=8443
@@ -7,7 +15,7 @@
715
#MQTT_PORT=11883
816

917

10-
DOCKER_IMAGE_PREFIX=localhost/
18+
DOCKER_IMAGE_PREFIX=ghcr.io/nasa-ammos/anms/
1119
DOCKER_IMAGE_TAG=latest
1220

1321
ANMS_VERSION=0

.github/workflows/anms-core.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,34 @@ jobs:
3030
run: |
3131
FAIL_SRC=0
3232
flake8 src || FAIL_SRC=$?
33+
anms-core_integration-test:
34+
runs-on: ubuntu-24.04
35+
env:
36+
ANMS_COMPOSE_OPTS: -f docker-compose.yml --profile light
37+
TEST_COMPOSE_OPTS: -f anms-core/integration_test/docker-compose.yml
38+
HOST_SOCKDIR: /run/anms
39+
DOCKER_CMD: docker
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
with:
44+
submodules: recursive
45+
- name: Build ANMS
46+
run: ${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} build
47+
- name: Build TEST
48+
run: ${DOCKER_CMD} compose ${TEST_COMPOSE_OPTS} build
49+
- name: Build Volume
50+
run: |
51+
./create_volume.sh ./puppet/modules/apl_test/files/anms/tls
52+
sudo mkdir /run/anms
53+
- name: Start
54+
run: |
55+
${DOCKER_CMD} compose ${TEST_COMPOSE_OPTS} up -d test-transport
56+
${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} up -d --force-recreate --wait --wait-timeout 600
57+
- name: Test
58+
run: ${DOCKER_CMD} compose ${TEST_COMPOSE_OPTS} run test-runner
59+
- name: Status
60+
if: failure()
61+
run: |
62+
${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} ps
63+
${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} logs anms-core

.github/workflows/build-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
- name: Status
6161
if: always()
6262
run: |
63+
${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} ps
6364
for BADSTATUS in stopped restarting; do
6465
${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} ps --services --filter status=${BADSTATUS} | tee -a /tmp/notgood
6566
done
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# On merge to main publish with the 'latest' label
2+
# Publish with release label when a releaes is published.
3+
name: Build and publish containers
4+
on:
5+
push:
6+
branches:
7+
- main
8+
release:
9+
types: [published]
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
14+
jobs:
15+
build-and-push:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
- name: Log in to GitHub Container Registry
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ${{ env.REGISTRY }}
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Set prefix
30+
run: |
31+
echo "DOCKER_IMAGE_PREFIX=${REGISTRY}/${REPO,,}/" >>${GITHUB_ENV}
32+
env:
33+
REPO: '${{ github.repository }}'
34+
- name: Set image tag
35+
id: vars
36+
run: |
37+
if [[ "${{ github.event_name }}" == "release" ]]; then
38+
echo "DOCKER_IMAGE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
39+
else
40+
echo "DOCKER_IMAGE_TAG=latest" >> $GITHUB_ENV
41+
fi
42+
43+
- name: Build and push base images via compose
44+
run: |
45+
docker compose build --push
46+
- name: Build and push testenv images via compose
47+
run: |
48+
docker compose -f testenv-compose.yml build --push

.github/workflows/puppet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
bundler-cache: true
4848

4949
- name: Install puppet-lint
50-
run: gem install puppet-lint
50+
run: gem install puppet-lint -v 4.3.0
5151

5252
- name: Run puppet-lint
5353
run: puppet-lint puppet --sarif --ignore-paths 'puppet/modules/anms/files/*' > puppet-lint-results.sarif

README.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ If your computer is behind a network proxy, this may cause issues related to usi
4949
Though ANMS can be run behind a proxy; building the ANMS Docker images from behind a network proxy may result in errors.
5050

5151
The first steps in each of the container image `Dockerfile` is to attempt to download an APLNIS root CA to validate the APLNIS HTTPS proxy.
52-
When building images outside of the APLNIS, this download will gracefully fail and the image will not be able to run within the APLNIS.
52+
When building images outside of the APLNIS, this download will gracefully fail and the image will not be able to run within the APLNIS. The URL for this certificate can be changed for users requiring equivalent functionality on their own networks.
53+
54+
### Special Notes on Podman
55+
56+
If not otherwise specified, most commands in this document allow podman and docker to be used interchangeably. It is also possible to install an alias (provided in most package managers) to map `docker` to `podman` if desired.
57+
58+
Podman, running as a standard user, is typically unable to bind to **low-numbered ports**. It is recommended to edit the `.env` file and uncomment the lines at top for AUTHNZ_PORT and AUTHNZ_HTTPS_PORT to remap those services to a higher port number. In the directions below, you would then use for example http://localhost:8084 and https://localhost:8443 instead of the default.
59+
60+
Note: If running on a system where **SELinux** is enabled, the system will not start if the appropriate security groups have not been defined. As an alternative, the `security_opt` sections can be commented out in the *-compose.yml files if required.
61+
5362

5463
### Upgrading ANMS
5564

@@ -63,32 +72,41 @@ The following command sequence uses standard Docker commands to stop all contain
6372
docker stop $(docker ps -q); docker rm $(docker ps --all -q); docker system prune -f; docker volume prune -f
6473
```
6574

66-
### Deployment Scenario
6775

68-
The current ANMS capability is designed to run on `localhost` and on a development virtual machine.
69-
This 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.
70-
If you deploy this to a VM, you will need to replace `localhost` with the hostname of the machine where it is deployed.
76+
## ANMS build and deploy
7177

72-
### Special Notes on Podman
78+
## Quickstart
7379

74-
If not otherwise specified, most commands in this document allow podman and docker to be used interchangeably. It is also possible to install an alias (provided in most package managers) to map `docker` to `podman` if desired.
80+
`./quickstart.sh`
7581

76-
Podman, running as a standard user, is typically unable to bind to **low-numbered ports**. It is recommended to edit the `.env` file and uncomment the lines at top for AUTHNZ_PORT and AUTHNZ_HTTPS_PORT to remap those services to a higher port number. In the directions below, you would then use for example http://localhost:8084 and https://localhost:8443 instead of the default.
82+
The quickstart script will configure, pull, and start the ANMS system for the first time. See comments in the script for additional details, including optional ENV variables to override default behavior.
7783

78-
Note: If running on a system where **SELinux** is enabled, the system will not start if the appropriate security groups have not been defined. As an alternative, the `security_opt` sections can be commented out in the *-compose.yml files if required.
84+
NOTICE: By default, quick start will pull pre-built containers from the github registry (ghcr.io). To force a rebuild, run it as `FORCE_REBULD=y ./quickstart.sh`. See the script header for details.
7985

86+
To stop the system use `podman compose -f testenv-compose.yml -f docker-compose.yml down`.
8087

81-
## ANMS build and deploy
88+
To start the system in the future use `podman compose -f testenv-compose.yml up` and `podman compose up`.
8289

90+
## Manual Startup
8391
Choose the appropriate docker, podman or podman-compose commands in the directions below as appropriate for your system.
8492

85-
- Select appropriate profile(s) as desired.
86-
- If no profiles are set, a "light" deployment of the ANMS focused on browser-less API-only ANMS users.
87-
- For a full deployment: `export COMPOSE_PROFILES=full`
88-
- For a full deployment with additional developer tools: `export COMPOSE_PROFILES=full,dev`
93+
- Edit `.env` file as appropriately
94+
- Select appropriate profile(s) as desired.
95+
- Core ANMS services are always started.
96+
- The 'full' profile starts up all UI and related services.
97+
- The 'dev' profile adds development tools, such as adminer
98+
- Profiles can be set with COMPOSE_PROFILES in the .env file. The default includes full and dev profiles.
99+
- Adjust network ports as necessary to avoid any conflicts or permissions issues.
100+
- For rootless podman, the AUTHNZ_* ports must be changed to higher number ports to avoid permissions issues.
101+
- The corresponding lines can be uncommented in .env.
102+
- SELinux Security Labels Setup
103+
- If your system does not support security labels, no additional steps are needed.
104+
- If security labels are supported and you are unable to define them, they can be disabled for development purposes:
105+
- `cp docker-compose.no-security-override.yml docker-compose.override.yml`
89106
- Clone this repository recursively (`git clone --recursive https://github.com/NASA-AMMOS/anms.git`)
90107
- Setup Volume containing PKI configuration (certificate chains and private keys):
91108
- `./create_volume.sh ./puppet/modules/apl_test/files/anms/tls`
109+
- OPTIONAL: The next 2 steps will build all ANMS containers. If desired, these steps can be replaced with 'pull'ing prebuilt containers from ghcr.
92110
- Build Core Images using one of the following:
93111
- `docker compose -f docker-compose.yml build`
94112
- `podman compose -f docker-compose.yml build`
@@ -98,7 +116,6 @@ Choose the appropriate docker, podman or podman-compose commands in the directio
98116
- `docker compose -f testenv-compose.yml build`
99117
- `podman compose -f testenv-compose.yml build`
100118
- `podman-compose --podman-build-args='--format docker' -f testenv-compose.yml build`
101-
102119
- Start System using one of the following:
103120
- `docker compose -f docker-compose.yml up -d`
104121
- `podman compose -f docker-compose.yml up -d`
@@ -214,6 +231,8 @@ Refer to the `.env` file for port binding overrides, or `docker-compose.yml` for
214231

215232
### ANMS-UI is not visible at hostname
216233

234+
Ensure that you are running with the 'full' profile. This is the default option when using the `.env` file, however some older versions of podman-compose may not parse the COMPOSE_PROFILES ENV variable correctly. If this is the case, specify the profile explicitly in your compose up commands. For example, `podman compose --profile full up`.
235+
217236
Check the startup logs for any errors. If using podman, some port numbers may need to be remapped using the `.env` file to higher numbered ports, or the system configuration modified to adjust permissions (not recommended).
218237

219238
If you go to your browser and hostname:9030 (replace hostname with the server's hostname) and you see the ANMS UI,

anms-core/anms/components/schemas/ARIs/registered_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
# Shared properties
3333
class RegisteredAgentBase(BaseModel):
34-
agent_id_string: Optional[str] = None
34+
agent_endpoint_uri: Optional[str] = None
3535
first_registered: Optional[datetime] = None
3636
last_registered: Optional[datetime] = None
3737

anms-core/anms/components/schemas/ARIs/rpt_entry.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@
2929

3030
# Shared properties
3131
class RptEntryBase(BaseModel):
32-
reference_time: Optional[str] = None
33-
agent_id: Optional[str] = None
34-
correlator_nonce: Optional[str] = None
32+
class Config:
33+
arbitrary_types_allowed = True
34+
35+
ari_rptset_id: Optional[str] = None
36+
reference_time: Optional[datetime] = None
3537
report_list: Optional[str] = None
36-
ari_rptset_id: Optional[int] = None
38+
agent_id: Optional[int] = None
3739

3840

3941
class RptEntryBaseInDBBase(RptEntryBase):

anms-core/anms/models/relational/execution_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
class ExecutionSet(Model):
3636
__tablename__ = 'vw_execution_set'
3737
execution_set_id = Column(Integer, primary_key=True)
38-
correlator_nonce = Column(Integer)
38+
nonce_cbor = Column(LargeBinary)
3939
use_desc = Column(String)
4040
agent_id = Column(String)
4141
num_entries = Column(Integer)
@@ -47,7 +47,7 @@ def __repr__(self) -> str:
4747
def as_dict(self) -> Dict[str, Any]:
4848
dict_obj = {
4949
'execution_set_id': getattr(self, 'execution_set_id'),
50-
'correlator_nonce': getattr(self, 'correlator_nonce'),
50+
'nonce_cbor': getattr(self, 'nonce_cbor'),
5151
'use_desc': getattr(self, 'use_desc'),
5252
'agent_id': getattr(self, 'agent_id'),
5353
'num_entries': getattr(self, 'num_entries'),

anms-core/anms/models/relational/registered_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class RegisteredAgent(Model):
3737
__tablename__ = 'registered_agents'
3838

3939
registered_agents_id = Column(Integer, primary_key=True)
40-
agent_id_string = Column(
40+
agent_endpoint_uri = Column(
4141
String(128),
4242
default='ipn:0.0',
4343
unique=True,

0 commit comments

Comments
 (0)