Skip to content

Commit

Permalink
adding config param for the lxc create command
Browse files Browse the repository at this point in the history
  • Loading branch information
ooemperor committed Feb 19, 2024
1 parent dfc5150 commit 01afbff
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions codeGrader/backend/config/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
1 change: 1 addition & 0 deletions codeGrader/backend/config/config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion codeGrader/backend/execution/LXC.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import os
import subprocess
from codeGrader.backend.config import config


class LXC:
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion doc/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 01afbff

Please sign in to comment.