Skip to content

Introduce an experimental python pipeline operator #3592

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 13 commits into from
Nov 20, 2023
Merged

Conversation

lava
Copy link
Member

@lava lava commented Oct 20, 2023

This experimental operator is intended for situations where development velocity is more important than performance; it allows the user to run arbitrary code against the (converted-to-python) contents of a table slice.

Example:

$ tenzir 'show build | python "import math; sanitizers.root = math.sqrt(2*len(tree_hash) + len(type))"'

{
  "type": "Debug",
  "tree_hash": "0a178da187a13feefa10c1f18f7f20e9",
  "assertions": true,
  "sanitizers": {
    "address": true,
    "undefined_behavior": false,
    "root": 8.306623862918075
  }
}

Remaining Work

  • Make use of the extras feature to avoid installing false dependencies for the operator venvs.
  • Put the venvs under a suitable cache location.
  • Synchronize venv creation to prevent write races.
  • Implement a "mutable pytenzir" config option.
  • Wire python errors into the operator API.
  • Extend the test coverage.
  • Clean up the commit history.
  • Improve the docs.

@lava lava added the feature New functionality label Oct 20, 2023
@lava lava force-pushed the topic/python-operator branch 3 times, most recently from b3378b4 to dc154d7 Compare October 27, 2023 08:46
@lava lava marked this pull request as ready for review October 27, 2023 08:47
@tobim tobim force-pushed the topic/python-operator branch 2 times, most recently from f78508d to 9490bff Compare October 29, 2023 21:54
@lava lava force-pushed the topic/python-operator branch 3 times, most recently from f804188 to be1532e Compare November 1, 2023 15:42
@tobim tobim force-pushed the topic/python-operator branch 4 times, most recently from c5e7086 to ad13139 Compare November 2, 2023 04:43
@tobim tobim force-pushed the topic/python-operator branch from 31c29f9 to 5d6ec3e Compare November 15, 2023 13:28
@lava lava force-pushed the topic/python-operator branch 2 times, most recently from f2502c6 to f44d7be Compare November 15, 2023 17:52
@tobim tobim force-pushed the topic/python-operator branch from 26bae63 to 0266c41 Compare November 16, 2023 11:53
tobim and others added 4 commits November 16, 2023 12:56
* Fix the subnet extension type
* Add utilites to infer tenzir types from python data
This change finally adds the `python` operator, along with docs,
tests, and CI integration.

Co-authored-by: Jannis Christopher Köhl <mail@koehl.dev>
Co-authored-by: Benno Evers <benno.evers@tenzir.com>
@tobim tobim force-pushed the topic/python-operator branch from 0266c41 to 8c6fb1b Compare November 16, 2023 11:56
@lava lava force-pushed the topic/python-operator branch from 723e374 to aeca5f8 Compare November 17, 2023 11:56
Copy link
Member

@tobim tobim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been a long time coming. Thanks to everyone for their input and help. Especially @lava and @jachris.

@lava
Copy link
Member Author

lava commented Nov 20, 2023

We decided to merge this despite the tests still failing in the macOS plugins build, because the error in question

***Exception:   0.03 sec
Errors while running CTest
dyld[8010]: Library not loaded: '/usr/local/opt/simdjson/lib/libsimdjson.18.dylib'
  Referenced from: '/Users/runner/work/tenzir/tenzir/_install/lib/libtenzir.2821.0.dylib'

is caused by the rolling upgrade of Github's macOS runners, causing the plugin builds to randomly run in a different environment than the tenzir build.

Since this PR doesn't touch the other plugins' code at all and it feels silly to keep restarting the build until we get lucky, we decided to merge the PR anyways.

@lava lava closed this Nov 20, 2023
@lava lava reopened this Nov 20, 2023
@lava lava merged commit a9f4d25 into main Nov 20, 2023
@lava lava deleted the topic/python-operator branch November 20, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants