Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
524e67f
Testing workflow build with Dockerfile
JackStrohm-asana May 14, 2025
9371070
update
JackStrohm-asana May 14, 2025
7714135
change node location in docker image
JackStrohm-asana May 15, 2025
46731cd
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
71dc872
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
59d3da1
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
c2fc020
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
ff6c50c
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
8b0e1e3
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
48b135c
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
02a1e16
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
1f9c4de
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
0b08ce9
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
60c07e5
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
b323e9f
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
fecf418
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
0741a10
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
8ec7bdc
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
96504f5
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
226535a
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
69ecd42
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
942aa5f
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
1c5617d
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
ac45391
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
acb7bf0
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
f0d2840
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
9e3db8f
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
43e837e
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
9be07f0
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
c7741d1
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
8ce5e40
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
47a5672
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
2b987bf
working on Dockerfile for fibers
JackStrohm-asana May 15, 2025
e2f6592
Didn't mean to pull this into the branch
JackStrohm-asana May 19, 2025
7522419
accidental checkin
JackStrohm-asana May 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/build-node-fibers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build node-fibers with prebuilt Node

on:
workflow_dispatch:
push:
branches:
- node20.18.3_dockerfile

jobs:
build-fibers:
strategy:
matrix:
include:
- platform: linux
arch: x64
runs_on: ubuntu-22.04
- platform: linux
arch: arm64
runs_on: ubuntu-22.04-arm
runs-on: ${{ matrix.runs_on }}

env:
NODE_VERSION: v20.18.3

steps:
- name: Debug Matrix Values
run: |
echo "Matrix platform: ${{ matrix.platform }}"
echo "Matrix arch: ${{ matrix.arch }}"

- name: Download Node archive
run: |
gh release download node-${{ env.NODE_VERSION }}-release \
--repo asana/node \
--pattern "node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz"
mv node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz node.tar.xz
pwd
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download Dockerfile from GitHub API
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw" -o Dockerfile.Fibers https://api.github.com/repos/Asana/node/contents/Dockerfile.Fibers?ref=node20.18.3_dockerfile
cat Dockerfile.Fibers
pwd

- name: Execute the Dockerfile
run: |
pwd
docker build -t node20_fibers_build -f Dockerfile.Fibers .

- name: Extract resources
run: |
docker create --name temp_node_fibers_extract node20_fibers_build
docker cp temp_node_fibers_extract:/usr/src/node/node-fibers $GITHUB_WORKSPACE/node-fibers
docker rm temp_node_fibers_extract

- name: Find and archive fibers.node
run: |
# Find the directory under bin/ that contains fibers.node
FIBERS_PATH=$(find ./node-fibers/bin -type f -name fibers.node | head -n1)
FIBERS_DIR=$(dirname "$FIBERS_PATH")
ARCHIVE_NAME=$(basename "$FIBERS_DIR").tar.gz
echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $GITHUB_ENV
tar -czf "$ARCHIVE_NAME" -C "$(dirname "$FIBERS_DIR")" "$(basename "$FIBERS_DIR")"

- name: Upload archive to release
uses: softprops/action-gh-release@v1
with:
name: node-${{ env.NODE_VERSION }}-LATEST
tag_name: node-${{ env.NODE_VERSION }}-release
files: ${{ env.ARCHIVE_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77 changes: 77 additions & 0 deletions .github/workflows/build-node-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build node-packages with prebuilt Node

on:
workflow_dispatch:
push:
branches:
- node20.18.3_dockerfile

jobs:
build-packages:
strategy:
matrix:
include:
- platform: linux
arch: x64
runs_on: ubuntu-22.04
- platform: linux
arch: arm64
runs_on: ubuntu-22.04-arm
runs-on: ${{ matrix.runs_on }}

env:
NODE_VERSION: v20.18.3

steps:
- name: Debug Matrix Values
run: |
echo "Matrix platform: ${{ matrix.platform }}"
echo "Matrix arch: ${{ matrix.arch }}"

- name: Download Node archive
run: |
gh release download node-${{ env.NODE_VERSION }}-release \
--repo asana/node \
--pattern "node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz"
mv node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz node.tar.xz
pwd
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download Dockerfile from GitHub API
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw" -o Dockerfile.Packages https://api.github.com/repos/Asana/node/contents/Dockerfile.Packages?ref=node20.18.3_dockerfile
cat Dockerfile.Packages
pwd

- name: Execute the Dockerfile
run: |
pwd
docker build -t node20_packages_build -f Dockerfile.Packages .

- name: Extract resources
run: |
docker create --name temp_node_packages_extract node20_packages_build
docker cp temp_node_packages_extract:/usr/src/node/node_modules $GITHUB_WORKSPACE/node_modules
docker rm temp_node_packages_extract

- name: Tar node-packages
run: |
mkdir -p ./bcrypt@5.1.0/node_modules/bcrypt
mkdir -p ./cld@2.9.1/node_modules/cld
mkdir -p ./unix-dgram@2.0.6/node_modules/unix-dgram
mv node_modules/bcrypt ./bcrypt@5.1.0/node_modules/bcrypt
mv node_modules/cld ./cld@2.9.1/node_modules/cld
mv node_modules/unix-dgram ./unix-dgram@2.0.6/node_modules/unix-dgram
tar --hard-dereference -cvzf packages_${{matrix.arch}}.tar.gz bcrypt@5.1.0 cld@2.9.1 unix-dgram@2.0.6

- name: Upload archive to release
uses: softprops/action-gh-release@v1
with:
name: node-${{ env.NODE_VERSION }}-LATEST
tag_name: node-${{ env.NODE_VERSION }}-release
files: packages_${{matrix.arch}}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112 changes: 112 additions & 0 deletions .github/workflows/build-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Build Node

on:
workflow_dispatch:

jobs:
build-node:
name: Build ${{ matrix.platform }}-${{ matrix.arch }}
strategy:
matrix:
include:
- platform: linux
arch: x64
runs_on: ubuntu-22.04
- platform: linux
arch: arm64
runs_on: ubuntu-22.04-arm
runs-on: ${{ matrix.runs_on }}

env:
S3_BUCKET: your-bucket-name
AWS_REGION: us-east-1

steps:
- name: Checkout Node fork
uses: actions/checkout@v3
with:
repository: Asana/node
path: node
ref: ${{ github.event_name == 'pull_request' && format('refs/pull/{0}/merge', github.event.pull_request.number) || github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Node Version
id: extract-node-version
run: |
NODE_MAJOR_VERSION=$(grep '#define NODE_MAJOR_VERSION' node/src/node_version.h | awk '{print $3}')
NODE_MINOR_VERSION=$(grep '#define NODE_MINOR_VERSION' node/src/node_version.h | awk '{print $3}')
NODE_PATCH_VERSION=$(grep '#define NODE_PATCH_VERSION' node/src/node_version.h | awk '{print $3}')
NODE_VERSION="v${NODE_MAJOR_VERSION}.${NODE_MINOR_VERSION}.${NODE_PATCH_VERSION}"
echo "NODE_VERSION=${NODE_VERSION}" >> $GITHUB_ENV

- name: Set build metadata
id: meta
working-directory: node
run: |
TIMESTAMP=$(date -u +%Y-%m-%dT%H-%M)
SHORT_SHA=$(git rev-parse --short HEAD)
echo "BUILD_ID=${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_ENV
echo "build_id=${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_OUTPUT

#- name: Install dependencies (Linux)
#if: matrix.platform == 'linux'
#run: |
#sudo apt-get update
#sudo apt-get install -y python3 g++ make curl tar xz-utils

#- name: Build Node (linux)
#working-directory: node
#if: matrix.platform == 'linux'
#run: |
#./configure --experimental-enable-pointer-compression
#make -j4 install DESTDIR=$GITHUB_WORKSPACE/node-install

#- name: Build Node (darwin)
#working-directory: node
#if: matrix.platform == 'darwin'
#run: |
#./configure --experimental-enable-pointer-compression --without-snapshot
#make -j2 install DESTDIR=$GITHUB_WORKSPACE/node-install
#

- name: Execute the Dockerfile
working-directory: node
run: |
docker build -t node20_build -f ./Dockerfile.Node20 .

- name: Extract resources
run: |
docker create --name temp_node_extract node20_build
docker cp temp_node_extract:/usr/src/node/node-install $GITHUB_WORKSPACE/node-install
docker rm temp_node_extract

- name: Archive Node
run: |
mkdir -p artifacts
FILENAME=node-${NODE_VERSION}-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }}.tar.xz
FILENAME_LATEST=node-${NODE_VERSION}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz
tar -C node-install -cJf artifacts/$FILENAME .
cp artifacts/$FILENAME artifacts/$FILENAME_LATEST
echo "NODE_ARCHIVE=$FILENAME" >> $GITHUB_ENV
echo "NODE_ARCHIVE_LATEST=$FILENAME_LATEST" >> $GITHUB_ENV

- name: Upload Node archive
uses: actions/upload-artifact@v4
with:
name: node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ steps.meta.outputs.build_id }}
path: artifacts/${{ env.NODE_ARCHIVE }}

