-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add custom JAVA_TOOL_OPTIONS by SdkRunnableTask #238
Conversation
f6414dc
to
2190d43
Compare
Signed-off-by: Andres Gomez Ferrer <[email protected]>
2190d43
to
b4e4062
Compare
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.
Minor comments, otherwise LGTM.
Please create an issue and reference to it for visibility, as this is a pretty useful new feature. |
46c2eef
to
3563166
Compare
|
||
@Override | ||
public List<String> getCustomJavaToolOptions() { | ||
return sdkTask.getCustomJavaToolOptions(); |
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.
Hmm, this is actually problematic. flytekit-java
is shipped from user code space, which means for existing code, getCustomJavaToolOptions
does not exist in SdkRunnableTask
. So here for now we need to use reflection to check existence of this method, until we migrate all users.
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.
You're right... this is the case where a user uses an old version of flytekit-java and tries to register with a new version of it, right?
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.
Let's me think about it. It may not be a problem. I need to check how jflyte works.
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.
Forgot about my previous comment. I somehow thought this code was in jflyte module.
I think we will need to have default implementation in RunnableTask
after all. jflyte
will use flytekit-java
module from user code space when registering because of ChildFirstClassLoader, so when processing old version where RunnableTaskImpl
does not have getCustomJavaToolOptions
, ProjectClosure
will fail when calling task.getCustomJavaToolOptions()
, or maybe even earlier because old RunnableTaskImpl
does not really implement new RunnableTask
if there is no default implementation.
It might come as a common rule that there must be default implementation in RunnableTask
whenever we extend it, so the existing FIXME
s are not telling the truth.
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.
so.. in this case, should I remove all the FIXME comments?
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.
I tested it using the old flytekit-java in the user repo and registered the task with the new flytekit-java container and with the default property, everything worked fine.
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.
so.. in this case, should I remove all the FIXME comments?
I think it makes sense. It is rather simple to keep the defaults than asking users to migrate, and the migration itself doesn't bring much value anyway.
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.
I tested it using the old flytekit-java in the user repo and registered the task with the new flytekit-java container and with the default property, everything worked fine.
Great. Sorry I gave wrong direction in an early comment. I did not think carefully about those "FIXME"s .
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.
Don't worry! so.. looks good to you the PR now?
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.
This breaks backward compatibility. Please check my comment https://github.com/flyteorg/flytekit-java/pull/238/files#r1279358563.
3563166
to
172afb3
Compare
Signed-off-by: Andres Gomez Ferrer <[email protected]>
43b4f10
to
1339b99
Compare
There are some test failures. |
yes... I just saw this.. checking |
I think that this test return a duplicated 😮
@Test
void nextNodeIdShouldReturnUniquePrefixForDistinctPolicies() {
var prefixes =
Stream.generate(SdkNodeNamePolicy::new)
.limit(10)
.map(SdkNodeNamePolicy::nextNodeId)
.map(SdkNodeNamePolicyTest::prefix)
.collect(toList());
var uniquePrefixes = Set.copyOf(prefixes);
assertThat("returned duplicated prefix", prefixes, hasSize(uniquePrefixes.size()));
} |
Read then delete this section
Allow configuring custom JAVA_TOOL_OPTIONS by SdkRunnableTask
Tests
I tested it manually and it worked fine:
Type
Are all requirements met?
Issue
flyteorg/flyte#3910