-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Feature][Zeta] Add tag to node used to filter worker when submit job #7045
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @liunaijie ! This feature is very important for SeaTunnel.
| member-attributes: | ||
| group: | ||
| type: string | ||
| value: platform | ||
| team: | ||
| type: string | ||
| value: team1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, please do not change this. I believe this feature should not open by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted
| if (workerAttr == null || workerAttr.isEmpty()) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why workerAttr is empty it will be matched?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| @@ -150,7 +151,8 @@ public PhysicalPlanGenerator( | |||
| } | |||
|
|
|||
| public Tuple2<PhysicalPlan, Map<Integer, CheckpointPlan>> generate() { | |||
|
|
|||
| Map<String, Object> envOptions = jobImmutableInformation.getJobConfig().getEnvOptions(); | |||
| Map<String, String> tags = JsonUtils.toMap(envOptions.getOrDefault("tag", "").toString()); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tag into
seatunnel/seatunnel-api/src/main/java/org/apache/seatunnel/api/env/EnvCommonOptions.java
Line 27 in 476d492
| public interface EnvCommonOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| @@ -0,0 +1,81 @@ | |||
| --- | |||
|
|
|||
| sidebar_position: 9 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this page into
Line 172 in 476d492
| "items": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
docs/images/architecture_diagram.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move image folder from docs/en/images to docs/images
|
The tag filter can also apply to task level, but for now not implement this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test case with end to end use tag filter feature too.
docs/sidebars.js
Outdated
| @@ -178,7 +178,8 @@ const sidebars = { | |||
| "seatunnel-engine/checkpoint-storage", | |||
| "seatunnel-engine/rest-api", | |||
| "seatunnel-engine/tcp", | |||
| "seatunnel-engine/engine-jar-storage-mode" | |||
| "seatunnel-engine/engine-jar-storage-mode", | |||
| "seatunnel-engine/resource-manager", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about named this part as Resource Isolation?
| @@ -96,6 +96,10 @@ public void toMap(Map<String, String> result) { | |||
| } | |||
| } | |||
|
|
|||
| public Map<String, Object> getMapConfig() { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public Map<String, Object> getMapConfig() { | |
| public Map<String, Object> getSourceMap() { |
| tag_filter { | ||
| group = "platform" | ||
| team = "team1" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except some minior problem.
| Options.key("tag_filter") | ||
| .mapType() | ||
| .noDefaultValue() | ||
| .withDescription("custom parameters for run engine"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .withDescription("custom parameters for run engine"); | |
| .withDescription("Define the worker where the job runs by tag"); |
| Map.Entry::getKey, Map.Entry::getValue)); | ||
| } | ||
| if (matchedWorker.isEmpty()) { | ||
| log.error("No matched worker."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| log.error("No matched worker."); | |
| log.error("No matched worker with tag filter {}.", tagFilter); |
| tag_filter { | ||
| group = "platform" | ||
| team = "team1" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to adapt to flink/spark?
env{} is visible to all engines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At now, it is fine to only take effect under the zeta engine. We should not mention it on other engine's doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Purpose of this pull request
close #7036
Does this PR introduce any user-facing change?
yes, use can add
tagin seatunnel config use to choose node by tagHow was this patch tested?
Check list
New License Guide
release-note.