-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lambda-sqs-worker-cdk template #695
Conversation
🦋 Changeset detectedLatest commit: 248e13f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -56,12 +56,13 @@ steps: | |||
label: 🧪 Test, Lint & Build | |||
artifact_paths: lib/**/* | |||
commands: | |||
- yarn package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't feel right to have to run yarn package here when it's already in Dockerfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does your test step require you to run yarn build beforehand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see what might be happening here. Do we need to mount lib/node_modules as a volume too? @72636c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try something for me - could you add
- /workdir/lib/node_modules
to the volumes section in your docker-compose file and undo all changes except the deploy script change in your package.json in your repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 That sounds right - it looks like lib/node_modules
from yarn package
is never mounted.
TBH I'm questioning why yarn package
is even in the Dockerfile, it sounds like it belongs on the deploy step. I believe that was the rationale behind it being --offline
, ideally it would be runnable without requiring access to the npm read token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooo that might be due to yarn cache clean afaik we need the cache to run any with --offline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, is the command doing anything that cp -R
doesn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure aha, I think it may be possibly installing production node_modules in lib whilst leaving the Dev deps in tact? That's my theory. Running --production I think strips dev deps out yeah?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah of course, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this worked, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇 Thanks a bunch!
Did these things in https://github.com/SEEK-Jobs/asia-jobs-data-migrator in order to get it working:
Fixed the yarn test step in buildkite (it passes locally)
Fixed errors where node_modules weren't being included in the lambda
fixed the weird logs in cicd on deploying for cdk