vmwarecloudadvocacy / acme_fitness_demo Goto Github PK
View Code? Open in Web Editor NEWDeploys ACME Fitness application across different environments
License: MIT License
Deploys ACME Fitness application across different environments
License: MIT License
Hello, how do I change the default user password?
How is it encoded?
Thanks!
A KeyError: 'token'
error occurs when I try to run locust load generator.
huangxin@huangxin:~/acme_fitness_demo/traffic-generator$ locust --host=http://10.239.154.176
[2021-10-26 21:38:54,918] huangxin/WARNING/locust.main: System open file limit '1024' is below minimum setting '10000'. It's not high enough for load testing, and the OS didn't allow locust to increase it by itself. See https://github.com/locustio/locust/wiki/Installation#increasing-maximum-number-of-open-files-limit for more info.
[2021-10-26 21:38:54,918] huangxin/INFO/locust.main: Starting web interface at http://0.0.0.0:8089 (accepting connections from all network interfaces)
[2021-10-26 21:38:54,931] huangxin/INFO/locust.main: Starting Locust 2.4.1
[2021-10-26 21:39:02,001] huangxin/INFO/locust.runners: Ramping to 1 users at a rate of 1.00 per second
[2021-10-26 21:39:02,001] huangxin/INFO/locust.runners: All users spawned: {"WebSiteUser": 1} (1 total users)
[2021-10-26 21:39:02,012] huangxin/ERROR/locust.user.task: 'token'
Traceback (most recent call last):
File "/home/huangxin/.local/lib/python3.8/site-packages/locust/user/task.py", line 296, in run
self.execute_next_task()
File "/home/huangxin/.local/lib/python3.8/site-packages/locust/user/task.py", line 321, in execute_next_task
self.execute_task(self._task_queue.pop(0))
File "/home/huangxin/.local/lib/python3.8/site-packages/locust/user/task.py", line 330, in execute_task
task(self).run()
File "/home/huangxin/.local/lib/python3.8/site-packages/locust/user/task.py", line 281, in run
self.on_start()
File "/home/huangxin/acme_fitness_demo/traffic-generator/locustfile.py", line 101, in on_start
self.login()
File "/home/huangxin/acme_fitness_demo/traffic-generator/locustfile.py", line 118, in login
self.user.userid = body["token"]
KeyError: 'token'
And I tried to print the body's data, there is no "token" key in it, only "access_token" and "refresh_token" can be found.
{'access_token': 'eyJhbGciOiJIUzI1NiIsImtpZCI6InNpZ25pbl8xIiwidHlwIjoiSldUIn0.eyJVc2VybmFtZSI6InBob2ViZSIsImV4cCI6MTYzNTI1OTI5NSwic3ViIjoiNjE3MmViYjM1YTNkM2RhZGFlZjA0YzAxIn0.VDSR0_v7vjef7vS7FOVcNKf5sHjpDGHIg-vm_qwp3Cc', 'refresh_token': 'eyJhbGciOiJIUzI1NiIsImtpZCI6InNpZ25pbl8yIiwidHlwIjoiSldUIn0.eyJleHAiOjE2MzUyNjY0OTUsInN1YiI6IjYxNzJlYmIzNWEzZDNkYWRhZWYwNGMwMSJ9.oMoTzumdEZlO4Ozszm0ZbFnhbvav6Zj_u1f_Zps0luk', 'status': 200}
Hi,
I encounter a problem when deploying on k8s (1.19.2) the pos pod is in CrashLoopBackOff mode.
when I look at the log the message is as follows :
2021/03/10 15:43:54 FRONTEND_HOST is set to frontend.default.svc.cluster.local
2021/03/10 15:43:54 DATASTORE is set to REMOTE
2021/03/10 15:43:54 HTTP_PORT is set to 7777
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
[GIN-debug] Loaded HTML Templates (2):
-
- index.tmpl
[GIN-debug] GET /assets/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)
[GIN-debug] HEAD /assets/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)
2021/03/10 15:43:54 Get http://frontend.default.svc.cluster.local/products: dial tcp: lookup frontend.default.svc.cluster.local on 10.96.0.10:53: no such host
I have access to the portal.
Do you have an idea of the problem ?
Thanks,
Emmanuel
Hi, I am getting this error
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/locust/user/task.py", line 296, in run
self.execute_next_task()
File "/usr/local/lib/python3.8/dist-packages/locust/user/task.py", line 321, in execute_next_task
self.execute_task(self._task_queue.pop(0))
File "/usr/local/lib/python3.8/dist-packages/locust/user/task.py", line 330, in execute_task
task(self).run()
File "/usr/local/lib/python3.8/dist-packages/locust/user/task.py", line 281, in run
self.on_start()
File "/root/locustfile.py", line 101, in on_start
self.login()
File "/root/locustfile.py", line 118, in login
self.user.userid = body["token"]
KeyError: 'token'
When running locust with the provided locust file and the following locust.conf
parameters:
locustfile = /root/locustfile.py
headless = true
expect-workers = 0
host = http://localhost:30430
users = 10
spawn-rate = 5
run-time = 5m
the locustfile.py has some deprecated syntax:
old:
from locust import HttpLocust, TaskSet, task, TaskSequence, seq_task, Locust
new:
from locust import HttpUser, TaskSet, task, SequentialTaskSet, Locust
(seq_task is no longer used. it is included in the SequentialTaskSet)
When I run the following command: sudo docker-compose pull && docker-compose up
I get the following errors:
Pulling catalog-db ... done
Pulling catalog ... done
Pulling user-db ... done
Pulling user-redis-db ... done
Pulling user ... done
Pulling redis-db ... done
Pulling cart ... error
Pulling front-end ... error
Pulling jaeger ... done
Pulling postgres ... done
Pulling order ... error
Pulling payment ... error
ERROR: for order manifest for gcr.io/vmwarecloudadvocacy/order-postgres-tracing:3.0 not found: manifest unknown: Failed to fetch "3.0" from request "/v2/vmwarecloudadvocacy/order-postgres-tracing/manifests/3.0".
ERROR: for front-end manifest for gcr.io/vmwarecloudadvocacy/acmeshop-front-end:2.2.0 not found: manifest unknown: Failed to fetch "2.2.0" from request "/v2/vmwarecloudadvocacy/acmeshop-front-end/manifests/2.2.0".
ERROR: for payment manifest for gcr.io/vmwarecloudadvocacy/acmeshop-payment:4.6 not found: manifest unknown: Failed to fetch "4.6" from request "/v2/vmwarecloudadvocacy/acmeshop-payment/manifests/4.6".
ERROR: for cart manifest for gcr.io/vmwarecloudadvocacy/acmeshop-cart:1.3.1 not found: manifest unknown: Failed to fetch "1.3.1" from request "/v2/vmwarecloudadvocacy/acmeshop-cart/manifests/1.3.1".
ERROR: manifest for gcr.io/vmwarecloudadvocacy/order-postgres-tracing:3.0 not found: manifest unknown: Failed to fetch "3.0" from request "/v2/vmwarecloudadvocacy/order-postgres-tracing/manifests/3.0".
manifest for gcr.io/vmwarecloudadvocacy/acmeshop-front-end:2.2.0 not found: manifest unknown: Failed to fetch "2.2.0" from request "/v2/vmwarecloudadvocacy/acmeshop-front-end/manifests/2.2.0".
manifest for gcr.io/vmwarecloudadvocacy/acmeshop-payment:4.6 not found: manifest unknown: Failed to fetch "4.6" from request "/v2/vmwarecloudadvocacy/acmeshop-payment/manifests/4.6".
manifest for gcr.io/vmwarecloudadvocacy/acmeshop-cart:1.3.1 not found: manifest unknown: Failed to fetch "1.3.1" from request "/v2/vmwarecloudadvocacy/acmeshop-cart/manifests/1.3.1".
I'm using the Kubernetes version, running on GKE.
Issue - when scaling the cart pod (cart-total.yaml) the cart details and state are deleted.
To reproduce:
Since the cart redis is implemented separately from the cart service, the expected result will be to keep the users' cart state.
Cheers.
Am I doing it wrong or is there something wrong with the code?
$ pip install locust
Collecting locust
Using cached locust-1.3.2-py3-none-any.whl (658 kB)
Requirement already satisfied: pyzmq>=16.0.2 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (18.0.1)
Requirement already satisfied: Flask-BasicAuth>=0.2.0 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (0.2.0)
Requirement already satisfied: geventhttpclient>=1.4.4 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (1.4.4)
Requirement already satisfied: flask>=1.1.2 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (1.1.2)
Requirement already satisfied: requests>=2.9.1 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (2.21.0)
Requirement already satisfied: ConfigArgParse>=1.0 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (1.2.3)
Requirement already satisfied: psutil>=5.6.7 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (5.7.3)
Requirement already satisfied: gevent>=20.9.0 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (20.9.0)
Requirement already satisfied: msgpack>=0.6.2 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (1.0.0)
Requirement already satisfied: Werkzeug>=1.0.1 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from locust) (1.0.1)
Requirement already satisfied: six in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from geventhttpclient>=1.4.4->locust) (1.12.0)
Requirement already satisfied: certifi in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from geventhttpclient>=1.4.4->locust) (2019.3.9)
Requirement already satisfied: click>=5.1 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from flask>=1.1.2->locust) (7.0)
Requirement already satisfied: Jinja2>=2.10.1 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from flask>=1.1.2->locust) (2.10.1)
Requirement already satisfied: itsdangerous>=0.24 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from flask>=1.1.2->locust) (1.1.0)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from requests>=2.9.1->locust) (1.24.2)
Requirement already satisfied: idna<2.9,>=2.5 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from requests>=2.9.1->locust) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from requests>=2.9.1->locust) (3.0.4)
Requirement already satisfied: zope.event in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from gevent>=20.9.0->locust) (4.5.0)
Requirement already satisfied: greenlet>=0.4.17; platform_python_implementation == "CPython" in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from gevent>=20.9.0->locust) (0.4.17)
Requirement already satisfied: setuptools in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from gevent>=20.9.0->locust) (50.3.2)
Requirement already satisfied: zope.interface in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from gevent>=20.9.0->locust) (5.2.0)
Requirement already satisfied: MarkupSafe>=0.23 in /Users/mewald/.envs/locust/lib/python3.8/site-packages (from Jinja2>=2.10.1->flask>=1.1.2->locust) (1.1.1)
Installing collected packages: locust
Successfully installed locust-1.3.2
$ locust --host="http://$HOSTNAME:80"
Traceback (most recent call last):
File "/Users/mewald/.envs/locust/bin/locust", line 8, in <module>
sys.exit(main())
File "/Users/mewald/.envs/locust/lib/python3.8/site-packages/locust/main.py", line 123, in main
docstring, user_classes, shape_class = load_locustfile(locustfile)
File "/Users/mewald/.envs/locust/lib/python3.8/site-packages/locust/main.py", line 79, in load_locustfile
imported = source.load_module()
File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 962, in load_module
File "<frozen importlib._bootstrap_external>", line 787, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/mewald/src/acme_fitness_demo/traffic-generator/locustfile.py", line 4, in <module>
from locust import HttpLocust, TaskSet, task, TaskSequence, seq_task, Locust
ImportError: cannot import name 'TaskSequence' from 'locust' (/Users/mewald/.envs/locust/lib/python3.8/site-packages/locust/__init__.py)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.