Giter VIP home page Giter VIP logo

Comments (7)

IMG-PRCSNG avatar IMG-PRCSNG commented on September 28, 2024 1

Hey all,

Was able to get over this bump by upgrading aws-cdk to v2.85 and aws-sdk to something higher than 2.1311 that is compatible with v2.85. I also had to include a couple of files manually in the infra.pkg.json

There are newer version of CDK / SDK available - but I only managed to fix errors till 2.85. Newer versions throw more errors than what my puny little brain can handle 😅

(2.85 is the lowest version of CDK with all the bug fixes that replaces the use of deprecated runtimes. See here and here )

The error is related to AWS deprecating the lambda runtimes - the old versions of CDK deploys Lambda function helpers with the deprecated runtimes, thus blocking all new deployments and updates, till we update the CDK dependency.

While this got me over the deployment problem, I am far from being able to tell if the new dependency versions would cause some runtime issues with Matano, due to hidden breaking changes / regression. Would need the help of maintainers to comment on the significance of sticking to AWS CDK v2.54 version.

This is the patch of the changes I applied
aws-cdk.patch.txt

Pasting it here directly to make the changes easy to see.

Hope this helps!

diff --git a/cli/package.json b/cli/package.json
index 0100152..36f5da1 100644
--- a/cli/package.json
+++ b/cli/package.json
@@ -26,8 +26,8 @@
     "@oclif/plugin-help": "^5",
     "@oclif/plugin-plugins": "^2.0.1",
     "ansi-styles": "^5",
-    "aws-cdk": "2.54.0",
-    "aws-sdk": "^2.1093",
+    "aws-cdk": "2.85.0",
+    "aws-sdk": "^2.1311",
     "chalk": "^4",
     "enquirer": "^2.3",
     "execa": "^5",
@@ -110,4 +110,4 @@
   "prettier": {
     "printWidth": 120
   }
-}
+}
\ No newline at end of file
diff --git a/infra.pkg.json b/infra.pkg.json
index 892a58e..2562770 100644
--- a/infra.pkg.json
+++ b/infra.pkg.json
@@ -1,18 +1,25 @@
 {
   "name": "matano-cdk",
   "pkg": {
-    "scripts": ["./infra/dist/**/*.js"],
-    "targets": ["node14.18.1-linux-x64", "node14.18.1-macos-x64"],
+    "scripts": [
+      "./infra/dist/**/*.js"
+    ],
+    "targets": [
+      "node14.18.1-linux-x64",
+      "node14.18.1-macos-x64"
+    ],
     "assets": [
       "./data/**/*",
+      "./infra/node_modules/aws-cdk-lib/custom-resource-handlers/lib/aws-s3/auto-delete-objects-handler/*.js",
       "./infra/node_modules/aws-cdk-lib/custom-resources/lib/provider-framework/runtime/*.js",
       "./infra/node_modules/aws-cdk-lib/lambda-layer-awscli/**/*",
       "./infra/node_modules/aws-cdk-lib/asset-awscli-v1/**/*",
       "./infra/node_modules/@aws-cdk/asset-awscli-v1/**/*",
       "./infra/node_modules/aws-cdk-lib/aws-s3-assets/**/*",
       "./infra/node_modules/aws-cdk-lib/aws-s3-deployment/**/*",
-      "./infra/node_modules/aws-cdk-lib/aws-s3/**/*"
+      "./infra/node_modules/aws-cdk-lib/aws-s3/**/*",
+      "./infra/node_modules/aws-cdk-lib/lazy-index.js"
     ],
     "outputPath": "build"
   }
-}
+}
\ No newline at end of file
diff --git a/infra/package.json b/infra/package.json
index ffdc44c..4151995 100644
--- a/infra/package.json
+++ b/infra/package.json
@@ -24,9 +24,9 @@
   "dependencies": {
     "@aws-cdk/cx-api": "*",
     "@mrgrain/cdk-esbuild": "^3",
-    "aws-cdk": "2.54.0",
-    "aws-cdk-lib": "2.54.0",
-    "aws-sdk": "^2.1093",
+    "aws-cdk": "2.85.0",
+    "aws-cdk-lib": "2.85.0",
+    "aws-sdk": "^2.1311",
     "constructs": "^10.0.0",
     "fs-extra": "^10.1.0",
     "promptly": "^3.2.0",
@@ -39,4 +39,4 @@
   "prettier": {
     "printWidth": 120
   }
-}
+}
\ No newline at end of file
diff --git a/scripts/packaging/build.js b/scripts/packaging/build.js
index bde9c8f..5ef0144 100644
--- a/scripts/packaging/build.js
+++ b/scripts/packaging/build.js
@@ -43,7 +43,7 @@ function setCliPackageVersion() {
 }
 
 function prepareCdkPkg() {
-  execSync("npm install [email protected]", { cwd: workDir });
+  execSync("npm install [email protected]", { cwd: workDir });
 
   // some js template files mess up pkg, just delete
   fs.rmSync(path.resolve(workDir, "node_modules/aws-cdk/lib/init-templates/app/javascript"), {

from matano.

jlgore avatar jlgore commented on September 28, 2024 1

The above changes fixed my problems! Thank you.

from matano.

Stuxend avatar Stuxend commented on September 28, 2024 1

Hi there, something to add here too, needs to be updated the python requeriments for the matano_detection lambda, i face a few error with my detections and i fix it using the solution posted here ++ adding this to the req>

aiobotocore==2.8.0

from matano.

marklonghurst92 avatar marklonghurst92 commented on September 28, 2024

Hi, we are also hitting the same issue, can someone please advise on how we resolve?

Blocking our deployments

Cheers

from matano.

timoguin avatar timoguin commented on September 28, 2024

The runtime version needs to be bumped here:

https://github.com/matanolabs/matano/blob/main/infra/lib/rust-function-layer/Dockerfile#L3

from matano.

rw0007 avatar rw0007 commented on September 28, 2024

Any idea when it will be fixed?

from matano.

Samrose-Ahmed avatar Samrose-Ahmed commented on September 28, 2024

I've deployed a change that should fix these issues.

from matano.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.