Closed ysekiy closed 3 months ago
Since I learned about Langflow, I have researched it and actually deployed it to EC2, but since Langflow is frequently updated and there are frequent conflicts between components, I think it is worth trying if the project is at least up to version 1.x. Currently, distribution through Chainlit or Langflow embedd seems to be effective.
Hey We have a Docker swarm setup on the works with terraform to deploy on AWS. Maybe we could use your help.
You can checkout the Docker compose in the deploy
folder.
There's a branch called terraform
that has the terraform setup we are building.
Would Amplify work better for this? With Redis caching setup using lambda could be useful too.
any update on this @ysekiy were you able to create langflow in AWS + Lamda + amplify? , i am looking for a similar one it would be very helpful
I'm working on it with my colleague. We may be able to post any updates this month.
Hello.
We have created a procedure for deploying langflow on AWS.
It will be built using Fargate and Aurora MySQL. All resources will be deployed by AWS CDK.
We initially thought of using Lambda and Amplify, but in consideration of future program revisions, we implemented ECS on Fargate by launching it from a Dockerfile using the AWS CDK.
Also, since we select Aurora MySQL as the database, we modified some code associated with DATABASE_URL
specification.
The source of the program is here and the deployment procedure is in /langflow/scripts/aws/README.md
.
Is it possible to create a branch like aws-cdk
for this procedure?
Hi @kazuki306
Thank you for creating the deployment guide! The steps are nicely simple. I have a couple of requests.
I would like an architecture diagram in the section of "Langflow on AWS" that shows what kind of architecture makes up the configuration. Also, in the bottom of "How to set up your environment and deploy langflow", I would like a screenshot of the Web UI that is displayed when accessing the URL. https://github.com/kazuki306/langflow/blob/aws-cdk-dev2/scripts/aws/README.md
Hey, @kazuki306 !
This is looking great!
Would you be willing to make a PR with this?
Have you checked out the setup inside the langflow/deploy
folder?
Hi @ogabrielluiz !
Thanks for your comment! We would like to submit a PR.
Have you checked out the setup inside the langflow/deploy folder?
We have deploy instructions and CDK source code in /langflow/sceripts/aws
folder.
Should we put them in /langflow/deploy
folder?
We have changed the code under /langflow/src/
, so we would appreciate it if you could prepare a new branch (e.g. aws-cdk
) like the terraform
branch.
Hi!
I've created the branch for you.
The scripts folder is good for this.
Thanks for the help!
hi @kazuki306 thanks for sharing the deployment
i tried to deploy the same using the tutorial, however i was not successful
once i tried cdk deploy command
cdk deploy
✨ Synthesis time: 17.93s
current credentials could not be used to assume 'arn:aws:iam::692536198005:role/cdk-hnb659fds-deploy-role-692536198005-us-west-2', but are for the right account. Proceeding anyway.
current credentials could not be used to assume 'arn:aws:iam::692536198005:role/cdk-hnb659fds-deploy-role-692536198005-us-west-2', but are for the right account. Proceeding anyway.
current credentials could not be used to assume 'arn:aws:iam::692536198005:role/cdk-hnb659fds-deploy-role-692536198005-us-west-2', but are for the right account. Proceeding anyway.
current credentials could not be used to assume 'arn:aws:iam::692536198005:role/cdk-hnb659fds-deploy-role-692536198005-us-west-2', but are for the right account. Proceeding anyway.
current credentials could not be used to assume 'arn:aws:iam::692536198005:role/cdk-hnb659fds-deploy-role-692536198005-us-west-2', but are for the right account. Proceeding anyway.
LangflowAppStack: start: Building e77031893275c08bcaa0a774aa8b611727afd045b3b5d8e1e6f0f04063d9d386:current_account-current_region
LangflowAppStack: success: Built e77031893275c08bcaa0a774aa8b611727afd045b3b5d8e1e6f0f04063d9d386:current_account-current_region
LangflowAppStack: start: Building 2787cf9e14cb283f5bd620e092b3693febd0ead397441b7fe0deffdf2b93ddd0:current_account-current_region
LangflowAppStack: success: Built 2787cf9e14cb283f5bd620e092b3693febd0ead397441b7fe0deffdf2b93ddd0:current_account-current_region
LangflowAppStack: start: Publishing e77031893275c08bcaa0a774aa8b611727afd045b3b5d8e1e6f0f04063d9d386:current_account-current_region
LangflowAppStack: start: Building 94b83655403dac8fe335f8604b61c01d32209e0547652d8a1026bc2049365427:current_account-current_region
LangflowAppStack: success: Built 94b83655403dac8fe335f8604b61c01d32209e0547652d8a1026bc2049365427:current_account-current_region
LangflowAppStack: start: Publishing 2787cf9e14cb283f5bd620e092b3693febd0ead397441b7fe0deffdf2b93ddd0:current_account-current_region
LangflowAppStack: start: Building 91dded8d95bb1c65225d536db769102658af3236db20060f8104ba7fff8957c0:current_account-current_region
LangflowAppStack: start: Publishing 94b83655403dac8fe335f8604b61c01d32209e0547652d8a1026bc2049365427:current_account-current_region
current credentials could not be used to assume 'arn:aws:iam::692536198005:role/cdk-hnb659fds-file-publishing-role-692536198005-us-west-2', but are for the right account. Proceeding anyway.
current credentials could not be used to assume 'arn:aws:iam::692536198005:role/cdk-hnb659fds-file-publishing-role-692536198005-us-west-2', but are for the right account. Proceeding anyway.
current credentials could not be used to assume 'arn:aws:iam::692536198005:role/cdk-hnb659fds-file-publishing-role-692536198005-us-west-2', but are for the right account. Proceeding anyway.
LangflowAppStack: success: Published e77031893275c08bcaa0a774aa8b611727afd045b3b5d8e1e6f0f04063d9d386:current_account-current_region
LangflowAppStack: success: Published 94b83655403dac8fe335f8604b61c01d32209e0547652d8a1026bc2049365427:current_account-current_region
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
LangflowAppStack: fail: docker build --build-arg BACKEND_URL=http://backend.ecs-deploy.com:7860/ --tag cdkasset-91dded8d95bb1c65225d536db769102658af3236db20060f8104ba7fff8957c0 --file cdk.Dockerfile --platform linux/amd64 . exited with error code 1: ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
LangflowAppStack: success: Published 2787cf9e14cb283f5bd620e092b3693febd0ead397441b7fe0deffdf2b93ddd0:current_account-current_region
❌ Deployment failed: Error: Failed to publish asset 2787cf9e14cb283f5bd620e092b3693febd0ead397441b7fe0deffdf2b93ddd0:current_account-current_region
at Deployments.publishSingleAsset (/usr/local/lib/node_modules/aws-cdk/lib/index.js:470:11458)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.publishAsset (/usr/local/lib/node_modules/aws-cdk/lib/index.js:470:177912)
at async /usr/local/lib/node_modules/aws-cdk/lib/index.js:470:163339
Failed to publish asset 2787cf9e14cb283f5bd620e092b3693febd0ead397441b7fe0deffdf2b93ddd0:current_account-current_region`
also when i tried to reuse the command again i got no disk space limit error
Can you please guide me and tell if i am doing any thing wrong in the process
Hello,
First of all, thanks for this awesome work.
I've encountered an issue with the web application after deploying it on AWS using the dev branch (which I believe is the default one). The deployment process seemed fine, and the tasks and ECS services are showing normal operation in CloudWatch, including CPU usage.
However, I'm experiencing a persistent problem where the web page continuously reloads and loses all session data. This issue persists despite attempting to scale the tasks up or down. Notably, this behavior was not observed during a deployment on Railway, where the application functioned as expected without any such reloading issues.
I am available for providing any additional data or assistance needed for further clarification and contribution to resolving this issue.
Best Regards,
I think I got it, its the aws-cdk branch the one for aws usage.
My bad.
hi @aspirina765
I followed all the steps mentioned in the scripts/aws read me branch and i tried to deploy aws-cdk branch how ever while creating the resource i saw the following error am i doing anything wrong here ? precisely it started happening after 55/78 steps
cc @ogabrielluiz @kazuki306
Hi all. I am sorry for the delay in getting back to you.
We have reviewed our architecture to fix some issues.
We have changed to deploy the built frontend to S3 and the backend to a container (ECS) to be distributed via CloudFront. It allows access to applications using HTTPS.
The related PR is here(#1491). See /langflow/scripts/aws/README.md
for detailed architecture and deployment instructions.
Hi @ogabrielluiz By the way, the Amazon Bedrock components are not displayed since v0.6.6 (#1483), is it possible to display this components as Default instead of CustomComponent?
Hello, Any update on this? I am planning to showcase this to some customers. Is the CDK process stable to try now?
@ysekiy did an awesome work on it but I haven't caught up to it yet.
I think it requires some testing. Could you help us out on that?
@ogabrielluiz Sure, I'd be happy to assist with testing. Could you please provide more details?
The dev branch is a bit different than the main now and we need to make sure the 1.0 alpha still works in the AWS CDK setup.
got it. I'm working on it.
cdk-ecr-deployment
should be ^3.0.1
.cdk deploy
cannot be completed because the /health
endpoint becomes unreachable.git clone https://github.com/aws-samples/cloud9-setup-for-prototyping
cd cloud9-setup-for-prototyping
./bin/bootstrap
# ↓modified ver.
git clone https://github.com/langflow-ai/langflow.git -b v1.0.0a23
# original↓
# git clone https://github.com/langflow-ai/langflow.git
cd langflow/scripts/aws
cp .env.example .env
npm ci
cdk bootstrap
cdk deploy
Admin:~/environment/langflow/scripts/aws ((v1.0.0a23)) $ cdk deploy
✨ Synthesis time: 7.8s
LangflowAppStack: deploying... [1/1]
LangflowAppStack: creating CloudFormation changeset...
11:33:12 PM | CREATE_FAILED | AWS::Lambda::Function | CustomCDKECRDeploy...3666512MiB2
8EAD8E4
Resource handler returned message: "The runtime parameter of go1.x is no longer supported for creating or updating AWS
Lambda functions. We recommend you use the new runtime (provided.al2023) while creating or updating functions. (Service
: Lambda, Status Code: 400, Request ID: 6fed4837-7bc6-45d6-9ec4-6a1a406aa1fd)" (RequestToken: 43563eec-6c13-7e67-ccc4-9
5a562c9ba76, HandlerErrorCode: InvalidRequest)
❌ LangflowAppStack failed: Error: The stack named LangflowAppStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The runtime parameter of go1.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (provided.al2023) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: 6fed4837-7bc6-45d6-9ec4-6a1a406aa1fd)" (RequestToken: 43563eec-6c13-7e67-ccc4-95a562c9ba76, HandlerErrorCode: InvalidRequest)
at FullCloudFormationDeployment.monitorDeployment (/home/ec2-user/.nvm/versions/node/v20.12.2/lib/node_modules/cdk/node_modules/aws-cdk/lib/index.js:433:10615)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.deployStack2 [as deployStack] (/home/ec2-user/.nvm/versions/node/v20.12.2/lib/node_modules/cdk/node_modules/aws-cdk/lib/index.js:436:200503)
at async /home/ec2-user/.nvm/versions/node/v20.12.2/lib/node_modules/cdk/node_modules/aws-cdk/lib/index.js:436:181341
❌ Deployment failed: Error: The stack named LangflowAppStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The runtime parameter of go1.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (provided.al2023) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: 6fed4837-7bc6-45d6-9ec4-6a1a406aa1fd)" (RequestToken: 43563eec-6c13-7e67-ccc4-95a562c9ba76, HandlerErrorCode: InvalidRequest)
at FullCloudFormationDeployment.monitorDeployment (/home/ec2-user/.nvm/versions/node/v20.12.2/lib/node_modules/cdk/node_modules/aws-cdk/lib/index.js:433:10615)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.deployStack2 [as deployStack] (/home/ec2-user/.nvm/versions/node/v20.12.2/lib/node_modules/cdk/node_modules/aws-cdk/lib/index.js:436:200503)
at async /home/ec2-user/.nvm/versions/node/v20.12.2/lib/node_modules/cdk/node_modules/aws-cdk/lib/index.js:436:181341
The stack named LangflowAppStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The runtime parameter of go1.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (provided.al2023) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: 6fed4837-7bc6-45d6-9ec4-6a1a406aa1fd)" (RequestToken: 43563eec-6c13-7e67-ccc4-95a562c9ba76, HandlerErrorCode: InvalidRequest)
After modifying the cdk-ecr-deployment
version, I couldn't complete cdk deploy
. CDK doesn't show an error, but it never ends.
I'm trying to run version 1.0.0a23 locally to detect root cause.
Hi @ysekiy!
Are you still working on that case? How things are going?
sorry, due to handling other matters, I haven't been able to devote sufficient time to this activity.
Hi!
I'd be happy to assist with this issue if needed. I've already started working on the deployment for Azure using Terraform and optionally incorporating Azure DevOps for deployment automation. I can also handle deployments for AWS using Terraform. Let me know!
Hey @danielgines!
Thanks a ton for offering to help out! It’s awesome to hear you’ve already started working on the Azure deployment with Terraform and Azure DevOps. And handling AWS deployments too? That’s fantastic!
We’d love to see what you’ve got so far. Could you open a pull request with your work? That way, we can check it out and work together on it.
Also, if you could add some notes or documentation on the deployment process, that’d be super helpful for everyone else.
Thanks again for jumping in and helping out!
Hello all,
Thanks for this awesome work.
I'd like to use this on AWS. I think it would be good option for scalability & operation to use AWS Amplify + AWS Lambda + Amazon RDS.
Are there anyone working on this? Happy to help or contribute regarding this if not.
Thanks