diff --git a/codeGrader/backend/config/Config.py b/codeGrader/backend/config/Config.py index 4f80e38..f896a67 100644 --- a/codeGrader/backend/config/Config.py +++ b/codeGrader/backend/config/Config.py @@ -114,6 +114,7 @@ def __init__(self): self.executionPort = self.config["ExecutionService"]["Port"] self.executionFilePath = self.config["ExecutionService"]["PathToExecutionFiles"] self.executionIpWhiteList = self.config["ExecutionService"]["IP_Address_Whitelist"] + self.execution_LXC_Install_Command = self.config["ExecutionService"]["LXC_Install_Command"] def getInstallationCommand(self, codeLanguage: str): """ diff --git a/codeGrader/backend/config/config.conf b/codeGrader/backend/config/config.conf index a6121fe..e10a51d 100644 --- a/codeGrader/backend/config/config.conf +++ b/codeGrader/backend/config/config.conf @@ -35,6 +35,7 @@ Host = 10.101.10.80 Port = 8003 PathToExecutionFiles = /opt IP_Address_Whitelist = [127.0.0.1] +LXC_Install_Command = -t download -- -r bullseye -a amd64 -d debian [EvaluationService] diff --git a/codeGrader/backend/execution/LXC.py b/codeGrader/backend/execution/LXC.py index cc01604..58ca5f9 100644 --- a/codeGrader/backend/execution/LXC.py +++ b/codeGrader/backend/execution/LXC.py @@ -25,6 +25,7 @@ import os import subprocess +from codeGrader.backend.config import config class LXC: @@ -109,7 +110,7 @@ def _lxc_setup(self): @rtype: None """ assert self._invariant_os() - command = f"lxc-create -n {self.name} -t debian -- -r bullseye" + command = f"lxc-create -n {self.name} {config.execution_LXC_Install_Command}" self._run_cmd(command) def lxc_destroy(self): diff --git a/doc/Installation.md b/doc/Installation.md index 274b67f..87a7ae9 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -66,7 +66,7 @@ Following from here you can find all the needed steps for a full installation on Install all apt packages including postgres: ``` -apt-get install -y libpq-dev lxc libvirt0 libpam-cgfs bridge-utils uidmap pip git +apt-get install -y libpython3-dev libpq-dev lxc libvirt0 libpam-cgfs bridge-utils uidmap pip git ``` Verify the installation of the lxc with the lxc-ls command. It should return no output and no error.