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

feat: wasm worker manager #966

Merged
merged 36 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cfa9b01
feat: worker pooling
Natoandro Jan 15, 2025
3d77943
feat: min worker count
Natoandro Jan 15, 2025
7e4462e
timeout
Natoandro Jan 15, 2025
9be7ee4
refactor: pooling.ts
Natoandro Jan 16, 2025
ad8e667
feat: wait queue without timeout
Natoandro Jan 16, 2025
7838471
test: simple wait queue
Natoandro Jan 16, 2025
6487117
test: timeout
Natoandro Jan 16, 2025
94e9926
fix ajv version
Natoandro Jan 16, 2025
d57b4ea
fix tests
Natoandro Jan 16, 2025
2c4e0e2
fix
Natoandro Jan 17, 2025
4389e57
Merge branch 'main' into met-806-worker-pooling
Natoandro Jan 17, 2025
4f120b4
update
Natoandro Jan 20, 2025
b548328
Merge branch 'main' into met-806-worker-pooling
Natoandro Jan 20, 2025
ebf7188
bump to 0.5.1-rc.0
Natoandro Jan 20, 2025
49c5d1f
move all pooling relatd codes in pooling.ts
Natoandro Jan 21, 2025
577ed2a
shared pool
Natoandro Jan 21, 2025
348c359
lazy pool
Natoandro Jan 21, 2025
16a91dc
configuration variables
Natoandro Jan 21, 2025
4457e63
update docs
Natoandro Jan 22, 2025
faede60
wip: was worker management
luckasRanarison Jan 22, 2025
10f46df
fix pre-commit
Natoandro Jan 22, 2025
a4e178e
index on met-805-wasm-worker-manager: faede60a7 wip: was worker manag…
luckasRanarison Jan 23, 2025
415ebfb
On met-805-wasm-worker-manager: wip worker
luckasRanarison Jan 23, 2025
459dde5
wip: worker hostcall
luckasRanarison Jan 23, 2025
6be874a
feat: wasm worker manager
luckasRanarison Jan 24, 2025
b523445
Merge branch 'met-806-worker-pooling' into met-805-wasm-worker-manager
luckasRanarison Jan 24, 2025
93166df
Merge commit '415ebfb1f' into met-805-wasm-worker-manager
luckasRanarison Jan 26, 2025
7c860a4
fix: python tests
luckasRanarison Jan 27, 2025
30bb884
fix: pooling test
luckasRanarison Jan 27, 2025
39358a4
Merge branch 'main' into met-805-wasm-worker-manager
luckasRanarison Jan 28, 2025
4b8e000
fix: wit destroy handling
luckasRanarison Jan 28, 2025
3498852
fix: cleanup
luckasRanarison Jan 28, 2025
6a61cce
fix: docs & more cleanups
luckasRanarison Jan 28, 2025
6ff2bcd
fix: python tests
luckasRanarison Jan 28, 2025
2bc7721
fix: pooling cancelation
luckasRanarison Jan 29, 2025
af729a7
fix: make timer cleanup explicit
luckasRanarison Jan 29, 2025
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
Prev Previous commit
Next Next commit
bump to 0.5.1-rc.0
Natoandro committed Jan 20, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ebf718885a0522f120bd1bce799d98e40ea711a4
24 changes: 12 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ exclude = [
]

[workspace.package]
version = "0.5.0"
version = "0.5.1-rc.0"
edition = "2021"

[workspace.dependencies]
122 changes: 122 additions & 0 deletions deno.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/templates/deno/api/example.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Policy, t, typegraph } from "jsr:@typegraph/[email protected]";
import { PythonRuntime } from "jsr:@typegraph/[email protected]/runtimes/python";
import { DenoRuntime } from "jsr:@typegraph/[email protected]/runtimes/deno";
import { Policy, t, typegraph } from "jsr:@typegraph/[email protected].1-rc.0";
import { PythonRuntime } from "jsr:@typegraph/[email protected].1-rc.0/runtimes/python";
import { DenoRuntime } from "jsr:@typegraph/[email protected].1-rc.0/runtimes/deno";

