Comments (12)
Thanks!
I'll definitely fix it. Your use case sounds interesting. But it will take me a few days as I have little free time right now.
In the mean time, as a workaround for you, you can set an env var AWS_DEFAULT_REGION=eu-west-1
to stop the error.
from invokust.
I don't know what that is but you can simply use the first example:
https://github.com/FutureSharks/invokust#examples
This doesn't use Lambda.
from invokust.
It's Serverless FaaS but open-source (rather than proprietary/cloud-hosted) OpenFaaS/faas. This is what I managed to put together - https://github.com/alexellis/locust-openfaas
What do you think?
from invokust.
I see, interesting! Looks OK but using subprocess
is a bit hacky for something that is supposed to be serverless?
If I was you, in locust/index.py
, I would copy the code from my example and then return/print the stats.
from invokust.
Creating a subprocess
via the handler doesn't make it any more or less serverless. I couldn't find out how to launch locust without using their binary / helper, but if you have a way I'd be interested in changing over to it.
I think I tried your code last night but it had a boto3 or Lambda session reference somewhere that stopped it from working. Have you tried locust/index.py
in a regular Docker container for instance?
from invokust.
Creating a subprocess via the handler doesn't make it any more or less serverless.
OK fair enough 👍
I couldn't find out how to launch locust without using their binary / helper
That is exactly what this project does, as per the first example.
I think I tried your code last night but it had a boto3 or Lambda session reference somewhere that stopped it from working.
If you be specific, I'd be happy to help!
Have you tried locust/index.py in a regular Docker container for instance?
Nope.
from invokust.
Code:
import invokust
from locust import HttpLocust, TaskSet, task
class Task(TaskSet):
@task()
def get_home_page(self):
'''
Gets /
'''
self.client.get("/")
class WebsiteUser(HttpLocust):
task_set = Task
settings = invokust.create_settings(
classes=[WebsiteUser],
host='http://www.openfaas.com',
num_requests=10,
num_clients=1,
hatch_rate=1
)
loadtest = invokust.LocustLoadTest(settings)
loadtest.run()
loadtest.stats()
Error:
Traceback (most recent call last):
File "index.py", line 1, in <module>
import invokust
File "/usr/local/lib/python3.6/site-packages/invokust/__init__.py", line 5, in <module>
from .aws_lambda import get_lambda_runtime_info
File "/usr/local/lib/python3.6/site-packages/invokust/aws_lambda/__init__.py", line 4, in <module>
from .lambda_load_test import LambdaLoadTest
File "/usr/local/lib/python3.6/site-packages/invokust/aws_lambda/lambda_load_test.py", line 17, in <module>
client = session.client('lambda', config=config)
File "/usr/local/lib/python3.6/site-packages/boto3/session.py", line 263, in client
aws_session_token=aws_session_token, config=config)
File "/usr/local/lib/python3.6/site-packages/botocore/session.py", line 861, in create_client
client_config=config, api_version=api_version)
File "/usr/local/lib/python3.6/site-packages/botocore/client.py", line 73, in create_client
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "/usr/local/lib/python3.6/site-packages/botocore/client.py", line 285, in _get_client_args
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "/usr/local/lib/python3.6/site-packages/botocore/args.py", line 45, in get_client_args
endpoint_url, is_secure, scoped_config)
File "/usr/local/lib/python3.6/site-packages/botocore/args.py", line 111, in compute_client_args
service_name, region_name, endpoint_url, is_secure)
File "/usr/local/lib/python3.6/site-packages/botocore/client.py", line 358, in resolve
service_name, region_name)
File "/usr/local/lib/python3.6/site-packages/botocore/regions.py", line 122, in construct_endpoint
partition, service_name, region_name)
File "/usr/local/lib/python3.6/site-packages/botocore/regions.py", line 135, in _endpoint_for_partition
raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.
from invokust.
Btw I also saw you have an interest in RPi - OpenFaaS also runs natively on Raspberry Pi and 64-bit ARM.
Let me know if you can push a fix up for testing that doesn't try to load boto and all that other Lambda stuff.
from invokust.
Hi @alexellis could you test this PR and see if it solves the problem for you?
#14
from invokust.
Any update on this issue?
from invokust.
This is as far as I got - https://github.com/alexellis/locust-openfaas - it is working with the regular locust framework rather than the invokust wrapper. It would still be nice to get invokust working w/o a hard dependency on Lambda.
I'm really busy trying to get a new release out.. Would you be willing to spend a bit of time on it?
from invokust.
Would you be willing to spend a bit of time on it?
Spend more time on what? I fixed your issue in PR 14: #14
I'm waiting for you to test it.
from invokust.
Related Issues (20)
- Error invoking lambda following quickstart HOT 3
- Semantic versioning HOT 2
- version 0.75 missing for Pypi HOT 3
- AWS deployment fails HOT 8
- Handle environment variables with `LambdaLoadTest` on Locust HOT 4
- Ability to deploy Lambda through AWS-CDK instead of using local script HOT 1
- Locust exception ImportError("cannot import name 'User'",) HOT 6
- Unable to use invokust. locust version == 1.3.0, locustio==0.13.5, invokust==0.73 HOT 6
- gevent error when attempting to invoke lambda HOT 3
- Does add_listener work? HOT 3
- No results when using LambdaLoadTest HOT 2
- segmentation fault (core dumped) HOT 4
- Can you output CSV or HTML reports?
- AWS Lambda deployment with function layer
- Negative execution time
- Use invokust with odoo HOT 3
- no option to save the load test report HOT 1
- Logging Configuration HOT 3
- LoadTestShape HOT 3
- AttributeError: 'StatsError' object has no attribute 'to_dict' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invokust.