Skip to content

Commit 51a4b05

Browse files
authored
Update compose fixes (#183)
* Cherry-picking compose fixes and usability updates from PR 180 * Cleanup compose file uses * Adding nginx name dependencies * Remove superseded manifest chunk
1 parent aa480e9 commit 51a4b05

File tree

15 files changed

+89
-83
lines changed

15 files changed

+89
-83
lines changed

.github/workflows/build-test.yaml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ jobs:
1111
podman-checkout-test:
1212
runs-on: ubuntu-latest
1313
env:
14-
DOCKER_BUILDKIT: "1"
1514
AUTHNZ_EMU: "authnz-emu"
16-
ANMS_COMPOSE_OPTS: "-f docker-compose.yml -p anms"
17-
AGENT_COMPOSE_OPTS: "-f agent-compose.yml -p agents"
15+
ANMS_COMPOSE_OPTS: "-f docker-compose.yml"
16+
TESTENV_COMPOSE_OPTS: "-f testenv-compose.yml"
1817
DOCKER_CMD: "podman"
1918
AUTHNZ_PORT: 8084
2019
AUTHNZ_HTTPS_PORT: 8443
@@ -37,21 +36,17 @@ jobs:
3736
run: |
3837
DOCKER_IMAGE_TAG=$(echo ${{ github.head_ref || github.ref_name }} | sed 's/[^a-zA-Z0-9\-\._]/-/g')
3938
echo "DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG}" >> $GITHUB_ENV
40-
- name: Debug GitHub workspace
41-
run: |
42-
echo "GITHUB_WORKSPACE=${{ github.workspace }}"
43-
ls -al ${{ github.workspace }}
4439
- name: Build Main
45-
run: podman compose build
40+
run: podman compose ${ANMS_COMPOSE_OPTS} build
4641
- name: Build Agents
47-
run: podman compose -f agent-compose.yml build
42+
run: podman compose ${TESTENV_COMPOSE_OPTS} build
4843
- name: Build Volume
4944
run: |
5045
./create_volume.sh ./puppet/modules/apl_test/files/anms/tls
5146
- name: Start
5247
run: |
53-
podman compose up -d --force-recreate
54-
podman compose -f agent-compose.yml up -d --force-recreate
48+
podman compose ${ANMS_COMPOSE_OPTS} up -d --force-recreate
49+
podman compose ${TESTENV_COMPOSE_OPTS} up -d --force-recreate
5550
sleep 5
5651
- name: Status
5752
run: |
@@ -72,16 +67,17 @@ jobs:
7267
- name: Stop
7368
if: always()
7469
run: |
75-
for OPTS_NAME in ANMS_COMPOSE_OPTS AGENT_COMPOSE_OPTS; do
76-
podman compose ${!OPTS_NAME} rm --stop --force
70+
for OPTS_NAME in TESTENV_COMPOSE_OPTS ANMS_COMPOSE_OPTS; do
71+
podman compose ${!OPTS_NAME} down --remove-orphans
7772
done
73+
7874
docker-checkout-test:
7975
runs-on: ubuntu-latest
8076
env:
8177
DOCKER_BUILDKIT: "1"
8278
AUTHNZ_EMU: "authnz-emu"
83-
ANMS_COMPOSE_OPTS: "-f docker-compose.yml -p anms"
84-
AGENT_COMPOSE_OPTS: "-f agent-compose.yml -p agents"
79+
ANMS_COMPOSE_OPTS: "-f docker-compose.yml"
80+
TESTENV_COMPOSE_OPTS: "-f testenv-compose.yml"
8581
DOCKER_CMD: "docker"
8682
steps:
8783
- name: Versions
@@ -102,16 +98,16 @@ jobs:
10298
echo "GITHUB_WORKSPACE=${{ github.workspace }}"
10399
ls -al ${{ github.workspace }}
104100
- name: Build Main
105-
run: docker compose build
101+
run: docker compose ${ANMS_COMPOSE_OPTS} build
106102
- name: Build Agents
107-
run: docker compose -f agent-compose.yml build
103+
run: docker compose ${TESTENV_COMPOSE_OPTS} build
108104
- name: Build Volume
109105
run: |
110106
./create_volume.sh ./puppet/modules/apl_test/files/anms/tls
111107
- name: Start
112108
run: |
113-
docker compose up -d --force-recreate
114-
docker compose -f agent-compose.yml up -d --force-recreate
109+
docker compose ${ANMS_COMPOSE_OPTS} up -d --force-recreate
110+
docker compose ${TESTENV_COMPOSE_OPTS} up -d --force-recreate
115111
sleep 5
116112
- name: Status
117113
run: |
@@ -132,6 +128,6 @@ jobs:
132128
- name: Stop
133129
if: always()
134130
run: |
135-
for OPTS_NAME in ANMS_COMPOSE_OPTS AGENT_COMPOSE_OPTS; do
136-
docker compose ${!OPTS_NAME} rm --stop --force
131+
for OPTS_NAME in TESTENV_COMPOSE_OPTS ANMS_COMPOSE_OPTS; do
132+
docker compose ${!OPTS_NAME} down --remove-orphans
137133
done

.gitlab-ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ variables:
4949
DOCKER_IMAGE_TAG: $CI_COMMIT_REF_SLUG
5050
DOCKER_IMAGE_PREFIX: $DOCKER_REGISTRY/$DOCKER_GROUP/
5151
AUTHNZ_EMU: 1
52-
ANMS_COMPOSE_OPTS: -f docker-compose.yml -p anms
53-
AGENT_COMPOSE_OPTS: -f agent-compose.yml -p agents
52+
ANMS_COMPOSE_OPTS: -f docker-compose.yml
53+
TESTENV_COMPOSE_OPTS: -f testenv-compose.yml
5454

5555
stages:
5656
- build
@@ -88,8 +88,8 @@ stages:
8888
docker-compose version
8989

9090
.cleanup-docker: &cleanup-docker |
91-
for OPTS_NAME in ANMS_COMPOSE_OPTS AGENT_COMPOSE_OPTS; do
92-
docker-compose ${!OPTS_NAME} rm --stop --force
91+
for OPTS_NAME in TESTENV_COMPOSE_OPTS ANMS_COMPOSE_OPTS; do
92+
docker-compose ${!OPTS_NAME} down
9393
done
9494
docker network prune -f
9595
docker volume prune -f
@@ -127,12 +127,12 @@ checkout-test:
127127
- ./create_volume.sh ./puppet/modules/apl_test/files/anms/tls/
128128
- echo "running services..."
129129
- |
130-
for OPTS_NAME in ANMS_COMPOSE_OPTS AGENT_COMPOSE_OPTS; do
130+
for OPTS_NAME in ANMS_COMPOSE_OPTS TESTENV_COMPOSE_OPTS; do
131131
docker-compose ${!OPTS_NAME} up --detach --force-recreate
132132
done
133133
- sleep 5
134134
- |
135-
for OPTS_NAME in ANMS_COMPOSE_OPTS AGENT_COMPOSE_OPTS; do
135+
for OPTS_NAME in ANMS_COMPOSE_OPTS TESTENV_COMPOSE_OPTS; do
136136
docker-compose ${!OPTS_NAME} ps
137137
done
138138
- |

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ Choose the appropriate docker, podman or podman-compose commands in the directio
9393
- `podman-compose --podman-build-args='--format docker' build`
9494
- Note: The docker format argument here enables suppoort for HEALTHCHECK. If omitted, the system will run but will be unable to report the health of the system. This flag does not appear necessary when using the no-dash version of compose.
9595
- Build Agent images
96-
- `docker compose -f agent-compose.yml build`
97-
- `podman compose -f agent-compose.yml build`
98-
- `podman-compose -f agent-compose.yml --podman-build-args='--format docker' build`
96+
- `docker compose -f testenv-compose.yml build`
97+
- `podman compose -f testenv-compose.yml build`
98+
- `podman-compose -f testenv-compose.yml --podman-build-args='--format docker' build`
9999
- Start System. Note: You may omit the `-d` argument to keep logs in the foreground.
100100
- `docker compose up -d`
101101
- `podman compose up -d`
102102
- Start additional ION Agent Nodes
103-
- `docker compose -f agent-compose.yml up -d`
104-
- `podman compose -f agent-compose.yml up -d`
103+
- `docker compose -f testenv-compose.yml up -d`
104+
- `podman compose -f testenv-compose.yml up -d`
105105

106106
### Alternative Build.sh setup script (deprecated, docker-only)
107107
The ANMS repository contains a build script which will build and run multiple Docker containers.
@@ -188,9 +188,9 @@ docker-compose -f docker-compose.yml up -d
188188
```
189189
from within the `anms/` folder.
190190

191-
To restart the agents forcefully, controlled with a different compose file `agent-compose.yml` run:
191+
To restart the agents forcefully, controlled with a different compose file `testenv-compose.yml` run:
192192
```sh
193-
docker-compose -f agent-compose.yml up -d --force-recreate
193+
docker-compose -f testenv-compose.yml up -d --force-recreate
194194
```
195195

196196
### Compose Environment and Options

base.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ RUN --mount=type=cache,target=/var/cache/yum \
7272
pip3 install --upgrade pip pip-tools
7373

7474
# Submodules with dependencies
75-
env PY_WHEEL_DIR=/usr/local/lib/wheels
75+
ENV PY_WHEEL_DIR=/usr/local/lib/wheels
7676

7777
COPY deps/dtnma-ace /usr/src/dtnma-ace
7878
RUN pip3 wheel /usr/src/dtnma-ace -w ${PY_WHEEL_DIR} --no-deps

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ then
102102
fi
103103

104104
echo "Running docker-compose up"
105-
ANMS_COMPOSE_OPTS="-f docker-compose.yml -p anms"
106-
AGENT_COMPOSE_OPTS="-f agent-compose.yml -p agents"
105+
ANMS_COMPOSE_OPTS="-f docker-compose.yml"
106+
AGENT_COMPOSE_OPTS="-f testenv-compose.yml"
107107
for OPTS_NAME in ANMS_COMPOSE_OPTS AGENT_COMPOSE_OPTS; do
108108
docker compose ${!OPTS_NAME} up --detach
109109
done

checkout-test/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
# Allow the checkout tests to be run within a docker network
2424
FROM localhost/anms-base
2525

26-
COPY . /usr/src/checkout-test
2726
RUN --mount=type=cache,target=/var/cache/yum \
28-
dnf -y install python3 python3-pip python3-wheel
27+
dnf install -y iputils python3 python3-pip python3-wheel
28+
29+
COPY requirements.txt /usr/src/checkout-test/
2930
RUN --mount=type=cache,target=/root/.cache/pip \
3031
pip3 install -r /usr/src/checkout-test/requirements.txt
32+
COPY . /usr/src/checkout-test
3133

3234
# First argument is the base URL to test
3335
ENTRYPOINT ["/usr/src/checkout-test/run.sh"]

create_volume.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ fi
3333

3434
${DOCKER_CMD} volume create ${VOLNAME}
3535
CTRNAME=$(${DOCKER_CMD} run --detach --rm \
36-
-v ${VOLNAME}:${VOLPATH} -it \
37-
docker.io/redhat/ubi9 tail -f /dev/null)
36+
-v ${VOLNAME}:${VOLPATH} \
37+
docker.io/redhat/ubi9 tail -f /dev/null)
3838

3939
${DOCKER_CMD} exec ${CTRNAME} rm -rf ${VOLPATH}/*
4040
for FN in ${SRCPATH}/*

docker-compose.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
# DOCKER_IMAGE_PREFIX to contain a (default empty) image registry and path to all custom images
2626
# DOCKER_IMAGE_TAG to contain the image tag for custom images
2727
#
28+
name: anms
29+
2830
networks:
2931
default:
3032
name: ${DOCKER_CTR_PREFIX}anms
@@ -98,11 +100,13 @@ services:
98100
restart: unless-stopped
99101
security_opt:
100102
- "label=type:nginx.process"
101-
depends_on:
103+
depends_on: # dependencies for name resolution
102104
- anms-core
103105
- anms-ui
104106
- grafana
107+
- grafana-image-renderer
105108
- adminer
109+
- ion-manager
106110

107111
opensearch:
108112
hostname: opensearch
@@ -306,6 +310,8 @@ services:
306310
builder-acelib:
307311
# Not expected to run, but needed here to ensure build dependency
308312
condition: service_started
313+
ion-manager:
314+
condition: service_started
309315
postgres:
310316
condition: service_healthy
311317
mqtt-broker:

export.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ else
1818
exit 1
1919
fi
2020

21-
IMAGES=$(${COMPOSE_CMD} -f docker-compose.yml -f agent-compose.yml config | grep --color=auto 'image:' | awk '{print $2}' | sort -u | less)
21+
IMAGES=$(${COMPOSE_CMD} -f docker-compose.yml -f testenv-compose.yml config | grep --color=auto 'image:' | awk '{print $2}' | sort -u | less)
2222
echo "${COMPOSE_CMD} reports the following images: ${IMAGES}"
2323

2424
# Determine base command (docker or podman)

puppet/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ bolt-debug.log
77
.rerun.json
88

99
# Files replaced by prep.sh
10-
modules/anms/files/docker-compose.yml
11-
modules/anms/files/agent-compose.yml
10+
modules/anms/files/*-compose.yml
1211
modules/anms/files/create_volume.sh
1312

1413
# Files replaced by apply_local.sh

0 commit comments

Comments
 (0)