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/21 03:40:28 UTC

[GitHub] [submarine] cdmikechen opened a new pull request #844: SUBMARINE-1127. Jupyter Notebook can support initing overwrite.json

cdmikechen opened a new pull request #844:
URL: https://github.com/apache/submarine/pull/844


   ### What is this PR for?
   Jupyter Notebook have created a workspace volume /home/jovyan/workspace, but in some cases, we may need to do some initialization configuration when starting notebook. For example, we can configure an overrides.json in /opt/conda/share/jupyter/lab/settings/.
   We can refer to the official document of jupyter about overrides.json.
   <https://jupyterlab.readthedocs.io/en/stable/user/directories.html#overrides-json>
   
   Assuming that the user of submarine needs to specify the language of the initialized notebook to Chinese, we can write this in overrides.json.
   
   ```json
   {
     "@jupyterlab/translation-extension:plugin": {
       "locale": "zh_CN"
     }
   }
   ```
   After this configuration, the new logging will be displayed in Chinese by default.
   
   
   ### What type of PR is it?
   Improvement
   
   ### Todos
   * [x] - Add a configmap to use `overwrite.json` as a volume config file in pod
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-1127?filter=allissues
   
   ### How should this be tested?
   Try to set an env named `SUBMARINE_NOTEBOOK_DEFAULT_OVERWRITE_JSON` in submarine-server deployment.
   
   ### Screenshots (if appropriate)
   No
   
   ### Questions:
   * Do the license files need updating? No
   * Are there breaking changes for older versions? No
   * Does this need new documentation? Yes
   


-- 
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] cdmikechen commented on pull request #844: SUBMARINE-1127. Jupyter Notebook can support initing overwrite.json

Posted by GitBox <gi...@apache.org>.
cdmikechen commented on pull request #844:
URL: https://github.com/apache/submarine/pull/844#issuecomment-1008235063


   @pingsutw I've update codes to newest and pass git check test.


-- 
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 #844: SUBMARINE-1127. Jupyter Notebook can support initing overwrite.json

Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #844:
URL: https://github.com/apache/submarine/pull/844#discussion_r775065312



##########
File path: submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/parser/ConfigmapSpecParser.java
##########
@@ -0,0 +1,62 @@
+/*
+ * 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.submitter.k8s.parser;
+
+
+import io.kubernetes.client.openapi.models.V1ConfigMap;
+import io.kubernetes.client.openapi.models.V1ObjectMeta;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public class ConfigmapSpecParser {
+
+  public static V1ConfigMap parseConfigMap(String name, String ... values) {
+    Map<String, String> datas = new LinkedHashMap<>();
+    String key = null;
+    for (int i = 0; i < values.length; i++) {
+      if (i % 2 == 0) {
+        key = values[i];
+      } else {
+        datas.put(key, values[i]);
+      }
+    }

Review comment:
       ```suggestion
       for (int i = 0; i < values.length; i+=2) {
         datas.put(values[i], values[i+1]);
       }
   ```




-- 
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] cdmikechen edited a comment on pull request #844: SUBMARINE-1127. Jupyter Notebook can support initing overwrite.json

Posted by GitBox <gi...@apache.org>.
cdmikechen edited a comment on pull request #844:
URL: https://github.com/apache/submarine/pull/844#issuecomment-1002861049


   > Thank you for adding this feature, some comments below, others LGTM
   
   @pingsutw  Hi~ I have fixed it


-- 
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] cdmikechen edited a comment on pull request #844: SUBMARINE-1127. Jupyter Notebook can support initing overwrite.json

Posted by GitBox <gi...@apache.org>.
cdmikechen edited a comment on pull request #844:
URL: https://github.com/apache/submarine/pull/844#issuecomment-1008235063


   @pingsutw I've updated codes to newest and pass git check test.


-- 
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] cdmikechen commented on pull request #844: SUBMARINE-1127. Jupyter Notebook can support initing overwrite.json

Posted by GitBox <gi...@apache.org>.
cdmikechen commented on pull request #844:
URL: https://github.com/apache/submarine/pull/844#issuecomment-1002861049


   > Thank you for adding this feature, some comments below, others LGTM
   
   Hi~ I have fixed it


-- 
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 #844: SUBMARINE-1127. Jupyter Notebook can support initing overwrite.json

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #844:
URL: https://github.com/apache/submarine/pull/844


   


-- 
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