Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: publish docker images for wasm64 #633

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion dev-cli/container/src/node/apply-metering.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// this step will need to be invoked after the wasm file is compiled and it will load it and add
// the metering functions to the wasm and replace it.
const fs = require('fs')
const metering = require('wasm-metering')
const metering = require('@permaweb/wasm-metering')
const wasm = fs.readFileSync('/src/process.wasm')
fs.writeFileSync('/src/process.wasm', metering.meterWASM(wasm))
69 changes: 49 additions & 20 deletions dev-cli/container/src/node/package-lock.json

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

6 changes: 3 additions & 3 deletions dev-cli/container/src/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"dependencies": {
"@irys/sdk": "^0.1.6",
"@permaweb/aoconnect": "0.0.42",
"@permaweb/wasm-metering": "^0.2.2",
"arweave": "^1.14.4",
"mime-types": "^2.1.35",
"url-join": "^5.0.0",
"warp-arbundles": "^1.0.4",
"wasm-metering": "permaweb/wasm-metering#v0.2.2"
"warp-arbundles": "^1.0.4"
},
"engines": {
"node": ">=18"
}
}
}
2 changes: 1 addition & 1 deletion dev-cli/src/versions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
export const VERSION = {
"CLI": "0.0.54",
"CLI": "0.0.53",
"IMAGE": "0.0.34"
}
2 changes: 1 addition & 1 deletion loader/src/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module.exports = async function (binary, options) {
instance = await Emscripten(binary, options)
} else if (options.format === "wasm32-unknown-emscripten2") {
instance = await Emscripten2(binary, options)
} else if (options.format === "wasm64-unknown-emscripten") {
} else if (options.format === "wasm64-unknown-emscripten-draft_2024_02_15") {
instance = await Wasm64Emscripten(binary, options)
}

Expand Down
18 changes: 9 additions & 9 deletions loader/test/wasm64.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const wasmBinary = fs.readFileSync('./test/process64/process.wasm')

describe('loader', async () => {
it('load wasm and evaluate message', async () => {
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten' })
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten-draft_2024_02_15' })
const mainResult = await handle(null,
{
Owner: 'tom',
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('loader', async () => {
})

it('should load previous memory', async () => {
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten' })
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten-draft_2024_02_15' })
const result = await handle(null,
{ Owner: 'tom', Target: '1', Tags: [{ name: 'Action', value: 'inc' }], Data: '' },
{ Process: { Id: '1', Tags: [] } }
Expand All @@ -101,7 +101,7 @@ describe('loader', async () => {
})

it('should refill the gas on every invocation', async () => {
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten' })
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten-draft_2024_02_15' })

const result = await handle(null,
{ Owner: 'tom', Target: '1', Tags: [{ name: 'Action', value: 'inc' }], Data: '' },
Expand All @@ -122,7 +122,7 @@ describe('loader', async () => {
})

it.skip('should run out of gas', async () => {
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten', computeLimit: 9_000_000_000 })
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten-draft_2024_02_15', computeLimit: 9_000_000_000 })
try {
await handle(null,
{ Owner: 'tom', Target: '1', Tags: [{ name: 'Action', value: 'foo' }], Data: '' },
Expand All @@ -140,7 +140,7 @@ describe('loader', async () => {
it('should resize the initial heap to accomodate the larger incoming buffer', async () => {
const wasmBinary = fs.readFileSync('./test/aos64/process.wasm')

const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten', computeLimit: 9_000_000_000_000 })
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten-draft_2024_02_15', computeLimit: 9_000_000_000_000 })
const mainResult = handle(null,
{
Owner: 'tom',
Expand Down Expand Up @@ -171,7 +171,7 @@ describe('loader', async () => {
// assert.equal(mainResult.GasUsed, 463918939)
assert.ok(true)

const nextHandle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten' })
const nextHandle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten-draft_2024_02_15' })
const nextResult = nextHandle(mainResult.Memory,
{
Owner: 'tom',
Expand All @@ -190,7 +190,7 @@ describe('loader', async () => {
})

it('should get deterministic date', async () => {
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten' })
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten-draft_2024_02_15' })

const result = await handle(null,
{ Owner: 'tom', Target: '1', Tags: [{ name: 'Action', value: 'Date' }], Data: '' },
Expand All @@ -211,7 +211,7 @@ describe('loader', async () => {
})

it('should get deterministic random numbers', async () => {
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten' })
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten-draft_2024_02_15' })

const result = await handle(null,
{ Owner: 'tom', Target: '1', Tags: [{ name: 'Action', value: 'Random' }], Data: '' },
Expand All @@ -232,7 +232,7 @@ describe('loader', async () => {
})

it('should not list files', async () => {
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten' })
const handle = await AoLoader(wasmBinary, { format: 'wasm64-unknown-emscripten-draft_2024_02_15' })
try {
// eslint-disable-next-line
const result = await handle(null,
Expand Down