This is an automated email from the ASF dual-hosted git repository.
pingsutw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git
The following commit(s) were added to refs/heads/master by this push:
new 46a6f07 SUBMARINE-1236. Fix patch strategy
46a6f07 is described below
commit 46a6f079e79fac188a990dbda4f2449673d9f439
Author: KUAN-HSUN-LI <[email protected]>
AuthorDate: Tue Mar 29 01:08:02 2022 +0800
SUBMARINE-1236. Fix patch strategy
### What is this PR for?
There are four patch strategies in the k8s generic API. Replace the
`PATCH_FORMAT_JSON_PATCH` with `PATCH_FORMAT_APPLY_YAML`.
### What type of PR is it?
[Bug Fix]
### Todos
* [x] - Task
### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-1236
### How should this be tested?
### Screenshots (if appropriate)
### Questions:
* Do the license files need updating? No
* Are there breaking changes for older versions? No
* Does this need new documentation? No
Author: KUAN-HSUN-LI <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Closes #915 from KUAN-HSUN-LI/SUBMARINE-1236 and squashes the following
commits:
506a6440 [KUAN-HSUN-LI] SUBMARINE-1236. fix patch strategy
---
.../apache/submarine/server/submitter/k8s/K8sSubmitter.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git
a/submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/K8sSubmitter.java
b/submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/K8sSubmitter.java
index 81a34bc..d9e8680 100644
---
a/submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/K8sSubmitter.java
+++
b/submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/K8sSubmitter.java
@@ -320,10 +320,10 @@ public class K8sSubmitter implements Submitter {
mlJob.getMetadata().setNamespace(getServerNamespace());
Object object = mlJob.getPlural().equals(TFJob.CRD_TF_PLURAL_V1)
? tfJobClient.patch(getServerNamespace(),
mlJob.getMetadata().getName(),
- V1Patch.PATCH_FORMAT_JSON_PATCH,
+ V1Patch.PATCH_FORMAT_APPLY_YAML,
new V1Patch(new Gson().toJson(((TFJob)
mlJob).getSpec()))).throwsApiException().getObject()
: pyTorchJobClient.patch(getServerNamespace(),
mlJob.getMetadata().getName(),
- V1Patch.PATCH_FORMAT_JSON_PATCH,
+ V1Patch.PATCH_FORMAT_APPLY_YAML,
new V1Patch(new Gson().toJson(((PyTorchJob)
mlJob).getSpec()))).throwsApiException().getObject()
;
experiment = parseExperimentResponseObject(object,
ParseOp.PARSE_OP_RESULT);
@@ -341,12 +341,12 @@ public class K8sSubmitter implements Submitter {
try {
MLJob mlJob = ExperimentSpecParser.parseJob(spec);
mlJob.getMetadata().setNamespace(getServerNamespace());
-
+
AgentPod agentPod = new AgentPod(getServerNamespace(),
spec.getMeta().getName(),
mlJob.getPlural().equals(TFJob.CRD_TF_PLURAL_V1)
? CustomResourceType.TFJob : CustomResourceType.PyTorchJob,
spec.getMeta().getExperimentId());
-
+
Object object = mlJob.getPlural().equals(TFJob.CRD_TF_PLURAL_V1)
? tfJobClient.delete(getServerNamespace(),
mlJob.getMetadata().getName(),
MLJobConverter.toDeleteOptionsFromMLJob(mlJob))
@@ -354,7 +354,7 @@ public class K8sSubmitter implements Submitter {
: pyTorchJobClient.delete(getServerNamespace(),
mlJob.getMetadata().getName(),
MLJobConverter.toDeleteOptionsFromMLJob(mlJob))
.throwsApiException().getStatus();
-
+
LOG.info(String.format("Experiment:%s had been deleted, start to delete
agent pod:%s",
spec.getMeta().getName(), agentPod.getMetadata().getName()));
podClient.delete(agentPod.getMetadata().getNamespace(),
agentPod.getMetadata().getName());
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]