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

Clarify raptor tutorial #3052

Merged
merged 5 commits into from
Oct 11, 2023
Merged

Conversation

ejjordan
Copy link
Contributor

@ejjordan ejjordan commented Oct 5, 2023

It is not completely clear how one can use a local function in the existing tutorial. This is easily remedied.

It is not completely clear how one can use a local function in the existing tutorial. This is easily remedied.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -152,7 +152,7 @@
"source": [
Copy link
Member

@andre-merzky andre-merzky Oct 5, 2023

Choose a reason for hiding this comment

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

Line #12.                               'args'     : [1, 2]})

Shouldn't the args be removed here?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, sorry for that. I made a local branch and tried to push directly to the parent repo. When I saw that I didn't have permissions (perhaps such development is discouraged?), I just used the editor on github. I just forgot to also remove this line.

On a related note though, I could not get the args to work. Perhaps some documentation on how to use this is in order?
{'mode' : rp.TASK_FUNCTION, 'function' : 'msg', 'args' : [3]} # Fails

Copy link
Member

Choose a reason for hiding this comment

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

Oh, let me check that! Thanks for noting this!

Copy link
Member

@andre-merzky andre-merzky Oct 10, 2023

Choose a reason for hiding this comment

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

Sorry, I was a bit blind and should have seen that quicker. But also it points to a lack of documentation.

What happened is not that the args do not work, but rather that the 'function': 'msg' is the problem. The function msg is not defined in the namespace of the raptor worker, as it only defined in the client code. So the symbolic reference (the string 'msg') cannot be resolved and the call fails. In the earlier version you used (msg(3)), the function (and its arguments!) is/are serialized and passed to the raptor worker and then are available there.

I will open a documentation ticket for this - but I think it has no immediate bearing on the proposed notebook change. (see #3057)

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 agree that this notebook change can go forward in parallel to any changes to documentation or implementation of raptor. I just wanted to raise the issue somewhere. It is generally preferable to bring such things up in issues, but I was not sure if there was a way to make it work that I was just missing.

Please let me know if anything more is needed from my end for this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Ack! This looks good to me now. Thanks!

Copy link
Member

@andre-merzky andre-merzky left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks!

Copy link
Member

@andre-merzky andre-merzky left a comment

Choose a reason for hiding this comment

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

It seems like a json error has crept into the notebook - it does not parse right now...
https://github.com/radical-cybertools/radical.pilot/actions/runs/6467348997/job/17557212094?pr=3052

docs/source/tutorials/raptor.ipynb Outdated Show resolved Hide resolved
Copy link
Member

@andre-merzky andre-merzky left a comment

Choose a reason for hiding this comment

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

Thanks - this will be merged as soon as the tests pass 🙂

@andre-merzky andre-merzky merged commit 7eb9dd8 into radical-cybertools:devel Oct 11, 2023
28 checks passed
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