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

Beeflow connect - A REST API for BEEflow itself. #837

Merged
merged 35 commits into from
Sep 10, 2024
Merged

Conversation

aquan9
Copy link
Collaborator

@aquan9 aquan9 commented May 7, 2024

This PR, adds components to BEEflow to support a REST API for the BEEflow client itself.

Using this API users can remotely submit jobs to BEEflow by doing the following:

  1. Making a request to /droppoint to get the location of the droppoint on the remote system.
  2. Copying a workflow tarball, and workdir to that droppoint using SCP
  3. Making a request to /submit_long with the name of the workflow to start the workflow.

Documentation has been added to the sphinx docs directory.

@aquan9
Copy link
Collaborator Author

aquan9 commented May 13, 2024

After meeting with Pat, she mentioned that we should have a way to turn on the remote API without it being on by default. I'm working on this now.

@aquan9
Copy link
Collaborator Author

aquan9 commented May 14, 2024

The other thing was that we needed to do was put an option in the beeconfig to choose what port to use during startup for the remote api.

@pagrubel pagrubel added the WIP Work in progress label May 14, 2024
@pagrubel
Copy link
Collaborator

pagrubel commented May 14, 2024

By default could the port be generated similarly to the others that use the user id in some fashion?

@aquan9 aquan9 removed the WIP Work in progress label Jul 16, 2024
@aquan9
Copy link
Collaborator Author

aquan9 commented Jul 16, 2024

By default could the port be generated similarly to the others that use the user id in some fashion?

@pagrubel I created a separate issue for this particular feature. In this PR I'm just trying to pull in the basic functionality for the remote api. There are many other features for the remote api I want to add that are missing from this PR.

But I think your suggestion is a good idea, and we should do that at some point.

@aquan9 aquan9 requested a review from rstyd July 16, 2024 22:09


@app.get("/submit_long/{wf_name}/{tarball_name}/{main_cwl_file}/{job_file}")
def submit_new_wf_long(wf_name: str, tarball_name: str, main_cwl_file: str, job_file: str):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this should be a PUT or POST request? I think GET requests are usually just used for extracting information without causing state changes.

@jtronge
Copy link
Collaborator

jtronge commented Aug 6, 2024

I tried this locally with curl commands. Maybe I'm doing something wrong, but when I try to use the submit URL it doesn't show anything. I also don't see a workflow running (using beeflow list). I just copied a cat-grep-tar package into the droppoint.

@jtronge
Copy link
Collaborator

jtronge commented Aug 6, 2024

Oh, actually the remote_api is failing with ERROR: [Errno 98] error while attempting to bind on address ('0.0.0.0', 7777): address already in use for me, but it's showing as RUNNING with a beeflow core status. I must be connecting to your instance.

@jtronge
Copy link
Collaborator

jtronge commented Aug 6, 2024

I changed the port and now it's working for me. I was able to submit cat-grep-tar.

@pagrubel
Copy link
Collaborator

Please add unique port for user.

@pagrubel pagrubel added the WIP Work in progress label Aug 13, 2024
@pagrubel
Copy link
Collaborator

Per Jake: if the port is in use it still shows as Running so try to make it fail if this is the case.

@aquan9
Copy link
Collaborator Author

aquan9 commented Aug 27, 2024

The fix for finding a port dynamically has been added.

Pat requested I write up documentation for these changes so far as part of the PR.

Additionally I think it would be good if there were better notification for the user when the user's selected port has a conflict. Right now there's just a message in the .beeflow/log/remote saying that it picked a different port.

beeflow/common/config_driver.py Outdated Show resolved Hide resolved
@aquan9 aquan9 requested a review from pagrubel September 10, 2024 16:39
@aquan9 aquan9 removed the WIP Work in progress label Sep 10, 2024
@aquan9 aquan9 assigned pagrubel and unassigned pagrubel Sep 10, 2024
@pagrubel pagrubel merged commit 398ea68 into develop Sep 10, 2024
6 checks passed
@pagrubel pagrubel deleted the beeflow-connect branch September 10, 2024 21:44
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.

4 participants