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

Instance RPC functionality #1076

Draft
wants to merge 33 commits into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d422d4d
Refactored adapters out of STH
MichalCz Dec 14, 2023
ab294eb
Eslint fixes
MichalCz Dec 14, 2023
f364056
Add missing dependency
MichalCz Dec 14, 2023
6085a99
Add missing dependency ws
MichalCz Dec 14, 2023
fcfec67
Fix deps
MichalCz Dec 15, 2023
351cffb
Add empty tests for adapters
MichalCz Dec 15, 2023
890b641
Add pre-runner to docker dependencies
MichalCz Dec 15, 2023
fab1f1d
Fix after rebase
MichalCz Apr 4, 2024
4b45c95
Fix dockerode
MichalCz Oct 8, 2024
7844405
kube-client lazy load
MichalCz Oct 8, 2024
01a8cd5
Refactor adapter configs out of main config file
MichalCz Oct 9, 2024
c4e6307
Refactored configuration options out of general STH config.
MichalCz Oct 9, 2024
2d4649b
Eslint fixes
MichalCz Oct 9, 2024
a2495f7
Fix build issues
MichalCz Oct 9, 2024
70a7a2a
Fix runner build
MichalCz Oct 9, 2024
6034482
Fix workflow and update lockfiles
MichalCz Oct 9, 2024
835a0cd
Optimize adapter memory footprint
MichalCz Oct 11, 2024
8645aaa
Fixes to compile against platform
MichalCz Oct 13, 2024
cfb9986
Allow runner log level change
MichalCz Mar 19, 2024
2f1efcb
Add log level change to runners and CSI
MichalCz Mar 19, 2024
df15ca9
Fix eslint errors
MichalCz Mar 20, 2024
d3b0aa4
Fix reconnect logging and memleak
MichalCz Mar 20, 2024
969140d
Passthrough env to runner in development mode
MichalCz Mar 20, 2024
3fdc7f3
Fix refapps location
MichalCz Oct 14, 2024
ddce033
Fix detect operation
MichalCz Nov 11, 2024
48bf0f9
Merge remote-tracking branch 'origin/feat/improve-logging-levels' int…
MichalCz Nov 11, 2024
b09b476
Improve config construction - WIP
MichalCz Nov 16, 2024
32af242
Add ClientUtilsCustomAgent class for custom HTTP client handling
MichalCz Nov 17, 2024
266f61f
Eslint fixes
MichalCz Nov 17, 2024
29478bd
Fix schema validation typings (minor)
MichalCz Nov 20, 2024
7254eeb
Add Dockerfile and package.json for building Transform Hub packages q…
MichalCz Nov 20, 2024
c05b920
Fix deprecated packages
MichalCz Jan 8, 2025
eb22142
Initial implementation for the RPC service
MichalCz Jan 8, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/build-docker-runner-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: yarn install --ignore-engines --frozen-lockfile --prefer-offline

- name: Prebuild packages
run: scripts/run-script.js --scope packages/runner prebuild:docker
run: scripts/run-script.js -v --scope packages/runner prebuild:docker

- name: Build image
run: docker build -t scramjetorg/runner:$(git rev-parse HEAD) -f Dockerfile ../../
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-refapps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
node-version: ${{ inputs.node-version }}

- name: Install dependencies
run: yarn install --ignore-engines --frozen-lockfile --silent
run: yarn install --ignore-engines --frozen-lockfile --prefer-offline --silent

- name: Build refapps
run: yarn build:refapps

