Skip to content

Commit

Permalink
chore(cu)!: use node 22 as the CU runtime. Bump deps and refactor usa…
Browse files Browse the repository at this point in the history
…ges #655
  • Loading branch information
TillaTheHun0 committed Apr 30, 2024
1 parent b10df59 commit 44665e3
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: 📥 Download repo deps
run: |
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: 📥 Download deps
working-directory: servers/cu
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/su.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🦘 Test & Deploy AO Sequencer Unit
name: 👧 Test & Deploy AO Sequencer Unit
on:
workflow_dispatch:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion servers/cu/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
22
2 changes: 1 addition & 1 deletion servers/cu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18
FROM node:22

WORKDIR /usr/app

Expand Down
5 changes: 5 additions & 0 deletions servers/cu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This is an spec compliant `ao` Compute Unit, implemented using NodeJS

<!-- toc -->

- [Prerequisites](#prerequisites)
- [Usage](#usage)
- [Environment Variables](#environment-variables)
- [Tests](#tests)
Expand All @@ -19,6 +20,10 @@ This is an spec compliant `ao` Compute Unit, implemented using NodeJS

<!-- tocstop -->

## Prerequisites

You will need Node 22 installed. If you use `nvm`, then simply run `nvm install`

## Usage

First install dependencies using `npm i`
Expand Down
2 changes: 1 addition & 1 deletion servers/cu/nodemon.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"watch": ["src"],
"exec": "node -r dotenv/config src/app.js",
"exec": "node --experimental-wasm-memory64 -r dotenv/config src/app.js",
"ext": "js",
"delay": "500",
"signal": "SIGHUP"
Expand Down
47 changes: 8 additions & 39 deletions servers/cu/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions servers/cu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"scripts": {
"dev": "nodemon",
"lint": "standard .",
"start": "node -r dotenv/config src/app.js",
"test": "node --test ./src"
"start": "node --experimental-wasm-memory64 -r dotenv/config src/app.js",
"test": "node --experimental-wasm-memory64 --test"
},
"dependencies": {
"@fastify/middie": "^8.3.0",
"@permaweb/ao-loader": "^0.0.26",
"@permaweb/ao-scheduler-utils": "^0.0.18",
"@permaweb/ao-scheduler-utils": "^0.0.19",
"arweave": "^1.15.0",
"better-sqlite3": "^9.6.0",
"bytes": "^3.1.2",
Expand All @@ -23,7 +23,6 @@
"dotenv": "^16.4.5",
"fast-glob": "^3.3.2",
"fastify": "^4.26.2",
"heapdump": "^0.3.15",
"helmet": "^7.1.0",
"hyper-async": "^1.1.2",
"lru-cache": "^10.2.2",
Expand All @@ -32,12 +31,12 @@
"ramda": "^0.30.0",
"warp-arbundles": "^1.0.4",
"workerpool": "^9.1.1",
"zod": "^3.22.4"
"zod": "^3.23.5"
},
"devDependencies": {
"nodemon": "^3.1.0"
},
"engines": {
"node": "18"
"node": "22"
}
}
9 changes: 0 additions & 9 deletions servers/cu/src/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// import { join } from 'node:path'

// import heapdump from 'heapdump'
import { unapply, pipeWith } from 'ramda'
import ms from 'ms'

Expand Down Expand Up @@ -64,12 +61,6 @@ export const server = pipeP(
process.exit()
})

// process.on('SIGUSR2', () => {
// const name = `${Date.now()}.heapsnapshot`
// heapdump.writeSnapshot(join(config.DUMP_PATH, name))
// console.log(name)
// })

process.on('SIGUSR2', async () => {
logger('Received SIGUSR2. Manually Attempting to Checkpoint all Processes currently in WASM heap cache...')
await domain.apis.checkpointWasmMemoryCache().toPromise()
Expand Down

0 comments on commit 44665e3

Please sign in to comment.