Skip to content

Commit 5ad4da1

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/anms-ui/public/cipher-base-1.0.6
2 parents ff1f275 + 5ba1186 commit 5ad4da1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1400
-1787
lines changed
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
# SCM files
2-
.git
2+
.git/
33
.gitignore
44

55
# Ignore IDE/IntelliJ Files
66
.idea
77
*.iml
88

9-
# Ignore Node Modules used locally
10-
public/node_modules
11-
server/node_modules
12-
9+
# Ignore build files
10+
node_modules
11+
/puppet/.modules/
1312
# Ignore Compiled Vue App
14-
release
15-
13+
/anms-ui/release
1614
# Ignore Data Directory
17-
logs
18-
15+
/anms-ui/logs
1916

2017
# Ignore Other Specific Stuff
21-
docker-compose.yaml
18+
*-compose.yaml
19+
Containerfile
2220
Dockerfile
2321
Makefile
2422
.dockerignore
2523
gl-sast-report.json
2624
.metrics-dashboard.yml
27-
CONTRIBUTING.md
25+
*.md
26+
*.pdf
27+
*.docx

.env

Lines changed: 12 additions & 6 deletions
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,9 +15,7 @@
715
#MQTT_PORT=11883
816

917

10-
11-
DOCKER_CTR_PREFIX=
12-
DOCKER_IMAGE_PREFIX=localhost/
18+
DOCKER_IMAGE_PREFIX=ghcr.io/nasa-ammos/anms/
1319
DOCKER_IMAGE_TAG=latest
1420

1521
ANMS_VERSION=0
@@ -34,8 +40,8 @@ DB_HEALTHCHECK_USER=healthcheck
3440
DB_HEALTHCHECK_PASSWORD=healthcheck
3541

3642
GRAFANA_CONTAINER_PORT=3000
37-
GRAFANA_HOST_PORT=${DOCKER_CTR_PREFIX}grafana:${GRAFANA_CONTAINER_PORT}
38-
GRAFANA_PROXIES_PATH=localhost/${DOCKER_CTR_PREFIX}grafana
43+
GRAFANA_HOST_PORT=grafana:${GRAFANA_CONTAINER_PORT}
44+
GRAFANA_PROXIES_PATH=localhost/grafana
3945
REDIS_PORT=6379
4046
JS_AMP_PORT=3001
4147
ANMS_UI_HTTP_PORT=9030
@@ -48,7 +54,7 @@ LOGSTASH_MONITORING_PORT=9600
4854
KIBANA_PORT=5601
4955
ADMINER_PORT=8080
5056
RENDERER_PORT=8081
51-
RENDERER_HOST_PORT=${DOCKER_CTR_PREFIX}grafana-image-renderer:${RENDERER_PORT}
57+
RENDERER_HOST_PORT=grafana-image-renderer:${RENDERER_PORT}
5258
ION_MGR_PORT=8089
5359
HTTP_PORT=80
5460

.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: 29 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run integration checkout test
1+
name: Build and run tests
22
on:
33
push:
44
branches:
@@ -9,25 +9,31 @@ on:
99

