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

feat: redesigned protocol #106

Draft
wants to merge 102 commits into
base: main
Choose a base branch
from
Draft

feat: redesigned protocol #106

wants to merge 102 commits into from

Conversation

lars-reimann
Copy link
Member

@lars-reimann lars-reimann commented May 2, 2024

Closes #22
Closes #90
Closes #92

Summary of Changes

  • Use Socket.io instead of plain websockets. The rooms help send messages only to a subset of clients. Automatic reconnection saves us some effort.
  • Send runtime warnings.
  • Replace save_placeholder with two methods to either just report that a placeholder was computed and another to immediately send the value.
  • Augment progress message to send percentage of work done and an optional message. We can later use this to report, say, how many epochs are already done when training a neural network.

Message client -> server:

  • run - run a pipeline
  • shutdown - shutdown the server

Messages server -> client:

  • placeholder_value - send the value of a placeholder
  • progress - report that a placeholder was computed
  • runtime_warning - report a warning while running the pipeline
  • runtime_error- report an error while running the pipeline
  • done - finished running the pipeline

TODOs

  • Test sending a placeholder_value message
  • Test tableWindows argument of run message
  • Test cwd argument of run message

The `Task` provides an interface for cancellation
They don't work well with coroutines + we already offer means to cleanly shutdown.
Copy link

github-actions bot commented May 2, 2024

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 29 6 0 1.07s
❌ PYTHON mypy 29 1 0.18s
✅ PYTHON ruff 29 6 0 0.03s
✅ REPOSITORY git_diff yes no 0.02s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@lars-reimann lars-reimann force-pushed the socket-io branch 3 times, most recently from 7e51fd6 to 5b0158d Compare May 2, 2024 20:37
Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 97.35849% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 95.92%. Comparing base (b55f44e) to head (3862377).

❗ Current head 3862377 differs from pull request most recent head e0d0296. Consider uploading reports for the commit e0d0296 to get more accurate results

Files Patch % Lines
src/safeds_runner/server/_server.py 93.87% 3 Missing ⚠️
src/safeds_runner/interface/_reporters.py 80.00% 2 Missing ⚠️
src/safeds_runner/server/main.py 50.00% 1 Missing ⚠️
src/safeds_runner/server/messages/_from_server.py 98.14% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main     #106      +/-   ##
===========================================
- Coverage   100.00%   95.92%   -4.08%     
===========================================
  Files           15       21       +6     
  Lines          787      712      -75     
===========================================
- Hits           787      683     -104     
- Misses           0       29      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# Conflicts:
#	poetry.lock
#	pyproject.toml
#	src/safeds_runner/server/_messages.py
#	src/safeds_runner/server/_pipeline_manager.py
#	tests/safeds_runner/server/test_websocket_mock.py
# Conflicts:
#	poetry.lock
#	pyproject.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Immediately send placeholder values Server message for runtime warnings Socket.io vs. raw websockets
1 participant