install_manifest.txt
CMakeDoxyfile.in
CMakeDoxygenDefaults.cmake
+
+# Deployments
+docker-images/anna-adml-http/opt/
--- /dev/null
+# ADML with REST Interface (ADML-HTTP)
+
+## Deployment
+
+Execute 'example/diameter/launcher/deploy-adml-http.sh' and follow instructions.
+
+## Enabling HTTP2 Service
+
+This is done through nginx proxy configured as reverse proxy to translate `HTTP2` traffic coming to port *8074* towards *localhost* port *8000* where `ADML HTTP` is going to serve the *HTTP1.1* Rest Service.
+
+To build the docker image, execute this script:
+
+> tools/build-adml-http [variant: [Release]|Debug]
+
+## Running docker image
+
+> docker run --rm -d --network host --name adml-http anna-adml-http:<version>
+
+## Monitoring ADML traces
+
+> docker exec -it adml-http tail -F /opt/adml/launcher.trace
\ No newline at end of file
--- /dev/null
+FROM nginx
+COPY etc/ /etc
+COPY opt/adml/ /opt/adml
+
+COPY starter.sh /var/starter.sh
+
+CMD ["sh", "/var/starter.sh"]
--- /dev/null
+server {
+ listen 8074 http2;
+ listen [::]:8075 http2;
+ #It is possible to enable another port for pure HTTP11:
+ #listen 8073;
+ #listen [::]:8073;
+
+ server_name localhost;
+
+ location / {
+ proxy_pass http://localhost:8000/;
+ }
+}
+
--- /dev/null
+user nginx;
+worker_processes auto;
+
+error_log /var/log/nginx/error.log warn;
+pid /var/run/nginx.pid;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ # https://stackoverflow.com/questions/13895933/nginx-emerg-could-not-build-the-server-names-hash-you-should-increase-server/50813859
+ server_names_hash_bucket_size 64;
+
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ access_log /var/log/nginx/access.log main;
+
+ sendfile on;
+ #tcp_nopush on;
+ #gzip on;
+
+ include /etc/nginx/conf.d/*.conf;
+}
--- /dev/null
+#!/bin/sh
+
+# Start ADML agent:
+cd /opt/adml
+./start.sh
+
+# Execute nginx server:
+exec $(which nginx) -c /etc/nginx/nginx.conf -g "daemon off;"
--- /dev/null
+#!/bin/bash
+
+#############
+# VARIABLES #
+#############
+
+REPO_DIR="$(git rev-parse --show-toplevel 2>/dev/null)"
+[ -z "$REPO_DIR" ] && { echo "You must execute under a valid git repository !" ; exit 1 ; }
+
+IMAGEDIR=${REPO_DIR}/docker-images/anna-adml-http
+AD=${IMAGEDIR}/opt/adml
+
+#############
+# EXECUTION #
+#############
+
+TAG=$(${REPO_DIR}/tools/version)
+
+# Docker build functions
+source ${REPO_DIR}/tools/docker.src
+
+# Deploy Anna-ADML-HTTP:
+rm -rf ${AD}
+echo ${AD} | ${REPO_DIR}/example/diameter/launcher/deploy-adml-http.sh
+
+echo
+echo "Generate docker image ..."
+build_image ${IMAGEDIR} ${TAG} ${IMAGEDIR}
+
+echo
+echo "Done !"
+echo
+
[ -z "$REPO_DIR" ] && { echo "You must execute under a valid git repository !" ; exit 1 ; }
VARIANT=${1:-Release}
-
-#############
-# FUNCTIONS #
-#############
-
-# $1: image directory
-build_image() {
- local imgdir=$1
-
- local imgname=$(basename ${imgdir})
- local imgtag=${TAG}
-
- echo "Building ${imgname}:${imgtag} ..."
- cd ${imgdir}
-
- # Dockerfile for other contexts:
- local dck_opt=
- local preferred=Dockerfile.$(arch)
- [ -f ${preferred} ] && { dck_opt="-f ${preferred}" ; echo "Selected '${preferred}' for current architecture." ; }
- [ -z "${dck_opt}" -a ! -f Dockerfile ] && { echo "No Dockerfile for this directory. Ignoring ..." ; cd - >/dev/null ; return 1 ; }
-
- docker build -t ${imgname}:${imgtag} ${dck_opt} .
- [ $? -ne 0 ] && { echo "An error ocurred. Aborting ..." ; cd - >/dev/null ; return 1 ; }
- cd - >/dev/null
-}
+ENVS="-e VARIANT=${VARIANT}"
#############
# EXECUTION #
TAG=$(${REPO_DIR}/tools/version)
+# Docker build functions
+source ${REPO_DIR}/tools/docker.src
+
# Build compilation image:
-build_image ${REPO_DIR}/docker-images/anna-build-nodb # this image has neither oracle nor mysql installed
+build_image ${REPO_DIR}/docker-images/anna-build-nodb ${TAG} # this image has neither oracle nor mysql installed
# Build source with previous compilation image:
-docker run --rm -it -u $(id -u):$(id -g) -e VARIANT=${VARIANT} -v ${REPO_DIR}:/code -w /code anna-build-nodb:${TAG}
+docker run --rm -it -u $(id -u):$(id -g) ${ENVS} -v ${REPO_DIR}:/code -w /code anna-build-nodb:${TAG}
--- /dev/null
+#!/bin/echo "source me !"
+
+# $1: image directory; $2: image tag; $3: Dockerfile parent dir ('.' by default); $4: build context ('.' by default); $5: extra arguments (quoted)
+build_image() {
+ local imgdir=$1
+ local imgtag=$2
+ local dckdir=${3:-.}
+ local ctxdir=${4:-.}
+ local xtra=$5
+
+ local imgname=$(basename ${imgdir})
+
+ echo "Building ${imgname}:${imgtag} ..."
+ cd ${imgdir}
+
+ # Dockerfile for other contexts:
+ local dck_opt="-f ${dckdir}/Dockerfile"
+ local preferred=${dckdir}/Dockerfile.$(arch)
+ [ -f ${preferred} ] && { dck_opt="-f ${preferred}" ; echo "Selected '${preferred}' for current architecture." ; }
+
+ docker build -t ${imgname}:${imgtag} ${xtra} ${dck_opt} ${ctxdir}
+ [ $? -ne 0 ] && { echo "An error ocurred. Aborting ..." ; cd - >/dev/null ; return 1 ; }
+ cd - >/dev/null
+}
+