Repository: comic/evalutils (language: python)

Issue:
Cleanup requirements parameters for algorithms
* evalutils version: 0.2.4

### Description

When initializing an algorithm template there are a lot of parameters that are currently required to fill out. However, these aren't used so they should be removed to simplify the project creation process. 

Instead of the requirements, we still might want to support creating a default CUDA-enabled docker file if a flag called uses_gpu is set. But, this seems more like a feature for a separate issue.

### What I Did

```
evalutils init algorithm ...
```

Cleanup requirements parameters for algorithms
* evalutils version: 0.2.4

### Description

When initializing an algorithm template there are a lot of parameters that are currently required to fill out. However, these aren't used so they should be removed to simplify the project creation process. 

Instead of the requirements, we still might want to support creating a default CUDA-enabled docker file if a flag called uses_gpu is set. But, this seems more like a feature for a separate issue.

### What I Did

```
evalutils init algorithm ...
```

Cleanup requirements parameters for algorithms
* evalutils version: 0.2.4

### Description

When initializing an algorithm template there are a lot of parameters that are currently required to fill out. However, these aren't used so they should be removed to simplify the project creation process. 

Instead of the requirements, we still might want to support creating a default CUDA-enabled docker file if a flag called uses_gpu is set. But, this seems more like a feature for a separate issue.

### What I Did

```
evalutils init algorithm ...
```

Cleanup requirements parameters for algorithms
* evalutils version: 0.2.4

### Description

When initializing an algorithm template there are a lot of parameters that are currently required to fill out. However, these aren't used so they should be removed to simplify the project creation process. 

Instead of the requirements, we still might want to support creating a default CUDA-enabled docker file if a flag called uses_gpu is set. But, this seems more like a feature for a separate issue.

### What I Did

```
evalutils init algorithm ...
```

Cleanup requirements parameters for algorithms
* evalutils version: 0.2.4

### Description

When initializing an algorithm template there are a lot of parameters that are currently required to fill out. However, these aren't used so they should be removed to simplify the project creation process. 

Instead of the requirements, we still might want to support creating a default CUDA-enabled docker file if a flag called uses_gpu is set. But, this seems more like a feature for a separate issue.

### What I Did

```
evalutils init algorithm ...
```



Discussion / hints:

Fix patch:
diff --git a/evalutils/cli.py b/evalutils/cli.py
index 8b6fd2c..5d41015 100644
--- a/evalutils/cli.py
+++ b/evalutils/cli.py
@@ -165,59 +165,9 @@ def req_gpu_prompt(ctx, param, req_gpu_count):
     type=AbbreviatedChoice(ALGORITHM_CHOICES),
     prompt=f"What kind of algorithm is this?",
 )
-@click.option("--diag-ticket", type=click.STRING, default="")
-@click.option(
-    "--req-cpus",
-    type=click.IntRange(min=1, max=64, clamp=True),
-    default=1,
-    prompt="Required number of cpus?",
-)
-@click.option(
-    "--req-cpu-capabilities",
-    type=click.STRING,
-    multiple=True,
-    default=None,
-    callback=req_cpu_capabilities_prompt,
-)
-@click.option(
-    "--req-memory",
-    type=click.STRING,
-    default="1G",
-    prompt="Minimal required amount of cpu RAM?",
-    callback=validate_size_format_fn(can_be_empty=False),
-)
-@click.option(
-    "--req-gpus",
-    type=click.IntRange(min=0, max=8, clamp=True),
-    default=0,
-    prompt="Required number of gpus?",
-    callback=req_gpu_prompt,
-)
-@click.option(
-    "--req-gpu-compute-capability",
-    type=click.STRING,
-    is_eager=True,
-    default="",
-)
-@click.option(
-    "--req-gpu-memory",
-    type=click.STRING,
-    is_eager=True,
-    default="",
-    callback=validate_size_format_fn(can_be_empty=True),
-)
 @click.option("--dev", is_flag=True)
 def init_algorithm(
-    algorithm_name,
-    kind,
-    diag_ticket,
-    req_cpus,
-    req_cpu_capabilities,
-    req_memory,
-    req_gpus,
-    req_gpu_compute_capability,
-    req_gpu_memory,
-    dev,
+    algorithm_name, kind, dev,
 ):
     template_dir = Path(__file__).parent / "templates" / "algorithm"
     try:
@@ -225,20 +175,11 @@ def init_algorithm(
             template=str(template_dir.absolute()),
             no_input=True,
             extra_context={
-                "diag_ticket": diag_ticket,
                 "algorithm_name": algorithm_name,
                 "algorithm_kind": kind,
                 "evalutils_name": __name__.split(".")[0],
                 "evalutils_version": __version__,
                 "dev_build": 1 if dev else 0,
-                "requirements": {
-                    "cpu_count": req_cpus,
-                    "cpu_capabilities": req_cpu_capabilities,
-                    "memory": req_memory,
-                    "gpu_count": req_gpus,
-                    "gpu_compute_capability": req_gpu_compute_capability,
-                    "gpu_memory": req_gpu_memory,
-                },
             },
         )
         click.echo(f"Created project {algorithm_name}")
