## Deployment
-Execute this [script](./example/diameter/launcher/deploy-adml-http.sh) and follow instructions.
+Execute this [script](./example/diameter/launcher/deploy-adml-http.sh [Variant: Release by default]) and follow instructions.
-## Enabling HTTP2 Service
+## Building docker image
-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.
+In our image, we enable the `HTTP2 Service` to attack the `HTTP1.1 ADML interface`. 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]
+> tools/build-anna-adml-http [variant: [Release]|Debug]
## Running docker image
-> docker run --rm -d -p 8074:8074 --name adml-http anna-adml-http:<version>
+> docker run --rm -d -p 8074:8074 --name anna-adml-http anna-adml-http:<version>
Service port is **8074**.
### Monitoring ADML traces
-> docker exec -it adml-http tail -F /opt/adml/launcher.trace
+> docker exec -it anna-adml-http tail -F /opt/adml/launcher.trace
### Checking available diameter dictionaries
-> docker exec -it adml-http ls -1 /opt/adml/stacks
+> docker exec -it anna-adml-http ls -1 /opt/adml/stacks
>
> DictionaryGx.16777238.xml
> DictionaryRx.16777236.xml
SCR_DIR=`readlink -f $0 | xargs dirname`
PROJECT_ROOT=$(readlink -f $SCR_DIR/../../..)
+VARIANT=${1:-Release}
+
#############
# FUNCTIONS #
#############
echo " ADML with HTTP support installation "
echo "------------------------------------------------------"
echo
-[ -d $PROJECT_ROOT/build/Release ] && VARIANT=Release
-[ -d $PROJECT_ROOT/build/Debug ] && VARIANT=Debug
-[ -z "$VARIANT" ] && _exit "Cannot locate neither 'Release' nor 'Debug' variant !"
+[ ! -d $PROJECT_ROOT/build/${VARIANT} ] && _exit "Cannot locate neither '${VARIANT}' variant. Build the project !"
+echo "Variant: ${VARIANT}"
+echo
build_type_letter=$(echo $VARIANT | cut -c1 | tr '[:upper:]' '[:lower:]')
version__dflt=v"`date +'%y'`.`date +'%m'`.`date +'%d'`$build_type_letter"
> curl -v --request GET localhost:8000<uri>
-You could also expose the service as HTTP2 server through *nginx* working as reverse proxy (*adml-http* image is built in this way although internally provides HTTP operations script only for 1.1). Then you could use HTTP2 clients like *nghttp*:
+You could also expose the service as HTTP2 server through *nginx* working as reverse proxy (*anna-adml-http* image is built in this way although internally provides HTTP operations script only for 1.1). Then you could use HTTP2 clients like *nghttp*:
> nghttp -v -H ":method: GET" "<uri>"
> curl -v --request POST -H "Content-Type: application/json" localhost:8000<uri> -d@test.json
-You could also expose the service as HTTP2 server through *nginx* working as reverse proxy (*adml-http* image is built in this way although internally provides HTTP operations script only for 1.1). Then you could use HTTP2 clients like *nghttp*:
+You could also expose the service as HTTP2 server through *nginx* working as reverse proxy (*anna-adml-http* image is built in this way although internally provides HTTP operations script only for 1.1). Then you could use HTTP2 clients like *nghttp*:
> nghttp -v -H ":method: POST" -d test.json "<uri>"
}
```
-**Response body**:
+**Response body**:
```
{
SERVICES=${REPO_DIR}/example/diameter/launcher/resources/rest_api/ct/resources/servicesJson-request.json
ENDPOINT=http://localhost:8074
PORT=$(echo ${ENDPOINT} | cut -d: -f3)
-C_NAME=adml-http
+C_NAME=anna-adml-http
#############
# EXECUTION #
echo "Rebuild ADML HTTP service image (y/n) [y]:"
read opt
[ -z "${opt}" ] && opt=y
-[ "${opt}" = "y" ] && ${REPO_DIR}/tools/build-adml-http
+[ "${opt}" = "y" ] && ${REPO_DIR}/tools/build-anna-adml-http
version=$(${REPO_DIR}/tools/version)
echo "Restart ADML HTTP service image (version '${version}') ..."
+++ /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} || exit 1
-
-echo
-echo "Done !"
-echo
-
--- /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
+
+VARIANT=${1:-Release}
+
+#############
+# EXECUTION #
+#############
+
+echo
+echo "Variant: ${VARIANT}"
+echo "Remember usage: $0 [variant: <[Release]|Debug]>"
+echo
+
+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 ${VARIANT} || exit 1
+
+echo
+echo "Generate docker image ..."
+[ "${VARIANT}" = "Debug" ] && TAG=${TAG}-debug
+build_image ${IMAGEDIR} ${TAG} ${IMAGEDIR} || exit 1
+
+echo
+echo "Done !"
+echo
+
#############
echo
-echo "Remember usage: $0 [variant: Release|Debug], Release by default"
+echo "Variant: ${VARIANT}"
+echo "Remember usage: $0 [variant: <[Release]|Debug]>"
echo
TAG=$(${REPO_DIR}/tools/version)
--- /dev/null
+#!/bin/bash
+
+get_anna_images() {
+ docker images| egrep 'anna-build-nodb|anna-adml-http'
+}
+
+echo -e "\n=== IMAGES ===\n"
+get_anna_images
+echo -e "\n===============\n"
+
+# Removal:
+echo "Proceed with cleanup ? (y/n) [n]"
+read opt
+[ -z "${opt}" ] && opt=n
+[ "${opt}" = "n" ] && exit 0
+echo "Working ..."
+
+docker rmi -f $(get_anna_images | awk '{ print $3 }') &>/dev/null
+docker system prune
+echo
+