You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/08/13 14:34:11 UTC

[GitHub] WillemJiang closed pull request #250: [SCB-823] Refer to public images, add testing facilities

WillemJiang closed pull request #250: [SCB-823] Refer to public images, add testing facilities
URL: https://github.com/apache/incubator-servicecomb-saga/pull/250
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/saga-demo/saga-k8s-resources/README.md b/saga-demo/saga-k8s-resources/README.md
index a10588c7..894bd88b 100644
--- a/saga-demo/saga-k8s-resources/README.md
+++ b/saga-demo/saga-k8s-resources/README.md
@@ -27,6 +27,8 @@ service "alpha-server" created
 deployment "alphaserver" created
 service "postgresql" created
 deployment "database" created
+service "jmeter-collector" created
+deployment "jmeter-collector" created
 
 $ kubectl apply -f ./spring-demo
 service "booking" created
@@ -60,13 +62,8 @@ configmap "springdemo-jmeter-script" created
 deployment "spring-demo-jmeter" created
 
 $ kubectl get pods -n servicecomb | grep jmeter
+jmeter-collector-75c4c96dbb-2bjtc     1/1       Running   0          47s
 spring-demo-jmeter-6cfb679f58-sckkx   1/1       Running   0          12s
 ```
 
-The jmeter deployment will keep testing the demo and generate the test result. For now the the result file is stored in the Kubernetes nodes under the path `/saga-jmeter-result/{demo_name}.jtl`. You can generate the HTML dashboard with the command:
-
-```bash
-$ jmeter -g /saga-jmeter-result/{demo_name}.jtl -o output/
-```
-
-We will try to provide more services to automate the dashboard generation in the future.
+The jmeter deployment will keep testing the demo and generate the test result. After each test, the result and its corresponding dashboard will be uploaded to the jmeter-collector service, which provides a simple web page to browser the test outputs. So make sure you config the jmeter-collector to be accessible, like a [NodePort](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport) in a private cluster or [LoadBalancer](https://kubernetes.io/docs/concepts/services-networking/#loadbalancer) in a public cloud service.
diff --git a/saga-demo/saga-k8s-resources/base/alpha.yaml b/saga-demo/saga-k8s-resources/base/alpha.yaml
index 47c0d5df..408c13b7 100644
--- a/saga-demo/saga-k8s-resources/base/alpha.yaml
+++ b/saga-demo/saga-k8s-resources/base/alpha.yaml
@@ -44,7 +44,7 @@ spec:
     spec:
       containers:
       - name: alphaserver
-        image: alpha-server:0.3.0-SNAPSHOT
+        image: saga/alpha-server:0.3.0-SNAPSHOT
         imagePullPolicy: IfNotPresent
         # ports:
         # - containerPort: 8080
diff --git a/saga-demo/saga-k8s-resources/base/jmeter-collector.yaml b/saga-demo/saga-k8s-resources/base/jmeter-collector.yaml
new file mode 100644
index 00000000..4492fa49
--- /dev/null
+++ b/saga-demo/saga-k8s-resources/base/jmeter-collector.yaml
@@ -0,0 +1,53 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: jmeter-collector
+  namespace: servicecomb
+  labels:
+    app: jmeter-collector
+spec:
+  ports:
+  - port: 80
+    targetPort: 8883
+    name: http-jmeter-collector
+  # externalIPs: ["YOUR_NODE_IP"]
+  # type: NodePort
+  selector:
+    app: jmeter-collector
+---
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+  name: jmeter-collector
+  namespace: servicecomb
+spec:
+  replicas: 1
+  template:
+    metadata:
+      labels:
+        app: jmeter-collector
+        version: v1
+    spec:
+      containers:
+      - name: jmeter-collector
+        image: saga/jmeter-collector:v1
+        imagePullPolicy: IfNotPresent
+---
+
diff --git a/saga-demo/saga-k8s-resources/spring-demo/booking.yaml b/saga-demo/saga-k8s-resources/spring-demo/booking.yaml
index 93fc1519..10f7c801 100644
--- a/saga-demo/saga-k8s-resources/spring-demo/booking.yaml
+++ b/saga-demo/saga-k8s-resources/spring-demo/booking.yaml
@@ -45,7 +45,7 @@ spec:
     spec:
       containers:
       - name: booking
-        image: booking:0.3.0-SNAPSHOT
+        image: saga/booking:0.3.0-SNAPSHOT
         imagePullPolicy: IfNotPresent
         env:
         - name: JAVA_OPTS
diff --git a/saga-demo/saga-k8s-resources/spring-demo/car.yaml b/saga-demo/saga-k8s-resources/spring-demo/car.yaml
index 064ead20..52a74516 100644
--- a/saga-demo/saga-k8s-resources/spring-demo/car.yaml
+++ b/saga-demo/saga-k8s-resources/spring-demo/car.yaml
@@ -45,7 +45,7 @@ spec:
     spec:
       containers:
       - name: car
-        image: car:0.3.0-SNAPSHOT
+        image: saga/car:0.3.0-SNAPSHOT
         imagePullPolicy: IfNotPresent
         env:
         - name: JAVA_OPTS
diff --git a/saga-demo/saga-k8s-resources/spring-demo/hotel.yaml b/saga-demo/saga-k8s-resources/spring-demo/hotel.yaml
index ef1b0523..87f3808d 100644
--- a/saga-demo/saga-k8s-resources/spring-demo/hotel.yaml
+++ b/saga-demo/saga-k8s-resources/spring-demo/hotel.yaml
@@ -45,7 +45,7 @@ spec:
     spec:
       containers:
       - name: hotel
-        image: hotel:0.3.0-SNAPSHOT
+        image: saga/hotel:0.3.0-SNAPSHOT
         imagePullPolicy: IfNotPresent
         env:
         - name: JAVA_OPTS
diff --git a/saga-demo/saga-k8s-resources/spring-demo/test/jmeter.yaml b/saga-demo/saga-k8s-resources/spring-demo/test/jmeter.yaml
index b6312539..8283d22e 100644
--- a/saga-demo/saga-k8s-resources/spring-demo/test/jmeter.yaml
+++ b/saga-demo/saga-k8s-resources/spring-demo/test/jmeter.yaml
@@ -28,27 +28,24 @@ spec:
         version: v1
     spec:
       containers:
-      - name: jmeter
-        image: justb4/jmeter
+      - name: spring-demo-jmeter
+        image: saga/jmeter:v1
         imagePullPolicy: IfNotPresent
         # TODO ReplicaSet, ReplicationController, Deployment, Daemonset only allow restartPolicy to be 'Always'
         # Maybe we should provide a custom test scheduler to scale up pods and let them exit naturally.
         # restartPolicy: Never
-        args: ["-n", "-t", "/tmp/saga.jmx", "-l", "/tmp/jmeter-result/spring-demo.jtl"]
+        args: ["-n", "-t", "/tmp/saga.jmx", "-l", "/root/spring-demo.jtl", "-e", "-o", "/root/dashboard"]
+        env:
+        - name: REPORT_PATH
+          value: /root/spring-demo.jtl
+        - name: REPORT_UPLOAD_SERVER
+          value: jmeter-collector.servicecomb
+        - name: TESTNAME
+          value: spring-demo
         volumeMounts:
         - name: jmeter-script
           mountPath: /tmp/
-        - name: result-dir
-          mountPath: /tmp/jmeter-result
-        lifecycle:
-          preStop:
-            exec:
-              command: ["echo", "jmeter finished"]
       volumes:
         - name: jmeter-script
           configMap:
             name: springdemo-jmeter-script
-        - name: result-dir
-          hostPath:
-            type: DirectoryOrCreate
-            path: /saga-jmeter-result/


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services