aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-09-05 10:24:13 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-05 10:24:13 +0000
commit1bb3a184f1bbaaf468100f0873222150ac512133 (patch)
treec7428555483cfa57965e247b9a79bc892e231ddf
parentf040ecf089eac94a4efc90316175ccc0529bbfd2 (diff)
parent13ee3ecca3613b9bea287baf0430e19d515a86a4 (diff)
Merge changes I12e0fe14,I5d67885d,I988fd9f9,I747fc472
* changes: OCLIP: Enable docker compose for grpc OCLIP: Update docker to support grpc VTP: Add grpc cli in install OCLIP: Fix grpc role enforcement
-rw-r--r--deployment/docker/src/main/docker/Dockerfile17
-rw-r--r--deployment/docker/src/main/docker/docker-compose.yaml49
-rw-r--r--deployment/zip/installer/install.sh2
-rw-r--r--grpc/grpc-client/src/main/java/org/open/infc/grpc/client/OpenRemoteCli.java2
-rw-r--r--grpc/pom.xml4
5 files changed, 62 insertions, 12 deletions
diff --git a/deployment/docker/src/main/docker/Dockerfile b/deployment/docker/src/main/docker/Dockerfile
index 0c08bc54..21630d17 100644
--- a/deployment/docker/src/main/docker/Dockerfile
+++ b/deployment/docker/src/main/docker/Dockerfile
@@ -17,9 +17,10 @@ FROM openjdk:8-jre-slim
ENV OPEN_CLI_HOME=/opt/oclip \
OPEN_CLI_DEBUG=false \
OPEN_CLI_DEBUG_PORT=5005 \
- OPEN_CLI_MODE=console \
+ OPEN_CLI_MODE=shell \
OPEN_CLI_PRODUCT_IN_USE=onap-beijing \
- GOTTY_TITLE_FORMAT="{{ .command }}"
+ GOTTY_TITLE_FORMAT="{{ .command }}" \
+ OCLIP_GRPC_SERVER="http://oclip_ocs_grpc:50051"
ADD ./STAGE $OPEN_CLI_HOME
WORKDIR $OPEN_CLI_HOME
@@ -32,8 +33,12 @@ RUN apt-get update && apt-get install -y lighttpd git curl pandoc vim && \
pandoc -t plain $OPEN_CLI_HOME/docs/README.md > $OPEN_CLI_HOME/docs/oclip-readme.txt && \
apt-get purge -y pandoc && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/go /tmp/gotty /tmp/* /var/tmp/* && \
chmod +x $OPEN_CLI_HOME/bin/oclip.sh && \
+ chmod +x $OPEN_CLI_HOME/bin/oclip-rcli.sh && \
+ chmod +x $OPEN_CLI_HOME/bin/oclip-cmdflow-server.sh && \
ln $OPEN_CLI_HOME/bin/oclip.sh /usr/sbin/oclip && \
ln $OPEN_CLI_HOME/bin/oclip.sh /usr/sbin/onap && \
+ ln $OPEN_CLI_HOME/bin/oclip-cmdflow-server.sh /usr/sbin/oclip-grpc && \
+ ln $OPEN_CLI_HOME/bin/oclip-rcli.sh /usr/sbin/oclipr && \
if [ ! -d $OPEN_CLI_HOME/data ]; then mkdir $OPEN_CLI_HOME/data; fi && \
if [ ! -d $OPEN_CLI_HOME/open-cli-schema ]; then mkdir $OPEN_CLI_HOME/open-cli-schema; fi && \
if [ ! -f /var/log/lighttpd/access.log ]; then touch /var/log/lighttpd/access.log; fi && \
@@ -45,5 +50,9 @@ RUN apt-get update && apt-get install -y lighttpd git curl pandoc vim && \
cp $OPEN_CLI_HOME/installer/cli-*.zip /var/www-data/servers/open-cli/oclip.zip
EXPOSE 80
EXPOSE 8080
-
-ENTRYPOINT if [ "$OPEN_CLI_MODE" = "daemon" ]; then service lighttpd start; gotty --permit-write --reconnect oclip; else oclip -v && /bin/bash; fi
+EXPOSE 50051
+ENTRYPOINT if [ "$OPEN_CLI_MODE" = "daemon" ]; then service lighttpd start; gotty --permit-write --reconnect oclip; \
+ elif [ "$OPEN_CLI_MODE" = "ocs-web" ]; then echo "****** OCLIP Web Command Server ******"; service lighttpd start; \
+ elif [ "$OPEN_CLI_MODE" = "ocs-grpc" ]; then echo "****** OCLIP gRPC Command Server ******"; oclip-grpc; \
+ elif [ "$OPEN_CLI_MODE" = "occ" ]; then echo "****** OCLIP Web Command Console (OCC) ******"; gotty --permit-write --reconnect oclip; \
+ else echo "****** OCLIP Command Shell******"; oclip -v && /bin/bash; fi
diff --git a/deployment/docker/src/main/docker/docker-compose.yaml b/deployment/docker/src/main/docker/docker-compose.yaml
index f7b6127d..3104f97f 100644
--- a/deployment/docker/src/main/docker/docker-compose.yaml
+++ b/deployment/docker/src/main/docker/docker-compose.yaml
@@ -23,18 +23,57 @@ services:
- "21:21"
- 30000-30009:30000-30009
- oclip_cli:
+#OCLIP Web Command Center
+ oclip_ocs_web:
stdin_open: true
tty: true
image: onap/cli
environment:
- OPEN_CLI_MODE: 'daemon'
+ OPEN_CLI_MODE: 'ocs-web'
OPEN_CLI_DEBUG: 'false'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- - 30260:80
- - 30261:8080
- - 5005:5005
+ - 8080:80
+ - 50050:5005
+#OCLIP Command Console server
+ oclip_occ:
+ stdin_open: true
+ tty: true
+ image: onap/cli
+ environment:
+ OPEN_CLI_MODE: 'occ'
+ OPEN_CLI_DEBUG: 'false'
+ volumes:
+ - /var/run/docker.sock:/var/run/docker.sock
+ ports:
+ - 8081:8080
+ - 50051:5005
+#OCLIP gRPC server
+ oclip_ocs_grpc:
+ stdin_open: true
+ tty: true
+ image: onap/cli
+ environment:
+ OPEN_CLI_MODE: 'ocs-grpc'
+ OPEN_CLI_DEBUG: 'false'
+ volumes:
+ - /var/run/docker.sock:/var/run/docker.sock
+ ports:
+ - 8082:50051
+ - 50052:5005
+
+#Remote OCLIP CLI and OCLIP CLI
+ oclip_cli:
+ stdin_open: true
+ tty: true
+ image: onap/cli
+ environment:
+ OPEN_CLI_MODE: 'console'
+ OPEN_CLI_DEBUG: 'false'
+ volumes:
+ - /var/run/docker.sock:/var/run/docker.sock
+ ports:
+ - 5005:5005
diff --git a/deployment/zip/installer/install.sh b/deployment/zip/installer/install.sh
index 4503c371..6e1956f7 100644
--- a/deployment/zip/installer/install.sh
+++ b/deployment/zip/installer/install.sh
@@ -25,10 +25,12 @@ if [ ! -d ./data ]; then mkdir ./data; fi
if [ ! -d ./open-cli-schema ]; then mkdir ./open-cli-schema; fi
chmod +x ./bin/oclip.sh
+chmod +x ./bin/oclip-rcli.sh
#Make oclip available in path
ln -sf ./bin/oclip.sh /usr/bin/oclip
ln -sf ./bin/oclip.sh /usr/bin/onap
+ln -sf ./bin/oclip-rcli.sh /usr/bin/roclip
#Print the version
oclip -v
diff --git a/grpc/grpc-client/src/main/java/org/open/infc/grpc/client/OpenRemoteCli.java b/grpc/grpc-client/src/main/java/org/open/infc/grpc/client/OpenRemoteCli.java
index 7d02c141..0e9eba78 100644
--- a/grpc/grpc-client/src/main/java/org/open/infc/grpc/client/OpenRemoteCli.java
+++ b/grpc/grpc-client/src/main/java/org/open/infc/grpc/client/OpenRemoteCli.java
@@ -26,7 +26,7 @@ import org.open.infc.grpc.Result;
public class OpenRemoteCli {
public static final String OCLIP_GRPC_SERVER = "http://localhost:50051";
- public static final String OCLIP_GRPC_SERVER_ENV = "OCLIP_SERVER";
+ public static final String OCLIP_GRPC_SERVER_ENV = "OCLIP_GRPC_SERVER";
public static Result run (String[] args) throws Exception {
String oclipHome = System.getenv(OCLIP_GRPC_SERVER_ENV);
diff --git a/grpc/pom.xml b/grpc/pom.xml
index 187aa03d..cea7d4b7 100644
--- a/grpc/pom.xml
+++ b/grpc/pom.xml
@@ -89,7 +89,7 @@
</execution>
</executions>
</plugin>
- <plugin>
+ <!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
@@ -106,7 +106,7 @@
</configuration>
</execution>
</executions>
- </plugin>
+ </plugin> -->
</plugins>
<pluginManagement>
<plugins>