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

Add wasm version of jsonnet #313

Closed
wants to merge 84 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
f736d07
Metadata Enrichment (#200)
ArthSrivastava Aug 27, 2023
a2e6e13
Google Java Format
Aug 27, 2023
bdd019f
Prompt A/B Testing | Non-Null Checks For toJson() | Refining PgVector…
EmadHanif01 Aug 27, 2023
1ee8802
Google Java Format
Aug 27, 2023
9c42caf
Update README.md
sandys Aug 30, 2023
e0fc900
Google Java Format
Aug 30, 2023
60e1ad9
Update README.md
sandys Aug 30, 2023
d7a6979
Update README.md
sandys Aug 30, 2023
6fe86df
Update README.md
sandys Aug 30, 2023
24175b2
React Chain Fix (#204)
ArthSrivastava Aug 30, 2023
42f4a45
Google Java Format
Aug 30, 2023
bfb11cb
Update README.md
sandys Aug 31, 2023
3eb4df1
Update README.md
sandys Aug 31, 2023
f3477cf
Update README.md
sandys Sep 1, 2023
c454dfa
Update README.md
sandys Sep 2, 2023
375f78b
Parallelization & Metadata Enrichment Fixes (#207)
ArthSrivastava Sep 2, 2023
2b5c778
Google Java Format
Sep 2, 2023
9c2cab9
ArkRequest ~ Fixing JsonParsing (#209)
EmadHanif01 Sep 2, 2023
fed9d3f
Google Java Format
Sep 2, 2023
0375e6c
Add parent pom and related works (#201)
robincakeellis Sep 2, 2023
89d1906
Google Java Format
Sep 2, 2023
c7719f3
Update BuildAndRun.yml
sandys Sep 2, 2023
a654eeb
Update pr-build.yml
sandys Sep 3, 2023
0f0e324
Robin code quality (#206)
robincakeellis Sep 3, 2023
d6b8803
Google Java Format
Sep 3, 2023
2110ef2
Fix stall issue with Retrofit OKHttp interceptor (#210)
robincakeellis Sep 3, 2023
4fc7e72
Google Java Format
Sep 3, 2023
889cd63
Query with metadata fix (#211)
ArthSrivastava Sep 3, 2023
1ce01cd
Google Java Format
Sep 3, 2023
7b6daec
Refactored and Fixed Parallel Upsert in PostgreSQL Embeddings (#213)
EmadHanif01 Sep 3, 2023
7f48d4a
Google Java Format
Sep 3, 2023
f52a23c
[ATTENTION] tests for Postgres client with potential issues (#215)
robincakeellis Sep 4, 2023
0353962
Google Java Format
Sep 4, 2023
9226009
Spring Boot update (#216)
robincakeellis Sep 4, 2023
05448b7
Google Java Format
Sep 4, 2023
d222eeb
Added test cases in edgechain-app (#221)
hemantDwivedi Sep 9, 2023
6425143
Query with 'n' embeddings | Query with Rank Reciprocal Function | Exa…
EmadHanif01 Sep 11, 2023
9fa2052
Google Java Format
Sep 11, 2023
f786cad
[Fix] QueryRRF Response (#223)
EmadHanif01 Sep 12, 2023
eb61274
Google Java Format
Sep 12, 2023
6754f2b
Tuning QueryRRF (#224)
EmadHanif01 Sep 13, 2023
2969024
Google Java Format
Sep 13, 2023
29c94b2
FIXED WikiClientTest (#228)
hemantDwivedi Sep 15, 2023
7c1727b
Google Java Format
Sep 15, 2023
36d0c37
Batch Insertion into Join Table (#229)
ArthSrivastava Sep 16, 2023
bebe4b4
Google Java Format
Sep 16, 2023
39ab0c7
added test cases for pineconeclient (#230)
hemantDwivedi Sep 18, 2023
c7f0caa
Google Java Format
Sep 18, 2023
1f5dac5
Update README.md
sandys Sep 20, 2023
21bf6d4
Update README.md
sandys Sep 20, 2023
d50d5ed
Query RRF With 'n' Embeddings (#231)
EmadHanif01 Sep 26, 2023
e4a4b02
Google Java Format
Sep 26, 2023
86b91e7
Update README.md
sandys Sep 30, 2023
e8162ff
Embedding <> Database | Airtable Integration | Context Reorder | Rest…
EmadHanif01 Sep 30, 2023
4cdea9c
Google Java Format
Sep 30, 2023
24ed94a
Fix Issue (#243)
EmadHanif01 Oct 1, 2023
effd742
Google Java Format
Oct 1, 2023
f6f813d
Update README.md
sandys Oct 4, 2023
e24c63b
Llama Implementationn. (#248)
hemantDwivedi Oct 6, 2023
1b63602
Google Java Format
Oct 6, 2023
24cf405
Get request (#255)
hemantDwivedi Oct 15, 2023
6b893a1
Google Java Format
Oct 15, 2023
d2e2465
add wasi modules for jsonnet with external vars
rahul007-bit Jan 18, 2024
51307fd
Merge branch 'ts' into ts
rahul007-bit Jan 18, 2024
1b1216b
Merge branch 'ts' of github.com:arakoodev/EdgeChains into ts
rahul007-bit Jan 27, 2024
b564c0f
merge ts with local
rahul007-bit Jan 27, 2024
33f5c94
Update dependencies, remove unused code, and add wasm version of jsonnet
rahul007-bit Jan 27, 2024
c83f892
update repo with ts branch
rahul007-bit Jan 28, 2024
9d16384
revamp wasm compilation and serve flow
rahul007-bit Feb 4, 2024
3bf3c0a
merge origin
rahul007-bit Feb 4, 2024
0aa97b4
fix the response Body
rahul007-bit Feb 9, 2024
e92f05a
simple working example of jsonnet
rahul007-bit Feb 17, 2024
da14f61
complete jsonnet implementaion at wasmtime
rahul007-bit Feb 17, 2024
4ebee3d
fix jsonnet_eval function
rahul007-bit Feb 18, 2024
94642a3
add support for ext_string
rahul007-bit Feb 18, 2024
f135a39
add docs in binding.rs
rahul007-bit Feb 18, 2024
37c475c
add docs to run function
rahul007-bit Feb 18, 2024
b03ff2c
fix http response at hyper side
rahul007-bit Feb 19, 2024
7d7fe97
working example for nodejs with jsonnet
rahul007-bit Feb 19, 2024
3070aeb
add readme to jsonnet library
rahul007-bit Feb 24, 2024
c87a7ff
update the workflow of webassembly
rahul007-bit Feb 27, 2024
bd96502
Merge branch 'arakoodev:ts' into wasm
rahul007-bit Feb 27, 2024
cb01798
add support for evaluateFile
rahul007-bit Feb 27, 2024
d39c4de
fix shims build and upload release
rahul007-bit Feb 29, 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
65 changes: 25 additions & 40 deletions .github/workflows/webassembly-pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- reopened
- synchronize
paths:
- 'JS/**'
- 'JS/wasm/**'

jobs:
changes:
Expand Down Expand Up @@ -50,52 +50,37 @@ jobs:
toolchain: stable
override: true

- name: Cache wasmjs-engine
- name: Cache Javy Core
uses: actions/cache@v2
with:
path: ./JS/wasm/crates/wasmjs-engine/target
key: wasmjs-engine
path: ./target
key: javy-core
restore-keys: |
wasmjs-engine
javy-core

- name: Check if wasmjs-engine is cached
id: wasmjs-engine-hit
- name: Check if Javy Core is cached
id: cache-hit
run: |
echo "cache-hit=$(test -d ./JS/wasm/crates/wasmjs-engine/target && echo true || echo false)" >> $GITHUB_OUTPUT
# echo "cache-hit=$(test -d ./target && echo true || echo false)" >> $GITHUB_OUTPUT
echo "cache-hit=$(test -d ./target && echo true || echo false)" >> $GITHUB_OUTPUT

- name: Build wasmjs-engine
if: steps.wasmjs-engine-hit.outputs.cache-hit != 'true'
working-directory: ./JS/wasm/crates/wasmjs-engine
- name: Build Javy Core
if:
working-directory: .
run: |
npm install -g @go-task/cli
task build

- name: Cache wasmjs-runtime
uses: actions/cache@v2
with:
path: ./JS/wasm/crates/wasmjs-runtime/target
key: wasmjs-runtime
restore-keys: |
wasmjs-runtime

- name: Check if wasmjs-runtime is cached
id: wasmjs-runtime-hit
make add build-cors
- name: Build CLI
working-directory: .
run: |
echo "cache-hit=$(test -d ./JS/wasm/crates/wasmjs-runtime/target && echo true || echo false)" >> $GITHUB_OUTPUT

- name: Build wasmjs-runtime
if: steps.wasmjs-runtime-hit.outputs.cache-hit != 'true'
working-directory: ./JS/wasm/crates/wasmjs-runtime
run: |
cargo build --release

- name: Build ec-wasmjs-hono
working-directory: ./JS/wasm/examples/ec-wasmjs-hono
make
- name: Build Jsonnet
working-directory: .
run: |
npm install
npm run build
make build-jsonnet
- name: Build Release Binary
run: cargo build --release

- name: Run ec-wasmjs-hono
working-directory: ./JS/wasm/crates/wasmjs-runtime
run: |
./target/release/wasmjs-runtime run ../../examples/ec-wasmjs-hono/bin
- name: Upload to GitHub Releases
uses: actions/upload-rust-binary-action@v1
with:
bin: your_binary_name
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ build/
.vscode/

### Node Modules ###
node_modules
node_modules

### rust ###
/target/
index.wasm
index.wit
Cargo.lock

.DS_Store
30 changes: 30 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[workspace]
members = [
"JS/wasm/crates/apis",
"JS/wasm/crates/arakoo-core",
"JS/wasm/crates/cli",
"JS/wasm/crates/serve",
"JS/wasm/types/jsonnet",
]
resolver = "2"

[workspace.package]
edition = "2021"
version = "0.0.1"

[workspace.dependencies]
wizer = "4.0.0"
wasmtime = "16"
wasmtime-wasi = "16"
wasi-common = "16"
javy = { version = "2.1.0" }
anyhow = "1.0.79"
once_cell = "1.19.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
[profile.release]
lto = true
opt-level = 's'

[profile.dev]
incremental = true
21 changes: 21 additions & 0 deletions JS/wasm/crates/apis/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "apis"
edition.workspace = true
version.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
console = []
random = ["dep:fastrand"]
stream_io = []
text_encoding = []

[dependencies]
anyhow = { workspace = true }
fastrand = { version = "2.0.1", optional = true }
javy = { workspace = true }
# wit-bindgen-rust = { git = "https://github.com/bytecodealliance/wit-bindgen", tag = "v0.2.0" }
tokio = "1.36.0"
serde = { workspace = true }
serde_json = { workspace = true }
12 changes: 12 additions & 0 deletions JS/wasm/crates/apis/src/api_config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// A configuration for APIs added in this crate.
///
/// Example usage:
/// ```
/// # use javy_apis::APIConfig;
/// let api_config = APIConfig::default();
/// ```
#[derive(Debug, Default)]
pub struct APIConfig {
#[cfg(feature = "console")]
pub(crate) console: crate::console::ConsoleConfig,
}
51 changes: 51 additions & 0 deletions JS/wasm/crates/apis/src/console/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
use std::io::{self, Write};

use crate::APIConfig;

/// A selection of possible destination streams for `console.log` and
/// `console.error`.
#[derive(Debug)]
pub enum LogStream {
/// The standard output stream.
StdOut,
/// The standard error stream.
StdErr,
}

impl LogStream {
pub(super) fn to_stream(&self) -> Box<dyn Write + 'static> {
match self {
Self::StdErr => Box::new(io::stderr()),
Self::StdOut => Box::new(io::stdout()),
}
}
}

#[derive(Debug)]
pub(crate) struct ConsoleConfig {
pub(super) log_stream: LogStream,
pub(super) error_stream: LogStream,
}

impl Default for ConsoleConfig {
fn default() -> Self {
Self {
log_stream: LogStream::StdOut,
error_stream: LogStream::StdErr,
}
}
}

impl APIConfig {
/// Sets the destination stream for `console.log`.
pub fn log_stream(&mut self, stream: LogStream) -> &mut Self {
self.console.log_stream = stream;
self
}

/// Sets the destination stream for `console.error`.
pub fn error_stream(&mut self, stream: LogStream) -> &mut Self {
self.console.error_stream = stream;
self
}
}
Loading
Loading