humanmade / tachyon

Faster than light image resizing service that runs on AWS. Super simple to set up, highly available and very performant.

Home Page:https://engineering.hmn.md/projects/tachyon/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Circular dependency warnings on Node 14

jerico opened this issue · comments

Tachyon currently has dependency on aws-xray-sdk-core@2.4.0 which depends on winston@2.4.4 which has an issue on node 14: winstonjs/winston#1797

│ Human Made Tachyon in node
│ git+https://github.com/humanmade/node-tachyon.git
│ https://github.com/humanmade/node-tachyon#readme
└─┬ aws-xray-sdk-core@2.4.0
  │ AWS X-Ray SDK for Javascript
  │ https://github.com/aws/aws-xray-sdk-node/tree/master/packages/core
  └── winston@2.4.4
      A multi-transport async logging library for Node.js
      git+https://github.com/winstonjs/winston.git
      https://github.com/winstonjs/winston#readme

Winston throws out (node:26972) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency which is logged as an error in AWS Lambda (and trigger alarms if there are set in CloudWatch).

Later version of aws-xray-sdk-node removes dependency on winston which should resolve this issue.

Acceptance Criteria

  • aws-xray-sdk-node has to be updated to the latest version that supports Node 14.x
  • Code that uses aws-xray-sdk-node still works as expected

@ferschubert-hm @mikelittle we've estimated this one to 3SP and moved it to the Backlog

TESTING - I tested using the below method


  • Created a new Altis project in local-server named tachyon-test
  • Tested the current version of tachyon to confirm the warning by uploading an image random-picture-2.jpg and requesting the image using https://tachyon-test.altis.dev/tachyon/2022/07/random-picture-2.jpg?w=300&h=800 which returned the below circular dependency warning. Subsequent requests did not return this warning though.

image

  • Made the necessary dependency changes to package.json file
  • Ran composer update
  • Built the docker image with the command docker build -t humanmade/tachyon:v2.6.0 --build-arg DEBUG=1 -f Dockerfile.multiarch .
  • Replaced 'image' => 'humanmade/tachyon:v2.4.0', with 'image' => 'humanmade/tachyon:v2.6.0', in the file ./tachyon-test/vendor/altis/local-server/inc/composer/class-docker-compose-generator.php to test the update image.
  • Ran composer server stop tachyon and then composer server start tachyon to recreate the container with the new image.
  • Tested the updated version 2.6.0 by requesting the image using https://tachyon-test.altis.dev/tachyon/2022/07/random-picture-2.jpg with different arguments and this didn't return the circular dependency warning or any other warnings/errors.

image

After this PR is reviewed and merged, I'll push the docker image version 2.6.0 to docker hub.

Created new release v2.6.1 for Tachyon which in turn created a v2.6.1 image on dockerhub

Created new release v2.6.1 for Tachyon which in turn created a v2.6.1 image on dockerhub