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

Issue 357: Nodejs ReaderGroup and EventReader #358

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
60 changes: 60 additions & 0 deletions .github/workflows/nodejs_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master

name: nodejstest

jobs:
test_jest:
name: run-jest
runs-on: ubuntu-20.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "11" # The JDK version to make available on the path.
- name: Download and Run Pravega standalone
run: |
wget https://github.com/pravega/pravega/releases/download/v0.10.1/pravega-0.10.1.tgz
tar -xzvf pravega-0.10.1.tgz
pravega-0.10.1/bin/pravega-standalone > pravega.log 2>&1 &
sleep 20 && echo "Started standalone"
- name: Set up Nodejs
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Install modules
working-directory: ./nodejs
run: npm i
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install pravega
run: pip install pravega
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Test
working-directory: ./nodejs
run: |
node --loader ts-node/esm tests/stream_manager.ts
python3 tests/write.py
node --loader ts-node/esm tests/stream_reader.ts
- name: Upload Pravega standalone logs
uses: actions/upload-artifact@v2
if: always()
with:
name: pravega-standalone-log
path: pravega.log
retention-days: 5
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ pravega-*.tgz
__pycache__/
book/book
html/
python_binding/.tox/
python_binding/.tox/

# These are temp files of Nodejs bindings
nodejs/target
nodejs/index.node
**/node_modules
**/.DS_Store
npm-debug.log*
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ members = [
"config",
"examples",
"macros",
"pravegactl"
"pravegactl",
"nodejs"
]

[dependencies]
Expand Down
8 changes: 8 additions & 0 deletions nodejs/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "avoid",
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 120,
"endOfLine": "auto"
}
35 changes: 35 additions & 0 deletions nodejs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
authors = ["Pravega Community"]
categories = ["network-programming"]
description = "Pravega client"
edition = "2018"
exclude = ["index.node"]
keywords = ["streaming", "client", "pravega"]
license = "Apache-2.0"
name = "pravega_client"
readme = "README.md"
repository = "https://github.com/pravega/pravega-client-rust"
version = "0.2.0"

[lib]
crate-type = ["cdylib"]

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

[dependencies]
derive-new = "0.5"
futures = "0.3"
pravega-client = {path = "../", version = "0.3"}
pravega-client-config = {path = "../config", version = "0.3"}
pravega-client-retry = {path = "../retry", version = "0.3"}
pravega-client-shared = {path = "../shared", version = "0.3"}
pravega-controller-client = {path = "../controller-client", version = "0.3"}
tokio = "1.1"
tracing = "0.1.17"
tracing-futures = "0.2.4"
tracing-subscriber = "0.2.2"

[dependencies.neon]
default-features = false
features = ["napi-6", "promise-api", "channel-api"]
version = "0.10.0"
11 changes: 11 additions & 0 deletions nodejs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Pravega Nodejs client.

This project provides a way to interact with [Pravega](http://pravega.io) with a Nodejs client.

Pravega is an open source distributed storage service implementing Streams. It offers Stream as the main primitive for the foundation of reliable storage systems: a high-performance, durable, elastic, and unlimited append-only byte stream with strict ordering and consistency.

This project supports interaction with Pravega for Nodejs versions 16.

Only `StreamManager` is ready for use now. Example usage can be found in `./tests` and you may run it with `node --loader ts-node/esm tests/stream_manager.ts`.

Everything else is WORKING IN PROGRESS!
Loading