diff options
author | Brinda Santh <bs2796@att.com> | 2019-10-03 20:02:29 -0400 |
---|---|---|
committer | Brinda Santh <bs2796@att.com> | 2019-10-03 20:02:29 -0400 |
commit | 4c2b42f141e1501222a284f964eb4303cc4f03aa (patch) | |
tree | 0d839c5126fda40f6a89f6bb5f06ab0e27b7ad44 /ms/py-executor | |
parent | 5006588ac1a41b5ff8207a13fa118866d7ef4924 (diff) |
Add bi-directional python executor tests
Issue-ID: CCSDK-1747
Signed-off-by: Brinda Santh <bs2796@att.com>
Change-Id: I2e2b974d35d6878418eafe8ece9fcb1d69622a61
Diffstat (limited to 'ms/py-executor')
-rw-r--r-- | ms/py-executor/blueprints_grpc/blueprint_processing_server.py | 2 | ||||
-rw-r--r-- | ms/py-executor/blueprints_grpc/executor_utils.py | 2 | ||||
-rwxr-xr-x | ms/py-executor/dc/docker-compose.yaml | 23 | ||||
-rw-r--r-- | ms/py-executor/docker/Dockerfile | 4 | ||||
-rwxr-xr-x | ms/py-executor/docker/distribution.xml | 6 |
5 files changed, 31 insertions, 6 deletions
diff --git a/ms/py-executor/blueprints_grpc/blueprint_processing_server.py b/ms/py-executor/blueprints_grpc/blueprint_processing_server.py index 0c432d4cd..f1f29a035 100644 --- a/ms/py-executor/blueprints_grpc/blueprint_processing_server.py +++ b/ms/py-executor/blueprints_grpc/blueprint_processing_server.py @@ -46,4 +46,4 @@ class BluePrintProcessingServer(BluePrintProcessing_pb2_grpc.BluePrintProcessing # Get the Dynamic Process Instance based on request instance: AbstractScriptFunction = instance_for_input(self.configuration, request) instance.set_context(context) - return instance.process(request) + yield from instance.process(request) diff --git a/ms/py-executor/blueprints_grpc/executor_utils.py b/ms/py-executor/blueprints_grpc/executor_utils.py index 224e35ef9..44b6d8e87 100644 --- a/ms/py-executor/blueprints_grpc/executor_utils.py +++ b/ms/py-executor/blueprints_grpc/executor_utils.py @@ -29,7 +29,7 @@ logger = logging.getLogger("Utils") def current_time(): ts = time.time() - return datetime.datetime.fromtimestamp(ts).strftime("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + return datetime.datetime.fromtimestamp(ts).strftime("%Y-%m-%dT%H:%M:%S.%fZ") def blueprint_id(input: ExecutionServiceInput): diff --git a/ms/py-executor/dc/docker-compose.yaml b/ms/py-executor/dc/docker-compose.yaml new file mode 100755 index 000000000..76009411b --- /dev/null +++ b/ms/py-executor/dc/docker-compose.yaml @@ -0,0 +1,23 @@ +version: '3.3' + +services: + py-executor: + image: onap/ccsdk-py-executor + container_name: bp-py-executor + ports: + - "50052:50052" + restart: always + volumes: + - blueprints-deploy:/opt/app/onap/blueprints/deploy + environment: + APPLICATIONNAME: PythonExecutor + BUNDLEVERSION: 1.0.0 + APP_CONFIG_HOME: /opt/app/onap/config + STICKYSELECTORKEY: + ENVCONTEXT: dev + APP_PORT: 50052 + BASIC_AUTH: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== + LOG_FILE: /opt/app/onap/logs/application.log + +volumes: + blueprints-deploy: diff --git a/ms/py-executor/docker/Dockerfile b/ms/py-executor/docker/Dockerfile index 112180581..b49daf68f 100644 --- a/ms/py-executor/docker/Dockerfile +++ b/ms/py-executor/docker/Dockerfile @@ -11,8 +11,8 @@ RUN tar -xzf /source.tar.gz -C /tmp \ && rm -rf /source.tar.gz \ && rm -rf /tmp/@project.build.finalName@ -RUN pip install --no-cache-dir -r /opt/app/onap/requirements.txt +RUN pip install --no-cache-dir -r /opt/app/onap/python/requirements.txt VOLUME /opt/app/onap/blueprints/deploy/ -ENTRYPOINT /opt/app/onap/start.sh
\ No newline at end of file +ENTRYPOINT /opt/app/onap/python/start.sh
\ No newline at end of file diff --git a/ms/py-executor/docker/distribution.xml b/ms/py-executor/docker/distribution.xml index 8bd06c88f..6235a7b8a 100755 --- a/ms/py-executor/docker/distribution.xml +++ b/ms/py-executor/docker/distribution.xml @@ -34,20 +34,22 @@ </fileSet> <fileSet> <directory>${project.basedir}</directory> - <outputDirectory>opt/app/onap</outputDirectory> + <outputDirectory>opt/app/onap/python</outputDirectory> <includes> <include>requirements.txt</include> <include>configuration.ini</include> </includes> <useDefaultExcludes>true</useDefaultExcludes> + <fileMode>0666</fileMode> </fileSet> <fileSet> <directory>${project.basedir}/docker</directory> - <outputDirectory>opt/app/onap</outputDirectory> + <outputDirectory>opt/app/onap/python</outputDirectory> <includes> <include>*.sh</include> </includes> <useDefaultExcludes>true</useDefaultExcludes> + <fileMode>0755</fileMode> </fileSet> </fileSets> </assembly>
\ No newline at end of file |