Skip to content

Add a cosml.build command to build a project on a cluster - #518

Merged
sellisd merged 1 commit into
mainfrom
modapi_build_PROD-16371
Sep 15, 2026
Merged

sellisd merged 1 commit into
mainfrom
modapi_build_PROD-16371

Conversation

@sjoubert

@sjoubert sjoubert commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This makes use of temporary project in the modeling api, unless we decide to have full support for a persistent Project resource.

Until the modeling api is publicly exposed, babylon creates a temporary port-forward via kubectl.

Design discussion points left open:

  • Missing support for the new payload file in the init command, but the actual form of the file will depend of the other discussion points
  • Do we need full support for the modapi sub-commands like for the run api? Appart from the build use case it probably won't be used much for now.
  • Name of the sub-command group(s): cosml? for separate one-shot commands, modapi/mod-api/modeling-api? for the api command wrappers
  • Do we add support for it in apply? It probably needs a toggle to avoid triggering a build each time the project data is applied.
  • Do we add first class support for the Project resource or do we keep using a temporary project for now? If we only have a ProjectBuild for now, is the project archive url better placed in a metadata field or as a sidecar.

This is part of a multi repo effort that also involves the terraform modules to have the modeling api deploy in a tenant (Cosmo-Tech/terraform-shared#31, Cosmo-Tech/terraform-tenant#41) and will require the next SDK version (12.3.0)

@sjoubert
sjoubert force-pushed the modapi_build_PROD-16371 branch from e546bcc to 349acd1 Compare August 14, 2026 08:35
@sjoubert
sjoubert requested a review from sellisd August 14, 2026 09:48
@sjoubert
sjoubert force-pushed the modapi_build_PROD-16371 branch from 349acd1 to 97a4aed Compare August 14, 2026 12:47
@sjoubert
sjoubert force-pushed the modapi_build_PROD-16371 branch 2 times, most recently from 28210d2 to 5f24078 Compare August 28, 2026 15:29
@sjoubert

sjoubert commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Code has been updated with latest design decisions:

  • Remove the separate micro-command and integrate the ProjectBuild resource into the apply macro-command
  • I still think that ProjectBuild resources should not be enabled by default, but I didn't find adding a boolean in the yaml file very easy/practical for the whole payload. So for now one has to used the --exclude projectbuild option to avoid rebuilding the project every time. Let me know if that's ok with you or if you want another behavior/way of dealing with that
  • The build log behavior is now the following:
    • I've removed the log streaming, build output is only retrieved and handled once the build is complete
    • If the build succeed, the build output is logged at the debug level. So it will be recorded in the babylon log file but not displayed in the terminal (for a standard run at info level)
    • If the build fails, the build output is logged at the error level. So it will be recorded in the babylon log file but also appear in the terminal.

@MohcineTor MohcineTor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It’s okay for me we can go with this approach for now using --exclude. Later, we can have a quick discussion with the Integration team to see what their preference is.

I also have a quick remark: we could change the order of the steps. We could start with building the project, then move on to organizing the solution, etc. in applay command

Comment thread Babylon/commands/macro/build_project.py Outdated
@sjoubert
sjoubert force-pushed the modapi_build_PROD-16371 branch 2 times, most recently from 93c2ca3 to 788d9a2 Compare September 2, 2026 09:56
@sjoubert
sjoubert marked this pull request as ready for review September 2, 2026 09:58
@sjoubert
sjoubert force-pushed the modapi_build_PROD-16371 branch 2 times, most recently from e6927cf to accb458 Compare September 2, 2026 12:06
@MohcineTor
MohcineTor self-requested a review September 3, 2026 09:16

@MohcineTor MohcineTor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

Comment thread Babylon/commands/macro/build.py
Comment thread Babylon/commands/macro/build_project.py Outdated
Comment thread Babylon/commands/macro/build.py
Comment thread Babylon/commands/macro/apply.py Outdated
This makes use of temporary project in the modeling api to build a
simulator and optionnally push the resulting docker image in the tenant
registry
Until the modeling api is publicly exposed, babylon creates a temporary
port-forward via kubectl
@sjoubert
sjoubert force-pushed the modapi_build_PROD-16371 branch from accb458 to d561249 Compare September 14, 2026 08:33
@sjoubert
sjoubert requested a review from sellisd September 15, 2026 07:53
@sellisd
sellisd merged commit be7ce93 into main Sep 15, 2026
7 checks passed
@sellisd
sellisd deleted the modapi_build_PROD-16371 branch September 15, 2026 08:24
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.

3 participants