|
|
|
@ -72,16 +72,16 @@ public class PytorchTaskTest {
|
|
|
|
|
envManager.setPythonEnvTool(PythonEnvManager.ENV_TOOL_CONDA); |
|
|
|
|
envManager.setCondaPythonVersion("3.9"); |
|
|
|
|
String condaEnvCommand39 = envManager.getBuildEnvCommand(requirementPath); |
|
|
|
|
Assert.assertEquals(condaEnvCommand39, "conda create -y python=3.9 -p ./venv && source activate ./venv && python -m pip install -r " + requirementPath); |
|
|
|
|
Assert.assertEquals(condaEnvCommand39, "conda create -y python=3.9 -p ./venv && source activate ./venv && ./venv/bin/python -m pip install -r " + requirementPath); |
|
|
|
|
|
|
|
|
|
envManager.setCondaPythonVersion("3.8"); |
|
|
|
|
String condaEnvCommand38 = envManager.getBuildEnvCommand(requirementPath); |
|
|
|
|
Assert.assertEquals(condaEnvCommand38, "conda create -y python=3.8 -p ./venv && source activate ./venv && python -m pip install -r " + requirementPath); |
|
|
|
|
Assert.assertEquals(condaEnvCommand38, "conda create -y python=3.8 -p ./venv && source activate ./venv && ./venv/bin/python -m pip install -r " + requirementPath); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
envManager.setPythonEnvTool(PythonEnvManager.ENV_TOOL_VENV); |
|
|
|
|
String venvEnvCommand = envManager.getBuildEnvCommand(requirementPath); |
|
|
|
|
Assert.assertEquals(venvEnvCommand, "virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && python -m pip install -r " + requirementPath); |
|
|
|
|
Assert.assertEquals(venvEnvCommand, "virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && ./venv/bin/python -m pip install -r " + requirementPath); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -146,7 +146,7 @@ public class PytorchTaskTest {
|
|
|
|
|
PytorchTask task = initTask(parameters); |
|
|
|
|
Assert.assertEquals(task.buildPythonExecuteCommand(), |
|
|
|
|
"export PYTHONPATH=.\n" + |
|
|
|
|
"conda create -y python=3.6 -p ./venv && source activate ./venv && python -m pip install -r requirements.txt\n" + |
|
|
|
|
"conda create -y python=3.6 -p ./venv && source activate ./venv && ./venv/bin/python -m pip install -r requirements.txt\n" + |
|
|
|
|
"./venv/bin/python main.py --epochs=1 --dry-run"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -163,7 +163,7 @@ public class PytorchTaskTest {
|
|
|
|
|
PytorchTask task = initTask(parameters); |
|
|
|
|
Assert.assertEquals(task.buildPythonExecuteCommand(), |
|
|
|
|
"export PYTHONPATH=.\n" + |
|
|
|
|
"virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && python -m pip install -r requirements.txt\n" + |
|
|
|
|
"virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && ./venv/bin/python -m pip install -r requirements.txt\n" + |
|
|
|
|
"./venv/bin/python main.py --epochs=1 --dry-run"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -189,7 +189,7 @@ public class PytorchTaskTest {
|
|
|
|
|
createFile(scriptFile); |
|
|
|
|
|
|
|
|
|
String expected = "export PYTHONPATH=%s\n" + |
|
|
|
|
"virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && python -m pip install -r %s\n" + |
|
|
|
|
"virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && ./venv/bin/python -m pip install -r %s\n" + |
|
|
|
|
"./venv/bin/python %s"; |
|
|
|
|
System.out.println(task.buildPythonExecuteCommand()); |
|
|
|
|
Assert.assertEquals(String.format(expected, pythonPath, requirementFile, scriptFile), task.buildPythonExecuteCommand()); |
|
|
|
|