-
Notifications
You must be signed in to change notification settings - Fork 13
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
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 0048d19
wip(SDK core): support globs deno-runtime
destifo 3ceefa2
Merge branch 'main' of https://github.com/metatypedev/metatype into u…
destifo 0051a0b
wip(Core-SDK): globs and dirs for deno-rt and python-rt
destifo 3c9fe2d
wip(core SDK): debug print meta artifacts
destifo 71494f3
chore(test): prepare python_rt and deno_rt tests
destifo 0208e04
Merge branch 'main' into upload/globs-and-dirs
Natoandro c271083
wip: change t.engine impl to run ts tg from shell
destifo 9759f6c
chore: bump metatype version to 0.4.1-0
destifo 8c1dbb9
wip(test): add python engine init from shell
destifo cfd9384
feat(test): add ts SDK tg engine init from shell
destifo 9efe5e1
chore(test): update existing tests to shell based
destifo 6fff657
chore(tests): update existing tests to shell based and pass secrets t…
destifo 9132b45
chore(tests): update existing tests to shell based
destifo 29b1a11
chore(test): update existing tests to shell based engine
destifo e16477e
chore(test): update existing tests to shell based engine
destifo 8b966d0
fix(tests): fix failing tests
destifo 5051509
fix(tests): fix failing tests
destifo 7b2bc22
create migrations
destifo 6842c98
Merge branch 'main' of https://github.com/metatypedev/metatype into m…
destifo 02fa506
chore(tests): update tests to shell based
destifo 83693f6
chore(tests): fix failing prisma tests
destifo b29053c
Merge branch 'main' of https://github.com/metatypedev/metatype into u…
destifo 058b51a
wip(SDK): add post-process logs in typegraph SDK
destifo bf3fa39
chore: add debug print to expand_path_host call
destifo 1d105ae
feat(meta-test): assign unique tempDirs for typegates in metatest, ad…
destifo 2267f6f
feat(meta-test): read deploy params from env var
destifo 233bc8f
chore: address comments
destifo 9c454f8
chore(tests): add glob and dir tests for python runtime
destifo 8e6762a
chore: address comments
destifo b27ee6f
chore(core-SDK): add glob and dir support, add tests
destifo e758108
Merge branch 'main' into upload/globs-and-dirs
destifo 209cfa5
chore(test): remove duplicate test
destifo 68cc5af
chore: remove debug print
destifo bdad769
fix(tests): fix failing tests
destifo 1d825c8
chore(SDK): move expand_glob to the core SDK
destifo 7202848
feat: add multi-typegraph in a single file support in metaTest
destifo c8914e9
chore: address comments
destifo 121833a
Merge branch 'main' of https://github.com/metatypedev/metatype into m…
destifo 3d29a33
Merge branch 'main' into upload/globs-and-dirs
destifo 6e3932b
Merge branch 'main' into upload/globs-and-dirs
destifo e25e0f3
chore(core SDK): better error logs
destifo e5dc481
Merge branch 'main' into upload/globs-and-dirs
destifo 67ac1e8
Merge branch 'main' of https://github.com/metatypedev/metatype into m…
destifo 17b3f52
fix(test): fix import:
destifo b0fe14e
Merge branch 'meta-test/engine' of https://github.com/metatypedev/met…
destifo f30e190
chore(tests): update tests
destifo 05b2b34
Merge branch 'main' into upload/globs-and-dirs
destifo 8f5e188
fix: fix test path
destifo e8217fa
chore(tests): move sync tests under one file and bucket name.
destifo 29125dd
chore: remove unnecessary line
destifo 405ba02
fix: fix tg s3 keyon TG store
destifo dd7d41b
Merge branch 'main' into upload/globs-and-dirs
destifo 847c3dd
chore: delete empty readme
destifo 32278cf
Merge branch 'upload/globs-and-dirs' of https://github.com/metatypede…
destifo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
}); | ||
}); | ||
destifo marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.