evgenyigumnov / rustsn

This Rust-based tool generates, compiles, and tests code using LLMs, resolves dependencies, and provides explanations of existing code through embeddings.
Apache License 2.0
59 stars 15 forks source link

Add `--environment` Parameter to Support Docker Execution #19

Open evgenyigumnov opened 2 months ago

evgenyigumnov commented 2 months ago

Description:

Enhance the project to allow execution within a Docker container by introducing a new launch parameter --environment. By default, the project currently generates code, places it in the sandbox folder, compiles, and runs it on the host machine. This update will provide flexibility to run the processes either on the host or within a Docker container based on the specified environment.


Requirements:

  1. Parameter Addition:

    • Introduce a new command-line parameter --environment with two possible values:
      • host (default): Executes the compile and run processes on the host machine.
      • docker: Executes the compile and run processes inside a Docker container.
  2. Default Behavior:

    • If the --environment parameter is not specified, default to --environment=host.
  3. Docker Integration:

    • When --environment=docker is specified:
      • Automatically create and configure a Docker container.
      • Ensure the sandbox folder is accessible within the Docker environment.
      • Compile and run the generated code inside the Docker container.
      • Handle any necessary Dockerfile creation or use an existing one.
      • Manage Docker container lifecycle (creation, execution, teardown) as part of the process.
UserCommon commented 1 month ago

I'll implement it!