Skip to content

Commit

Permalink
[FEA] npm packaging (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt authored Jun 30, 2022
1 parent a78b6b3 commit bfac9c8
Show file tree
Hide file tree
Showing 197 changed files with 4,173 additions and 2,680 deletions.
5 changes: 5 additions & 0 deletions .creds.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Optional AWS access id for writing to the shared sccache S3 bucket
AWS_ACCESS_KEY_ID=<AWS Access Key Id>

# Optional AWS secret key for writing to the shared sccache S3 bucket
AWS_SECRET_ACCESS_KEY=<AWS Secret Key>
8 changes: 1 addition & 7 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PARALLEL_LEVEL=4
# LINUX_VERSION=ubuntu20.04

# RAPIDS version to use
# RAPIDS_VERSION=22.02.00
# RAPIDS_VERSION=22.06.00

# How long sccache should wait until it considers a compile job timed out.
# This number should be large, because C++ and CUDA can take a long time to compile.
Expand All @@ -26,9 +26,3 @@ SCCACHE_IDLE_TIMEOUT=32768
# Using these values can significantly speed up your compile times.
SCCACHE_REGION=us-west-2
SCCACHE_BUCKET=node-rapids-sccache

# Optional AWS access id for writing to the shared sccache S3 bucket
# AWS_ACCESS_KEY_ID=<AWS Access Key Id>

# Optional AWS secret key for writing to the shared sccache S3 bucket
# AWS_SECRET_ACCESS_KEY=<AWS Secret Key>
127 changes: 127 additions & 0 deletions .github/actions/build-and-publish-image-ssh/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: build-and-publish-image-ssh

description: "Build and publish a Docker image with SSH forwarding"

inputs:
file:
required: true
description: "Dockerfile to build"
tags:
required: true
description: "Image tags to publish"
pull:
default: false
required: false
description: "Attempt to pull a newer version of the image (default false)"
push:
default: false
required: false
description: "Push the image to the container registry (default false)"
temp:
default: /tmp
required: true
description: "Path to temp dir"
context:
default: "."
required: true
description: "Path to image build context"
platforms:
default: "linux/amd64"
required: false
description: "Platforms to build"
buildx-driver-opts:
default: ""
required: false
description: "List of additional driver-specific options"
build-args:
default: ""
required: false
description: "Build arguments to use"
registry-url:
default: ""
required: false
description: "Address of container registry"
registry-username:
default: ""
required: false
description: "Username used to log in to the container registry"
registry-password:
default: ""
required: false
description: "Password used to log in to the container registry"
AWS_ACCESS_KEY_ID:
default: ""
required: false
description: "AWS access id for writing to the shared sccache S3 bucket"
AWS_SECRET_ACCESS_KEY:
default: ""
required: false
description: "AWS secret key for writing to the shared sccache S3 bucket"
SSH_PRIVATE_KEY:
default: ""
required: true
description: "Private SSH key for cloning private RAPIDS repositories"

outputs:
digest:
description: "Image content-addressable identifier"
value: ${{ steps.docker-build.outputs.digest }}
metadata:
description: "Build result metadata"
value: ${{ steps.docker-build.outputs.metadata }}

runs:
using: composite
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx context
shell: bash
run: |
docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
endpoint: builders
buildkitd-flags: --debug
driver-opts: ${{ inputs.buildx-driver-opts }}
- name: Login to container registry
if: inputs.push == 'true'
uses: docker/login-action@v1
with:
registry: ${{ inputs.registry-url }}
username: ${{ inputs.registry-username }}
password: ${{ inputs.registry-password }}
- name: Initialize sccache_credentials
shell: bash
run: |
echo "AWS_ACCESS_KEY_ID=${{ inputs.AWS_ACCESS_KEY_ID }}" >> ${{ inputs.temp }}/sccache_credentials
echo "AWS_SECRET_ACCESS_KEY=${{ inputs.AWS_SECRET_ACCESS_KEY }}" >> ${{ inputs.temp }}/sccache_credentials
- name: Set up ssh-agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ inputs.SSH_PRIVATE_KEY }}
- name: Build image
id: docker-build
uses: docker/build-push-action@v2
with:
pull: ${{ inputs.pull }}
push: ${{ inputs.push }}
file: ${{ inputs.file }}
tags: ${{ inputs.tags }}
context: ${{ inputs.context }}
load: ${{ inputs.push == false }}
platforms: ${{ inputs.platforms }}
build-args: ${{ inputs.build-args }}
ssh: |
default=${{ env.SSH_AUTH_SOCK }}
labels: |
org.opencontainers.image.vendor=NVIDIA
org.opencontainers.image.source=https://github.com/rapidsai/node
secret-files: |
"sccache_credentials=${{ inputs.temp }}/sccache_credentials"
- name: Clean up
if: always()
shell: bash
run: |
rm ${{ inputs.temp }}/sccache_credentials
57 changes: 18 additions & 39 deletions .github/actions/build-and-publish-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ inputs:
default: false
required: false
description: "Push the image to the container registry (default false)"
context:
default: "."
required: true
description: "Path to image build context"
platforms:
default: "linux/amd64"
required: false
description: "Platforms to build"
buildx-driver-opts:
default: ""
required: false
description: "List of additional driver-specific options"
build-args:
default: ""
required: false
Expand All @@ -37,14 +45,6 @@ inputs:
default: ""
required: false
description: "Password used to log in to the container registry"
AWS_ACCESS_KEY_ID:
default: ""
required: false
description: "AWS access id for writing to the shared sccache S3 bucket"
AWS_SECRET_ACCESS_KEY:
default: ""
required: false
description: "AWS secret key for writing to the shared sccache S3 bucket"

outputs:
digest:
Expand All @@ -57,58 +57,37 @@ outputs:
runs:
using: composite
steps:
- name: Free up disk space
shell: bash
run: |
df -h
docker images
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
sudo rm -rf /opt/ghc "$CONDA" \
/usr/share/swift \
/usr/share/dotnet \
/usr/local/lib/android \
/home/linuxbrew/.linuxbrew \
/opt/hostedtoolcache/CodeQL
docker rmi $(docker image ls -aq) || true
df -h
docker images
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx context
shell: bash
run: |
docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
endpoint: builders
buildkitd-flags: --debug
driver-opts: ${{ inputs.buildx-driver-opts }}
- name: Login to container registry
if: inputs.push == 'true'
uses: docker/login-action@v1
with:
registry: ${{ inputs.registry-url }}
username: ${{ inputs.registry-username }}
password: ${{ inputs.registry-password }}
- name: Initialize sccache_credentials
shell: bash
run: |
echo "AWS_ACCESS_KEY_ID=${{ inputs.AWS_ACCESS_KEY_ID }}" >> /tmp/sccache_credentials
echo "AWS_SECRET_ACCESS_KEY=${{ inputs.AWS_SECRET_ACCESS_KEY }}" >> /tmp/sccache_credentials
- name: Build image
id: docker-build
uses: docker/build-push-action@v2
with:
context: .
pull: ${{ inputs.pull }}
push: ${{ inputs.push }}
file: ${{ inputs.file }}
tags: ${{ inputs.tags }}
load: ${{ inputs.push == 'false' }}
context: ${{ inputs.context }}
load: ${{ inputs.push == false }}
platforms: ${{ inputs.platforms }}
build-args: ${{ inputs.build-args }}
labels: |
org.opencontainers.image.vendor=NVIDIA
org.opencontainers.image.source=https://github.com/rapidsai/node
secret-files: |
"sccache_credentials=/tmp/sccache_credentials"
- name: Clean up
shell: bash
run: |
rm /tmp/sccache_credentials
31 changes: 31 additions & 0 deletions .github/actions/free-disk-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: free-disk-space

description: "Free up disk space on the GitHub-hosted runners"

inputs:
tool_cache:
required: true
description: "GitHub runner's tool_cache"

runs:
using: composite
steps:
- name: Free up disk space
shell: bash
run: |
df -h
docker images
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
sudo rm -rf \
"$CONDA" \
/opt/ghc \
/usr/share/swift \
/usr/share/dotnet \
/usr/local/lib/android \
/home/linuxbrew/.linuxbrew \
${{ inputs.tool_cache }}/CodeQL
docker rmi $(docker image ls -aq) || true
df -h
docker images
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
container: node:16.15.1-bullseye
steps:
- name: Checkout main
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: main
- name: Checkout gh-pages
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: gh-pages
path: gh-pages
Expand Down
Loading

0 comments on commit bfac9c8

Please sign in to comment.