Skip to content

Commit fc71121

Browse files
committed
AP-515: add 4.9.6 image for cross-platform testing
* Build from wowzamedia/wowza-streaming-engine-linux:4.9.6. * Auto install platform-specific version of OpenJDK 21. * Wrap Python testing scripts in a virtual environment. * Readd arm64 to bthe build matrix. * Add healthcheck to the compose file for the API endpoint.
1 parent 29c1ad8 commit fc71121

File tree

8 files changed

+37
-73
lines changed

8 files changed

+37
-73
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
build:
1515
runs-on: ${{ matrix.runner }}
1616
outputs:
17-
# image-arm64: ${{ steps.gen-output.outputs.image-arm64 }}
17+
image-arm64: ${{ steps.gen-output.outputs.image-arm64 }}
1818
image-x64: ${{ steps.gen-output.outputs.image-x64 }}
1919
strategy:
2020
fail-fast: false
2121
matrix:
2222
runner:
2323
- ubuntu-24.04
24-
# - ubuntu-24.04-arm
24+
- ubuntu-24.04-arm
2525
steps:
2626
- name: Checkout code
2727
uses: actions/checkout@v4
@@ -77,7 +77,7 @@ jobs:
7777
runs-on: ubuntu-24.04
7878
needs: build
7979
env:
80-
# DOCKER_APP_IMAGE_ARM64: ${{ needs.build.outputs.image-arm64 }}
80+
DOCKER_APP_IMAGE_ARM64: ${{ needs.build.outputs.image-arm64 }}
8181
DOCKER_APP_IMAGE_X64: ${{ needs.build.outputs.image-x64 }}
8282
outputs:
8383
image: ${{ steps.meta.outputs.tags }}
@@ -106,7 +106,7 @@ jobs:
106106
run: |
107107
docker buildx imagetools create \
108108
--tag "$DOCKER_METADATA_OUTPUT_TAGS" \
109-
"$DOCKER_APP_IMAGE_X64"
109+
"$DOCKER_APP_IMAGE_ARM64" "$DOCKER_APP_IMAGE_X64"
110110
111111
test:
112112
runs-on: ubuntu-24.04
@@ -143,7 +143,7 @@ jobs:
143143
- name: Run tests
144144
if: ${{ always() }}
145145
run: |
146-
docker compose run app /opt/app/test/run_tests.py
146+
docker compose exec app /opt/app/venv/bin/python -m unittest discover -s /opt/app -p "*_test.py"
147147
env:
148148
WOWZA_LICENSE_KEY: ${{ secrets.WOWZA_LICENSE_KEY }}
149149

@@ -153,7 +153,8 @@ jobs:
153153
docker compose cp app:/opt/app/artifacts ./
154154
docker compose logs > artifacts/docker-compose-services.log
155155
docker compose config > artifacts/docker-compose.merged.yml
156-
156+
env:
157+
WOWZA_LICENSE_KEY: EZZZZ-INTEN-TIONA-LLYRE-DACT-EDFROM-BUILDLOGS
157158
- name: Upload the test report
158159
if: ${{ always() }}
159160
uses: actions/upload-artifact@v4

Dockerfile

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Target: base
33
#
44

5-
FROM wowzamedia/wowza-streaming-engine-linux:4.8.25 AS base
5+
FROM wowzamedia/wowza-streaming-engine-linux:4.9.6 AS base
66

77
# =============================================================================
88
# Ports
@@ -27,28 +27,29 @@ RUN apt-get update -qq
2727
RUN apt-get install -y --no-install-recommends \
2828
curl \
2929
dnsutils \
30-
iputils-ping \
31-
lsb-core
30+
iputils-ping
3231

3332
# =============================================================================
3433
# Java
3534

36-
# The upstream Wowza image ships with OpenJDK 9.0.4+11, which is not a
37-
# long-term support release and, importantly, doesn't know about containers:
38-
# https://www.wowza.com/community/t/creating-a-production-worthy-docker-image/53957/3
35+
# The upstream Wowza image may ship with an outdated OpenJDK, and
36+
# previously (even as of 4.8.25) did not include an LTS release or
37+
# one that was aware of containers.
3938
#
4039
# Luckily, Wowza supports manually replacing the JRE:
4140
# https://www.wowza.com/docs/manually-install-and-troubleshoot-java-on-wowza-streaming-engine
41+
# ... so this updates to the latest version of OpenJDK 21 (LTS).
4242
#
4343
# (Unfortunately, this by itself isn't enough to get Wowza to properly
4444
# calculate its own max heap size, so we still need to set that explicitly
4545
# in Tune.xml. Possibly a future version of Wowza will be clever enough to
4646
# use -XX:MaxRAMPercentage instead.)
4747

48-
RUN apt-get install -y --no-install-recommends openjdk-11-jre-headless
48+
RUN apt-get install -y --no-install-recommends openjdk-21-jre-headless
4949

5050
RUN rm -rf /usr/local/WowzaStreamingEngine/java
51-
RUN ln -s /usr/lib/jvm/java-11-openjdk-amd64 /usr/local/WowzaStreamingEngine/java
51+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
52+
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) ln -s "/usr/lib/jvm/java-21-openjdk-${arch}" /usr/local/WowzaStreamingEngine/java
5253

5354
# =============================================================================
5455
# Global configuration
@@ -74,8 +75,9 @@ WORKDIR /opt/app
7475
# =============================================================================
7576
# Tests
7677

