seratch/ChatGPT-in-Slack

Unable to understand deployment methods for Lambda environments.

tashua314 opened this issue · 3 comments

I am having difficulty understanding how to deploy to Lambda environments with s3.
I would greatly appreciate it if you could provide me with detailed instructions, please.

Hey @tashua314, it's quite simple. Once you create S3 buckets for installations and OAuth state parameters, you can go through these steps:

# export SLACK_CLIENT_ID=
# export SLACK_CLIENT_SECRET=
# export SLACK_SIGNING_SECRET=
# export SLACK_SCOPES=app_mentions:read,channels:history,groups:history,im:history,mpim:history,chat:write.public,chat:write,users:read
# export SLACK_INSTALLATION_S3_BUCKET_NAME=
# export SLACK_STATE_S3_BUCKET_NAME=
# export OPENAI_S3_BUCKET_NAME=
# npm install -g serverless
# serverless plugin install -n serverless-python-requirements
# serverless deploy

If you still don't get the point, I would suggest going with a different way to deploy the app. For instance, you can deploy the app using this Dockerfile to ECS and any other container services.

@seratch

Thank you! I have successfully deployed to Lambda and can now be used as a Slackbot!

I have an additional question, if I may ask?

Once I answer, there may be multiple responses. Do you know what might be causing this?

@tashua314 With the given information, I cannot pinpoint the cause of your situation, but there may be some kind of race condition issue in this app and/or cold-start issues on the AWS Lambda platform. I'd suggest enabling debug-level logging, and if you find something suspicious, please feel free to share the logs.

Either way, I've provided an answer to your original question. So, let me close this issue now.