- name: Install pigz
run: sudo apt-get install pigz -y

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preinstall-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
key: ${{ runner.os }}-${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: yarn install --ignore-engines --frozen-lockfile
run: yarn install --ignore-engines --frozen-lockfile --prefer-offline --silent
2 changes: 1 addition & 1 deletion .github/workflows/security-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
node-version: ${{ inputs.node-version }}

- name: Install dependencies
run: yarn install --ignore-engines --frozen-lockfile
run: yarn install --ignore-engines --frozen-lockfile

- name: Checks for known security issues with the installed packages
run: yarn audit
2 changes: 1 addition & 1 deletion .github/workflows/test-bdd-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: dist-refapps-${{ github.event.pull_request.head.sha }}-${{ inputs.node-version }}.tar.gz

- name: Install pigz
run: sudo apt-get install pigz -y

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-bdd-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
uses: actions/download-artifact@v3
with:
name: dist-refapps-${{ github.event.pull_request.head.sha }}-${{ inputs.node-version }}.tar.gz

- name: Install pigz
run: sudo apt-get install pigz -y

- name: Unzip dist-${{ github.event.pull_request.head.sha }}-${{ inputs.node-version }}.tar.gz artifact
run: ls dist*tar.gz |xargs -n1 tar -I pigz -xf

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: ls dist*tar.gz |xargs -n1 tar -I pigz -xf

- name: Install dependencies
run: yarn install --ignore-engines --frozen-lockfile --cache-folder=$( $( dirname yarn cache dir ) )
run: yarn install --ignore-engines --frozen-lockfile --prefer-offline --silent

- name: Run packages tests
run: SCP_ENV_VALUE=GH_CI yarn test:packages-no-concurrent
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules

This file was deleted.

2 changes: 1 addition & 1 deletion bdd/features/e2e/E2E-002-stop.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Stop e2e tests
@ci-instance-node
Scenario: E2E-002 TC-001 API test - Send stop, sequence sends keepAlive, runner closes successfully
Given host is running
When sequence "../packages/can-keep-alive.tar.gz" loaded
When sequence "../refapps/can-keep-alive.tar.gz" loaded
And instance started with arguments "SEND_KEEPALIVE"
And wait for instance healthy is "true"
And get runner PID
Expand Down
2 changes: 1 addition & 1 deletion bdd/features/e2e/E2E-003-kill.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Kill e2e tests
@ci-instance-node
Scenario: E2E-003 TC-003 API test - Kill instance when it's not responding
Given host is running
When sequence "../packages/process-not-responding.tar.gz" loaded
When sequence "../refapps/process-not-responding.tar.gz" loaded
And instance started
And wait for instance healthy is "true"
And get runner PID
Expand Down
4 changes: 2 additions & 2 deletions bdd/features/e2e/E2E-007-host-client.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Test for host client used by sequences
@ci-api @cli
Scenario: E2E-007 TC-001 Test sequence with basic host client methods like getVersion(), getStatus(), etc.
Given I set config for local Hub
When I execute CLI with "seq send ../packages/js-hostclient-basic.tar.gz"
When I execute CLI with "seq send ../refapps/js-hostclient-basic.tar.gz"
When I execute CLI with "seq start -"
And wait for "3000" ms
When I execute CLI with "inst output -" without waiting for the end
Expand All @@ -18,7 +18,7 @@ Feature: Test for host client used by sequences
@ci-api @cli
Scenario: E2E-007 TC-002 Test Sequence that starts another Sequence
Given I set config for local Hub
When I execute CLI with "seq send ../packages/js-hostclient-basic.tar.gz"
When I execute CLI with "seq send ../refapps/js-hostclient-basic.tar.gz"
And I execute CLI with "seq info -"
And I get sequence id
Then I start "js-hostclient-start-seq" with the first sequence id
Expand Down
40 changes: 20 additions & 20 deletions bdd/features/e2e/E2E-010-cli.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Feature: CLI tests

@ci-api @cli
Scenario: E2E-010 TC-003 Test Sequence 'pack' option
When I execute CLI with "seq pack data/sequences/simple-stdio -o ../packages/simple-stdio.tar.gz"
Then I get location "../packages/simple-stdio.tar.gz" of compressed directory
When I execute CLI with "seq pack data/sequences/simple-stdio -o ../refapps/simple-stdio.tar.gz"
Then I get location "../refapps/simple-stdio.tar.gz" of compressed directory

@ci-api @cli
Scenario: E2E-010 TC-004 Test Sequence options
When I execute CLI with "seq --help"
When I execute CLI with "seq send ../packages/args-to-output.tar.gz"
When I execute CLI with "seq send ../packages/checksum-sequence.tar.gz"
When I execute CLI with "seq send ../packages/hello-alice-out.tar.gz"
When I execute CLI with "seq send ../refapps/args-to-output.tar.gz"
When I execute CLI with "seq send ../refapps/checksum-sequence.tar.gz"
When I execute CLI with "seq send ../refapps/hello-alice-out.tar.gz"
When I execute CLI with "seq info -"
When I execute CLI with "seq list"
When I execute CLI with "seq delete -"
Expand All @@ -47,8 +47,8 @@ Feature: CLI tests
@ci-api @cli
Scenario: E2E-010 TC-006 Test Sequence 'prune --force' option
Given I set config for local Hub
When I execute CLI with "seq send ../packages/checksum-sequence.tar.gz"
When I execute CLI with "seq send ../packages/csv-transform.tar.gz"
When I execute CLI with "seq send ../refapps/checksum-sequence.tar.gz"
When I execute CLI with "seq send ../refapps/csv-transform.tar.gz"
When I execute CLI with "seq list"
When I execute CLI with "seq start -"
When I execute CLI with "inst list"
Expand All @@ -59,7 +59,7 @@ Feature: CLI tests
@ci-api @cli
Scenario: E2E-010 TC-007 Test Instance options
When I execute CLI with "inst --help"
When I execute CLI with "seq send ../packages/csv-transform.tar.gz"
When I execute CLI with "seq send ../refapps/csv-transform.tar.gz"
When I execute CLI with "seq start -"
When I execute CLI with "inst info -"
When I execute CLI with "inst health -"
Expand All @@ -69,7 +69,7 @@ Feature: CLI tests

@ci-api @cli
Scenario: E2E-010 TC-008 Test Instances 'stop' option
When I execute CLI with "seq send ../packages/checksum-sequence.tar.gz"
When I execute CLI with "seq send ../refapps/checksum-sequence.tar.gz"
When I execute CLI with "seq start -"
When I execute CLI with "inst ls"
When I execute CLI with "inst stop - 3000"
Expand All @@ -80,7 +80,7 @@ Feature: CLI tests

@ci-api @cli
Scenario: E2E-010 TC-009 Get 404 on health endpoint for finished Instance
When I execute CLI with "seq send ../packages/js-inert-function.tar.gz"
When I execute CLI with "seq send ../refapps/js-inert-function.tar.gz"
When I execute CLI with "seq start -"
When I execute CLI with "inst health -"
And I wait for Instance to end
Expand All @@ -89,40 +89,40 @@ Feature: CLI tests

@ci-api @cli
Scenario: E2E-010 TC-010 Test Instance 'log' option
When I execute CLI with "seq send ../packages/js-inert-function.tar.gz"
When I execute CLI with "seq send ../refapps/js-inert-function.tar.gz"
When I execute CLI with "seq start -"
When I execute CLI with "inst log -" without waiting for the end
Then I confirm instance logs received

@ci-api @cli
Scenario: E2E-010 TC-011 Test Instance 'input' option
When I execute CLI with "seq deploy ../packages/checksum-sequence.tar.gz"
When I execute CLI with "seq deploy ../refapps/checksum-sequence.tar.gz"
When I execute CLI with "inst input - data/test-data/checksum.json"

@ci-api @cli
Scenario: E2E-010 TC-012 Test Instance 'input --end' option and confirm output received
When I execute CLI with "seq deploy ../packages/checksum-sequence.tar.gz"
When I execute CLI with "seq deploy ../refapps/checksum-sequence.tar.gz"
When I execute CLI with "inst input - data/test-data/checksum.json --end"
When I execute CLI with "inst output -"
Then I confirm data named "checksum" received

@ci-api @cli
Scenario: E2E-010 TC-013 Test Instance 'event' option with payload
When I execute CLI with "seq deploy ../packages/event-sequence-v2.tar.gz"
When I execute CLI with "seq deploy ../refapps/event-sequence-v2.tar.gz"
When I execute CLI with "inst event emit - test-event test message"
When I execute CLI with "inst event on - test-event-response"
Then I get event "test-event-response" with event message "\"message from sequence\"" from Instance

@ci-api @cli
Scenario: E2E-010 TC-013a Test Instance 'event' option without payload
When I execute CLI with "seq deploy ../packages/event-sequence-v2.tar.gz"
When I execute CLI with "seq deploy ../refapps/event-sequence-v2.tar.gz"
When I execute CLI with "inst event emit - test-event"
When I execute CLI with "inst event on - test-event-response"
Then I get event "test-event-response" with event message "\"message from sequence\"" from Instance

@ci-api @cli
Scenario: E2E-010 TC-014 Test Sequence 'start' with multiple JSON arguments
When I execute CLI with "seq send ../packages/args-to-output.tar.gz"
When I execute CLI with "seq send ../refapps/args-to-output.tar.gz"
When I execute CLI with "seq start - --args [\"Hello\",123,{\"abc\":456},[\"789\"]]"
When I execute CLI with "inst output -" without waiting for the end
Then I confirm data named "args-on-output" will be received
Expand All @@ -141,7 +141,7 @@ Feature: CLI tests

@ci-api @cli
Scenario: E2E-010 TC-017 Test Instance 'restart' option
When I execute CLI with "seq deploy ../packages/hello.tar.gz"
When I execute CLI with "seq deploy ../refapps/hello.tar.gz"
When I execute CLI with "inst restart -"
Then I confirm instance status is "killing"
When I execute CLI with "inst info -"
Expand All @@ -152,7 +152,7 @@ Feature: CLI tests
##
@ci-api @cli
Scenario: E2E-010 TC-018 Test Set instance id
When I execute CLI with "seq send ../packages/hello.tar.gz"
When I execute CLI with "seq send ../refapps/hello.tar.gz"
When I execute CLI with "seq start - --inst-id <instanceId>"
When I execute CLI with "inst ls"
Then I confirm instance id is: <instanceId>
Expand All @@ -172,14 +172,14 @@ Feature: CLI tests

@ci-api @cli
Scenario: E2E-010 TC-020 Test Start sequence with startup-config
When I execute CLI with "seq send ../packages/endless-names-output.tar.gz"
When I execute CLI with "seq send ../refapps/endless-names-output.tar.gz"
And I execute CLI with "seq start - --startup-config ../bdd/data/seq-startup-config.json"
And I execute CLI with "inst info -"
Then Instance info should contain provided parameters in "seq-startup-config.json"

@ci-api @cli
Scenario: E2E-010 TC-021 Test Start sequence in python with startup-config
When I execute CLI with "seq send ../packages/python-weather-args.tar.gz"
When I execute CLI with "seq send ../refapps/python-weather-args.tar.gz"
And I execute CLI with "seq start - --startup-config ../bdd/data/python-weather-startup-config.json"
And I execute CLI with "inst info -"
Then Instance info should contain provided parameters in "python-weather-startup-config.json"
8 changes: 4 additions & 4 deletions bdd/features/e2e/E2E-011-cli-topic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This feature checks topic functionalities over CLI

@ci-topic @cli
Scenario: E2E-011 TC-002 Instance to API
When I execute CLI with "seq send ../packages/endless-names-output.tar.gz"
When I execute CLI with "seq send ../refapps/endless-names-output.tar.gz"
When I execute CLI with "seq start -"
Then I execute CLI with "topic get names" without waiting for the end
Then I confirm data named "endless-names-10" will be received
Expand All @@ -21,7 +21,7 @@ This feature checks topic functionalities over CLI
Scenario: E2E-011 TC-003 API to Instance
# Given I set config for local Hub
When I execute CLI with "topic send avengers data/data.json" without waiting for the end
When I execute CLI with "seq send ../packages/hello-input-out.tar.gz"
When I execute CLI with "seq send ../refapps/hello-input-out.tar.gz"
When I execute CLI with "seq start - --input-topic avengers "
And wait for "10000" ms
And I execute CLI with "inst output -" without waiting for the end
Expand All @@ -31,10 +31,10 @@ This feature checks topic functionalities over CLI
# TODO: need to test this via separate two sequences
@ci-topic @cli
Scenario: E2E-011 TC-004 Instance to Instance
When I execute CLI with "seq send ../packages/endless-names-output.tar.gz"
When I execute CLI with "seq send ../refapps/endless-names-output.tar.gz"
When I execute CLI with "seq start -"
And wait for "6000" ms
When I execute CLI with "seq send ../packages/hello-input-out.tar.gz"
When I execute CLI with "seq send ../refapps/hello-input-out.tar.gz"
When I execute CLI with "seq start -"
And wait for "4000" ms
And I execute CLI with "inst output -" without waiting for the end
Expand Down
4 changes: 2 additions & 2 deletions bdd/features/e2e/E2E-012-stream-flooding-test.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Stream flooding tests. Ensure that even if a large amount of data is se
@ci-api @runner-cleanup
Scenario: E2E-012 TC-001 Flood stdin of Instance, do not consume it and check if Instance responds to event sent.
Given host is running
When sequence "../packages/event-sequence-v2.tar.gz" loaded
When sequence "../refapps/event-sequence-v2.tar.gz" loaded
And instance started with arguments "500"
And wait for instance healthy is "true"
And get runner PID
Expand All @@ -17,7 +17,7 @@ Feature: Stream flooding tests. Ensure that even if a large amount of data is se
@ci-api @runner-cleanup
Scenario: E2E-012 TC-002 Instance floods wrtites stdout, then Host checks whether even sent by Instance can be still received.
Given host is running
When sequence "../packages/flood-stdout-sequence.tar.gz" loaded
When sequence "../refapps/flood-stdout-sequence.tar.gz" loaded
And instance started with arguments "4000 10000"
And wait for instance healthy is "true"
And get runner PID
Expand Down
22 changes: 11 additions & 11 deletions bdd/features/e2e/E2E-013-topic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The tests check topic functionalities, where we send and receive data from /topi
@ci-api
Scenario: E2E-013 TC-002 Instance to API
Given host is running
And sequence "../packages/endless-names-output.tar.gz" loaded
And sequence "../refapps/endless-names-output.tar.gz" loaded
And start Instance with output topic name "ranger"
And wait for "3000" ms
And get data named "ranger" without waiting for the end
Expand All @@ -38,7 +38,7 @@ The tests check topic functionalities, where we send and receive data from /topi
Scenario: E2E-013 TC-003 API to Instance
Given host is running
Then send json data "{ \"name\": \"Hulk\" }" named "avngr"
And sequence "../packages/hello-input-out.tar.gz" loaded
And sequence "../refapps/hello-input-out.tar.gz" loaded
And start Instance with input topic name "avngr"
And get output without waiting for the end
Then confirm data defined as "hulkName" will be received
Expand All @@ -47,9 +47,9 @@ The tests check topic functionalities, where we send and receive data from /topi
@ci-api
Scenario: E2E-013 TC-004 Instance to Instance
Given host is running
And sequence "../packages/endless-names-output.tar.gz" loaded
And sequence "../refapps/endless-names-output.tar.gz" loaded
* start Instance with output topic name "powerRengers2"
And sequence "../packages/hello-input-out.tar.gz" loaded
And sequence "../refapps/hello-input-out.tar.gz" loaded
* start Instance with input topic name "powerRengers2"
And get output without waiting for the end
Then confirm data defined as "hello-input-out-10" will be received
Expand All @@ -65,15 +65,15 @@ The tests check topic functionalities, where we send and receive data from /topi
# TODO: disabled, test has a race condition, we should wait until data is received
# Scenario: E2E-013 TC-007 Send data from multiple Instances to another Instance on the same host
# Given host is running
# And sequence "../packages/endless-names-output.tar.gz" loaded
# And sequence "../refapps/endless-names-output.tar.gz" loaded
# * start Instance with args "5" and output topic name "5names"
# And wait for "4000" ms
# And instance is finished
# Then send data from file "../dist/avengers-names-output/avengers.json" named "5names"
# * start Instance with args "5" and output topic name "5names"
# And wait for "4000" ms
# And instance is finished
# And sequence "../packages/hello-input-out.tar.gz" loaded
# And sequence "../refapps/hello-input-out.tar.gz" loaded
# * start Instance with input topic name "5names"
# And wait for "4000" ms
# And get output without waiting for the end
Expand All @@ -83,20 +83,20 @@ The tests check topic functionalities, where we send and receive data from /topi
@ci-api
Scenario: E2E-013 TC-007 Send and read data two times
Given host is running
And sequence "../packages/endless-names-output.tar.gz" loaded
And sequence "../refapps/endless-names-output.tar.gz" loaded
* start Instance with args "5" and output topic name "powerRengers"
And sequence "../packages/hello-input-out.tar.gz" loaded
And sequence "../refapps/hello-input-out.tar.gz" loaded
* start Instance with args "5" and input topic name "powerRengers"
And get output without waiting for the end
Then confirm data defined as "hello-input-out-5" will be received
When send kill message to instance
And wait for "1000" ms
And instance is finished
And sequence "../packages/endless-names-output.tar.gz" loaded
And sequence "../refapps/endless-names-output.tar.gz" loaded
* start Instance with output topic name "powerRengersVol2"
# We want to verify that nothing else is reading the topic
And wait for "2000" ms
And sequence "../packages/hello-input-out.tar.gz" loaded
And sequence "../refapps/hello-input-out.tar.gz" loaded
* start Instance with input topic name "powerRengersVol2"
And get output without waiting for the end
Then confirm data defined as "hello-input-out-10" will be received
Expand All @@ -105,7 +105,7 @@ The tests check topic functionalities, where we send and receive data from /topi
@ci-api
Scenario: E2E-013 TC-008 Send data json data from Sequence, get it via API
Given host is running
And sequence "../packages/avengers-names-output.tar.gz" loaded
And sequence "../refapps/avengers-names-output.tar.gz" loaded
And instance started
And get data named "avengers" without waiting for the end
Then confirm data defined as "hulk-nl" will be received
Expand Down
Loading
Loading