-
-
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
Fixed docker compose script so that it fails if any container fails #2330
Conversation
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DockerComposeGenerator
participant Docker
User->>DockerComposeGenerator: Invoke createLauncher()
DockerComposeGenerator->>Docker: docker compose up
Docker-->>DockerComposeGenerator: Containers start
Docker->>DockerComposeGenerator: Container failure detection
DockerComposeGenerator-->>User: Process aborts on container failure
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java (1 hunks)
Additional comments not posted (1)
core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java (1)
141-141
: Approved change to Docker Compose command.The addition of
--abort-on-container-exit
to the Docker Compose command is a crucial update for ensuring that the script fails if any container exits prematurely, aligning with the PR's objectives.Verification successful
The verification process indicates that the addition of the
--abort-on-container-exit
flag in thedocker compose up
command is isolated to theDockerComposeGenerator.java
file. No other instances of the command were found, and there are no related tests or documentation files that need updates.
- The search for other
docker compose up
commands in the repository returned only the modified instance.- No related tests were found that include Docker Compose commands.
- The documentation search did not reveal any additional references to Docker Compose commands outside the modified file.
This confirms that the change is localized and does not negatively affect other parts of the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if the `--abort-on-container-exit` flag affects other Docker Compose configurations. # Test: Search for other Docker Compose commands in the repository. Expect: No other configurations should be negatively affected. rg --type java $'docker compose up'Length of output: 163
Script:
#!/bin/bash # Description: Verify if there are any tests related to Docker Compose commands. # Test: Search for test files that may include Docker Compose commands. rg --type java --type groovy 'docker compose' --glob '*Test*'Length of output: 63
Script:
#!/bin/bash # Description: Verify if there is any documentation related to Docker Compose commands. # Test: Search for documentation files that may include Docker Compose commands. rg 'docker compose'Length of output: 256
core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java
Outdated
Show resolved
Hide resolved
558f1fa
to
ff1b0fe
Compare
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java
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.
I tested this change locally and it solves the problem!
FYI, this uses a recently-added Docker feature that did not exist 1 year ago (on Docker Engine 24.0.5). Our users should be advised to upgrade to Docker Engine 26.1.4 or later in order to be sure that the launch script will work.
Addresses #2328 (review)
Summary by CodeRabbit
--abort-on-container-failure
flag to ensure that all containers are stopped if one fails.--abort-on-container-exit
flag to thedocker compose up
command to ensure the service stops if any container exits.