-
Notifications
You must be signed in to change notification settings - Fork 8
Example of Lightrun sdk containerised in lambda #5
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| FROM amazon/aws-lambda-python | ||
|
|
||
| COPY requirements.txt . | ||
| COPY src/ . | ||
|
|
||
| RUN pip install --upgrade pip \ | ||
| && pip install -r requirements.txt | ||
|
|
||
| CMD ["sample.main"] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| lightrun==1.2.2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| def import_lightrun(): | ||
| try: | ||
| import lightrun | ||
| lightrun.enable(com_lightrun_server='https://app.lightrun.com/company/success', company_key='b33aaabc-2ef0-4bcd-9c09-e3de48ac90fe') | ||
|
||
| except ImportError as e: | ||
| print("Error importing Lightrun: ", e) | ||
|
|
||
| def start_fibonacci(n): | ||
| if n in {0, 1}: | ||
| return n | ||
| return start_fibonacci(n - 1) + start_fibonacci(n - 2) | ||
|
|
||
| def main(event, context): | ||
| import_lightrun() | ||
| 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 need to pass
numsomehow?