Skip to content

Conversation

@bisgaard-itis
Copy link
Contributor

@bisgaard-itis bisgaard-itis commented Mar 19, 2025

What's the point of this PR?

As part of out metamodeling efforts we plan to develop the concept of a function in the api server. These functions could point to concepts we already have in the api-server (studies or solvers) or to new types of functions. This PR does nothing more than setup a few files and connect a functions section in the api-server with a new functions domain in the api-server so that @wvangeit can start implementing the thing. I.e. it is a skeleton to guide the development. I.e. the functions which are introduced in this PR will eventually go away as we start to merge the real functionality for the functions.

What do these changes do?

  • Add functions section in api-server. Expose a single ping endpoint as an example
  • Add functions domain with example files of how to setup the domain.
  • Connect ping endpoint with webserver via rpc to webserver.

Related issue/s

How to test

Dev-ops checklist

@bisgaard-itis bisgaard-itis changed the title 7348 add dummy functions api Add example functions section to api-server Mar 19, 2025
@bisgaard-itis bisgaard-itis changed the title Add example functions section to api-server 👽️ Add example functions section to api-server Mar 19, 2025
@bisgaard-itis bisgaard-itis self-assigned this Mar 19, 2025
@bisgaard-itis bisgaard-itis added this to the The Awakening milestone Mar 19, 2025
@bisgaard-itis bisgaard-itis requested a review from wvangeit March 19, 2025 16:23
@bisgaard-itis bisgaard-itis marked this pull request as ready for review March 19, 2025 16:24
@bisgaard-itis
Copy link
Contributor Author

@wvangeit please let me know if anything in this example is unclear. I am very happy to extend it to make it more realistic or add some actual functionality if required.

@codecov
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

Attention: Patch coverage is 62.26415% with 20 lines in your changes missing coverage. Please review.

Project coverage is 87.44%. Comparing base (c9296d7) to head (df7b5d8).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7398      +/-   ##
==========================================
+ Coverage   87.42%   87.44%   +0.01%     
==========================================
  Files        1723     1721       -2     
  Lines       66749    66612     -137     
  Branches     1133     1133              
==========================================
- Hits        58356    58247     -109     
+ Misses       8072     8044      -28     
  Partials      321      321              
