Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions sample_aws_container/Dockerfile
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"]
Copy link
Contributor

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?


1 change: 1 addition & 0 deletions sample_aws_container/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lightrun==1.2.2
18 changes: 18 additions & 0 deletions sample_aws_container/src/sample.py
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')
Copy link
Contributor

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.

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)
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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 :/

Copy link
Contributor Author

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.