-
Notifications
You must be signed in to change notification settings - Fork 2
Pipeline and scripts for custom node 18 build (with glibc 2.17) #4
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
Merged
Merged
Changes from 68 commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
ddddc28
feat: add scripts for building custom node distributions
delanni 7e1ef7a
feat: add pipeline definition for the build
delanni b1fc304
feat: fix typos
delanni 36f5f9f
feat: try fixing 'privileged mode is incompatible with user namespace…
delanni 4dd173c
try without qemu
delanni 260f10c
try creating a driver instead
delanni 84e6a42
feat: remove --force flag
delanni 8f86ed5
feat: increase timeouts and add wait between stages
delanni 545d8d1
feat: fix bad param name in build script
delanni 2104c0c
feat: push/pull images to docker.io/elastic
delanni d0ac37f
feat: use new images, branch in build script based on ARCH env variable
delanni 3cca249
Try manual login/build/upload to elastic's docker repo
delanni 5ac745d
add agent definition
delanni ef3d7bc
Load docker image before progressing to next step
delanni 07a3796
Try building in the same step
delanni f375c10
List images, to see why they're not available
delanni 10c26eb
Fix arm-amd mixup
delanni 4859c07
Add +x flag to entrypoint scripts
delanni 4e53748
List dirs, wonder why they're not accessible
delanni 17acf35
Add Z flag, to access the directories
delanni 4583258
Increase timeout, try build in different steps
delanni b45822e
Separate builds because 'ERROR: docker exporter does not currently su…
delanni 15e9c59
Fix bad image names and conditionals
delanni 43d3007
Try arm64 build
delanni 1e0e916
use arm machines for arm build
delanni 046ef03
Add a pre-checkout hook to try to fix github urls
delanni 5d3db88
Add a few commands for discovery
delanni 6e887aa
Add post-checkout hook to cleanup git configs
delanni a3c45fa
No post-checkout - it changes the kibana executors for good, might me…
delanni a7bac4e
Refactor, and prepare pipeline for upload
delanni 7a08d5d
Retry after fixing access rights
delanni c3dd54d
Strip -glibc-217 variant from filenames to keep original naming
delanni c63603b
Plug in ARM build, try a complete build
delanni fa10326
Attempt build on the macos executor
delanni 9b0d9f9
Retreat back to cross-compiling, while the agent is set up
delanni a20eefc
Fix arm64<->amd64 parameterization, names
delanni 000e638
Allow all users to rwx on created artifacts, so external scripts can …
delanni 805e765
Allow writing of the created dist folder, to allow for rename
delanni d3e6284
Try macos executor again
delanni 75354d2
Re-add x64 build
delanni 6b71765
Bump to build node 18.16.0
delanni 3eb5955
Find where the node builds are running, for debugging
delanni 2e589f5
More debug
delanni 3eb345d
Try fast agents with cross-compilation
delanni b9916d1
Try building re2
delanni 2785d83
Mkdir & new folder names to avoid clash
delanni c037b40
Fix docker image name
delanni 133ccff
Centralize build image name, so there are no typos
delanni 1813dec
Fix double slash typo in path
delanni 922dec3
Use public URLs for the node distro
delanni 42b4990
Use npm binary extracted locally
delanni c13eb22
Remove variant from extracted node folder if needed
delanni 07f47df
Add SHA256 file fixing,remove variation, fix re2 artifact building
delanni edd9232
Re-add upload section
delanni bdd64e8
Use correct path for SHASUMS256.txt
delanni 7a61c2e
Use spaces in shasum file, re-enable mac build, bump node version
delanni 702ca66
Add SHASUM fixing as a last step after both agents finished
delanni 58f0c0a
Add retry around node download.. node.js org is flaky
delanni e85ade7
Fix typo, temporarily disable build steps
delanni 7dde65d
Re-enable build steps
delanni fecc714
Remove unnecessary files, add README/Context
delanni a05224f
Merge branch 'main' into docker-manual-upload
delanni 1656a11
Update README.md
delanni 21f14c0
Centralize the artifacts' upload bucket name
delanni 68d258e
Remove RE2 aspects of the build
delanni ab58662
Remove traces of the ci-systems pipeline
delanni 9957258
Rationalize timeouts for beefier runner instances
delanni 12ed8d8
Rename pipeline-kibana to pipeline, as the default
delanni 00a8b2f
Update .buildkite/pipeline.yml
delanni 8997a62
Update .buildkite/pipeline.yml
delanni 983da3e
try overriding node target version in command
delanni c18809e
Fix default value expression
delanni 8e0ae33
Remove debug / exit statements
delanni 5c1d41e
Centralize version override, add annotation for built version
delanni 8c34500
Fix typo for --style
delanni 7ce4d9b
Fix defaulting logic
delanni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,32 @@ | ||
| agents: | ||
| provider: aws | ||
| instanceType: m6g.xlarge | ||
| imagePrefix: drivah-ubuntu-2204-aarch64 | ||
| env: | ||
| TARGET_VERSION: 18.16.1 | ||
|
|
||
| steps: | ||
| - label: ":buildah: Building Container Images for ARM64" | ||
| branches: "*" | ||
| command: | | ||
| buildah --version | ||
| drivah build --changed-since=main ./containers/arm64 | ||
| - label: Build node.js 18 with glibc 2.17 for x64 | ||
delanni marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| command: | ||
| - scripts/create_build_images.sh | ||
| - scripts/build_nodejs.sh | ||
| - scripts/upload_nodejs_artifacts.sh | ||
| env: | ||
| ARCH: amd64 | ||
| agents: | ||
| queue: c2-16 | ||
| timeout_in_minutes: 60 # ideally runs in ~30m | ||
|
|
||
| # - label: ":buildah: Building Container Images for AMD64" | ||
| # branches: "*" | ||
| # command: | | ||
| # buildah --version | ||
| # drivah build --changed-since=main ./.buildkite/containers/amd64 | ||
| - label: Build node.js 18 with glibc 2.17 for arm64 | ||
delanni marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| command: | ||
| - scripts/create_build_images.sh | ||
| - scripts/build_nodejs.sh | ||
| - scripts/upload_nodejs_artifacts.sh | ||
| env: | ||
| ARCH: arm64 | ||
| agents: | ||
| queue: c2-60 # cross-compiling takes a while | ||
| timeout_in_minutes: 180 # ideally runs in ~2hr | ||
|
|
||
| - wait | ||
|
|
||
| - label: Fix SHASUMS256.txt with newly built files' hashes | ||
| command: scripts/replace_sha_hashes.sh | ||
| agents: | ||
| queue: kibana-default | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| .vscode | ||
| .idea | ||
|
|
||
| workdir | ||
| workdir/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,46 @@ | ||
| # kibana-custom-nodejs-builds | ||
| Contains configuration and sources to build node.js for custom platforms | ||
| Contains configuration and sources to build node.js | ||
|
|
||
| The main usecase right now is building `node.js@18+` with `[email protected]`, which is required for some older platforms. (More context: https://github.com/nodejs/unofficial-builds/pull/69) | ||
|
|
||
| ## Running locally | ||
| You can run most scripts locally on Mac/Linux. You'll need a few of the build/infra tools: | ||
| - Docker | ||
| - node.js | ||
| - gsutil (`brew install google-cloud-sdk`) | ||
|
|
||
| Export some env variables required for the builds | ||
| ```sh | ||
| export ARCH="arm64" | ||
| export TARGET_VERSION="18.16.1" | ||
| ``` | ||
|
|
||
| Then run individual scripts locally: | ||
| ```sh | ||
| ./scripts/create_build_images.sh | ||
| ./scripts/build_nodejs.sh | ||
| ``` | ||
|
|
||
| ## Docker image for node.js builds | ||
| One of the main components we need to create in this step is a docker image for an environment that's set up for building `node.js`. | ||
|
|
||
| The bits for this component are in the [build-image-config](./build-image-config/) folder. | ||
|
|
||
| The docker image uses mounted directories as working directories, as well as outputting the artifacts in these directories. | ||
|
|
||
|
|
||
| ## Scripts for running the builds | ||
| Most of the `buildkite` logic is sheltered in the [scripts](./scripts/) directory. | ||
|
|
||
|
|
||
|
|
||
| ## Context | ||
| During development, we found some more information that can be helpful as context, should anyone find this repo again | ||
|
|
||
| - This repository is only needed while | ||
| - centos:7 / RHEL7 is supported by Elastic, and we ship node.js with Kibana | ||
| - the unofficial-builds repo accepts a linux/arm64 build (https://github.com/nodejs/unofficial-builds/pull/83) | ||
| - The created Docker images needn't be pushed | ||
| - they can be used once for the build, then rebuilt in case we need to run it again | ||
| - I decided to remove the `VARIATION` attribute on the node.js: | ||
| - build would result in the variation showing up in the file and folder names, making the logistics more difficult, if we want to keep this mostly transparent for Kibana |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.