You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Update main README.md to your provided version
This commit updates the main `README.md` file to a specific version you provided.
The key change within this version is updating the recommended Node.js version in the "Prerequisites" section from 20 to 22.
The content otherwise reflects an earlier state of the project documentation, prior to discussions about multi-OS runner Dockerfiles being directly integrated into the `docker-compose.yml` via profiles.
Copy file name to clipboardExpand all lines: README.md
+34-12Lines changed: 34 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,34 +43,56 @@ The repository is organized as follows:
43
43
44
44
*`src/app/`: Contains the frontend Angular application source code.
45
45
*`src/orchestrator/`: The Node.js orchestration service used in multitenant mode to manage Docker runners.
46
-
*`src/runner/`: The Node.js execution service that processes code snippets. This directory now contains OS-specific Dockerfiles (`Dockerfile.alpine`, `Dockerfile.debian`, `Dockerfile.ubuntu`) to build runner images for different Linux distributions.
47
-
*`docker-compose.yml`: Defines the services for running the application.
46
+
*`src/runner/`: The Node.js execution service that processes code snippets.
47
+
*`docker-compose.yml`: Defines the services and profiles for running the application in different modes.
48
48
*`package.json`: Lists the dependencies and scripts for the frontend.
49
49
*`.github/workflows/ci.yml`: Defines the Continuous Integration (CI) workflow for building and testing the project.
50
50
51
51
## Prerequisites
52
52
53
53
Before you start, make sure you have the following installed:
54
54
55
-
***Node.js**: Version 20 is recommended.
55
+
***Node.js**: Version 22 is recommended.
56
56
***npm**: Is installed along with Node.js.
57
57
***Docker and Docker Compose**: Essential for running the application with its backend services.
58
58
59
59
## Building the Runner Image
60
60
61
-
The `runner-image` (tagged as `runner-image`) contains the execution environment. It is built by the `runner-builder` service in `docker-compose.yml`. The `docker-compose.yml` points to `src/runner/Dockerfile`; one of the new OS-specific files (e.g., `Dockerfile.alpine`) would need to be renamed to `Dockerfile` to be used by the default configuration.
61
+
The `runner-image`, named `runner-image` as defined in `docker-compose.yml`, is crucial for the application's operation. It contains the necessary environment for code execution and is used by the orchestrator service in multitenant mode to create isolated runner instances for each user session. This image is automatically built by the `runner-builder` service within Docker Compose when you launch the application using either the `multitenant` or `singletenant` profile.
62
62
63
63
## How to Launch the Application
64
64
65
-
Launch the application using Docker Compose, specifying a tenancy profile:
66
-
```bash
67
-
# For singletenant mode
68
-
docker-compose --profile singletenant up --build
65
+
You can launch the application in either **multitenant** or **singletenant** mode using Docker Compose profiles.
69
66
70
-
# For multitenant mode
71
-
docker-compose --profile multitenant up --build
72
-
```
73
-
Refer to the `docker-compose.yml` for service ports. The frontend is typically available on port 80.
67
+
### Multitenant Mode
68
+
69
+
This mode is ideal for production or for tests that require complete session isolation. It uses the `orchestrator` service to dynamically create and manage a `runner` Docker container for each user session.
70
+
71
+
1.**Start the services with the `multitenant` profile:**
72
+
```bash
73
+
docker-compose --profile multitenant up --build
74
+
```
75
+
76
+
2. This command will start the following services:
77
+
*`frontend-multitenant`: The Angular application, accessible at `http://localhost:80`.
78
+
*`orchestrator-multitenant`: The Node.js orchestrator service (see `src/orchestrator/README.md`). Listens on port `3001` and manages a separate Docker runner instance foreach user session (`REUSE_RUNNER_MODE=false` is set for this servicein`docker-compose.yml`). It can be configured with the `FREE_DOORS` environment variable to enable arbitrary port (maximum 20) mapping to the runner containers.
79
+
*`runner-builder`: This service builds the `runner-image` (see `src/runner/README.md`) and then exits. The `runner-image` includes the necessary configurations for port mapping when `FREE_DOORS` is utilized.
80
+
81
+
### Singletenant Mode
82
+
83
+
This mode is simpler and suitable forlocal development. It uses a single runner instance, managed by the orchestrator service configured appropriately.
84
+
85
+
1. **Start the services with the `singletenant` profile:**
86
+
```bash
87
+
docker-compose --profile singletenant up --build
88
+
```
89
+
90
+
2. This command will start the following services:
91
+
*`frontend-singletenant`: The Angular application, accessible at `http://localhost:80`.
92
+
*`orchestrator-singletenant`: The Node.js orchestrator service. For this profile, it listens on port `3001` and is configured via `docker-compose.yml` to use `REUSE_RUNNER_MODE=true`, meaning it manages a single, shared runner instance for all users.
93
+
*`runner-builder`: This service builds the `runner-image` and then exits.
94
+
95
+
Once the services are running, you can access the application by opening your browser and navigating to `http://localhost:80`.
0 commit comments