Skip to content

Bug fix - Temporary solution to address positional arguments not working #245 #248

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 2 commits into from
May 13, 2024

Conversation

myxie
Copy link
Collaborator

@myxie myxie commented May 2, 2024

Note: These changes were originally raised in #245.

Bug

The positional parameter option currently does not work for Docker and Bash applications. For example, the wsclean_data_local.graph has the Docker-contained wsclean with the following input parameter that is marked as a positional parameter:

image

However, the graph fails on deployment because the msname property is incorrectly processed as a keyword argument, even thought it is set as "positional" in the UI above. This leads to the -msname property being passed to wsclean as opposed to just the file name:

/bin/bash -c "wsclean -size 512 512 -scale 0.7amin -pol I -spws 0 -niter 10000 -auto-threshold 3 -padding 1 -msname /home/rwb/dlg/workspace/wsclean_data_local12_2024-04-26T12-00-40.261395/MWA-single-timeslot.ms

Root cause

This is due to us populating the cleaned keyargs dictionary with any portkeyargs that have been identified:

keyargs = {
arg: appArgs[arg]["value"] for arg in appArgs if not appArgs[arg]["positional"]
}
for k, v in portkeyargs.items():
if v not in [None, ""]:
keyargs.update({k: v})

The code correctly initialises keyargs by ensuring there are no "positional" arguments; however, if the portkeyargs contains any positional arguments that are also port names (such as in the case of msname), then those arguments will be added to keyargs.

Why is this issue suddenly happening now? portkeyargs is populated by identify_named_ports(). Previously, there was code that commented out adding positional port arguments to the returned portargs variable, which was uncommented in ad3d520:
image

Solution

As a temporary fix, I've removed the code that was un-commented to return us to previous functionality.
Moving forward, we will want to consider a more holistic fix to update the way we coordinate named ports and keyword arguments.

@myxie myxie changed the title Update posargs graphenabler Bug fix - Temporary solution to address positional arguments not working #245 May 2, 2024
@myxie myxie marked this pull request as ready for review May 6, 2024 06:48
@myxie
Copy link
Collaborator Author

myxie commented May 6, 2024

@awicenec I am now targetting the graph-enabler branch, may you please review this PR?

@@ -135,7 +135,7 @@ def identify_named_ports(
value = parser(port_dict[keys[i]]["drop"])
pargsDict.update({key: value})
logger.debug("Using %s '%s' for parg %s", mode, value, key)
portargs.update({key: value})
# portargs.update({key: value}) # TODO identify more permanent fix for updating portargs
Copy link
Collaborator Author

@myxie myxie May 6, 2024

Choose a reason for hiding this comment

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

This has been raised on JIRA: LIU-384

@awicenec awicenec merged commit 2e306f4 into graph-enabler May 13, 2024
12 of 16 checks passed
awicenec added a commit that referenced this pull request Sep 9, 2024
 Bug fix - Temporary solution to address positional arguments not working #245
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.

2 participants