Flag Coverage Δ
integrationtests 65.15% <58.62%> (+0.01%) ⬆️
unittests 86.61% <62.26%> (+0.01%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library 93.90% <ø> (ø)
pkg_dask_task_models_library 97.09% <ø> (ø)
pkg_models_library 92.05% <ø> (ø)
pkg_notifications_library 84.57% <ø> (ø)
pkg_postgres_database 88.11% <ø> (ø)
pkg_service_integration 70.03% <ø> (ø)
pkg_service_library 72.49% <0.00%> (-0.16%) ⬇️
pkg_settings_library 90.78% <ø> (ø)
pkg_simcore_sdk 85.46% <ø> (ø)
agent 96.46% <ø> (ø)
api_server 90.73% <83.33%> (-0.03%) ⬇️
autoscaling 96.08% <ø> (ø)
catalog 91.82% <ø> (ø)
clusters_keeper 99.24% <ø> (ø)
dask_sidecar 91.25% <ø> (ø)
datcore_adapter 98.11% <ø> (ø)
director 76.70% <ø> (ø)
director_v2 91.30% <ø> (ø)
dynamic_scheduler 97.33% <ø> (ø)
dynamic_sidecar 90.11% <ø> (ø)
efs_guardian 89.79% <ø> (ø)
invitations 93.28% <ø> (ø)
payments 92.66% <ø> (ø)
resource_usage_tracker 89.12% <ø> (+0.21%) ⬆️
storage 86.61% <ø> (ø)
webclient ∅ <ø> (∅)
webserver 85.90% <79.31%> (-0.01%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9296d7...df7b5d8. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

I'm a bit lost. What would be te final goal of this functions?
I see no reference to that

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

I am also not clear what this "function" api is. all this seems very hard-coded in the end... I thought this was something where you send a "function" to be executed in there... but this looks like you have to implement each function precisely instead...

@bisgaard-itis
Copy link
Contributor Author

bisgaard-itis commented Mar 20, 2025

I'm a bit lost. What would be te final goal of this functions? I see no reference to that

Yes, sorry. That's on me. I did not explain well in the header what exactly the goal of this PR is. I will update it

@bisgaard-itis
Copy link
Contributor Author

I am also not clear what this "function" api is. all this seems very hard-coded in the end... I thought this was something where you send a "function" to be executed in there... but this looks like you have to implement each function precisely instead...

Yes, actually this PR just introduce some "dummy" functions so Werner can start implementing the actual api and has a pattern to follow. I have updated the header of this PR with some more info

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

ok thanks for the explanation. I am still a bit unsure. but let's see.

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

Sorry, but I have doubts and issues with this approach. Please let's have chat about it. See my reasons below.

I am not convinced at all by these changes/pattern.

I believe that the current approach will just cause harm in the long run.

I see the following issues/uncertainties:

  • I did not understand the concept of a function
  • no generic interface to register, launch and get the result of a function
  • a function could also be long running (long lived), the current pattern will eventually fail (example, if the webserver is restarted)
  • why was the webserver chosen as the owner of these functions?
  • Can you please provide a schema/diagarm of how the interaction with a functions will work?

@bisgaard-itis bisgaard-itis requested a review from pcrespov March 24, 2025 10:39
Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

thx!

@bisgaard-itis bisgaard-itis requested a review from GitHK March 24, 2025 14:50
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

As said on Friday, the reason for this PR being blocked is that it lacks any interface for long running execution.

I think we agreed that most, if not all the payloads would be long running. Such support would be useful.
I think it would greatly help to have such a system in place. Event if it's not perfect, we can always improve it, instead of having to change all the interfaces in the future.

Could this be added?

@bisgaard-itis
Copy link
Contributor Author

As said on Friday, the reason for this PR being blocked is that it lacks any interface for long running execution.

I think we agreed that most, if not all the payloads would be long running. Such support would be useful. I think it would greatly help to have such a system in place. Event if it's not perfect, we can always improve it, instead of having to change all the interfaces in the future.

Could this be added?

That's part of the prototype Werner will implement. As I mentioned, this PR is just to show how the different services are connected.

@bisgaard-itis bisgaard-itis requested a review from GitHK March 25, 2025 14:37
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

I will not block it, but I do not agree one bit with anything in this PR.

@bisgaard-itis
Copy link
Contributor Author

I will not block it, but I do not agree one bit with anything in this PR.

Thanks a lot for unblocking 🙏🏻

@bisgaard-itis
Copy link
Contributor Author

@Mergifyio queue

@bisgaard-itis bisgaard-itis added the 🤖-automerge marks PR as ready to be merged for Mergify label Mar 26, 2025
@mergify
Copy link
Contributor

mergify bot commented Mar 26, 2025

queue

🟠 Waiting for conditions to match

  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • any of: [🛡 GitHub branch protection]
        • check-neutral = deploy to dockerhub
        • check-skipped = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-neutral = system-tests
        • check-skipped = system-tests
        • check-success = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-neutral = unit-tests
        • check-skipped = unit-tests
        • check-success = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
        • check-success = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-neutral = integration-tests
        • check-skipped = integration-tests
        • check-success = integration-tests
      • any of: [🛡 GitHub branch protection]
        • check-neutral = [build] docker images (excluding frontend) (3.11, ubuntu-24.04)
        • check-skipped = [build] docker images (excluding frontend) (3.11, ubuntu-24.04)
        • check-success = [build] docker images (excluding frontend) (3.11, ubuntu-24.04)
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • label!=🤖-do-not-merge
      • label=🤖-automerge
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed

@bisgaard-itis
Copy link
Contributor Author

@Mergifyio queue

@mergify
Copy link
Contributor

mergify bot commented Mar 28, 2025

queue

🟠 Waiting for conditions to match

  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of: [🛡 GitHub branch protection]
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-success = integration-tests
        • check-neutral = integration-tests
        • check-skipped = integration-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = [build] docker images (excluding frontend) (3.11, ubuntu-24.04)
        • check-neutral = [build] docker images (excluding frontend) (3.11, ubuntu-24.04)
        • check-skipped = [build] docker images (excluding frontend) (3.11, ubuntu-24.04)

@sonarqubecloud
Copy link

@bisgaard-itis bisgaard-itis merged commit 45a8b63 into ITISFoundation:master Mar 28, 2025
92 of 94 checks passed
@bisgaard-itis bisgaard-itis deleted the 7348-add-dummy-functions-api branch March 28, 2025 09:43
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Apr 15, 2025
56 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:apiserver api-server service Meta-modeling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add example functionsapi with a single endpoint which is connected all the way to the webserver via rpc

4 participants