evgenyigumnov / rustsn

Code snippets generator via LLMs and compiler/tester via build tools
GNU General Public License v3.0
18 stars 5 forks source link

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

Open evgenyigumnov opened 2 days ago

evgenyigumnov commented 2 days 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.