Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docker-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.


# Start with a base Python 3.7.2 image
FROM python:3.7.2
# Start with a base Python 3.8.2 image
FROM python:3.8.2

# Add the licenses for third party software and libraries
ADD licenses /licenses
Expand All @@ -26,10 +26,10 @@ ADD locust-tasks /locust-tasks
RUN pip install -r /locust-tasks/requirements.txt

# Expose the required Locust ports
EXPOSE 5557 5558 8089
EXPOSE 5557 8089

# Set script to be executable
RUN chmod 755 /locust-tasks/run.sh

# Start Locust using LOCUS_OPTS environment variable
ENTRYPOINT ["/locust-tasks/run.sh"]
ENTRYPOINT ["/locust-tasks/run.sh"]
9 changes: 4 additions & 5 deletions docker-image/locust-tasks/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ certifi==2019.3.9
chardet==3.0.4
Click==7.0
Flask==1.0.2
gevent==1.4.0
gevent==1.5a3
greenlet==0.4.15
idna==2.8
itsdangerous==1.1.0
Jinja2==2.10.1
locustio==0.11.0
locustio==0.14.5
MarkupSafe==1.1.1
msgpack==0.6.1
msgpack-python==0.5.6
msgpack==1.0.0
pyzmq==18.0.1
requests==2.21.0
six==1.12.0
urllib3==1.24.2
Werkzeug==0.15.1
Werkzeug==0.15.5
4 changes: 2 additions & 2 deletions docker-image/locust-tasks/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ LOCUST_MODE=${LOCUST_MODE:-standalone}
if [[ "$LOCUST_MODE" = "master" ]]; then
LOCUS_OPTS="$LOCUS_OPTS --master"
elif [[ "$LOCUST_MODE" = "worker" ]]; then
LOCUS_OPTS="$LOCUS_OPTS --slave --master-host=$LOCUST_MASTER"
LOCUS_OPTS="$LOCUS_OPTS --slave --master-host=$LOCUST_MASTER_HOST"
fi

echo "$LOCUST $LOCUS_OPTS"

$LOCUST $LOCUS_OPTS
$LOCUST $LOCUS_OPTS
5 changes: 3 additions & 2 deletions docker-image/locust-tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import uuid

from datetime import datetime
from locust import HttpLocust, TaskSet, task
from locust import HttpLocust, TaskSet, task, between


class MetricsTaskSet(TaskSet):
Expand All @@ -39,4 +39,5 @@ def post_metrics(self):


class MetricsLocust(HttpLocust):
task_set = MetricsTaskSet
task_set = MetricsTaskSet
wait_time = between(5, 10)
4 changes: 1 addition & 3 deletions kubernetes-config/locust-master-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,4 @@ spec:
- name: loc-master-p1
containerPort: 5557
protocol: TCP
- name: loc-master-p2
containerPort: 5558
protocol: TCP
enableServiceLinks: false
3 changes: 2 additions & 1 deletion kubernetes-config/locust-worker-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ spec:
env:
- name: LOCUST_MODE
value: worker
- name: LOCUST_MASTER
- name: LOCUST_MASTER_HOST
value: locust-master
- name: TARGET_HOST
value: https://[TARGET_HOST]
enableServiceLinks: false
19 changes: 19 additions & 0 deletions sample-webapp/.gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

# Python pycache:
__pycache__/
# Ignored by the build system
/setup.cfg