Skip to content
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

fix: Docker default non-interactive mode for Cloud instances #796

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

rarepepi
Copy link
Contributor

@rarepepi rarepepi commented Dec 2, 2024

Relates to:

No linked issue.

Risks

Risk Level: Low
Adding a new flag non-interactive that defaults to skipping chat() should not affect existing functionality unless explicitly enabled. The main risk is around unintended bypass of user input under edge cases.

Background

What does this PR do?

This PR adds a non-interactive flag to prevent running the chat() function and avoid waiting for user input. This is particularly useful for environments such as Cloud platforms where interactive sessions are not feasible and can cause the application to hang.

Additionally, the non-interactive flag is added to the CMD in the Dockerfile as the default.

What kind of change is this?

Features (non-breaking change which adds functionality)

Why are we doing this? Any context or related work?

Running the application in a non-interactive environment such as Cloud platforms caused the process to hang due to waiting for terminal input. Adding this flag makes the application more robust for deployment in such scenarios.

Documentation changes needed?

My changes do not require a change to the project documentation.

Testing

Where should a reviewer start?

  • Review the changes in the Dockerfile for the updated CMD with the non-interactive flag.
  • Review the changes in /agent/src/index.ts where the non-interactive flag is implemented and its logic for skipping chat().

Detailed testing steps

  1. Run the application locally without the non-interactive flag and verify that chat() runs as expected.
  2. Run the application locally with the non-interactive flag and confirm it bypasses chat() and does not wait for user input.
  3. Build and run the updated Docker image to ensure the non-interactive flag is applied by default and prevents hanging in Cloud environments.

Deploy Notes

No special deployment steps are required. Ensure the updated Docker image is pushed to the appropriate registry.

Database changes

None.

Deployment instructions

Build and deploy the updated Docker image as usual.


Let me know if anything else needs tweaking! 😊

@rarepepi rarepepi changed the title Docker fix: non-interactive mode for Cloud instances fix: Docker default non-interactive mode for Cloud instances Dec 2, 2024
@odilitime
Copy link
Collaborator

One additional note from chat, this helps with AWS ECS deployments

@rarepepi
Copy link
Contributor Author

rarepepi commented Dec 2, 2024

One additional note from chat, this helps with AWS ECS deployments

Fly.io deployments as well

@shakkernerd
Copy link
Member

I really like this.
Thanks for adding it in!

Copy link
Member

@shakkernerd shakkernerd left a comment

Choose a reason for hiding this comment

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

A very good feature to have.

@shakkernerd shakkernerd merged commit d3ee3a1 into elizaOS:main Dec 2, 2024
3 checks passed
dsldsl pushed a commit to dsldsl/eliza that referenced this pull request Dec 7, 2024
fix: Docker default non-interactive mode for Cloud instances
@rarepepi rarepepi mentioned this pull request Dec 11, 2024
@rarepepi rarepepi deleted the docker-fix branch December 16, 2024 19:57
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