-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example of Lightrun sdk containerised in lambda #5
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be moved inside the examples folder
Something like:
examples/AWS_Lambda/fibonacci
WDYT?
sample_aws_container/src/sample.py
Outdated
def import_lightrun(): | ||
try: | ||
import lightrun | ||
lightrun.enable(com_lightrun_server='https://app.lightrun.com/company/success', company_key='b33aaabc-2ef0-4bcd-9c09-e3de48ac90fe') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove company_key, and server details.
sample_aws_container/src/sample.py
Outdated
num = event['num'] | ||
|
||
print("Calculating Fibonacci of {}...".format(num)) | ||
start_fibonacci(num) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line at end of file
sample_aws_container/src/sample.py
Outdated
num = event['num'] | ||
|
||
print("Calculating Fibonacci of {}...".format(num)) | ||
start_fibonacci(num) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want to print the result? or return it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be without prints/logs as the idea is to run the app and play with lightrun for demo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this app makes sense :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not..? We have just to run lambda with any app, that will last long to demonstrate lightrun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, please see comments.
In addition:
- This is a Python example, consider having it under python folder, maybe "sample_aws_container/python/...."
- Please add a short readme, you can copy from the other examples.
RUN pip install --upgrade pip \ | ||
&& pip install -r requirements.txt | ||
|
||
CMD ["sample.main"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to pass num
somehow?
def import_lightrun(): | ||
try: | ||
import lightrun | ||
lightrun.enable(com_lightrun_server=LIGHTRUN_SERVER, company_key=LIGHTRUN_KEY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you miss lightrun_wait_for_init=true
that is required for lambdas, this will be released in 1.2.3, next week.
Probably need to change requirements too
Example. We will provide a link in doc