Skip to content

Commit

Permalink
Merge branch 'main' into met-657-prisma-generated-type-names
Browse files Browse the repository at this point in the history
  • Loading branch information
Natoandro committed Sep 23, 2024
2 parents 905c5db + c56803c commit db4cc1b
Show file tree
Hide file tree
Showing 52 changed files with 5,520 additions and 399 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
],
"python.languageServer": "Pylance",
"python.analysis.extraPaths": [
"typegraph/python"
"./src/typegraph/python"
],
"prettier.proseWrap": "never"
}
13 changes: 13 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ members = [
"src/typegate/standalone",
"src/typegraph/core",
"src/xtask",
"src/substantial"
]

exclude = [
Expand All @@ -28,6 +29,7 @@ edition = "2021"
# internal crates
mt_deno = { path = "src/mt_deno/" }
common = { path = "src/common/" }
substantial = { path = "src/substantial/" }
metagen = { path = "src/metagen/" }
typegate_engine = { path = "src/typegate/engine" }

Expand Down
231 changes: 231 additions & 0 deletions docs/metatype.dev/blog/2024-08-26-python-on-webassembly/index.mdx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ You need to add the secrets `HOST` and `NAMESPACE` under your typegraph name ins
<summary>metatype.yaml</summary>

```yaml
typegates:
typegate:
dev:
url: "http://localhost:7890"
username: admin
Expand Down
3 changes: 3 additions & 0 deletions docs/metatype.dev/static/images/wasi_vfs_python_and_rust.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ sandboxed
Infisical
Zsh
WASI
[wW]asm
monorepos?
Github
CPython
sandboxing
POSIX
JIT
26 changes: 23 additions & 3 deletions src/common/src/typegraph/runtimes/substantial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,42 @@ use std::path::PathBuf;

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct RedisConfig {
pub host: String,
pub port: u16,
}

#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum SubstantialBackend {
Fs,
Memory,
Redis(RedisConfig),
}

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct SubstantialRuntimeData {
pub endpoint: String,
pub basic_auth_secret: Option<String>,
pub backend: SubstantialBackend,
}

#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "lowercase")]
pub enum WorkflowKind {
Python,
Deno,
}

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct WorkflowMatData {
pub name: String,
pub file: String,
pub file: PathBuf,
pub kind: WorkflowKind,
pub deps: Vec<PathBuf>,
}

#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ModuleMatData {
pub entry_point: PathBuf,
pub deps: Vec<PathBuf>,
}
15 changes: 15 additions & 0 deletions src/substantial/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "substantial"
edition.workspace = true
version.workspace = true

[dependencies]
anyhow.workspace = true
chrono = "0.4.38"
serde.workspace = true
serde_json.workspace = true

protobuf = "3.5.1"

[dev-dependencies]
tokio = { workspace = true, features =["full"] }
7 changes: 7 additions & 0 deletions src/substantial/proto-gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -eux

# https://github.com/protocolbuffers/protobuf/issues/13346

# must be in sync with substantial/Cargo.toml protobuf
cargo install protobuf-codegen
protoc -I . --rust_out=src/protocol protocol/*
50 changes: 50 additions & 0 deletions src/substantial/protocol/events.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
syntax = "proto3";

package substantial.protos.events;

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

message Start {
google.protobuf.Struct kwargs = 1;
}

message Save {
uint32 id = 1;
string value = 2;
int32 counter = 3;
}

message Sleep {
uint32 id = 1;
google.protobuf.Timestamp start = 2;
google.protobuf.Timestamp end = 3;
}

message Send {
string name = 1;
string value = 2;
}

message Stop {
oneof result {
string ok = 1;
string err = 2;
}
}

message Event {
google.protobuf.Timestamp at = 1;
oneof of {
Start start = 10;
Save save = 11;
Sleep sleep = 12;
Send send = 13;
Stop stop = 14;
}
};

message Records {
string run_id = 1;
repeated Event events = 2;
}
27 changes: 27 additions & 0 deletions src/substantial/protocol/metadata.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
syntax = "proto3";

package substantial.protos.metadata;

import "google/protobuf/timestamp.proto";

message Info {
string message = 1;
}
message Error {
string message = 1;
string stack = 2;
string type = 3;
}

message Metadata {
google.protobuf.Timestamp at = 1;
oneof of {
Info info = 10;
Error error = 11;
}
};

message Records {
string run_id = 1;
repeated Metadata metadata = 2;
}
Loading

0 comments on commit db4cc1b

Please sign in to comment.