You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2021/12/06 14:16:49 UTC
[GitHub] [submarine] FatalLin opened a new pull request #822: [SUBMARINE-1105]implementation of the base frame of k8s-agent
FatalLin opened a new pull request #822:
URL: https://github.com/apache/submarine/pull/822
### What is this PR for?
just like we discussed earlier, we would like to turn submarine into a more k8s specialize solution; thus I build the base frame k8s-agent in this PR, which is responsible for tracking different types of custom resource we created - tfjob, pytorch job, and note book.
### What type of PR is it?
Feature
### Todos
* implement the customResourceHandler for each custom resource.
* add the building process into current building progress.
### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-1105
### How should this be tested?
For now the codes is quite simple, I think we could add the unit test once the customResource handler is done.
### Screenshots (if appropriate)


### Questions:
* Do the license files need updating? No
* Are there breaking changes for older versions? No
* Does this need new documentation? Yes (Design Doc)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] asfgit closed pull request #822: SUBMARINE-1105. implementation of the base frame of k8s-agent
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #822:
URL: https://github.com/apache/submarine/pull/822
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] pingsutw commented on a change in pull request #822: SUBMARINE-1105. implementation of the base frame of k8s-agent
Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #822:
URL: https://github.com/apache/submarine/pull/822#discussion_r765520336
##########
File path: submarine-server/server-submitter/submarine-k8s-agent/src/main/java/org/apache/submarine/server/k8s/agent/handler/CustomResourceHandler.java
##########
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.submarine.server.k8s.agent.handler;
+
+import java.io.IOException;
+
+import io.kubernetes.client.openapi.ApiClient;
+import io.kubernetes.client.openapi.Configuration;
+import io.kubernetes.client.openapi.apis.CoreV1Api;
+import io.kubernetes.client.util.Config;
+
+public abstract class CustomResourceHandler {
+ private CoreV1Api coreApi;
+ private ApiClient client = null;
+ private String namespace;
+ private String crType;
+ private String crName;
+
+ public CustomResourceHandler() throws IOException {
+ this.client = Config.defaultClient();
+ Configuration.setDefaultApiClient(client);
+ this.coreApi = new CoreV1Api(this.client);
+ }
+
+ public abstract void init(String namespace, String crType, String crName);
+ public abstract void run();
+ public abstract void onAddEvent();
+ public abstract void onModifyEvent();
+ public abstract void onDeleteEvent();
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ public String getCrType() {
+ return crType;
+ }
+
+ public void setCrType(String crType) {
+ this.crType = crType;
+ }
+
+ public String getCrName() {
+ return crName;
+ }
+
+ public void setCrName(String crName) {
+ this.crName = crName;
+ }
+
+
+
Review comment:
```suggestion
```suggestion
```
```
##########
File path: bin/submarine-daemon.sh
##########
@@ -120,9 +120,9 @@ function start() {
initialize_default_directories
- echo "SUBMARINE_SERVER_CLASSPATH: ${SUBMARINE_SERVER_CLASSPATH}" >> "${SUBMARINE_SERVER_LOGFILE}"
+ echo "SUBMARINE_SERVER_CLASSPATH: ${SUBMARINE_APP_CLASSPATH}" >> "${SUBMARINE_SERVER_LOGFILE}"
Review comment:
```suggestion
echo "SUBMARINE_APP_CLASSPATH: ${SUBMARINE_APP_CLASSPATH}" >> "${SUBMARINE_SERVER_LOGFILE}"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org