langflow-ai / langflow

Langflow is a low-code app builder for RAG and multi-agent AI applications. It’s Python-based and agnostic to any model, API, or database.
http://www.langflow.org
MIT License
34.07k stars 4.11k forks source link

CDK Deploy fails due to Cloud9 deprecation. #3894

Open dfridkin opened 1 month ago

dfridkin commented 1 month ago

Bug Description

Cloud9 is now deprecated, therefore anyone deploying on new aws accounts can not use the cdk stack provided.

Reproduction

  1. Create new AWS account.
  2. Attempt to deploy the provided stack.

Expected behavior

The cdk stack should deploy with no errors.

Who can help?

No response

Operating System

N/A

Langflow Version

1.0.18

Python Version

None

Screenshot

No response

Flow File

No response

dosubot[bot] commented 1 month ago

Hey @dfridkin! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve this issue!

The issue you're encountering is due to the deprecation of Cloud9, which is causing the CDK stack deployment to fail on new AWS accounts. Unfortunately, the specific components or resources in the CDK stack that are dependent on Cloud9, as well as any alternative services or migration guides, are not documented in the repository.

However, you can check for any conditional statements or feature flags in the CDK stack that handle different AWS account configurations. These are implemented as commented-out lines that can be uncommented to specify the AWS account and region:

// env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION },

// env: { account: '123456789012', region: 'us-east-1' },

Additionally, the stack uses context variables to enable or disable certain features based on the configuration. For example, the ragEnabled context variable is used to conditionally include the Rag construct:

const ragEnabled: boolean = this.node.tryGetContext('ragEnabled')!;
if (typeof ragEnabled !== 'boolean') {
  throw new Error(errorMessageForBooleanContext('ragEnabled'));
}
if (ragEnabled) {
  new Rag(this, 'Rag', {});
}

These lines and context variables allow the stack to be specialized for the AWS Account and Region implied by the current CLI configuration or a specific account and region, as well as to enable or disable specific features based on the context [1][2].

To resolve the issue, you may need to identify and replace the Cloud9-dependent resources in the CDK stack with alternative services recommended by AWS. Unfortunately, specific details on these replacements are not available in the repository.

To continue talking to Dosu, mention @dosu.

dfridkin commented 1 month ago

Trying to bypass cloud9 and deploying locally using aws cli and cdk cli I've run into the following issues:

Needed to move Dockerfiles, dockerignore, and .sh cdk helper script from docker to root directory due to inability to reference pyproject.toml in the parent directory during docker build.

Added cdk* to dockerignore to fix infinite recursion directory naming error (maximum length exceeded).

I then hit issues with alembic during cdk deploy once the tasks try to execute in the backend ecs cluster. Stuck trying to resolve this.

2024-09-23 22:36:35 - ERROR - service.py:196 service - Error initializing
alembic:
(pymysql.err.OperationalError)
(1072, "Key column
'description' doesn't exist in
table")
[SQL: CREATE INDEX
ix_flow_description ON flow
(description)]
(Background on this error at:
https://sqlalche.me/e/20/e3q8)

Dmtmr commented 1 month ago

Hi there, same issue here. Can someone get back pls

jolo-dev commented 1 month ago

I ran into the same issue, but I believe this issue has nothing to do with Cloud9 @dfridkin

dfridkin commented 1 month ago

I ran into the same issue, but I believe this issue has nothing to do with Cloud9 @dfridkin

That is true. There are multiple reasons cdk deploy is failing. Listed them above

jolo-dev commented 1 month ago

Do you have a branch you work on, I might have solved it? However, Cloudfront is quite slow in terms of connecting to the database: https://d27eo6d7y8uc6m.cloudfront.net/