Skip to content

Commit

Permalink
GQL-98: Update cdk util library
Browse files Browse the repository at this point in the history
  • Loading branch information
macrouch committed Dec 20, 2024
1 parent 997e995 commit 3c4fd16
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 24 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ To install Node dependencies:

npm install

You will also need Python3.11+ (Ideally installed in a virtual environment) to query the collection generateVariableDrafts field. Run the following to ensure proper operation of this query.
Note: The generateVariableDrafts is currently not working in the development environment. These steps do not work with the CDK changes.

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
You will also need Python3.11+ (Ideally installed in a virtual environment) to query the collection generateVariableDrafts field. Run the following to ensure proper operation of this query.

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

### Environment Variables

Expand Down
8 changes: 4 additions & 4 deletions cdk/graphql-infrastructure/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cdk/graphql-infrastructure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"typescript": "~5.6.3"
},
"dependencies": {
"@edsc/cdk-utils": "^0.0.1",
"@edsc/cdk-utils": "^0.0.2",
"aws-cdk-lib": "^2.173.2",
"constructs": "^10.0.0"
}
Expand Down
26 changes: 16 additions & 10 deletions cdk/graphql/lib/graphql-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,23 @@ export class GraphqlStack extends cdk.Stack {
logGroupName: `/aws/lambda/${this.stackName}-earthdataVarinfo${logGroupSuffix}`,
});

// In production, we build the lambda with build-python.sh
let earthdataVarinfoCode = lambda.Code.fromAsset('../../src/earthdataVarinfo');
if (NODE_ENV === 'development') {
// In development, build the lambda with the Python bundling image
earthdataVarinfoCode = lambda.Code.fromAsset('../../src/earthdataVarinfo', {
bundling: {
command: [
'bash', '-c',
'pip install -r requirements.txt -t /asset-output && cp -au . /asset-output',
],
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
}
});
}

const earthdataVarinfoLambdaFunction = new lambda.Function(this, 'EarthdataVarinfoLambdaFunction', {
// TODO does this work in dev?
code: lambda.Code.fromAsset('../../src/earthdataVarinfo', {// I switched this to happen in deploy_bamboo.sh during deployments
// bundling: {
// command: [
// 'bash', '-c',
// 'pip install -r requirements.txt -t /asset-output && cp -au . /asset-output',
// ],
// image: lambda.Runtime.PYTHON_3_11.bundlingImage,
// }
}),
code: earthdataVarinfoCode,
currentVersionOptions: {
removalPolicy: cdk.RemovalPolicy.RETAIN
},
Expand Down
8 changes: 4 additions & 4 deletions cdk/graphql/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cdk/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"typescript": "~5.6.3"
},
"dependencies": {
"@edsc/cdk-utils": "^0.0.1",
"@edsc/cdk-utils": "^0.0.2",
"aws-cdk-lib": "^2.173.2",
"constructs": "^10.0.0"
}
Expand Down

0 comments on commit 3c4fd16

Please sign in to comment.