- name: Upload Node archive latest
uses: actions/upload-artifact@v4
with:
name: node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST
path: artifacts/${{ env.NODE_ARCHIVE_LATEST }}

- name: Upload Node archive to release
uses: softprops/action-gh-release@v1
with:
name: node-${{ env.NODE_VERSION }}-LATEST
tag_name: node-${{ env.NODE_VERSION }}-release
files: ./artifacts/${{ env.NODE_ARCHIVE_LATEST }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions Dockerfile.Fibers
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Stage 1
FROM ubuntu:20.04 AS base

# Set non-interactive mode to avoid prompts during installation
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary dependencies
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get update
RUN apt-get install -y build-essential python3 python3-distutils g++-10 make curl git pkg-config libssl-dev libffi-dev libgmp-dev libtool autoconf automake cmake wget xz-utils unzip vim

# Copy local Node.js source into the image
WORKDIR /usr/src/node
COPY node.tar.xz .

RUN mkdir -p node-install && tar -C node-install -xJf node.tar.xz

ENV PATH="/usr/src/node/node-install/usr/local/bin:$PATH"

RUN which node
RUN node -v
RUN node -p "process.arch"
RUN echo -------------------
RUN git clone --branch jackstrohm_node20_fibers --depth 1 https://github.com/asana/node-fibers.git node-fibers

WORKDIR /usr/src/node/node-fibers
RUN npm install --nodedir="/usr/src/node/node-install/usr/local"
RUN npm test || true
RUN rm bin/repl
RUN find .


CMD ["bash"]

25 changes: 25 additions & 0 deletions Dockerfile.Node20
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Stage 1
FROM ubuntu:20.04 AS base

# Set non-interactive mode to avoid prompts during installation
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary dependencies
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt-get install -y build-essential python3 python3-distutils g++-10 make curl git pkg-config libssl-dev libffi-dev libgmp-dev libtool autoconf automake cmake wget xz-utils unzip vim
RUN rm -rf /var/lib/apt/lists/*

# Set g++ 10 as the default
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100

# Copy local Node.js source into the image
WORKDIR /usr/src/node
COPY . .

RUN ./configure --experimental-enable-pointer-compression
RUN make -j4 install DESTDIR=./node-install

CMD ["bash"]

35 changes: 35 additions & 0 deletions Dockerfile.Packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Stage 1
FROM ubuntu:20.04 AS base

# Set non-interactive mode to avoid prompts during installation
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary dependencies
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get update
RUN apt-get install -y build-essential python3 python3-distutils g++-10 make curl git pkg-config libssl-dev libffi-dev libgmp-dev libtool autoconf automake cmake wget xz-utils unzip vim

# Copy local Node.js source into the image
WORKDIR /usr/src/node
COPY node.tar.xz .

RUN mkdir -p node-install && tar -C node-install -xJf node.tar.xz

ENV PATH="/usr/src/node/node-install/usr/local/bin:$PATH"

RUN which node
RUN node -v
RUN node -p "process.arch"
RUN echo -------------------

RUN npm i --nodedir="/usr/src/node/node-install/usr/local" bcrypt@5.1.0
RUN npm i --nodedir="/usr/src/node/node-install/usr/local" cld@2.9.1
RUN npm i --nodedir="/usr/src/node/node-install/usr/local" unix-dgram@2.0.6

RUN ls
RUN ls node_modules

CMD ["bash"]

4 changes: 2 additions & 2 deletions stage_for_s3.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gh release download -p "*.xz"
curl "https://asana-oss-cache.s3.us-east-1.amazonaws.com/node-fibers/fibers-5.0.4.pc.tgz" --output fibers-5.0.4.tar.gz
tar -xzf fibers-5.0.4.tar.gz

find . -name "*.gz" | while read -r a
find . -name "linux-*.gz" | while read -r a
do
tar -xzf "$a" -C package/bin
rm "$a"
Expand Down Expand Up @@ -44,7 +44,7 @@ for file in *.tar.xz; do
echo "Target Dir: $target_dir"
mkdir "$target_dir"
tar -xzf "$new_name" -C "$target_dir"
mv "$target_dir/usr/local/*" "$target_dir"
mv $target_dir/usr/local/* "$target_dir"
rm -fr "$target_dir/usr/local"

tar -cJf "$new_name" "$target_dir"
Expand Down
Loading