|
2 | 2 |
|
3 | 3 | Our Analyzers are deployed as Docker images.
|
4 | 4 |
|
5 |
| -Please read the [general tooling Docker information](/docs/building/tooling/docker) to familiarize yourself with how these work. |
| 5 | +Please read the [general Tooling docker information](/docs/building/tooling/docker) to familiarize yourself with how these work. |
6 | 6 |
|
7 |
| -When we run the Analyzer's container we execute a `run.sh` script. |
8 |
| -To ensure this works properly the following rules must be following: |
| 7 | +## Integration |
9 | 8 |
|
| 9 | +When we run an Analyzer to analyze a solution, we run a Docker command that looks like this: |
| 10 | + |
| 11 | +```shell |
| 12 | +docker run \ |
| 13 | + --rm \ |
| 14 | + --network none \ |
| 15 | + --mount type=bind,src="${solution_dir}",dst=/solution \ |
| 16 | + --mount type=bind,src="${output_dir}",dst=/output \ |
| 17 | + --tmpfs /tmp:rw \ |
| 18 | + "exercism/${track_slug}-analyzer" \ |
| 19 | + "${exercise_slug}" "/solution" "/output" |
| 20 | +``` |
| 21 | + |
| 22 | +You can see that we pass three arguments to the Docker image: |
| 23 | + |
| 24 | +1. The exercise slug |
| 25 | +2. The path to the solution's directory |
| 26 | +3. The path to the output directory |
| 27 | + |
| 28 | +## Conventions |
| 29 | + |
| 30 | +All our Analyzers use the following conventions in their implementation: |
| 31 | + |
| 32 | +- The `Dockerfile` is in the repo's root directory. |
10 | 33 | - The working directory should be `/opt/analyzer`.
|
11 |
| -- There should be a `/opt/analyzer/bin/run.sh` script that can be called with 3 parameters: |
12 |
| - the `exercise slug`, the path to the `solution folder`, and the path to the `output folder`. |
13 |
| - For more information see [The Interface](/docs/building/tooling/analyzers/interface). |
| 34 | +- The entrypoint is `/opt/analyzer/bin/run.sh` |
| 35 | +- The `/opt/analyzer/bin/run.sh` script takes 3 arguments: |
| 36 | + 1. The exercise slug |
| 37 | + 2. The path to the solution's directory |
| 38 | + 3. The path to the output directory |
| 39 | + |
| 40 | +For more information see [The Interface](/docs/building/tooling/analyzer/interface). |
| 41 | + |
| 42 | +```exercism/note |
| 43 | +New analyzer repos will use these conventions by default. |
| 44 | +``` |
0 commit comments