diff --git a/evalutils/templates/algorithm/cookiecutter.json b/evalutils/templates/algorithm/cookiecutter.json
index d6ad6c7..987ec5e 100644
--- a/evalutils/templates/algorithm/cookiecutter.json
+++ b/evalutils/templates/algorithm/cookiecutter.json
@@ -5,20 +5,11 @@
         "Segmentation",
         "Detection"
     ],
-    "diag_ticket": "",
     "package_name": "{{ cookiecutter.algorithm_name|replace(' ', '') }}",
     "evalutils_name": "",
     "evalutils_version": "",
     "docker_base_container": "python:3.9-slim",
     "dev_build": 0,
-    "requirements": {
-        "cpu_count": 1,
-        "cpu_capabilities": [],
-        "memory": "1G",
-        "gpu_count": 0,
-        "gpu_compute_capability": null,
-        "gpu_memory": null
-    },
     "_copy_without_render": [
         "*.github"
     ]
diff --git a/evalutils/templates/algorithm/{{ cookiecutter.package_name }}/Dockerfile b/evalutils/templates/algorithm/{{ cookiecutter.package_name }}/Dockerfile
index bea9132..4d61a21 100644
--- a/evalutils/templates/algorithm/{{ cookiecutter.package_name }}/Dockerfile
+++ b/evalutils/templates/algorithm/{{ cookiecutter.package_name }}/Dockerfile
@@ -34,16 +34,3 @@ ENTRYPOINT python -m process $0 $@
 
 # These labels are required
 LABEL nl.diagnijmegen.rse.algorithm.name={{ cookiecutter.algorithm_name }}
-
-# These labels are required and describe what kind of hardware your algorithm requires to run.
-LABEL nl.diagnijmegen.rse.algorithm.hardware.cpu.count={{ cookiecutter.requirements.cpu_count }}
-LABEL nl.diagnijmegen.rse.algorithm.hardware.cpu.capabilities={{ cookiecutter.requirements.cpu_capabilities }}
-LABEL nl.diagnijmegen.rse.algorithm.hardware.memory={{ cookiecutter.requirements.memory }}
-LABEL nl.diagnijmegen.rse.algorithm.hardware.gpu.count={{ cookiecutter.requirements.gpu_count }}
-LABEL nl.diagnijmegen.rse.algorithm.hardware.gpu.cuda_compute_capability={{ cookiecutter.requirements.gpu_compute_capability }}
-LABEL nl.diagnijmegen.rse.algorithm.hardware.gpu.memory={{ cookiecutter.requirements.gpu_memory }}
-
-{% if cookiecutter.diag_ticket|trim() -%}
-# Optional labels
-LABEL nl.diagnijmegen.rse.algorithm.ticket={{ cookiecutter.diag_ticket|trim() }}
-{%- endif %}


Test patch:
diff --git a/evalutils/templates/algorithm/{{ cookiecutter.package_name }}/test.sh b/evalutils/templates/algorithm/{{ cookiecutter.package_name }}/test.sh
index 74aeece..e4b428d 100755
--- a/evalutils/templates/algorithm/{{ cookiecutter.package_name }}/test.sh
+++ b/evalutils/templates/algorithm/{{ cookiecutter.package_name }}/test.sh
@@ -9,7 +9,6 @@ VOLUME_SUFFIX=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
 docker volume create {{ cookiecutter.package_name|lower }}-output-$VOLUME_SUFFIX
 
 docker run --rm \
-        --memory={{ cookiecutter.requirements.memory|lower }} \
         -v $SCRIPTPATH/test/:/input/ \
         -v {{ cookiecutter.package_name|lower }}-output-$VOLUME_SUFFIX:/output/ \
         {{ cookiecutter.package_name|lower }}
diff --git a/tests/test_templates.py b/tests/test_templates.py
index 003546a..05366fb 100644
--- a/tests/test_templates.py
+++ b/tests/test_templates.py
@@ -92,28 +92,8 @@ def test_evaluation_cli(tmpdir, kind, expected):
 @pytest.mark.parametrize(
     "kind", ("Detection", "Segmentation", "Classification")
 )
-@pytest.mark.parametrize(
-    (
-        "diag_ticket",
-        "req_cpus",
-        "req_cpu_capabilities",
-        "req_memory",
-        "req_gpus",
-        "req_gpu_compute_capability",
-        "req_gpu_memory",
-    ),
-    [("", 1, (), "2G", 0, "", "")],
-)
 def test_algorithm_cli(
-    tmpdir,
-    kind,
-    diag_ticket,
-    req_cpus,
-    req_cpu_capabilities,
-    req_memory,
-    req_gpus,
-    req_gpu_compute_capability,
-    req_gpu_memory,
+    tmpdir, kind,
 ):
     project_name = f"testalg{kind}"
 
@@ -127,13 +107,6 @@ def test_algorithm_cli(
             "algorithm",
             project_name,
             f"--kind={kind}",
-            f"--diag-ticket={diag_ticket}",
-            f"--req-cpus={req_cpus}",
-            f"--req-cpu-capabilities={req_cpu_capabilities}",
-            f"--req-memory={req_memory}",
-            f"--req-gpus={req_gpus}",
-            f"--req-gpu-compute-capability={req_gpu_compute_capability}",
-            f"--req-gpu-memory={req_gpu_memory}",
             "--dev",
         ],
         cwd=tmpdir,