Skip to content

Commit

Permalink
Multi OS Build Changes (#47)
Browse files Browse the repository at this point in the history
* multios-build changes
* Update configure.in
* Update .travis.yml
* Update disctribution docker file
* Update README.md
  • Loading branch information
kingster authored Apr 2, 2021
1 parent 2d1cd8a commit 8620c79
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 29 deletions.
7 changes: 4 additions & 3 deletions .devcontainer/Dockerfile.orkaudio.build
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# escape=`
ARG TAG=xenial

FROM ubuntu:xenial
FROM ubuntu:$TAG

# Configure apt
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y build-essential libtool automake git tree rpm libboost-dev libboost-all-dev`
libpcap-dev libsndfile1-dev libapr1-dev libspeex-dev liblog4cxx10-dev libace-dev `
libopus-dev libxerces-c3.1 libxerces-c3-dev libssl-dev cmake megatools`
libpcap-dev libsndfile1-dev libapr1-dev libspeex-dev liblog4cxx-dev libace-dev `
libopus-dev libxerces-c3-dev libssl-dev cmake`
&& rm -rf /var/lib/apt/lists/*

#silk
Expand Down
45 changes: 26 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sudo: true
os: linux
dist: xenial
language: shell
addons:
apt:
packages:
Expand All @@ -18,27 +19,33 @@ cache:
directories:
- $HOME/docker_images

matrix:
include:
- language: shell
before_install:
- docker load -i $HOME/docker_images/images.tar || true
- git clone https://github.com/voiceip/oreka-build.git $HOME/oreka-build
- docker build -t oreka -f .devcontainer/Dockerfile.orkaudio.build .
script:
- docker run -v "$HOME/oreka-build":/oreka-build -v "$TRAVIS_BUILD_DIR":/oreka-src -i oreka bash /entrypoint.sh
- ls -ltrah $HOME/oreka-build/distribution
before_cache:
- docker save -o $HOME/docker_images/images.tar $(docker images -a -q)
- language: java
dist: trusty
jdk: oraclejdk8
script:
- mvn clean install -DskipTests=true
env:
- OS_TAG=xenial
- OS_TAG=bionic
- OS_TAG=focal

jobs:
- language: java
dist: trusty
jdk: oraclejdk8
script:
- mvn clean install -DskipTests=true

before_install:
- docker load -i $HOME/docker_images/images.tar || true
- git clone https://github.com/voiceip/oreka-build.git $HOME/oreka-build
- docker build -t oreka-$OS_TAG --build-arg TAG="$OS_TAG" -f .devcontainer/Dockerfile.orkaudio.build .
script:
- docker run -v "$HOME/oreka-build":/oreka-build -v "$TRAVIS_BUILD_DIR":/oreka-src -i "oreka-$OS_TAG" bash /entrypoint.sh
- mv $HOME/oreka-build/distribution/orkaudio.deb $HOME/oreka-build/distribution/orkaudio_$OS_TAG.deb
- ls -ltrah $HOME/oreka-build/distribution

before_cache:
- docker save -o $HOME/docker_images/images.tar $(docker images -a -q)

deploy:
provider: releases
api_key:
token:
secure: "M4odEjSv9Hj8BoMCkc10DRJmA+FVrWrbwKt4vHVy04WVUonwZo5/31UsUJgDYMV+SnRazTDDTfhjFuWbWaKkNUgVm42Ddz1sQdiOg5/3DXUHI6hAM3HKpiO5f2MgMGbHtga1l4VqMbDJhQEGl8StsQq64tXwcHCGHykX7F0ZPJx/QPy8VEfFZ330i3J4tl36jS7pE5LsVUzfzfoMp0aruM1lpg9BJXW0CcI7+0wZTxLrgziWnk6r0DSltDvbVkeWDE8Ol+51CfxIlwatEfTj3R5xx1XvRFUumLm/w4hal19Thi5Owag6kTtP6wmcYnd+UA1awpe6NZZlRr3Tdly67Pduh/B5BT7cLGGuOw55KaPk9ZPM5omQptp5hVhxw2xMg7tLyqh30nxXZaH4/maXp9RJmr7o1gRKmv6Fe0mthcaO+AtOCPZy6Rwe285ZdhP0pbnBRA6qHNPUn5zagsDunEtvchU5TfRkdx7Lw01kqtgQaZP2PwraG9JQf3HoUIyM1pwMVlXqao3CFVbbsebobIUrqZqcdAwXmVTt4O+4FMCwJohGSI3Hk8/XPKypXl+yY91UAF82Kc4lVnXp7CvhJpEx+7eP8dW16cHwwwU1QLJ/xJMLXRNgOZO+4XqlicKCaK7yi551nJqwHIPGhu20465E4BD6BrlKVuIv072Y9HU="
file_glob: true
file:
Expand All @@ -48,4 +55,4 @@ deploy:
skip_cleanup: true
draft: true
on:
tags: true
tags: true
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Based on [OrecX](http://www.orecx.com/open-source/) [Oreka](https://github.com/O
```bash
export DOCKER_BUILDKIT=1
distribution/docker
docker build -f Dockerfile.orkaudio -t orkaudio .
docker run -itd --net=host --restart=always --privileged=true -v /var/log/orkaudio:/var/log/orkaudio --name orkaudio orkaudio
docker build -f Dockerfile.orkaudio -t voiceip/orkaudio .
docker run -it --net=host --restart=always --privileged=true -v /var/log/orkaudio:/var/log/orkaudio -v /etc/orkaudio:/etc/orkaudio voiceip/orkaudio:latest
```

#### Debian
Expand All @@ -58,7 +58,7 @@ You can natively build if you have all dependencies but I develop on a OSx syste
Docker images are available via [docker hub](https://hub.docker.com/r/voiceip/orkaudio/tags), so just run the below command to pull images directly from hub.docker.com. Note: `--net=host` on docker works on linux systems and is a [limitation of docker](https://docs.docker.com/network/host/), so please keep that in mind.

```bash
docker run -itd --net=host --restart=always --privileged=true -v /var/log/orkaudio:/var/log/orkaudio voiceip/orkaudio:latest
docker run -it --net=host --restart=always --privileged=true -v /var/log/orkaudio:/var/log/orkaudio -v /etc/orkaudio:/etc/orkaudio voiceip/orkaudio:latest
```

#### Debian/Ubuntu
Expand Down
7 changes: 4 additions & 3 deletions distribution/docker/Dockerfile.orkaudio
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ MAINTAINER Kinshuk B ([email protected])
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y build-essential libtool automake git tree rpm libboost-dev `
libpcap-dev libsndfile1-dev libapr1-dev libspeex-dev liblog4cxx10-dev libace-dev `
libopus-dev libxerces-c3.1 libxerces-c3-dev libssl-dev cmake`
libpcap-dev libsndfile1-dev libapr1-dev libspeex-dev liblog4cxx-dev libace-dev `
libopus-dev libxerces-c3-dev libssl-dev cmake`
&& rm -rf /var/lib/apt/lists/*

#silk
Expand Down Expand Up @@ -71,9 +71,10 @@ RUN --mount=type=bind,source=/,target=/artifacts,from=builder `
&& mkdir -p /usr/lib/orkaudio/plugins/ `
&& cp /artifacts/opt/oreka/orkaudio/plugins/*.so /usr/lib/orkaudio/plugins/

RUN mkdir /etc/orkaudio && chmod 777 /etc/orkaudio

ADD https://raw.githubusercontent.com/voiceip/oreka/master/orkaudio/logging-linux-template.properties /etc/orkaudio/logging.properties
COPY config.xml /etc/orkaudio/config.xml
COPY config.xml /etc/orkaudio/config_default.xml
COPY entrypoint.sh /opt/entrypoint.sh

ENV SHELL /bin/bash
Expand Down
11 changes: 10 additions & 1 deletion distribution/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@ set -e

INF=${INTERFACE:-eth0}

sed -i "s/__INTERFACE__/$INF/g" /etc/orkaudio/config.xml
#check if /etc/orkaudio is mounted externally

if grep -qs '/etc/orkaudio' /proc/mounts; then
echo "Config File exists externally."
else
echo "Config File does not exist. Applying default template"
sed "s/__INTERFACE__/$INF/g" /etc/orkaudio/config_default.xml > /etc/orkaudio/config.xml
fi

echo "---- Using Configuration -----"
cat /etc/orkaudio/config.xml
echo "---------"

exec "$@"

4 changes: 4 additions & 0 deletions orkbasecxx/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ if [cat /etc/issue | grep "Ubuntu 18"]; then
CXXFLAGS+=" -DXERCES_3"
fi

if [cat /etc/issue | grep "Ubuntu 20"]; then
CXXFLAGS+=" -DXERCES_3"
fi

# Check if gcc supports cpp11
if [echo "main(){}" | $CXX -std=c++11 -xc++ -S - &>/dev/null]; then
CXXFLAGS+=" -g -O2 -std=c++11 -DSUPPORTS_CPP11 -fPIC $CXXFLAGS"
Expand Down

0 comments on commit 8620c79

Please sign in to comment.