Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Wowza 4.3.0 #10

Merged
merged 3 commits into from
Jan 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.git
.gitignore
support
docker-compose.yml
LICENSE
Makefile
VERSION
README.md
Changelog.md
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

**4.3.0**
- wowza: upgrade to 4.3.0

**4.1.2-1**
- moved data dir to `/var/lib/wowza`
- added `WOWZA_ACCEPT_LICENSE` environment variable
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM sameersbn/ubuntu:14.04.20160121
MAINTAINER [email protected]

ENV WOWZA_VERSION=4.1.2 \
ENV WOWZA_VERSION=4.3.0 \
WOWZA_DATA_DIR=/var/lib/wowza \
WOWZA_LOG_DIR=/var/log/wowza

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y wget supervisor openjdk-7-jre \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y wget supervisor openjdk-7-jre expect \
&& rm -rf /var/lib/apt/lists/*

COPY install.sh /app/install.sh
RUN bash /app/install.sh
COPY prepare.sh interaction.exp /app/
RUN /app/prepare.sh

COPY entrypoint.sh /sbin/entrypoint.sh
RUN chmod 755 /sbin/entrypoint.sh
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

> **NOTICE**:
>
> Due to changes in the WOWZA installer, `4.1.x` is the last version that is made available by this image.
> Due to changes in the WOWZA installer, `4.3.x` and later versions are installed during container startup.

# sameersbn/wowza:4.1.2-8
# sameersbn/wowza:4.3.0

- [Introduction](#introduction)
- [Contributing](#contributing)
Expand Down Expand Up @@ -58,7 +58,7 @@ Automated builds of the image are available on [Dockerhub](https://hub.docker.co
> **Note**: Builds are also available on [Quay.io](https://quay.io/repository/sameersbn/wowza)

```bash
docker pull sameersbn/wowza:4.1.2-8
docker pull sameersbn/wowza:4.3.0
```

Alternatively you can build the image yourself.
Expand All @@ -81,7 +81,7 @@ docker run --name wowza -d --restart=always \
--env 'WOWZA_KEY=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx' \
--volume /srv/docker/wowza/data:/var/lib/wowza \
--volume /srv/docker/wowza/log:/var/log/wowza \
sameersbn/wowza:4.1.2-8
sameersbn/wowza:4.3.0
```

**The `--env WOWZA_ACCEPT_LICENSE=yes` parameter in the above command indicates that you agree to the Wowza EULA.**
Expand Down Expand Up @@ -129,7 +129,7 @@ To upgrade to newer releases:
1. Download the updated Docker image:

```bash
docker pull sameersbn/wowza:4.1.2-8
docker pull sameersbn/wowza:4.3.0
```

2. Stop the currently running image:
Expand All @@ -149,7 +149,7 @@ To upgrade to newer releases:
```bash
docker run -name wowza -d \
[OPTIONS] \
sameersbn/wowza:4.1.2-8
sameersbn/wowza:4.3.0
```

## Shell Access
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.2-8
4.3.0
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Wowza:
image: sameersbn/wowza:4.1.2-8
image: sameersbn/wowza:4.3.0
environment:
- WOWZA_ACCEPT_LICENSE=yes
- WOWZA_KEY=
Expand Down
63 changes: 40 additions & 23 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,45 @@ set -e

WOWZA_KEY=${WOWZA_KEY:-}

check_and_install_wowza() {
echo "Checking if Wowza Streaming Engine is installed..."
if [[ -e /usr/local/WowzaStreamingEngine ]]; then
echo "Installation found"
return
fi

echo "No installation found"
echo "Installing Wowza..."

if [[ ${WOWZA_ACCEPT_LICENSE} != yes ]]; then
echo "ERROR: "
echo " Please accept the Wowza EULA by specifying 'WOWZA_ACCEPT_LICENSE=yes'"
echo " Visit https://www.wowza.com/legal to read the Licensing Terms."
echo " Aborting..."
exit 1
fi

if [[ -z ${WOWZA_KEY} && ! -f /usr/local/WowzaStreamingEngine/conf/Server.license ]]; then
echo "ERROR: "
echo " Please specify your Wowza Streaming Engine license key using"
echo " the WOWZA_KEY environment variable."
echo " Cannot continue without a license. Aborting..."
exit 1
fi

# install Wowza
sed -i "s/xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxxxxx/${WOWZA_KEY}/g" /app/interaction.exp
/app/interaction.exp > /dev/null

# symlink /usr/local/WowzaStreamingEngine/logs -> ${WOWZA_LOG_DIR}/wowza
rm -rf /usr/local/WowzaStreamingEngine/logs
ln -sf ${WOWZA_LOG_DIR}/wowza /usr/local/WowzaStreamingEngine/logs

# symlink /usr/local/WowzaStreamingEngine/manager/logs -> ${WOWZA_LOG_DIR}/manager
rm -rf /usr/local/WowzaStreamingEngine/manager/logs
ln -sf ${WOWZA_LOG_DIR}/manager /usr/local/WowzaStreamingEngine/manager/logs
}

rewire_wowza() {
echo "Preparing Wowza..."
rm -rf /usr/local/WowzaStreamingEngine/conf
Expand Down Expand Up @@ -60,34 +99,12 @@ initialize_log_dir() {
chown -R root:root ${WOWZA_LOG_DIR}/manager
}

initialize_license() {
if [[ -z ${WOWZA_KEY} && ! -f /usr/local/WowzaStreamingEngine/conf/Server.license ]]; then
echo "ERROR: "
echo " Please specify your Wowza Streaming Engine license key using"
echo " the WOWZA_KEY environment variable."
echo " Cannot continue without a license. Aborting..."
exit 1
fi

if [[ -n ${WOWZA_KEY} ]]; then
echo "Installing Wowza Streaming Engine license..."
echo "${WOWZA_KEY}" > /usr/local/WowzaStreamingEngine/conf/Server.license
fi
}

check_and_install_wowza
initialize_data_dir
initialize_log_dir
rewire_wowza
initialize_license

if [[ -z ${1} ]]; then
if [[ ${WOWZA_ACCEPT_LICENSE} != yes ]]; then
echo "ERROR: "
echo " Please accept the Wowza EULA by specifying 'WOWZA_ACCEPT_LICENSE=yes'"
echo " Visit https://www.wowza.com/legal to read the Licensing Terms."
echo " Aborting..."
exit 1
fi
exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
else
exec "$@"
Expand Down
60 changes: 0 additions & 60 deletions install.sh

This file was deleted.

32 changes: 32 additions & 0 deletions interaction.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/expect -f

# Modified version of https://github.com/simplycycling/ansible-wowza/blob/f6ed47147d6ab318230f978be99322b9fe58d8eb/templates/script.exp.j2

set timeout -1
spawn /app/WowzaStreamingEngine.run

expect {
-gl "*Press *Enter* to continue*" { send -- "\r"; exp_continue }
-gl "*Do you accept this agreement*"
}
send -- "\ry\r"

expect -gl "*License Key*"
send -- "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxxxxx\r"

expect -gl "*User Name*"
send -- "admin\r"

expect -gl "*Password*"
send -- "admin\r"

expect -gl "*Confirm Password*"
send -- "admin\r"

expect -gl "*Start Wowza Streaming Engine automatically*"
send -- "n\r"

expect -gl "*Do you want to continue*"
send -- "y\r"

expect eof
40 changes: 40 additions & 0 deletions prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

WOWZA_INSTALLER_URL="https://www.wowza.com/downloads/WowzaStreamingEngine-${WOWZA_VERSION//./-}/WowzaStreamingEngine-${WOWZA_VERSION}-linux-x64-installer.run"
WOWZA_INSTALLER_FILE="WowzaStreamingEngine.run"

cd /app

# download wowza installer
wget "${WOWZA_INSTALLER_URL}" -O "${WOWZA_INSTALLER_FILE}"
chmod +x "${WOWZA_INSTALLER_FILE}"

# move supervisord.log file to ${WOWZA_LOG_DIR}/supervisor/
sed 's|^logfile=.*|logfile='"${WOWZA_LOG_DIR}"'/supervisor/supervisord.log ;|' -i /etc/supervisor/supervisord.conf

# configure supervisord to start wowza streaming engine
cat > /etc/supervisor/conf.d/wowza.conf <<EOF
[program:wowza]
priority=10
directory=/usr/local/WowzaStreamingEngine/bin
command=/usr/local/WowzaStreamingEngine/bin/startup.sh
user=root
autostart=true
autorestart=true
stdout_logfile=${WOWZA_LOG_DIR}/supervisor/%(program_name)s.log
stderr_logfile=${WOWZA_LOG_DIR}/supervisor/%(program_name)s.log
EOF

# configure supervisord to start wowza streaming engine manager
cat > /etc/supervisor/conf.d/wowzamgr.conf <<EOF
[program:wowzamgr]
priority=20
directory=/usr/local/WowzaStreamingEngine/manager/bin
command=/usr/local/WowzaStreamingEngine/manager/bin/startmgr.sh
user=root
autostart=true
autorestart=true
stdout_logfile=${WOWZA_LOG_DIR}/supervisor/%(program_name)s.log
stderr_logfile=${WOWZA_LOG_DIR}/supervisor/%(program_name)s.log
EOF
4 changes: 2 additions & 2 deletions support/systemd/wowza.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Requires=docker.service
[Service]
ExecStartPre=-/usr/bin/docker kill wowza
ExecStartPre=-/usr/bin/docker rm wowza
#ExecStartPre=-/usr/bin/docker pull sameersbn/wowza:4.1.2-8
ExecStart=/usr/bin/docker run --name wowza --publish 1935:1935 --publish 8086:8086 --publish 8087:8087 --publish 8088:8088 --env 'WOWZA_ACCEPT_LICENSE=yes' --env 'WOWZA_KEY=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx' --volume /srv/docker/wowza/data:/var/lib/wowza --volume /srv/docker/wowza/log:/var/log/wowza sameersbn/wowza:4.1.2-8
#ExecStartPre=-/usr/bin/docker pull sameersbn/wowza:4.3.0
ExecStart=/usr/bin/docker run --name wowza --publish 1935:1935 --publish 8086:8086 --publish 8087:8087 --publish 8088:8088 --env 'WOWZA_ACCEPT_LICENSE=yes' --env 'WOWZA_KEY=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx' --volume /srv/docker/wowza/data:/var/lib/wowza --volume /srv/docker/wowza/log:/var/log/wowza sameersbn/wowza:4.3.0
ExecStop=/usr/bin/docker stop wowza

[Install]
Expand Down