await typegraph("example", (g) => {
const pub = Policy.public();
2 changes: 1 addition & 1 deletion examples/templates/deno/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.5.0
image: ghcr.io/metatypedev/typegate:v0.5.1-rc.0
restart: always
ports:
- "7890:7890"
2 changes: 1 addition & 1 deletion examples/templates/node/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.5.0
image: ghcr.io/metatypedev/typegate:v0.5.1-rc.0
restart: always
ports:
- "7890:7890"
2 changes: 1 addition & 1 deletion examples/templates/node/package.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"dev": "MCLI_LOADER_CMD='npm x tsx' meta dev"
},
"dependencies": {
"@typegraph/sdk": "^0.5.0"
"@typegraph/sdk": "^0.5.1-rc.0"
},
"devDependencies": {
"tsx": "^3.13.0",
2 changes: 1 addition & 1 deletion examples/templates/python/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.5.0
image: ghcr.io/metatypedev/typegate:v0.5.1-rc.0
restart: always
ports:
- "7890:7890"
4 changes: 2 additions & 2 deletions examples/templates/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.poetry]
name = "example"
version = "0.5.0"
version = "0.5.1-rc.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
typegraph = "0.5.0"
typegraph = "0.5.1-rc.0"

[build-system]
requires = ["poetry-core"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

[tool.poetry]
name = "metatype"
version = "0.5.0"
version = "0.5.1-rc.0"
description = ""
authors = []

2 changes: 1 addition & 1 deletion src/pyrt_wit_wire/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyrt_wit_wire"
version = "0.5.0"
version = "0.5.1-rc.0"
description = "Wasm component implementing the PythonRuntime host using wit_wire protocol."
license = "MPL-2.0"
readme = "README.md"
2 changes: 1 addition & 1 deletion src/typegate/src/runtimes/wit_wire/mod.ts
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import { getLogger } from "../../log.ts";

const logger = getLogger(import.meta);

const METATYPE_VERSION = "0.5.0";
const METATYPE_VERSION = "0.5.1-rc.0";

export class WitWireMessenger {
static async init(
2 changes: 1 addition & 1 deletion src/typegraph/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "typegraph_core"
version = "0.5.0"
version = "0.5.1-rc.0"
edition = "2021"

[lib]
2 changes: 1 addition & 1 deletion src/typegraph/core/src/global_store.rs
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ impl Store {

thread_local! {
pub static STORE: RefCell<Store> = RefCell::new(Store::new());
pub static SDK_VERSION: String = "0.5.0".to_owned();
pub static SDK_VERSION: String = "0.5.1-rc.0".to_owned();
}

fn with_store<T, F: FnOnce(&Store) -> T>(f: F) -> T {
2 changes: 1 addition & 1 deletion src/typegraph/deno/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typegraph/sdk",
"version": "0.5.0",
"version": "0.5.1-rc.0",
"publish": {
"exclude": [
"!src/gen",
2 changes: 1 addition & 1 deletion src/typegraph/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "typegraph"
version = "0.5.0"
version = "0.5.1-rc.0"
description = "Declarative API development platform. Build backend components with WASM, Typescript and Python, no matter where and how your (legacy) systems are."
authors = ["Metatype Contributors <[email protected]>"]
license = "MPL-2.0"
2 changes: 1 addition & 1 deletion src/typegraph/python/typegraph/__init__.py
Original file line number Diff line number Diff line change
@@ -5,4 +5,4 @@
from typegraph.policy import Policy # noqa
from typegraph import effects as fx # noqa

version = "0.5.0"
version = "0.5.1-rc.0"
2 changes: 1 addition & 1 deletion src/xtask/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xtask"
version = "0.5.0"
version = "0.5.1-rc.0"
edition = "2021"

# this allows us to exclude the rust files
1 change: 0 additions & 1 deletion tests/e2e/published/sdk_test.ts
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ for (const version of previousVersions) {
async teardown() {
await testConfig.clearSyncData();
},
ignore: version === LATEST_RELEASE_VERSION,
},
async (t) => {
const { publishedBin, examplesDir } = await downloadSteps(t, version);
4 changes: 2 additions & 2 deletions tests/metagen/__snapshots__/metagen_test.ts.snap
Original file line number Diff line number Diff line change
@@ -454,7 +454,7 @@ impl Router {
}

pub fn init(&self, args: InitArgs) -> Result<InitResponse, InitError> {
static MT_VERSION: &str = "0.5.0";
static MT_VERSION: &str = "0.5.1-rc.0";
if args.metatype_version != MT_VERSION {
return Err(InitError::VersionMismatch(MT_VERSION.into()));
}
@@ -1253,7 +1253,7 @@ impl Router {
}

pub fn init(&self, args: InitArgs) -> Result<InitResponse, InitError> {
static MT_VERSION: &str = "0.5.0";
static MT_VERSION: &str = "0.5.1-rc.0";
if args.metatype_version != MT_VERSION {
return Err(InitError::VersionMismatch(MT_VERSION.into()));
}
2 changes: 1 addition & 1 deletion tests/metagen/typegraphs/sample/rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sample_client"
edition = "2021"
version = "0.5.0"
version = "0.5.1-rc.0"

[dependencies]
metagen-client.workspace = true
2 changes: 1 addition & 1 deletion tests/metagen/typegraphs/sample/rs_upload/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sample_client_upload"
edition = "2021"
version = "0.5.0"
version = "0.5.1-rc.0"

[dependencies]
metagen-client.workspace = true
2 changes: 1 addition & 1 deletion tests/runtimes/wasm_reflected/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust"
version = "0.5.0"
version = "0.5.1-rc.0"
edition = "2021"

[lib]
6 changes: 3 additions & 3 deletions tools/consts.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

export const CURRENT_VERSION = "0.5.0";
export const LATEST_RELEASE_VERSION = "0.4.10";
export const LATEST_PRE_RELEASE_VERSION = "0.5.0-rc.9";
export const CURRENT_VERSION = "0.5.1-rc.0";
export const LATEST_RELEASE_VERSION = "0.5.0";
export const LATEST_PRE_RELEASE_VERSION = null;
export const GHJK_VERSION = "v0.2.1";
export const GHJK_ACTION_VERSION = "318209a9d215f70716a4ac89dbeb9653a2deb8bc";
export const RUST_VERSION = "1.80.1";
9 changes: 5 additions & 4 deletions tools/tasks/lock.ts
Original file line number Diff line number Diff line change
@@ -65,15 +65,16 @@ export function validateVersions() {
const latestRelease = semver.parse(consts.LATEST_RELEASE_VERSION);
const prerelease = currentVersion.prerelease ?? [];
const isPreRelease = prerelease.length > 0;
const latestPreRelease = isPreRelease
? semver.parse(consts.LATEST_PRE_RELEASE_VERSION)
: null;
const latestPreRelease =
isPreRelease && consts.LATEST_PRE_RELEASE_VERSION != null
? semver.parse(consts.LATEST_PRE_RELEASE_VERSION)
: null;

if (!isPreRelease || (isPreRelease && prerelease[1] == 0)) {
assert(latestPreRelease == null, "expected no latest pre-release version");
}

if (isPreRelease) {
if (latestPreRelease) {
assert(
semver.greaterThan(currentVersion, latestPreRelease!),
"expected current version to be greater than latest pre-release version",