Skip to content

Commit bfac9c8

Browse files
authored
[FEA] npm packaging (#406)
1 parent a78b6b3 commit bfac9c8

197 files changed

Lines changed: 4173 additions & 2680 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.creds.sample

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Optional AWS access id for writing to the shared sccache S3 bucket
2+
AWS_ACCESS_KEY_ID=<AWS Access Key Id>
3+
4+
# Optional AWS secret key for writing to the shared sccache S3 bucket
5+
AWS_SECRET_ACCESS_KEY=<AWS Secret Key>

.env.sample

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ PARALLEL_LEVEL=4
1313
# LINUX_VERSION=ubuntu20.04
1414

1515
# RAPIDS version to use
16-
# RAPIDS_VERSION=22.02.00
16+
# RAPIDS_VERSION=22.06.00
1717

1818
# How long sccache should wait until it considers a compile job timed out.
1919
# This number should be large, because C++ and CUDA can take a long time to compile.
@@ -26,9 +26,3 @@ SCCACHE_IDLE_TIMEOUT=32768
2626
# Using these values can significantly speed up your compile times.
2727
SCCACHE_REGION=us-west-2
2828
SCCACHE_BUCKET=node-rapids-sccache
29-
30-
# Optional AWS access id for writing to the shared sccache S3 bucket
31-
# AWS_ACCESS_KEY_ID=<AWS Access Key Id>
32-
33-
# Optional AWS secret key for writing to the shared sccache S3 bucket
34-
# AWS_SECRET_ACCESS_KEY=<AWS Secret Key>
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: build-and-publish-image-ssh
2+
3+
description: "Build and publish a Docker image with SSH forwarding"
4+
5+
inputs:
6+
file:
7+
required: true
8+
description: "Dockerfile to build"
9+
tags:
10+
required: true
11+
description: "Image tags to publish"
12+
pull:
13+
default: false
14+
required: false
15+
description: "Attempt to pull a newer version of the image (default false)"
16+
push:
17+
default: false
18+
required: false
19+
description: "Push the image to the container registry (default false)"
20+
temp:
21+
default: /tmp
22+
required: true
23+
description: "Path to temp dir"
24+
context:
25+
default: "."
26+
required: true
27+
description: "Path to image build context"
28+
platforms:
29+
default: "linux/amd64"
30+
required: false
31+
description: "Platforms to build"
32+
buildx-driver-opts:
33+
default: ""
34+
required: false
35+
description: "List of additional driver-specific options"
36+
build-args:
37+
default: ""
38+
required: false
39+
description: "Build arguments to use"
40+
registry-url:
41+
default: ""
42+
required: false
43+
description: "Address of container registry"
44+
registry-username:
45+
default: ""
46+
required: false
47+
description: "Username used to log in to the container registry"
48+
registry-password:
49+
default: ""
50+
required: false
51+
description: "Password used to log in to the container registry"
52+
AWS_ACCESS_KEY_ID:
53+
default: ""
54+
required: false
55+
description: "AWS access id for writing to the shared sccache S3 bucket"
56+
AWS_SECRET_ACCESS_KEY:
57+
default: ""
58+
required: false
59+
description: "AWS secret key for writing to the shared sccache S3 bucket"
60+
SSH_PRIVATE_KEY:
61+
default: ""
62+
required: true
63+
description: "Private SSH key for cloning private RAPIDS repositories"
64+
65+
outputs:
66+
digest:
67+
description: "Image content-addressable identifier"
68+
value: ${{ steps.docker-build.outputs.digest }}
69+
metadata:
70+
description: "Build result metadata"
71+
value: ${{ steps.docker-build.outputs.metadata }}
72+
73+
runs:
74+
using: composite
75+
steps:
76+
- name: Set up QEMU
77+
uses: docker/setup-qemu-action@v1
78+
- name: Set up Docker Buildx context
79+
shell: bash
80+
run: |
81+
docker context create builders
82+
- name: Set up Docker Buildx
83+
uses: docker/setup-buildx-action@v2
84+
with:
85+
endpoint: builders
86+
buildkitd-flags: --debug
87+
driver-opts: ${{ inputs.buildx-driver-opts }}
88+
- name: Login to container registry
89+
if: inputs.push == 'true'
90+
uses: docker/login-action@v1
91+
with:
92+
registry: ${{ inputs.registry-url }}
93+
username: ${{ inputs.registry-username }}
94+
password: ${{ inputs.registry-password }}
95+
- name: Initialize sccache_credentials
96+
shell: bash
97+
run: |
98+
echo "AWS_ACCESS_KEY_ID=${{ inputs.AWS_ACCESS_KEY_ID }}" >> ${{ inputs.temp }}/sccache_credentials
99+
echo "AWS_SECRET_ACCESS_KEY=${{ inputs.AWS_SECRET_ACCESS_KEY }}" >> ${{ inputs.temp }}/sccache_credentials
100+
- name: Set up ssh-agent
101+
uses: webfactory/ssh-agent@v0.5.4
102+
with:
103+
ssh-private-key: ${{ inputs.SSH_PRIVATE_KEY }}
104+
- name: Build image
105+
id: docker-build
106+
uses: docker/build-push-action@v2
107+
with:
108+
pull: ${{ inputs.pull }}
109+
push: ${{ inputs.push }}
110+
file: ${{ inputs.file }}
111+
tags: ${{ inputs.tags }}
112+
context: ${{ inputs.context }}
113+
load: ${{ inputs.push == false }}
114+
platforms: ${{ inputs.platforms }}
115+
build-args: ${{ inputs.build-args }}
116+
ssh: |
117+
default=${{ env.SSH_AUTH_SOCK }}
118+
labels: |
119+
org.opencontainers.image.vendor=NVIDIA
120+
org.opencontainers.image.source=https://github.com/rapidsai/node
121+
secret-files: |
122+
"sccache_credentials=${{ inputs.temp }}/sccache_credentials"
123+
- name: Clean up
124+
if: always()
125+
shell: bash
126+
run: |
127+
rm ${{ inputs.temp }}/sccache_credentials

.github/actions/build-and-publish-image/action.yml

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ inputs:
1717
default: false
1818
required: false
1919
description: "Push the image to the container registry (default false)"
20+
context:
21+
default: "."
22+
required: true
23+
description: "Path to image build context"
2024
platforms:
2125
default: "linux/amd64"
2226
required: false
2327
description: "Platforms to build"
28+
buildx-driver-opts:
29+
default: ""
30+
required: false
31+
description: "List of additional driver-specific options"
2432
build-args:
2533
default: ""
2634
required: false
@@ -37,14 +45,6 @@ inputs:
3745
default: ""
3846
required: false
3947
description: "Password used to log in to the container registry"
40-
AWS_ACCESS_KEY_ID:
41-
default: ""
42-
required: false
43-
description: "AWS access id for writing to the shared sccache S3 bucket"
44-
AWS_SECRET_ACCESS_KEY:
45-
default: ""
46-
required: false
47-
description: "AWS secret key for writing to the shared sccache S3 bucket"
4848

4949
outputs:
5050
digest:
@@ -57,58 +57,37 @@ outputs:
5757
runs:
5858
using: composite
5959
steps:
60-
- name: Free up disk space
61-
shell: bash
62-
run: |
63-
df -h
64-
docker images
65-
sudo swapoff -a
66-
sudo rm -f /swapfile
67-
sudo apt clean
68-
sudo rm -rf /opt/ghc "$CONDA" \
69-
/usr/share/swift \
70-
/usr/share/dotnet \
71-
/usr/local/lib/android \
72-
/home/linuxbrew/.linuxbrew \
73-
/opt/hostedtoolcache/CodeQL
74-
docker rmi $(docker image ls -aq) || true
75-
df -h
76-
docker images
7760
- name: Set up QEMU
7861
uses: docker/setup-qemu-action@v1
62+
- name: Set up Docker Buildx context
63+
shell: bash
64+
run: |
65+
docker context create builders
7966
- name: Set up Docker Buildx
80-
uses: docker/setup-buildx-action@v1
67+
uses: docker/setup-buildx-action@v2
8168
with:
69+
endpoint: builders
8270
buildkitd-flags: --debug
71+
driver-opts: ${{ inputs.buildx-driver-opts }}
8372
- name: Login to container registry
73+
if: inputs.push == 'true'
8474
uses: docker/login-action@v1
8575
with:
8676
registry: ${{ inputs.registry-url }}
8777
username: ${{ inputs.registry-username }}
8878
password: ${{ inputs.registry-password }}
89-
- name: Initialize sccache_credentials
90-
shell: bash
91-
run: |
92-
echo "AWS_ACCESS_KEY_ID=${{ inputs.AWS_ACCESS_KEY_ID }}" >> /tmp/sccache_credentials
93-
echo "AWS_SECRET_ACCESS_KEY=${{ inputs.AWS_SECRET_ACCESS_KEY }}" >> /tmp/sccache_credentials
9479
- name: Build image
9580
id: docker-build
9681
uses: docker/build-push-action@v2
9782
with:
98-
context: .
9983
pull: ${{ inputs.pull }}
10084
push: ${{ inputs.push }}
10185
file: ${{ inputs.file }}
10286
tags: ${{ inputs.tags }}
103-
load: ${{ inputs.push == 'false' }}
87+
context: ${{ inputs.context }}
88+
load: ${{ inputs.push == false }}
10489
platforms: ${{ inputs.platforms }}
10590
build-args: ${{ inputs.build-args }}
10691
labels: |
10792
org.opencontainers.image.vendor=NVIDIA
10893
org.opencontainers.image.source=https://github.com/rapidsai/node
109-
secret-files: |
110-
"sccache_credentials=/tmp/sccache_credentials"
111-
- name: Clean up
112-
shell: bash
113-
run: |
114-
rm /tmp/sccache_credentials
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: free-disk-space
2+
3+
description: "Free up disk space on the GitHub-hosted runners"
4+
5+
inputs:
6+
tool_cache:
7+
required: true
8+
description: "GitHub runner's tool_cache"
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Free up disk space
14+
shell: bash
15+
run: |
16+
df -h
17+
docker images
18+
sudo swapoff -a
19+
sudo rm -f /swapfile
20+
sudo apt clean
21+
sudo rm -rf \
22+
"$CONDA" \
23+
/opt/ghc \
24+
/usr/share/swift \
25+
/usr/share/dotnet \
26+
/usr/local/lib/android \
27+
/home/linuxbrew/.linuxbrew \
28+
${{ inputs.tool_cache }}/CodeQL
29+
docker rmi $(docker image ls -aq) || true
30+
df -h
31+
docker images

.github/workflows/docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
container: node:16.15.1-bullseye
2222
steps:
2323
- name: Checkout main
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v3
2525
with:
2626
path: main
2727
- name: Checkout gh-pages
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
2929
with:
3030
ref: gh-pages
3131
path: gh-pages

0 commit comments

Comments
 (0)