Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

anna-lightrun
Copy link
Contributor

Example. We will provide a link in doc

Copy link
Contributor

@amit-shuster amit-shuster left a 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?

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.

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

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.

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.

Copy link
Contributor

@amit-shuster amit-shuster left a 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:

  1. This is a Python example, consider having it under python folder, maybe "sample_aws_container/python/...."
  2. 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"]
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?

def import_lightrun():
try:
import lightrun
lightrun.enable(com_lightrun_server=LIGHTRUN_SERVER, company_key=LIGHTRUN_KEY)
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants