-
Notifications
You must be signed in to change notification settings - Fork 63
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
Docker compose override #2371
Docker compose override #2371
Conversation
core/src/main/java/org/lflang/federated/generator/FederateInstance.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/lflang/target/property/DockerProperty.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/lflang/target/property/DockerProperty.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/lflang/target/property/DockerProperty.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Marten Lohstroh <[email protected]>
Co-authored-by: Marten Lohstroh <[email protected]>
Co-authored-by: Marten Lohstroh <[email protected]>
CI is failing because of #2376 |
Can you explain more about this statement?
There are other places where we depend on the |
There were some previous discussion about this --
The C tests has been fixed. But if there are other places that depend on the prefix, this change can be accomplished without removing the |
I don't think we should have the prefix. Is there any reason anyone can cite for needing it? |
I have no problem with removing the prefix, both implementations are fine on my side. @elgeeko1 said he has some places that uses the
|
It's not clear from your comment where this prefix is being removed. Which files are you proposing to change? For better or worse, the LF code generator uses Why is this change necessary? Does this mean that the names of the services would be different depending on whether I used an override file or not? If so then it's problematic that my service names would change between the two use cases. |
This reverts commit 9d0635b.
This reverts commit 62e6142.
Shulu and I had a chance to chat, here's my understanding: A docker compose override file overrides the behavior of the parent docker compose file by overriding properties of a given service. The service is identified by its service name as defined in the parent docker compose file. The proposal currently in this PR is to have the user-provided docker compose override file reference service names by their LF filename and hence absent the My concerns with this are:
I agree that the service names without That's my only concern with this PR. Outside of this concern, this is a very helpful feature that I will plan to use! |
I'm happy as long as we don't introduce an extra parsing step for the same reasons @elgeeko1 already pointed out. |
I added a command to build RTI docker image in the CI testing environment. Otherwise a docker RTI image version mismatch would cause the test to fail. I think we can merge this then? |
Wouldn't it suffice to use the option |
I think using |
We already have... |
I'll use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to go. One last thing: please also update the website to describe the feature.
I created a PR lf-lang/lf-lang.github.io#281 for the updated documentation on docker compose override. (Also could you merge this current PR? I can see that it's been approved but I don't have merge access) |
Great work! |
Added
docker-config-file
option to docker target options. This allows the user to provide a custom docker-compose file that will add and override the generated docker-compose file using this feature provided by docker.The design of the
docker-config-file
is similar toenv-file
. The user specifies adocker-config-file
parameter in the docker target as the path to a custom docker compose yaml file.The user-specified yaml file will be copied as
docker-compose-override.yml
undersrc-gen
folder. Ifdocker-compose-override.yml
exists under thesrc-gen
folder, the script underbin
will usedocker-compose.yml
anddocker-compose-override.yml
to start the docker containers:docker compose -f docker-compose.yml -f docker-compose-override.yml up --abort-on-container-failure
.The specified yaml file should be the same structure as a normal
docker-compose.yml
file that has each top level federate as a service. To accommodate this syntax, thefederate__
prefix has been removed from the generated.lf
files for each federate insrc
folder.