blob: 04f2330b6e93c82edd71c85b7f3cdb9510439307 [file] [log] [blame]
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.70">
<link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="Apache Submarine Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="Apache Submarine Blog Atom Feed"><title data-react-helmet="true">Development Guide | Apache Submarine</title><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" name="docusaurus_locale" content="en"><meta data-react-helmet="true" name="docusaurus_version" content="current"><meta data-react-helmet="true" name="docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:title" content="Development Guide | Apache Submarine"><meta data-react-helmet="true" name="description" content="&lt;!--"><meta data-react-helmet="true" property="og:description" content="&lt;!--"><meta data-react-helmet="true" property="og:url" content="https://submarine.apache.org//docs/next/devDocs/Development"><link data-react-helmet="true" rel="shortcut icon" href="/img/submarine.ico"><link data-react-helmet="true" rel="canonical" href="https://submarine.apache.org//docs/next/devDocs/Development"><link rel="stylesheet" href="/styles.39775f96.css">
<link rel="preload" href="/styles.f6b0c2f2.js" as="script">
<link rel="preload" href="/runtime~main.13a9404d.js" as="script">
<link rel="preload" href="/main.1c145c17.js" as="script">
<link rel="preload" href="/1.d23d1451.js" as="script">
<link rel="preload" href="/2.45bcb8a0.js" as="script">
<link rel="preload" href="/1f391b9e.785b37ba.js" as="script">
<link rel="preload" href="/127.875bba76.js" as="script">
<link rel="preload" href="/935f2afb.e0ddaa28.js" as="script">
<link rel="preload" href="/17896441.faf04472.js" as="script">
<link rel="preload" href="/897bc7ae.07fec934.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<nav aria-label="Skip navigation links"><button type="button" tabindex="0" class="skipToContent_11B0">Skip to main content</button></nav><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><div aria-label="Navigation bar toggle" class="navbar__toggle" role="button" tabindex="0"><svg aria-label="Menu" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></div><a class="navbar__brand" href="/"><img src="/img/icons/128.png" alt="Apache Submarine Site Logo" class="themedImage_YANc themedImage--light_3CMI navbar__logo"><img src="/img/icons/128.png" alt="Apache Submarine Site Logo" class="themedImage_YANc themedImage--dark_3ARp navbar__logo"><strong class="navbar__title">Apache Submarine</strong></a><a class="navbar__item navbar__link navbar__link--active" href="/docs/next/gettingStarted/quickstart">Docs</a><a class="navbar__item navbar__link" href="/docs/next/api/environment">API</a><a class="navbar__item navbar__link" href="/docs/next/download">Download</a></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a class="navbar__item navbar__link" href="/docs/next/gettingStarted/quickstart">master πŸƒ</a><ul class="dropdown__menu"><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/docs/next/devDocs/Development">master πŸƒ</a></li><li><a class="dropdown__link" href="/docs/devDocs/Development">0.6.0</a></li><li><a class="dropdown__link" href="/versions">All versions</a></li></ul></div><a href="https://github.com/apache/submarine" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub</a><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a class="navbar__item navbar__link">Apache</a><ul class="dropdown__menu"><li><a href="https://www.apache.org/foundation/how-it-works.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Apache Software Foundation</a></li><li><a href="https://www.apache.org/events/current-event" target="_blank" rel="noopener noreferrer" class="dropdown__link">Events</a></li><li><a href="https://www.apache.org/licenses/" target="_blank" rel="noopener noreferrer" class="dropdown__link">Apache License</a></li><li><a href="https://www.apache.org/foundation/thanks.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Thanks</a></li><li><a href="https://www.apache.org/security/" target="_blank" rel="noopener noreferrer" class="dropdown__link">Security</a></li><li><a href="https://www.apache.org/foundation/sponsorship.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Sponsorship</a></li></ul></div><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_2N3Q"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_3NWk">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_3NWk">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div><div class="navbar__search"><span aria-label="expand searchbar" role="button" class="search-icon" tabindex="0"></span><input type="search" id="search_input_react" placeholder="Search" aria-label="Search" class="navbar__search-input search-bar"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/"><img src="/img/icons/128.png" alt="Apache Submarine Site Logo" class="themedImage_YANc themedImage--light_3CMI navbar__logo"><img src="/img/icons/128.png" alt="Apache Submarine Site Logo" class="themedImage_YANc themedImage--dark_3ARp navbar__logo"><strong class="navbar__title">Apache Submarine</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a class="menu__link navbar__link--active" href="/docs/next/gettingStarted/quickstart">Docs</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/next/api/environment">API</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/next/download">Download</a></li><li class="menu__list-item"><a role="button" class="menu__link menu__link--sublist">Versions</a><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active" href="/docs/next/devDocs/Development">master πŸƒ</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/devDocs/Development">0.6.0</a></li><li class="menu__list-item"><a class="menu__link" href="/versions">All versions</a></li></ul></li><li class="menu__list-item"><a href="https://github.com/apache/submarine" target="_blank" rel="noopener noreferrer" class="menu__link">GitHub</a></li><li class="menu__list-item menu__list-item--collapsed"><a role="button" class="menu__link menu__link--sublist">Apache</a><ul class="menu__list"><li class="menu__list-item"><a href="https://www.apache.org/foundation/how-it-works.html" target="_blank" rel="noopener noreferrer" class="menu__link">Apache Software Foundation</a></li><li class="menu__list-item"><a href="https://www.apache.org/events/current-event" target="_blank" rel="noopener noreferrer" class="menu__link">Events</a></li><li class="menu__list-item"><a href="https://www.apache.org/licenses/" target="_blank" rel="noopener noreferrer" class="menu__link">Apache License</a></li><li class="menu__list-item"><a href="https://www.apache.org/foundation/thanks.html" target="_blank" rel="noopener noreferrer" class="menu__link">Thanks</a></li><li class="menu__list-item"><a href="https://www.apache.org/security/" target="_blank" rel="noopener noreferrer" class="menu__link">Security</a></li><li class="menu__list-item"><a href="https://www.apache.org/foundation/sponsorship.html" target="_blank" rel="noopener noreferrer" class="menu__link">Sponsorship</a></li></ul></li></ul></div></div></div></nav><div class="main-wrapper"><div class="docPage_vMrn"><div class="docSidebarContainer_3Ak5" role="complementary"><div class="sidebar_3gvy"><div class="menu menu--responsive thin-scrollbar menu_1yIk"><button aria-label="Open Menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_1CUI" width="24" height="24" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">Getting Started</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/gettingStarted/quickstart">Quickstart</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/gettingStarted/notebook">Jupyter Notebook</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/gettingStarted/python-sdk">Submarine Python SDK</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/gettingStarted/helm">Custom Configuation</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">User Docs</a><ul class="menu__list"><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!" tabindex="-1">API documentation</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/userDocs/api/experiment">Experiment REST API</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/userDocs/api/environment">Environment REST API</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/userDocs/api/experiment-template">Experiment Template REST API</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/userDocs/api/notebook">Notebook REST API</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!" tabindex="-1">Submarine SDK</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/userDocs/submarine-sdk/experiment-client">Experiment Client</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/userDocs/submarine-sdk/submarine-cli">Submarine CLI</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/userDocs/submarine-sdk/tracking">Tracking</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!" tabindex="-1">Others</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/userDocs/others/mlflow">MLflow UI</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/userDocs/others/tensorboard">Tensorboard</a></li></ul></li></ul></li><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#!">Developer Docs</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/next/devDocs/README">Project Architecture</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/next/devDocs/Dependencies">Dependencies for Submarine</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/next/devDocs/BuildFromCode">How to Build Submarine</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/docs/next/devDocs/Development">Development Guide</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/next/devDocs/IntegrationTestK8s">How to Run Integration K8s Test</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/next/devDocs/IntegrationTestE2E">How to Run Frontend Integration Test</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/next/devDocs/HowToRelease">How to Release</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/next/devDocs/HowToVerify">How to Verify</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">Community</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/community/README">Apache Submarine Community</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/community/Bylaws">Bylaws</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/community/HowToCommit">Guide for Apache Submarine Committers</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/community/contributing">How To Contribute to Submarine</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/community/HowToVoteCommitterOrPMC">How to vote a Committer or PMC</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/community/HowToBecomeCommitter">How to become a Committer</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/community/Resources">Resources</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">Design Docs</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/architecture-and-requirements">Architecture and Requirment</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/implementation-notes">Implementation Notes</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/environments-implementation">Environments Implementation</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/experiment-implementation">Experiment Implementation</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/notebook-implementation">Notebook Implementation</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/storage-implementation">Storage Implementation</a></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!" tabindex="-1">Submarine Server</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/submarine-server/architecture">Submarine Server Implementation</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/submarine-server/experimentSpec">Generic Experiment Spec</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!" tabindex="-1">WIP Design Docs</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/wip-designs/submarine-launcher">Submarine Launcher</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/wip-designs/submarine-clusterServer">Cluster Server Design - High-Availability</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/next/designDocs/wip-designs/security-implementation">Security Implementation</a></li></ul></li></ul></li></ul></div></div></div><main class="docMainContainer_2iGs"><div class="container padding-vert--lg docItemWrapper_1bxp"><div class="row"><div class="col docItemCol_U38p"><div class="alert alert--warning margin-bottom--md" role="alert"><div>This is unreleased documentation for Apache Submarine <strong>master πŸƒ</strong> version.</div><div class="margin-top--md">For up-to-date documentation, see the <strong><a href="/docs/devDocs/Development">latest version</a></strong> (0.6.0).</div></div><div class="docItemContainer_a7m4"><article><div><span class="badge badge--secondary">Version: master πŸƒ</span></div><header><h1 class="docTitle_Oumm">Development Guide</h1></header><div class="markdown"><h1><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="project-overview"></a>Project Overview<a class="hash-link" href="#project-overview" title="Direct link to heading">#</a></h1><p>The document <a href="/docs/next/gettingStarted/quickstart">Submarine Quickstart</a> shows how to deploy the Submarine service to your Kubernetes cluster. The Submarine service consists mainly of nine components, and you can check them with the following command:</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-undefined codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">kubectl get pods -n ${your_namespace}</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div><p>A brief introduction about these components:</p><ol><li><strong>tf-operator</strong>: Enable users to run TensorFlow jobs distributedly</li><li><strong>pytorch-operator</strong>: Enable users to run PyTorch jobs distributedly</li><li><strong>notebook-controller</strong>: Jupyter Notebook controller</li><li><strong>submarine-traefik</strong>: Kubernetes Ingress controller</li><li><strong>submarine-database</strong>: A MySQL database to store metadata</li><li><strong>submarine-minio</strong>: An object store for machine learning artifacts</li><li><strong>submarine-mlflow</strong>: A platform for model management</li><li><strong>submarine-tensorboard</strong>: A visualization tool for distributed training experiments</li><li><strong>submarine-server</strong>: Handle API requests, and submit distributed training experiments to Kubernetes.</li></ol><h1><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="submarine-development"></a>Submarine Development<a class="hash-link" href="#submarine-development" title="Direct link to heading">#</a></h1><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="video"></a>Video<a class="hash-link" href="#video" title="Direct link to heading">#</a></h2><ul><li>From this <a href="https://youtu.be/32Na2k6Alv4" target="_blank" rel="noopener noreferrer">Video</a>, you will know how to deal with the configuration of Submarine and be able to contribute to it via Github.</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="develop-server"></a>Develop server<a class="hash-link" href="#develop-server" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="prerequisites"></a>Prerequisites<a class="hash-link" href="#prerequisites" title="Direct link to heading">#</a></h3><ul><li>JDK 1.8</li><li>Maven 3.3 or later ( &lt; 3.8.1 )</li><li>Docker</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="setting-up-checkstyle-in-ide"></a>Setting up checkstyle in IDE<a class="hash-link" href="#setting-up-checkstyle-in-ide" title="Direct link to heading">#</a></h3><p>Checkstyle plugin may help to detect violations directly from the IDE.</p><ol><li>Install Checkstyle+IDEA plugin from <code>Preference</code> -&gt; <code>Plugins</code></li><li>Open <code>Preference</code> -&gt; <code>Tools</code> -&gt; <code>Checkstyle</code><ol><li>Set Checkstyle version:<ul><li>Checkstyle version: 8.0</li></ul></li><li>Add (+) a new Configuration File<ul><li>Description: Submarine</li><li>Use a local checkstyle <code>${SUBMARINE_HOME}/dev-support/maven-config/checkstyle.xml</code></li></ul></li></ol></li><li>Open the Checkstyle Tool Window, select the Submarine rule and execute the check</li></ol><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="testing"></a>Testing<a class="hash-link" href="#testing" title="Direct link to heading">#</a></h3><ul><li><p>Unit Test</p><p>For each class, there is a corresponding testClass. For example, <code>SubmarineServerTest</code> is used for testing <code>SubmarineServer</code>. Whenever you add a funtion in classes, you must write a unit test to test it.</p></li><li><p>Integration Test: <a href="/docs/next/devDocs/IntegrationTestK8s">IntegrationTestK8s.md</a></p></li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="build-from-source"></a>Build from source<a class="hash-link" href="#build-from-source" title="Direct link to heading">#</a></h3><ul><li><p>Before building</p><ol><li>We assume the developer use <strong>minikube</strong> as a local kubernetes cluster.</li><li>Make sure you have <strong>installed the submarine helm-chart</strong> in the cluster.</li></ol></li></ul><ol><li><p>Package the Submarine server into a new jar file</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-bash codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">mvn </span><span class="token function" style="color:rgb(130, 170, 255)">install</span><span class="token plain"> -DskipTests</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div></li><li><p>Build the new server docker image in minikube</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-bash codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># switch to minikube docker daemon to build image directly in minikube</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(255, 203, 107)">eval</span><span class="token plain"> </span><span class="token variable" style="color:rgb(191, 199, 213)">$(</span><span class="token variable" style="color:rgb(191, 199, 213)">minikube docker-env</span><span class="token variable" style="color:rgb(191, 199, 213)">)</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># run docker build</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">./dev-support/docker-images/submarine/build.sh</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># exit minikube docker daemon</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(255, 203, 107)">eval</span><span class="token plain"> </span><span class="token variable" style="color:rgb(191, 199, 213)">$(</span><span class="token variable" style="color:rgb(191, 199, 213)">minikube docker-env -u</span><span class="token variable" style="color:rgb(191, 199, 213)">)</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div></li><li><p>Delete the server deployment and the operator will create a new one using the new image</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-bash codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">kubectl delete deployment submarine-server</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div></li></ol><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="develop-workbench"></a>Develop workbench<a class="hash-link" href="#develop-workbench" title="Direct link to heading">#</a></h2><ol><li><p>Deploy the Submarine</p><p>Follow <a href="/docs/next/gettingStarted/quickstart">Getting Started/Quickstart</a>, and make sure you can connect to <code>http://localhost:32080</code> in the browser.</p></li><li><p>Install the dependencies</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-bash codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token builtin class-name" style="color:rgb(255, 203, 107)">cd</span><span class="token plain"> submarine-workbench/workbench-web</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token function" style="color:rgb(130, 170, 255)">npm</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">install</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div></li><li><p>Run the workbench based on proxy server</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-bash codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">npm</span><span class="token plain"> run start</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div><ol><li>The request sent to <code>http://localhost:4200</code> will be redirected to <code>http://localhost:32080</code>.</li><li>Open <code>http://localhost:4200</code> in browser to see the real-time change of workbench.</li></ol></li><li><p>Frontend E2E test: <a href="/docs/next/devDocs/IntegrationTestE2E">IntegrationTestE2E.md</a></p></li></ol><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="develop-database"></a>Develop database<a class="hash-link" href="#develop-database" title="Direct link to heading">#</a></h2><ol><li><p>Build the docker image</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-bash codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># switch to minikube docker daemon to build image directly in minikube</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(255, 203, 107)">eval</span><span class="token plain"> </span><span class="token variable" style="color:rgb(191, 199, 213)">$(</span><span class="token variable" style="color:rgb(191, 199, 213)">minikube docker-env</span><span class="token variable" style="color:rgb(191, 199, 213)">)</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># run docker build</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">./dev-support/docker-images/database/build.sh</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># exit minikube docker daemon</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(255, 203, 107)">eval</span><span class="token plain"> </span><span class="token variable" style="color:rgb(191, 199, 213)">$(</span><span class="token variable" style="color:rgb(191, 199, 213)">minikube docker-env -u</span><span class="token variable" style="color:rgb(191, 199, 213)">)</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div></li><li><p>Deploy new pods in the cluster</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-bash codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">helm upgrade --set submarine.database.dev</span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain">true submarine ./helm-charts/submarine</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div></li></ol><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="develop-operator"></a>Develop operator<a class="hash-link" href="#develop-operator" title="Direct link to heading">#</a></h2><p>For details, please check out the <a href="https://github.com/apache/submarine/blob/master/submarine-cloud-v2/README.md" target="_blank" rel="noopener noreferrer">README</a> and <a href="https://github.com/apache/submarine/blob/master/submarine-cloud-v2/docs/developer-guide.md" target="_blank" rel="noopener noreferrer">Developer Guide</a> on GitHub.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="develop-submarine-website"></a>Develop Submarine Website<a class="hash-link" href="#develop-submarine-website" title="Direct link to heading">#</a></h2><p>Submarine website is built using <a href="https://v2.docusaurus.io/" target="_blank" rel="noopener noreferrer">Docusaurus 2</a>, a modern static website generator.</p><p>We store all the website content in markdown format in the <code>submarine/website/docs</code>. When committing a new patch to the <code>submarine</code> repo, Docusaurus will help us generate the <code>html</code> and <code>javascript</code> files and push them to <a href="https://github.com/apache/submarine-site/tree/asf-site" target="_blank" rel="noopener noreferrer">https://github.com/apache/submarine-site/tree/asf-site</a>.</p><p>To update the website, click β€œEdit this page” on the website.</p><p><img src="https://lh4.googleusercontent.com/gYcKpxbsGAKv2giTRqkxOehPGnuvnhE31WjsAsYhFmACIZF3Wh2ipar7mZ7F_KRwecM-L1J8YJAgNigJsJUjqc-5IXeO2XGxCIcYpP9CdSc3YByuUkjT_Bezby2HHtkBLyE1ZY_F"></p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="add-a-new-page"></a>Add a new page<a class="hash-link" href="#add-a-new-page" title="Direct link to heading">#</a></h3><p>If you want to add a new page to the website, make sure to add the file path to <a href="https://github.com/apache/submarine/blob/master/website/sidebars.js" target="_blank" rel="noopener noreferrer">sidebars.js</a>.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="installation"></a>Installation<a class="hash-link" href="#installation" title="Direct link to heading">#</a></h3><p>We use the yarn package manager to install all dependencies for the website</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-console codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">yarn install</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="build"></a>Build<a class="hash-link" href="#build" title="Direct link to heading">#</a></h3><p>Make sure you can successfully build the website before creating a pull request.</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-console codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">yarn build</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_prK2" id="local-development"></a>Local Development<a class="hash-link" href="#local-development" title="Direct link to heading">#</a></h3><p>This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.</p><div class="mdxCodeBlock_1zKU"><div class="codeBlockContent_actS"><div tabindex="0" class="prism-code language-console codeBlock_tuNs thin-scrollbar"><div class="codeBlockLines_3uvA" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">yarn start</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_2GIj">Copy</button></div></div></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/apache/submarine/edit/master/website/docs/devDocs/Development.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 40 40" class="iconEdit_2LL7"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Blog list page navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/docs/next/devDocs/BuildFromCode"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Β« How to Build Submarine</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/docs/next/devDocs/IntegrationTestK8s"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">How to Run Integration K8s Test Β»</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_2xL- thin-scrollbar"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#video" class="table-of-contents__link">Video</a></li><li><a href="#develop-server" class="table-of-contents__link">Develop server</a><ul><li><a href="#prerequisites" class="table-of-contents__link">Prerequisites</a></li><li><a href="#setting-up-checkstyle-in-ide" class="table-of-contents__link">Setting up checkstyle in IDE</a></li><li><a href="#testing" class="table-of-contents__link">Testing</a></li><li><a href="#build-from-source" class="table-of-contents__link">Build from source</a></li></ul></li><li><a href="#develop-workbench" class="table-of-contents__link">Develop workbench</a></li><li><a href="#develop-database" class="table-of-contents__link">Develop database</a></li><li><a href="#develop-operator" class="table-of-contents__link">Develop operator</a></li><li><a href="#develop-submarine-website" class="table-of-contents__link">Develop Submarine Website</a><ul><li><a href="#add-a-new-page" class="table-of-contents__link">Add a new page</a></li><li><a href="#installation" class="table-of-contents__link">Installation</a></li><li><a href="#build" class="table-of-contents__link">Build</a></li><li><a href="#local-development" class="table-of-contents__link">Local Development</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">Docs</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/docs/gettingStarted/quickstart">Getting Started</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/api/environment">API docs</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Community</h4><ul class="footer__items"><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/apache-submarine" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stack Overflow</a></li><li class="footer__item"><a href="https://s.apache.org/slack-invite" target="_blank" rel="noopener noreferrer" class="footer__link-item">Slack</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">More</h4><ul class="footer__items"><li class="footer__item"><a href="https://medium.com/@apache.submarine" target="_blank" rel="noopener noreferrer" class="footer__link-item">Blog</a></li><li class="footer__item"><a href="https://github.com/apache/submarine" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li></ul></div></div><div class="footer__bottom text--center"><div class="margin-bottom--sm"><a href="https://www.apache.org/" target="_blank" rel="noopener noreferrer" class="footerLogoLink_31Aa"><img class="footer__logo" alt="Apache Open Source Logo" src="https://hadoop.apache.org/asf_logo_wide.png"></a></div><div class="footer__copyright">Apache Submarine, Submarine, Apache, the Apache feather logo, and the Apache Submarine project logo are
either registered trademarks or trademarks of the Apache Software Foundation in the United States and other
countries.<br> Copyright Β© 2022 Apache Submarine is Apache2 Licensed software.</div></div></div></footer></div>
<script src="/styles.f6b0c2f2.js"></script>
<script src="/runtime~main.13a9404d.js"></script>
<script src="/main.1c145c17.js"></script>
<script src="/1.d23d1451.js"></script>
<script src="/2.45bcb8a0.js"></script>
<script src="/1f391b9e.785b37ba.js"></script>
<script src="/127.875bba76.js"></script>
<script src="/935f2afb.e0ddaa28.js"></script>
<script src="/17896441.faf04472.js"></script>
<script src="/897bc7ae.07fec934.js"></script>
</body>
</html>