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

implement status signaling #120

Merged
merged 2 commits into from
Apr 28, 2021

Conversation

conitrade-as
Copy link
Contributor

This change set adds the ability for karton instances to signal to downstream
consumers about the beginning and ending of task execution. Signaling is
performed by sending corresponding "status" tasks.

Task signaling is enabled using the following entry in the karton
configuration file:

[signaling]
status = 1

Task signaling is disabled by default.

This change set adds the ability for karton instances to signal to downstream
consumers about the beginning and ending of task execution. Signaling is
performed by sending corresponding "status" tasks.

Task signaling is enabled using the following entry in the karton
configuration file:
```
[signaling]
status = 1
```

Task signaling is disabled by default.
karton/core/karton.py Outdated Show resolved Hide resolved
Copy link
Member

@psrok1 psrok1 left a comment

Choose a reason for hiding this comment

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

Looks great 👍 Nice use of hooks.

I have only few comments according to the naming:

  • type:status => type:karton.status or type:karton.signaling? It would be nice to provide some separate "namespace" for internal tasks.
  • begin/end => task_begin/task_end to make some space for further signals

@conitrade-as
Copy link
Contributor Author

@psrok1 Good input regarding the proposed name changes. Let me update things accordingly.

@chivay chivay requested a review from psrok1 April 27, 2021 08:16
* use `ConfigParser.getboolean`
* rename signaling status task identifiers
@@ -39,7 +39,7 @@ def __init__(self, config):
endpoint=config["minio"]["address"],
access_key=config["minio"]["access_key"],
secret_key=config["minio"]["secret_key"],
secure=bool(int(config["minio"].get("secure", True))),
secure=config.config.getboolean("minio", "secure", fallback=True),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to push again, since in the previous change set it read config.getboolean.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, config.config is quite cumbersome. I think it should be simplified it in the future.

@chivay
Copy link
Contributor

chivay commented Apr 27, 2021

Tested manually, seems to be working! Thanks! 👍

Copy link
Member

@psrok1 psrok1 left a comment

Choose a reason for hiding this comment

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

Looks ok 👍

Thanks!

@psrok1 psrok1 merged commit 31f5baf into CERT-Polska:master Apr 28, 2021
@conitrade-as conitrade-as deleted the feature/status-signaling branch April 29, 2021 08:09
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.

3 participants