Skip to content

Commit

Permalink
*: use latest LTS node
Browse files Browse the repository at this point in the history
  • Loading branch information
tharvik committed Mar 25, 2024
1 parent 1c0e914 commit 36dff42
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 79 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
types: [completed]

env:
node_version: 16
server_url: https://deai-313515.ew.r.appspot.com/

jobs:
Expand All @@ -20,7 +19,7 @@ jobs:
ref: production
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
cache-dependency-path: |
discojs/package-lock.json
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ on:
branches: [production]
types: [completed]

env:
node_version: 16

jobs:
gh-pages-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
cache-dependency-path: |
discojs/package-lock.json
Expand All @@ -30,15 +27,15 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './web-client/dist'
path: "./web-client/dist"

gh-pages-deploy:
needs: gh-pages-build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
Expand Down
45 changes: 21 additions & 24 deletions .github/workflows/lint-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
branches: production
pull_request:

env:
node_version: 16

jobs:
download-datasets:
runs-on: ubuntu-latest
Expand All @@ -28,7 +25,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-{core,node} run build
Expand All @@ -41,7 +38,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-core run build
Expand All @@ -54,7 +51,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-core run build
Expand All @@ -67,7 +64,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-{core,node} run build
Expand All @@ -80,7 +77,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace={./discojs/discojs-{core,node},./server} run build
Expand All @@ -93,7 +90,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-{core,web} run build
Expand All @@ -106,7 +103,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace={./discojs/discojs-{core,node},./server} run build
Expand All @@ -119,7 +116,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-core run build
Expand All @@ -131,7 +128,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-core run build
Expand All @@ -144,7 +141,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run --workspace=./discojs/discojs-core build
Expand All @@ -157,7 +154,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run --workspace=./discojs/discojs-{core,node} build
Expand All @@ -180,7 +177,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run --workspace={./discojs/discojs-{core,node},./server} build
Expand All @@ -193,7 +190,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-{core,web} run build
Expand All @@ -206,7 +203,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace={./discojs/discojs-{core,node},./server} run build
Expand All @@ -228,7 +225,7 @@ jobs:
key: datasets-${{ hashFiles('datasets/**') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-{core,node} run build
Expand All @@ -248,7 +245,7 @@ jobs:
key: datasets-${{ hashFiles('datasets/**') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-core run build
Expand All @@ -268,7 +265,7 @@ jobs:
key: datasets-${{ hashFiles('datasets/**') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-core run build
Expand All @@ -288,7 +285,7 @@ jobs:
key: datasets-${{ hashFiles('datasets/**') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-{core,node} run build
Expand All @@ -308,7 +305,7 @@ jobs:
key: datasets-${{ hashFiles('datasets/**') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace=./discojs/discojs-{core,web} run build
Expand All @@ -335,7 +332,7 @@ jobs:
key: datasets-${{ hashFiles('datasets/**') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace={./discojs/discojs-{core,node},./server} run build
Expand All @@ -355,7 +352,7 @@ jobs:
key: datasets-${{ hashFiles('datasets/**') }}
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm --workspace={./discojs/discojs-{core,node},./server} run build
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ on:
required: true
type: string

env:
node_version: 16

jobs:

publish-and-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org
cache: npm
cache-dependency-path: |
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v20
39 changes: 14 additions & 25 deletions DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,49 +44,38 @@ flowchart LR

The following instructions will install the required dependencies, build Disco.js and launch a DISCO server and a web client. If you run into any sort of trouble check our [FAQ](./docs/FAQ.md); otherwise please create a new issue or feel free to ask on [our slack](https://join.slack.com/t/disco-decentralized/shared_invite/zt-fpsb7c9h-1M9hnbaSonZ7lAgJRTyNsw).

**1.** We recommend using [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) to handle multiple Node.js versions. Start by installing `nvm` by following [their installation instructions](https://github.com/nvm-sh/nvm).
After installation, you should be able to run
**1.** Clone the repository

```
nvm -v
0.39.7 # my nvm version at the time
git clone [email protected]:epfml/disco.git
cd disco
```

**2.** Install Node.js version 16
**2.** Install Node.js

```
nvm install 16
```

You can now choose which Node.js version to use:
We recommend using [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) to handle multiple Node.js versions. Start by installing `nvm` by following [their installation instructions](https://github.com/nvm-sh/nvm).
After installation, you should be able to run

```
nvm use 16
nvm -v
0.39.7 # at the time of writing
```

Using Node.js v16 should automatically set your [npm](https://docs.npmjs.com/about-npm) (Node Package Manager, different from n**v**m) version to 8:
Use it to install the version we use in DISCO.

```
npm --version
8.xx.xx
nvm install # it reads `.nvmrc` to select the correct version
```

`nvm` manages your different Node.js versions while `npm` handles your different Node.js project packages within one version.

**3.** Clone the repository

```
git clone [email protected]:epfml/disco.git
cd disco
```

**4.** Install the dependencies
**3.** Install the dependencies

```
npm ci
```

**5.** Build the projects
**4.** Build the projects

Then we need to builds the packages meaning compile TypeScript into JavaScript.

Expand All @@ -98,13 +87,13 @@ Or you can select a specific workspace via `--workspace=$name-or-path-to-package
npm -ws run build
```

**6.** Download and extract the sample training datasets. These datasets are used in the automated tests.
**5.** Download and extract the sample training datasets. These datasets are used in the automated tests.

```
./datasets/populate
```

**7.** Launch DISCO
**6.** Launch DISCO

As you may have seen, there are many ways to use DISCO. Here we will run a server and a web client. From there, a user can use DISCO from their browser.

Expand Down
15 changes: 1 addition & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# syntax=docker/dockerfile:1

FROM ubuntu:20.04

ENV NODE_ENV=development

RUN apt-get upgrade -y \
&& apt-get update -y \
&& apt-get install -y libnode-dev \
&& apt-get install -y python3.8 \
&& apt install -y build-essential \
&& apt-get install -y curl \
&& curl --silent --location https://deb.nodesource.com/setup_16.x | bash - \
&& apt install -y nodejs
FROM node:20

COPY package*.json .
COPY isomorphic-wrtc/package.json isomorphic-wrtc/
Expand Down

0 comments on commit 36dff42

Please sign in to comment.