Skip to content
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

chore: start using package-lock.json for repeatable Lambda Layer builds #2627

Merged
merged 20 commits into from
May 12, 2022

Conversation

trentm
Copy link
Member

@trentm trentm commented Mar 28, 2022

We should have repeatable (strict dep versions) builds for our Lambda
Layer released packages.

Closes: #2626

Checklist

trentm added 2 commits March 28, 2022 15:25
We should have repeatable (strict dep versions) builds for our Lambda
Layer released packages.
@trentm trentm self-assigned this Mar 28, 2022
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Mar 28, 2022
@apmmachine
Copy link
Contributor

apmmachine commented Mar 28, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-05-12T00:09:24.698+0000

  • Duration: 21 min 52 sec

Test stats 🧪

Test Results
Failed 0
Passed 255727
Skipped 0
Total 255727

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run module tests for <modules> : Run TAV tests for one or more modules, where <modules> can be either a comma separated list of modules (e.g. memcached,redis) or the string literal ALL to test all modules

  • run benchmark tests : Run the benchmark test only.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@@ -17,7 +17,7 @@ pipeline {
NOTIFY_TO = 'build-apm+apm-agent-nodejs@elastic.co'
NPMRC_SECRET = 'secret/jenkins-ci/npmjs/elasticmachine'
TOTP_SECRET = 'totp/code/npmjs-elasticmachine'
NODE_VERSION = 'v14.17.5'
BUILD_NODE_VERSION = 'v16.15.0'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW NOTE:

  1. Switch to v16 for npm v8 which has lockfileVersion: 2.
  2. Rename to BUILD_NODE_VERSION to differentiate from other unrelated usages of NODE_VERSION in this and other files in the repo.

@@ -383,7 +383,7 @@ pipeline {
environment {
HOME = "${env.WORKSPACE}"
RESULT_FILE = 'apm-agent-benchmark-results.json'
NODE_VERSION = '14'
BENCH_NODE_VERSION = '14'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW NOTE: Rename to BENCH_NODE_VERSION to differentiate from other unrelated usages of NODE_VERSION in this and other files in the repo.

mv node_modules nodejs
.PHONY: dist
dist: validate-branch-name
../dev-utils/make-lambda-layer-zip.sh
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW NOTE: Move the authoritative logic for building the lambda layer zip to a separate script that can be used separate from CI (useful for local dev as well), and to not have the same logic in two places.

…ning that with npm v6 which silently doesn't support --omit=dev; .nvmrc doesn't support comments
@trentm
Copy link
Member Author

trentm commented May 9, 2022

I tested the created lambda layer with my play/dev Lambda briefly.

@trentm trentm marked this pull request as ready for review May 10, 2022 00:07
@trentm trentm requested a review from astorm May 10, 2022 00:07
Also rename the release pipeline step and Makefile target to
"github-release" because that's what it is doing.
Copy link
Contributor

@astorm astorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection to this in principle. Using Node 16 makes sense to me and having the logic for doing build extracted from the CI Makefile so it can be used in different contexts seems like a reasonable step.

Approving, but my understanding of the .ci folder is very black box so I can't really comment on the more ground level changes made there -- so file this review under caveat emptor.

@trentm trentm merged commit a289d44 into main May 12, 2022
@trentm trentm deleted the trentm/i-can-haz-package-lock branch May 12, 2022 01:20
trentm added a commit that referenced this pull request May 13, 2022
I think this change from #2627 may have broken running the benchmarks.
trentm added a commit that referenced this pull request May 13, 2022
The change away from `NODE_VERSION` in #2627 surprisingly
broke running the benchmarks. `NODE_VERSION` is used by nvm
and exporting it (?) makes a difference?
astorm pushed a commit that referenced this pull request May 19, 2022
The change away from `NODE_VERSION` in #2627 surprisingly
broke running the benchmarks. `NODE_VERSION` is used by nvm
and exporting it (?) makes a difference?
trentm added a commit that referenced this pull request May 25, 2022
The `BRANCH_NAME=... make -C .ci dist` failed on
    cp: ../build/aws/elastic-apm-node-lambda-layer-...zip: No such file or directory
because the "../build/aws" dir had not been created.
This was broken in #2627.
trentm added a commit that referenced this pull request May 25, 2022
The `BRANCH_NAME=... make -C .ci dist` failed on
    cp: ../build/aws/elastic-apm-node-lambda-layer-...zip: No such file or directory
because the "../build/aws" dir had not been created.
This was broken in #2627.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

start using package-lock.json
3 participants