77-
RUN apt-get install -y --no-install-recommends python3-pip
78-
RUN pip3 install unittest-xml-reporting
78+
RUN apt-get install -y --no-install-recommends python3-pip python3-venv
79+
RUN python3 -m venv venv
80+
RUN venv/bin/pip3 install unittest-xml-reporting
7981

8082
COPY --chown=$APP_USER test /opt/app/test
8183

@@ -133,12 +135,13 @@ RUN rm -r /opt/app/WEB-INF
133135
# Uninstall zip
134136
RUN apt-get remove -y zip
135137

138+
# TODO: Fix this? Wowza's default image expects to run Wowza as root.
136139
# =============================================================================
137140
# Run as the wowza user to minimize risk to the host.
138141

139-
USER $APP_USER
142+
# USER $APP_USER
140143

141144
# =============================================================================
142145
# Default command
143146

144-
CMD ["/opt/app/bin/docker-entrypoint.sh"]
147+
ENTRYPOINT ["/opt/app/bin/docker-entrypoint.sh"]

bin/docker-entrypoint.sh

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
# Streaming Media Engine Manager in subprocesses, and waits
66
# for them to exit.
77

8-
# TODO: now that we're running the manager and server in the same container,
9-
# consider getting rid of this (or simplifying it) in favor of the
10-
# upstream container's /sbin/entrypoint.sh, which uses supervisord
11-
128
BASENAME=$(basename ${BASH_SOURCE})
139
echo "${BASENAME} running"
1410

@@ -26,58 +22,17 @@ if [ ! -z "${WOWZA_ENABLE_DOCUMENTATION_SERVER}" ]; then
2622
"${WOWZA_BIN}"/enable-documentation-server.sh
2723
fi
2824

29-
# ########################################
30-
# Start server and manager in background
31-
32-
# shellcheck source=start-server.sh
33-
echo "Invoking ${WOWZA_BIN}"/start-server.sh
34-
"${WOWZA_BIN}"/start-server.sh &
35-
SERVER_PID=$!
36-
echo "SERVER_PID=${SERVER_PID}"
37-
38-
echo "Invoking ${WMSMGR_HOME}"/bin/startmgr.sh
39-
"${WMSMGR_HOME}"/bin/startmgr.sh &
40-
MANAGER_PID=$!
41-
echo "MANAGER_PID=${MANAGER_PID}"
42-
43-
# ########################################
44-
# Make sure child processes exit cleanly
45-
46-
ensure_clean_exit() {
47-
trap - SIGINT SIGTERM # clear the trap
48-
echo "Killing process $$ and all subprocesses"
49-
kill -- -$$
50-
}
51-
52-
sigint_received() {
53-
echo "SIGINT received"
54-
ensure_clean_exit
55-
}
56-
57-
sigterm_received() {
58-
echo "SIGTERM received"
59-
ensure_clean_exit
60-
}
25+
# load secrets into wowza env vars. by default, the Wowza entrypoint
26+
# creates the keyfile in question, which is why we pass the variable
27+
# in using a different name.
28+
. "${WOWZA_BIN}/secrets.sh"
6129

62-
trap sigint_received SIGINT
63-
trap sigterm_received SIGTERM
30+
export WSE_MGR_USER=$WOWZA_MANAGER_USER
31+
export WSE_MGR_PASS=$WOWZA_MANAGER_PASSWORD
32+
export WSE_LIC=$WOWZA_LICENSE_KEY
6433

6534
# ########################################
66-
# Wait for manager or server to exit
67-
68-
wait -n
69-
EXIT_STATUS=$?
70-
71-
# Whichever exited, kill the other one
72-
if ! kill -0 $SERVER_PID 2> /dev/null; then
73-
echo "Wowza Streaming Engine (PID ${SERVER_PID}) exited with ${EXIT_STATUS}"
74-
echo "Stopping Wowza Streaming Engine Manager (PID ${MANAGER_PID})"
75-
kill -- -$MANAGER_PID 2> /dev/null
76-
elif ! kill -0 $MANAGER_PID 2> /dev/null; then
77-
echo "Wowza Streaming Engine Manager (PID ${MANAGER_PID}) exited with ${EXIT_STATUS}"
78-
echo "Stopping Wowza Streaming Engine (PID ${SERVER_PID})"
79-
kill -- -$SERVER_PID 2> /dev/null
80-
fi
35+
# Start server and manager by handing off to Wowza's entrypoint
8136

82-
echo "Exiting with status ${EXIT_STATUS}"
83-
exit $EXIT_STATUS
37+
echo Invoking Wowza\'s /sbin/entrypoint.sh
38+
exec /sbin/entrypoint.sh "$@"

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ services:
1616
- WOWZA_MANAGER_USER=${WOWZA_MANAGER_USER}
1717
- WOWZA_MANAGER_PASSWORD=${WOWZA_MANAGER_PASSWORD}
1818
- WOWZA_ENABLE_DOCUMENTATION_SERVER=yes
19+
healthcheck:
20+
test: curl -s http://localhost:8087 > /dev/null || exit 1
21+
interval: 5s
22+
timeout: 5s
23+
retries: 10
1924
# Uncommment these when editing / running tests locally.
2025
# (Note: slows performance on macOS Catalina, for some reason.)
2126
# volumes:

lib-ucblit/log4j-api-2.17.0.jar

-295 KB
Binary file not shown.

lib-ucblit/log4j-core-2.17.0.jar

-1.71 MB
Binary file not shown.
-215 KB
Binary file not shown.
230 KB
Binary file not shown.

0 commit comments

Comments
 (0)