-
Notifications
You must be signed in to change notification settings - Fork 19
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 java_opts to cbioportalImporter.py #13
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.
Looks good, would be nice to be able to throttle memory for the loader, some questions:
if args.java_opts is None: | ||
args.java_opts = f"-cp {jar_path}" | ||
else: | ||
args.java_opts = f"-cp {jar_path} {args.java_opts}" |
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.
Will this not become -cp -cp JAR_PATH OTHER_JAVA_OPTS
if -cp is specified in java_opts?
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.
No, because this line only evaluates when there is no -cp
in args.java_opts
parser.add_argument('-jar', '--jar_path', type=str, required=False, | ||
help='Path to scripts JAR file') | ||
help='DEPRECATED ARGUMENT. Please, use -jvo/--java_opts instead. If you \ |
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 not:
if args.jar_path:
args.java_opts = f"-cp {args.jar_path} {args.java_opts}"
Then there is no 'need' to deprecate and you can replace it with something like 'WILL BE DEPRECATED IN THE FUTURE'?
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... but we want people to move away from using jar_path
, right? We should then force them somehow to use the new attribute
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 like the idea of adding java_opts as a parameter to these scripts. However, I agree with @MatthijsPon that this should be a warning at the most and we should continue to support jar_path. Asking all sites that use this to change to a new way of launching this is a big ask especially with no warning. We are doing that enough with spinning out CORE into it's own repo.
Since https://stackoverflow.com/questions/2231227/python-subprocess-popen-with-a-modified-environment Avoids adding additional code to handle another cli parameter and u could e.g. set java opts directly as env on the container. Not sure if that is necessary more clear to a user tho (as you're sorta passing a JAVA_OPTS env variable to a Pyhon wrapper script) |
@inodb I've tried to set the |
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 - thank you!
Currently we can only pass the
jar_path
tocbioportalImporter.py
. This addsjava_opts
as a new option tocbioportalImporter.py
to allow passing anyJAVA_OPTS
parameter. This allows us pass max memory usage etc. Thejar_path
option is retained in a backward-compatible manner