<commit_before>
Build the image with tag `jsglr2evaluation` (not from this directory, but from the parent directory `jsglr2evaluation`):

```
docker build -f docker/Dockerfile -t jsglr2evaluation .
```

Run the evaluation in a container:

```
docker run -d --rm -v ~/jsglr2evaluation:/jsglr2evaluation/data -e "target=evaluation" -e "evaluation_target=all" jsglr2evaluation
```

`-d`: run container in the background  
`--rm`: removes the container when it exits  
`-v ~/jsglr2evaluation:/jsglr2evaluation/data`: use `~/jsglr2evaluation` as working directory on the host to persist data (Spoofax sources, evaluation corpus, results)  
`-e "target=evaluation"`: specify the target of the Make build (e.g. `all`, `spoofax`, `evaluation`)  
`-e "evaluation_config=config.yml"`: specify the configuration file to use (in the working directory)  
`-e "evaluation_target=all"`: specify the target of the evaluation


To start a shell inside the container:

```
docker run --rm -v ~/jsglr2evaluation:/jsglr2evaluation/data -it --entrypoint /bin/bash jsglr2evaluation
```

`-it`: Run the container interactively
`--entrypoint /bin/bash`: Start a shell instead of directly running the evaluation scripts

## Docker documentattion

- https://docs.docker.com/get-started/part2/
- Dockerfile: https://docs.docker.com/engine/reference/builder/#exec-form-entrypoint-example
- Running: https://docs.docker.com/engine/reference/commandline/run/.
<commit_msg>Docs on specifying Spoofax/JSGLR version and GitHub token while running in Docker<commit_after>
Build the image with tag `jsglr2evaluation` (not from this directory, but from the parent directory `jsglr2evaluation`):

```
docker build -f docker/Dockerfile -t jsglr2evaluation .
```

Run the evaluation in a container:

```
docker run -d --rm -v ~/jsglr2evaluation:/jsglr2evaluation/data -e "target=evaluation" -e "evaluation_target=all" jsglr2evaluation
```

`-d`: run container in the background
`--rm`: removes the container when it exits
`-v ~/jsglr2evaluation:/jsglr2evaluation/data`: use `~/jsglr2evaluation` as working directory on the host to persist data (Spoofax sources, evaluation corpus, results)
`-e "target=evaluation"`: specify the target of the Make build (e.g. `all`, `spoofax`, `evaluation`)
`-e "evaluation_config=config.yml"`: specify the configuration file to use (in the working directory)
`-e "evaluation_target=all"`: specify the target of the evaluation
`-e "spoofax_version=master"`: specify the Spoofax version
`-e "jsglr_version=develop/jsglr2"`: specify the JSGLR version, which will be built againa independently after building Spoofax completely. This enables you to run the evaluation with a JSGLR version from specific branch, without having to rebuild Spoofax completely.
`-e "github_token=?"`: provide a GitHub access token to publish evaluation results to https://metaborg.github.io/jsglr2evaluation-site/


To start a shell inside the container:

```
docker run --rm -v ~/jsglr2evaluation:/jsglr2evaluation/data -it --entrypoint /bin/bash jsglr2evaluation
```

`-it`: Run the container interactively
`--entrypoint /bin/bash`: Start a shell instead of directly running the evaluation scripts

## Docker documentattion

- https://docs.docker.com/get-started/part2/
- Dockerfile: https://docs.docker.com/engine/reference/builder/#exec-form-entrypoint-example
- Running: https://docs.docker.com/engine/reference/commandline/run/.

{'fraction_non_alphanumeric': 0.11512481644640235, 'fraction_numerical': 0.008223201174743025, 'mean_word_length': 4.964973730297723, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '907903', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1039, 'n_words': 354}