1010
jobs:
1111
podman-checkout-test:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
ctrmgr: ['docker', 'podman']
17+
name: Checkout Test (${{matrix.ctrmgr}})
1318
env:
1419
AUTHNZ_EMU: "demo"
20+
COMPOSE_PROFILES: "full"
1521
ANMS_COMPOSE_OPTS: "-f docker-compose.yml"
1622
TESTENV_COMPOSE_OPTS: "-f testenv-compose.yml"
17-
DOCKER_CMD: "podman"
23+
DOCKER_CMD: ${{matrix.ctrmgr}}
1824
AUTHNZ_PORT: 8084
1925
AUTHNZ_HTTPS_PORT: 8443
2026
steps:
21-
- name: Start Podman API Service
27+
- name: Start Container Service
28+
if: ${{matrix.ctrmgr}} == 'podman'
2229
run: |
2330
systemctl --user start podman.socket
2431
systemctl --user enable podman.socket
25-
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
32+
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
2633
- name: Versions
2734
run: |
28-
podman -v
29-
podman ps
30-
podman compose ls
35+
${DOCKER_CMD} -v
36+
${DOCKER_CMD} compose -v
3137
- name: Checkout repository
3238
uses: actions/checkout@v4
3339
with:
@@ -36,100 +42,40 @@ jobs:
3642
run: |
3743
DOCKER_IMAGE_TAG=$(echo ${{ github.head_ref || github.ref_name }} | sed 's/[^a-zA-Z0-9\-\._]/-/g')
3844
echo "DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG}" >> $GITHUB_ENV
39-
- name: Build Main
40-
run: podman compose ${ANMS_COMPOSE_OPTS} build
45+
- name: Build ANMS
46+
run: ${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} build
4147
- name: Build Agents
42-
run: podman compose ${TESTENV_COMPOSE_OPTS} build
48+
run: ${DOCKER_CMD} compose ${TESTENV_COMPOSE_OPTS} build
4349
- name: Build Volume
4450
run: |
4551
./create_volume.sh ./puppet/modules/apl_test/files/anms/tls
4652
sudo mkdir /run/anms
53+
- name: Pull Images
54+
run: ${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} pull --ignore-buildable
4755
- name: Start
4856
run: |
49-
podman compose ${TESTENV_COMPOSE_OPTS} up -d --force-recreate --wait
50-
podman compose ${ANMS_COMPOSE_OPTS} up -d --force-recreate --wait
57+
# testenv started before
58+
${DOCKER_CMD} compose ${TESTENV_COMPOSE_OPTS} up -d --force-recreate
59+
${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} up -d --force-recreate --wait --wait-timeout 600
5160
- name: Status
52-
run: |
53-
for BADSTATUS in stopped restarting; do
54-
podman compose ${ANMS_COMPOSE_OPTS} ps --services --filter status=${BADSTATUS} | tee -a /tmp/notgood
55-
done
56-
# Show hints at what may be wrong
57-
for SERVNAME in $(cat /tmp/notgood); do
58-
podman compose ${ANMS_COMPOSE_OPTS} logs --tail 50 ${SERVNAME}
59-
done
60-
# Fail if any names are in the file
61-
! grep '[^[:space:]]' /tmp/notgood
62-
- name: Test
63-
run: |
64-
# Checkout the running gateway+backend
65-
podman build -t checkout-test checkout-test
66-
podman run --network anms -v $PWD:/mnt -e XUNIT_OUTFILE=/mnt/testresults.xml -e CHECKOUT_BASE_URL=http://authnz/ -e SSL_CERT_FILE=/mnt/puppet/modules/apl_test/files/anms/tls/certs/ammos-ca-bundle.crt checkout-test
67-
- name: Stop
6861
if: always()
6962
run: |
70-
for OPTS_NAME in TESTENV_COMPOSE_OPTS ANMS_COMPOSE_OPTS; do
71-
podman compose ${!OPTS_NAME} down --remove-orphans
72-
done
73-
74-
docker-checkout-test:
75-
runs-on: ubuntu-latest
76-
env:
77-
DOCKER_BUILDKIT: "1"
78-
AUTHNZ_EMU: "demo"
79-
ANMS_COMPOSE_OPTS: "-f docker-compose.yml"
80-
TESTENV_COMPOSE_OPTS: "-f testenv-compose.yml"
81-
DOCKER_CMD: "docker"
82-
steps:
83-
- name: Versions
84-
run: |
85-
docker -v
86-
docker ps
87-
docker compose ls
88-
- name: Checkout repository
89-
uses: actions/checkout@v4
90-
with:
91-
submodules: recursive
92-
- name: Tag name env
93-
run: |
94-
DOCKER_IMAGE_TAG=$(echo ${{ github.head_ref || github.ref_name }} | sed 's/[^a-zA-Z0-9\-\._]/-/g')
95-
echo "DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG}" >> $GITHUB_ENV
96-
- name: Debug GitHub workspace
97-
run: |
98-
echo "GITHUB_WORKSPACE=${{ github.workspace }}"
99-
ls -al ${{ github.workspace }}
100-
- name: Build Main
101-
run: |
102-
docker compose ${ANMS_COMPOSE_OPTS} build builder-base builder-init builder-acelib
103-
docker compose ${ANMS_COMPOSE_OPTS} build
104-
- name: Build Agents
105-
run: docker compose ${TESTENV_COMPOSE_OPTS} build
106-
- name: Build Volume
107-
run: |
108-
./create_volume.sh ./puppet/modules/apl_test/files/anms/tls
109-
sudo mkdir /run/anms
110-
- name: Start
111-
run: |
112-
docker compose ${TESTENV_COMPOSE_OPTS} up -d --force-recreate --wait
113-
docker compose ${ANMS_COMPOSE_OPTS} up -d --force-recreate --wait
114-
- name: Status
115-
run: |
63+
${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} ps
11664
for BADSTATUS in stopped restarting; do
117-
docker compose ${ANMS_COMPOSE_OPTS} ps --services --filter status=${BADSTATUS} | tee -a /tmp/notgood
65+
${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} ps --services --filter status=${BADSTATUS} | tee -a /tmp/notgood
11866
done
11967
# Show hints at what may be wrong
12068
for SERVNAME in $(cat /tmp/notgood); do
121-
docker compose ${ANMS_COMPOSE_OPTS} logs --tail 50 ${SERVNAME}
69+
${DOCKER_CMD} compose ${ANMS_COMPOSE_OPTS} logs --tail 50 ${SERVNAME}
12270
done
12371
# Fail if any names are in the file
12472
! grep '[^[:space:]]' /tmp/notgood
12573
- name: Test
126-
run: |
127-
# Checkout the running gateway+backend
128-
docker build -t checkout-test checkout-test
129-
docker run --network anms -v $PWD:/mnt -e XUNIT_OUTFILE=/mnt/testresults.xml -e CHECKOUT_BASE_URL=http://authnz/ -e SSL_CERT_FILE=/mnt/puppet/modules/apl_test/files/anms/tls/certs/ammos-ca-bundle.crt checkout-test
74+
run: ./checkout-test/run.sh
13075
- name: Stop
13176
if: always()
13277
run: |
133-
for OPTS_NAME in TESTENV_COMPOSE_OPTS ANMS_COMPOSE_OPTS; do
134-
docker compose ${!OPTS_NAME} down --remove-orphans
78+
# testenv stopped after
79+
for OPTS_NAME in ANMS_COMPOSE_OPTS TESTENV_COMPOSE_OPTS; do
80+
${DOCKER_CMD} compose ${!OPTS_NAME} down --remove-orphans
13581
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

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
.DS_Store
88
.project
99
.cproject
10+
.pydevproject
11+
.settings/
1012

1113
# Python intermediates
1214
__pycache__
@@ -16,11 +18,9 @@ coverage.xml
1618
testresults.xml
1719

1820
# local build files
19-
anms-core/build/
20-
anms-ui/release/
21+
/anms-core/build/
22+
/anms-ui/release/
2123

2224
# Javascript and ESLint related content to be ignored
2325
node_modules
2426
package-lock.json
25-
26-
ion/configs/**/logs

0 commit comments

Comments
 (0)