Skip to content

feat(SDK): add globs and dir support for artifact deps. #698

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

Merged
merged 55 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4653329
Squashed commit of the following:
destifo Apr 28, 2024
0048d19
wip(SDK core): support globs deno-runtime
destifo Apr 28, 2024
3ceefa2
Merge branch 'main' of https://github.com/metatypedev/metatype into u…
destifo Apr 30, 2024
0051a0b
wip(Core-SDK): globs and dirs for deno-rt and python-rt
destifo Apr 30, 2024
3c9fe2d
wip(core SDK): debug print meta artifacts
destifo May 2, 2024
71494f3
chore(test): prepare python_rt and deno_rt tests
destifo May 2, 2024
0208e04
Merge branch 'main' into upload/globs-and-dirs
Natoandro May 6, 2024
c271083
wip: change t.engine impl to run ts tg from shell
destifo May 10, 2024
9759f6c
chore: bump metatype version to 0.4.1-0
destifo May 12, 2024
8c1dbb9
wip(test): add python engine init from shell
destifo May 13, 2024
cfd9384
feat(test): add ts SDK tg engine init from shell
destifo May 13, 2024
9efe5e1
chore(test): update existing tests to shell based
destifo May 13, 2024
6fff657
chore(tests): update existing tests to shell based and pass secrets t…
destifo May 13, 2024
9132b45
chore(tests): update existing tests to shell based
destifo May 14, 2024
29b1a11
chore(test): update existing tests to shell based engine
destifo May 14, 2024
e16477e
chore(test): update existing tests to shell based engine
destifo May 14, 2024
8b966d0
fix(tests): fix failing tests
destifo May 14, 2024
5051509
fix(tests): fix failing tests
destifo May 14, 2024
7b2bc22
create migrations
destifo May 14, 2024
6842c98
Merge branch 'main' of https://github.com/metatypedev/metatype into m…
destifo May 15, 2024
02fa506
chore(tests): update tests to shell based
destifo May 15, 2024
83693f6
chore(tests): fix failing prisma tests
destifo May 15, 2024
b29053c
Merge branch 'main' of https://github.com/metatypedev/metatype into u…
destifo May 15, 2024
058b51a
wip(SDK): add post-process logs in typegraph SDK
destifo May 15, 2024
bf3fa39
chore: add debug print to expand_path_host call
destifo May 15, 2024
1d105ae
feat(meta-test): assign unique tempDirs for typegates in metatest, ad…
destifo May 16, 2024
2267f6f
feat(meta-test): read deploy params from env var
destifo May 16, 2024
233bc8f
chore: address comments
destifo May 16, 2024
9c454f8
chore(tests): add glob and dir tests for python runtime
destifo May 17, 2024
8e6762a
chore: address comments
destifo May 19, 2024
b27ee6f
chore(core-SDK): add glob and dir support, add tests
destifo May 19, 2024
e758108
Merge branch 'main' into upload/globs-and-dirs
destifo May 19, 2024
209cfa5
chore(test): remove duplicate test
destifo May 19, 2024
68cc5af
chore: remove debug print
destifo May 19, 2024
bdad769
fix(tests): fix failing tests
destifo May 20, 2024
1d825c8
chore(SDK): move expand_glob to the core SDK
destifo May 20, 2024
7202848
feat: add multi-typegraph in a single file support in metaTest
destifo May 21, 2024
c8914e9
chore: address comments
destifo May 21, 2024
121833a
Merge branch 'main' of https://github.com/metatypedev/metatype into m…
destifo May 21, 2024
3d29a33
Merge branch 'main' into upload/globs-and-dirs
destifo May 22, 2024
6e3932b
Merge branch 'main' into upload/globs-and-dirs
destifo May 23, 2024
e25e0f3
chore(core SDK): better error logs
destifo May 23, 2024
e5dc481
Merge branch 'main' into upload/globs-and-dirs
destifo May 23, 2024
67ac1e8
Merge branch 'main' of https://github.com/metatypedev/metatype into m…
destifo May 24, 2024
17b3f52
fix(test): fix import:
destifo May 24, 2024
b0fe14e
Merge branch 'meta-test/engine' of https://github.com/metatypedev/met…
destifo May 24, 2024
f30e190
chore(tests): update tests
destifo May 24, 2024
05b2b34
Merge branch 'main' into upload/globs-and-dirs
destifo May 26, 2024
8f5e188
fix: fix test path
destifo May 26, 2024
e8217fa
chore(tests): move sync tests under one file and bucket name.
destifo May 26, 2024
29125dd
chore: remove unnecessary line
destifo May 27, 2024
405ba02
fix: fix tg s3 keyon TG store
destifo May 27, 2024
dd7d41b
Merge branch 'main' into upload/globs-and-dirs
destifo May 27, 2024
847c3dd
chore: delete empty readme
destifo May 27, 2024
32278cf
Merge branch 'upload/globs-and-dirs' of https://github.com/metatypede…
destifo May 27, 2024
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
22 changes: 1 addition & 21 deletions .ghjk/lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "0",
"platform": "x86_64-linux",
"platform": "aarch64-darwin",
"moduleEntries": {
"ports": {
"version": "0",
Expand Down Expand Up @@ -432,7 +432,6 @@
"a12d1020fe585e5ea75d9a2035bdcbde8dd90044",
"4d1916871a40b6ac730709f7721f740df192c84d",
"4df902463d60efc5b8e760ea4899f6ab6df0f16e",
"88f6aa5ddb513712623d31a17096ea26286064da",
"185be72d02330f9b3dfa3d0791274feb958e119d",
"5549508f1f5eddf9cb2465f07cf0c7603dc0c849",
"5c041a4209ae50657ea5acacc26683688f2913a9",
Expand Down Expand Up @@ -856,25 +855,6 @@
},
"packageName": "node-gyp"
},
"88f6aa5ddb513712623d31a17096ea26286064da": {
"version": "v2.4.0",
"port": {
"ty": "denoWorker@v1",
"name": "mold_ghrel",
"platforms": [
"aarch64-linux",
"x86_64-linux"
],
"version": "0.1.0",
"deps": [
{
"name": "tar_aa"
}
],
"moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/423d38e/ports/mold.ts"
},
"replaceLd": false
},
"185be72d02330f9b3dfa3d0791274feb958e119d": {
"version": "3.8.18",
"port": {
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ jobs:
typegate/tests/utils/*.ts \
typegate/tests/runtimes/wasm/*.ts \
typegate/tests/runtimes/python_wasi/*.ts \
typegate/tests/runtimes/deno/*.ts \
dev/deps.ts \
dev/utils.ts
deno --unstable-worker-options --unstable-net coverage ./coverage --lcov > coverage.lcov
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

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

24 changes: 24 additions & 0 deletions typegate/tests/runtimes/deno/deno_dep.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
// SPDX-License-Identifier: Elastic-2.0

import { Policy, t, typegraph } from "@typegraph/sdk/index.js";
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";

export const denoDepTg = await typegraph({
name: "test_deno_dep",
}, (g: any) => {
const deno = new DenoRuntime();
const pub = Policy.public();

g.expose({
doAddition: deno.import(
t.struct({ a: t.float(), b: t.float() }),
t.float(),
{
module: "ts/dep/main.ts",
name: "doAddition",
deps: ["ts/dep/nested/dep.ts"],
},
).withPolicy(pub),
});
});
68 changes: 68 additions & 0 deletions typegate/tests/runtimes/deno/deno_globs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import os
import sys

from typegraph.gen.exports.core import (
ArtifactResolutionConfig,
MigrationAction,
MigrationConfig,
)
from typegraph.graph.shared_types import BasicAuth
from typegraph.graph.tg_deploy import TypegraphDeployParams, tg_deploy
from typegraph.graph.typegraph import Graph
from typegraph.policy import Policy
from typegraph.runtimes.deno import DenoRuntime

from typegraph import t, typegraph


@typegraph
def deno_globs(g: Graph):
deno = DenoRuntime()
public = Policy.public()

g.expose(
public,
test_glob=deno.import_(
t.struct({"a": t.float(), "b": t.float()}),
t.float(),
module="ts/dep/main.ts",
deps=["ts/*.ts"],
name="doAddition",
),
test_dir=deno.import_(
t.struct({"a": t.float(), "b": t.float()}),
t.float(),
module="ts/dep/main.ts",
deps=["ts/dep"],
name="doAddition",
),
)


cwd = sys.argv[1]
PORT = sys.argv[2]
gate = f"http://localhost:{PORT}"
auth = BasicAuth("admin", "password")

deno_tg = deno_globs()
deploy_result = tg_deploy(
deno_tg,
TypegraphDeployParams(
base_url=gate,
auth=auth,
typegraph_path=os.path.join(cwd, "deno_globs.py"),
artifacts_config=ArtifactResolutionConfig(
dir=cwd,
prefix=None,
disable_artifact_resolution=None,
codegen=None,
prisma_migration=MigrationConfig(
migration_dir="prisma-migrations",
global_action=MigrationAction(reset=False, create=True),
runtime_actions=None,
),
),
),
)

print(deploy_result.serialized)
Loading