X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-cass%2Fdocker%2Fdrun.sh;h=33b59d7cf793bcc66cc1778e16e0de4fec9cf776;hb=475da40b0d58acdf4dd1a3590c490ce7b95a1af8;hp=a412296bbe4ec4ed389abc260e927e78de02aa89;hpb=7a1817bf3cf3c40c6c33f673ddc46c3f115cc3bc;p=aaf%2Fauthz.git diff --git a/auth/auth-cass/docker/drun.sh b/auth/auth-cass/docker/drun.sh index a412296b..33b59d7c 100644 --- a/auth/auth-cass/docker/drun.sh +++ b/auth/auth-cass/docker/drun.sh @@ -23,8 +23,22 @@ if [ -e ../../docker/d.props ]; then . ../../docker/d.props fi DOCKER=${DOCKER:-docker} - -if [ "$1" = "publish" ]; then +if [ "$DOCKER" = "podman" ]; then + PODNAME=aaf-cass.onap + if $(podman pod exists $PODNAME); then + echo "Using existing 'podman' pod $PODNAME" + POD="--pod $PODNAME " + else + echo "Create new 'podman' pod $PODNAME" + # Note: Cassandra needs "infra" to work + # Keep in separate pod + #podman pod create --infra=true -n $PODNAME --publish 9042:9042 + podman pod create --infra=false -n $PODNAME + #POD="--pod new:$PODNAME " + POD="--pod $PODNAME " + PUBLISH='--publish 9042:9042 ' + fi +else PUBLISH='--publish 9042:9042 ' fi @@ -35,19 +49,21 @@ fi # Optional mount instead of v # --mount 'type=volume,src=aaf_cass_data,dst=/var/lib/cassandra,volume-driver=local' \ -if [ "`$DOCKER ps -a | grep aaf_cass`" == "" ]; then +if [ "`$DOCKER ps -a | grep aaf-cass`" == "" ]; then echo "starting Cass from 'run'" # NOTE: These HEAP Sizes are minimal. Not set for full organizations. + # --user ${USER} \ $DOCKER run \ - --name aaf_cass \ + --name aaf-cass \ -e HEAP_NEWSIZE=512M \ -e MAX_HEAP_SIZE=1024M \ -e CASSANDRA_DC=dc1 \ -e CASSANDRA_CLUSTER_NAME=osaaf \ -v "aaf_cass_data:/var/lib/cassandra" \ -v "aaf_status:/opt/app/aaf/status" \ + ${POD} \ $PUBLISH \ -d ${PREFIX}${ORG}/${PROJECT}/aaf_cass:${VERSION} "onap" else - $DOCKER start aaf_cass + $DOCKER start aaf-cass fi