Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
change container command version
Browse files Browse the repository at this point in the history
  • Loading branch information
cdmikechen committed Nov 25, 2023
1 parent d77c868 commit ed2cabe
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public enum ConfVars {
"org.apache.submarine.server.submitter.yarn.YarnRuntimeFactory"),
SUBMARINE_SUBMITTER("submarine.submitter", "k8s"),
SUBMARINE_SERVER_SERVICE_NAME("submarine.server.service.name", "submarine-server"),
ENVIRONMENT_CONDA_MIN_VERSION("environment.conda.min.version", "4.0.1"),
ENVIRONMENT_CONDA_MAX_VERSION("environment.conda.max.version", "4.11.10"),
ENVIRONMENT_CONDA_MIN_VERSION("environment.conda.min.version", "23.1.0"),
ENVIRONMENT_CONDA_MAX_VERSION("environment.conda.max.version", "23.12.10"),

/* cookie setting */
SUBMARINE_COOKIE_HTTP_ONLY("submarine.cookie.http.only", false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
import io.kubernetes.client.openapi.models.V1EmptyDirVolumeSource;
import io.kubernetes.client.openapi.models.V1EnvVar;

import static org.apache.submarine.commons.utils.SubmarineConfVars.ConfVars.ENVIRONMENT_CONDA_MAX_VERSION;
import static org.apache.submarine.commons.utils.SubmarineConfVars.ConfVars.ENVIRONMENT_CONDA_MIN_VERSION;


public class ExperimentSpecParserTest extends SpecBuilder {

Expand Down Expand Up @@ -359,20 +362,22 @@ public void testValidPyTorchJobSpecWithEnv()

String minVersion = "minVersion=\""
+ conf.getString(
SubmarineConfVars.ConfVars.ENVIRONMENT_CONDA_MIN_VERSION)
ENVIRONMENT_CONDA_MIN_VERSION)
+ "\";";
String maxVersion = "maxVersion=\""
+ conf.getString(
SubmarineConfVars.ConfVars.ENVIRONMENT_CONDA_MAX_VERSION)
ENVIRONMENT_CONDA_MAX_VERSION)
+ "\";";
String currentVersion = "currentVersion=$(conda -V | cut -f2 -d' ');";
Assert.assertEquals(
minVersion + maxVersion + currentVersion
+ "if [ \"$(printf '%s\\n' \"$minVersion\" \"$maxVersion\" "
+ "\"$currentVersion\" | sort -V | head -n2 | tail -1 )\" "
+ "!= \"$currentVersion\" ]; then echo \"Conda version " +
"should be between minVersion=\"4.0.1\"; " +
"and maxVersion=\"4.11.10\";\"; exit 1; else echo "
"should be between minVersion=\""
+ ENVIRONMENT_CONDA_MIN_VERSION.getStringValue() + "\"; "
+ "and maxVersion=\"" + ENVIRONMENT_CONDA_MAX_VERSION.getStringValue()
+ "\";\"; exit 1; else echo "
+ "\"Conda current version is " + currentVersion + ". "
+ "Moving forward with env creation and activation.\"; "
+ "fi && " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
{
"name": "INSTALL_ENVIRONMENT_COMMAND",
"value": "minVersion=\"4.0.1\";maxVersion=\"4.11.10\";currentVersion=$(conda -V | cut -f2 -d' ');if [ \"$(printf '%s\\n' \"$minVersion\" \"$maxVersion\" \"$currentVersion\" | sort -V | head -n2 | tail -1 )\" != \"$currentVersion\" ]; then echo \"Conda version should be between minVersion=\"4.0.1\"; and maxVersion=\"4.11.10\";\"; exit 1; else echo \"Conda current version is currentVersion=$(conda -V | cut -f2 -d' ');. Moving forward with env creation and activation.\"; fi"
"value": "minVersion=\"23.1.0\";maxVersion=\"23.12.10\";currentVersion=$(conda -V | cut -f2 -d' ');if [ \"$(printf '%s\\n' \"$minVersion\" \"$maxVersion\" \"$currentVersion\" | sort -V | head -n2 | tail -1 )\" != \"$currentVersion\" ]; then echo \"Conda version should be between minVersion=\"23.1.0\"; and maxVersion=\"23.12.10\";\"; exit 1; else echo \"Conda current version is currentVersion=$(conda -V | cut -f2 -d' ');. Moving forward with env creation and activation.\"; fi"
}
],
"image": "syharbor.sypesco.com:5000/apache/submarine:jupyter-notebook-0.7.0-syzh",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
import io.kubernetes.client.util.ClientBuilder;
import io.kubernetes.client.util.KubeConfig;

import static org.apache.submarine.commons.utils.SubmarineConfVars.ConfVars.ENVIRONMENT_CONDA_MAX_VERSION;
import static org.apache.submarine.commons.utils.SubmarineConfVars.ConfVars.ENVIRONMENT_CONDA_MIN_VERSION;

@SuppressWarnings("rawtypes")
public class ExperimentRestApiTest extends AbstractSubmarineServerTest {
private static final Logger LOG = LoggerFactory.getLogger(ExperimentRestApiTest.class);
Expand Down Expand Up @@ -343,8 +346,10 @@ private void assertK8sResultEquals(Environment env, Experiment experiment) throw
+ "if [ \"$(printf '%s\\n' \"$minVersion\" \"$maxVersion\" "
+ "\"$currentVersion\" | sort -V | head -n2 | tail -1 )\" "
+ "!= \"$currentVersion\" ]; then echo \"Conda version " +
"should be between minVersion=\"4.0.1\"; " +
"and maxVersion=\"4.11.10\";\"; exit 1; else echo "
"should be between minVersion=\""
+ ENVIRONMENT_CONDA_MIN_VERSION.getStringValue() + "\"; " +
"and maxVersion=\"" + ENVIRONMENT_CONDA_MAX_VERSION.getStringValue()
+ "\";\"; exit 1; else echo "
+ "\"Conda current version is " + currentVersion + ". "
+ "Moving forward with env creation and activation.\"; "
+ "fi && ";
Expand Down

0 comments on commit ed2cabe

Please sign in to comment.