Add gevent based Python server to benchmark test cases (#794)
This add the benchmark test cases, which is using gevent based on wsgi framework.
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
Fission Specs
|
||||||
|
=============
|
||||||
|
|
||||||
|
This is a set of specifications for a Fission app. This includes functions,
|
||||||
|
environments, and triggers; we collectively call these things "resources".
|
||||||
|
|
||||||
|
How to use these specs
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
These specs are handled with the 'fission spec' command. See 'fission spec --help'.
|
||||||
|
|
||||||
|
'fission spec apply' will "apply" all resources specified in this directory to your
|
||||||
|
cluster. That means it checks what resources exist on your cluster, what resources are
|
||||||
|
specified in the specs directory, and reconciles the difference by creating, updating or
|
||||||
|
deleting resources on the cluster.
|
||||||
|
|
||||||
|
'fission spec apply' will also package up your source code (or compiled binaries) and
|
||||||
|
upload the archives to the cluster if needed. It uses 'ArchiveUploadSpec' resources in
|
||||||
|
this directory to figure out which files to archive.
|
||||||
|
|
||||||
|
You can use 'fission spec apply --watch' to watch for file changes and continuously keep
|
||||||
|
the cluster updated.
|
||||||
|
|
||||||
|
You can add YAMLs to this directory by writing them manually, but it's easier to generate
|
||||||
|
them. Use 'fission function create --spec' to generate a function spec,
|
||||||
|
'fission environment create --spec' to generate an environment spec, and so on.
|
||||||
|
|
||||||
|
You can edit any of the files in this directory, except 'fission-deployment-config.yaml',
|
||||||
|
which contains a UID that you should never change. To apply your changes simply use
|
||||||
|
'fission spec apply'.
|
||||||
|
|
||||||
|
fission-deployment-config.yaml
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
fission-deployment-config.yaml contains a UID. This UID is what fission uses to correlate
|
||||||
|
resources on the cluster to resources in this directory.
|
||||||
|
|
||||||
|
All resources created by 'fission spec apply' are annotated with this UID. Resources on
|
||||||
|
the cluster that are _not_ annotated with this UID are never modified or deleted by
|
||||||
|
fission.
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: fission.io/v1
|
||||||
|
kind: Environment
|
||||||
|
metadata:
|
||||||
|
name: python
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
version: 2
|
||||||
|
poolsize: 3
|
||||||
|
TerminationGracePeriod: 5
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 300m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 300m
|
||||||
|
memory: 256Mi
|
||||||
|
runtime:
|
||||||
|
image: fission/python-env
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is generated by the 'fission spec init' command.
|
||||||
|
# See the README in this directory for background and usage information.
|
||||||
|
# Do not edit the UID below: that will break 'fission spec apply'
|
||||||
|
apiVersion: fission.io/v1
|
||||||
|
kind: DeploymentConfig
|
||||||
|
name: envs
|
||||||
|
uid: a0f67a18-7d1d-4e50-9d9a-dab854e01106
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
Fission Specs
|
||||||
|
=============
|
||||||
|
|
||||||
|
This is a set of specifications for a Fission app. This includes functions,
|
||||||
|
environments, and triggers; we collectively call these things "resources".
|
||||||
|
|
||||||
|
How to use these specs
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
These specs are handled with the 'fission spec' command. See 'fission spec --help'.
|
||||||
|
|
||||||
|
'fission spec apply' will "apply" all resources specified in this directory to your
|
||||||
|
cluster. That means it checks what resources exist on your cluster, what resources are
|
||||||
|
specified in the specs directory, and reconciles the difference by creating, updating or
|
||||||
|
deleting resources on the cluster.
|
||||||
|
|
||||||
|
'fission spec apply' will also package up your source code (or compiled binaries) and
|
||||||
|
upload the archives to the cluster if needed. It uses 'ArchiveUploadSpec' resources in
|
||||||
|
this directory to figure out which files to archive.
|
||||||
|
|
||||||
|
You can use 'fission spec apply --watch' to watch for file changes and continuously keep
|
||||||
|
the cluster updated.
|
||||||
|
|
||||||
|
You can add YAMLs to this directory by writing them manually, but it's easier to generate
|
||||||
|
them. Use 'fission function create --spec' to generate a function spec,
|
||||||
|
'fission environment create --spec' to generate an environment spec, and so on.
|
||||||
|
|
||||||
|
You can edit any of the files in this directory, except 'fission-deployment-config.yaml',
|
||||||
|
which contains a UID that you should never change. To apply your changes simply use
|
||||||
|
'fission spec apply'.
|
||||||
|
|
||||||
|
fission-deployment-config.yaml
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
fission-deployment-config.yaml contains a UID. This UID is what fission uses to correlate
|
||||||
|
resources on the cluster to resources in this directory.
|
||||||
|
|
||||||
|
All resources created by 'fission spec apply' are annotated with this UID. Resources on
|
||||||
|
the cluster that are _not_ annotated with this UID are never modified or deleted by
|
||||||
|
fission.
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: fission.io/v1
|
||||||
|
kind: Environment
|
||||||
|
metadata:
|
||||||
|
name: python
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
version: 2
|
||||||
|
poolsize: 3
|
||||||
|
TerminationGracePeriod: 5
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 300m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 300m
|
||||||
|
memory: 256Mi
|
||||||
|
runtime:
|
||||||
|
image: fission/python-env
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
container:
|
||||||
|
env:
|
||||||
|
- name: WSGI_FRAMEWORK
|
||||||
|
value: "GEVENT"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is generated by the 'fission spec init' command.
|
||||||
|
# See the README in this directory for background and usage information.
|
||||||
|
# Do not edit the UID below: that will break 'fission spec apply'
|
||||||
|
apiVersion: fission.io/v1
|
||||||
|
kind: DeploymentConfig
|
||||||
|
name: envs
|
||||||
|
uid: 1fc02a0c-7a51-4534-a86f-a8f397dfd1f2
|
||||||
@@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
ROOT=$(dirname $0)/../../../..
|
ROOT=$(readlink -f ./../../../..)
|
||||||
|
|
||||||
|
for framework in python_bjoern python_gevent
|
||||||
|
do
|
||||||
for executorType in poolmgr newdeploy
|
for executorType in poolmgr newdeploy
|
||||||
do
|
do
|
||||||
for concurrency in 100 250 500 750 1000
|
for concurrency in 100 250 500 750 1000
|
||||||
@@ -28,7 +30,7 @@ do
|
|||||||
echo "Creating python env"
|
echo "Creating python env"
|
||||||
# Use short grace period time to speed up resource recycle time
|
# Use short grace period time to speed up resource recycle time
|
||||||
# Use high min/max CPU so that K8S will distribute pod in different nodes
|
# Use high min/max CPU so that K8S will distribute pod in different nodes
|
||||||
fission env create --name python --version 2 --image fission/python-env --period 5 --mincpu 300 --maxcpu 300 --minmemory 256 --maxmemory 256
|
fission spec apply --specdir $ROOT/test/benchmark/assets/envs/$framework
|
||||||
trap "fission env delete --name python" EXIT
|
trap "fission env delete --name python" EXIT
|
||||||
|
|
||||||
sleep 30
|
sleep 30
|
||||||
@@ -38,7 +40,7 @@ do
|
|||||||
echo "Creating package"
|
echo "Creating package"
|
||||||
rm -rf pkg.zip pkg/ || true
|
rm -rf pkg.zip pkg/ || true
|
||||||
mkdir pkg
|
mkdir pkg
|
||||||
cp ../../../assets/hello.py pkg/hello.py
|
cp $ROOT/test/benchmark/assets/hello.py pkg/hello.py
|
||||||
|
|
||||||
zip -jr pkg.zip pkg/
|
zip -jr pkg.zip pkg/
|
||||||
pkgName=$(fission pkg create --env python --deploy pkg.zip | cut -d' ' -f 2 | cut -d"'" -f 2)
|
pkgName=$(fission pkg create --env python --deploy pkg.zip | cut -d' ' -f 2 | cut -d"'" -f 2)
|
||||||
@@ -64,7 +66,7 @@ do
|
|||||||
--vus ${concurrency} \
|
--vus ${concurrency} \
|
||||||
--no-connection-reuse \
|
--no-connection-reuse \
|
||||||
--out json="${rawFile}" \
|
--out json="${rawFile}" \
|
||||||
--summary-trend-stats="avg,min,med,max,p(5),p(10),p(15),p(20),p(25),p(30),p(35),p(40),p(45),p(50),p(55),p(60),p(65),p(70),p(75),p(80),p(85),p(90),p(95),p(100)" \
|
--summary-trend-stats="avg,min,med,max,p(5),p(10),p(15),p(20),p(25),p(30)" \
|
||||||
../${js} >> ${rawUsageReport}
|
../${js} >> ${rawUsageReport}
|
||||||
|
|
||||||
echo "Clean up"
|
echo "Clean up"
|
||||||
@@ -91,3 +93,4 @@ do
|
|||||||
|
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user