Add a cosml.build command to build a project on a cluster - #518
Conversation
e546bcc to
349acd1
Compare
349acd1 to
97a4aed
Compare
28210d2 to
5f24078
Compare
|
Code has been updated with latest design decisions:
|
MohcineTor
left a comment
There was a problem hiding this comment.
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
93c2ca3 to
788d9a2
Compare
788d9a2 to
e6927cf
Compare
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
e6927cf to
accb458
Compare
|
|
||
| # Once the modeling api is publicly exposed we should be able to remove the port-forward workaround | ||
| # and just get the target url in the babylon config instead of the service name | ||
| class ModelingAPIPortForward: |
There was a problem hiding this comment.
Not sure this is a good idea, or at least we risk keeping this here longer than we should.
In a cosmotech cluster this works fine because we all access the cluster with almost admin priviledges, but we should not rely on this being the case! I am afraid this will become a frozen accident and will require the user (or LLM) running Babylon alwats require elevated rights.
There was a problem hiding this comment.
I don't like it either but I don't have a better path until we can expose the modeling api through the gateway.
As for the cluster access, babylon already requires it to retrieve its remote state and its config (including the future modeling api url). So I'm not sure this changes things.
| "Successful", | ||
| "Failed", | ||
| ]: | ||
| time.sleep(5) |
There was a problem hiding this comment.
should break after some maximum if the api freezes or has any other issues. If this happens is it safe to quit babylon with an error here? or do some cleanup?
There was a problem hiding this comment.
Cleanup should already be done or error using the project and port-forward context manager.
I can try to add a timeout, but I'm not sure which value to use as project build time can vary a lot between project.
| from click import argument, command, echo, option, style | ||
| from yaml import safe_dump, safe_load | ||
|
|
||
| from Babylon.commands.macro.build_project import build_project |
There was a problem hiding this comment.
the file is build_project, the variable is project_build, but the resource is one word (I think I can't remember now), can we simplify further, e.g. just call it build?
This makes use of temporary project in the modeling api, unless we decide to have full support for a persistent
Projectresource.Until the modeling api is publicly exposed, babylon creates a temporary port-forward via kubectl.
Design discussion points left open:
initcommand, but the actual form of the file will depend of the other discussion pointscosml? for separate one-shot commands,modapi/mod-api/modeling-api? for the api command wrappersapply? It probably needs a toggle to avoid triggering a build each time the project data is applied.Projectresource or do we keep using a temporary project for now? If we only have aProjectBuildfor now, is the project archive url better placed in ametadatafield or as asidecar.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)