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

Update run_external_job to work with updated interface implementation #179

Open
amickan opened this issue Jan 24, 2025 · 5 comments
Open

Comments

@amickan
Copy link
Contributor

amickan commented Jan 24, 2025

With the introduction of optional inputs (https://github.com/DIAGNijmegen/rse-roadmap/issues/153), scheduling jobs through the API via the run_external_job helper function will break as soon as people update or add new interfaces to their algorithms.

The run_external_job function currently checks if the provided inputs match those defined on the algorithm.
We need to decide if we want to keep those checks here. The checks already happen on GC, so we could also remove them here, but then again it's good to do some quality checking...

If we want to keep the checks, they will need to be updated to check whether the inputs match any of the possible input sets of the algorithm.

To be able to do that:

  • The Algorithm model in gcapi will need to be updated to reflect the move from inputs and outputs to interfaces.
  • We'll likely need an AlgorithmInterface model and a AlgorithmInterfaceAPI that map to the new endpoint.
@chrisvanrun
Copy link
Contributor

The models are auto extracted. So the Algorithm should reflect the updates already once things are extracted, this includes your newly suggested models.

I do think it wise do some pre-flight checking on the client side. As such, updating those pre-flight checks make sense and should be pretty straight forward.

@amickan
Copy link
Contributor Author

amickan commented Jan 24, 2025

The models are auto extracted.

Ah nice! I didn't know that. So adding a serializer in GC for the new model is enough for gcapi to pick it up?

@chrisvanrun
Copy link
Contributor

The picking up is still a script that needs to be ran by a developer. But yes =)

@amickan
Copy link
Contributor Author

amickan commented Jan 24, 2025

Check! I almost thought magic was involved ;-)

But what I meant to clarify is that having a serializer is enough, no need for an API view, right?

@chrisvanrun
Copy link
Contributor

As long as it shows up via the schema it should suffice:

"https://grand-challenge.org/api/schema/",
thing

I think that if you make the serializer referenced via a field in Algorithm, the new interface model wil show up in the schema.

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

No branches or pull requests

2 participants