blob: dad5000d67d9310de79bb8c9eebcb89b21f15deb [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{109:function(e,r,t){"use strict";t.r(r),t.d(r,"frontMatter",(function(){return o})),t.d(r,"metadata",(function(){return c})),t.d(r,"toc",(function(){return u})),t.d(r,"default",(function(){return b}));var n=t(3),a=t(7),i=(t(0),t(144)),o={title:"How to Build Submarine"},c={unversionedId:"devDocs/BuildFromCode",id:"devDocs/BuildFromCode",isDocsHomePage:!1,title:"How to Build Submarine",description:"\x3c!--",source:"@site/docs/devDocs/BuildFromCode.md",slug:"/devDocs/BuildFromCode",permalink:"/docs/devDocs/BuildFromCode",editUrl:"https://github.com/apache/submarine/edit/master/website/docs/devDocs/BuildFromCode.md",version:"current",sidebar:"docs",previous:{title:"Dependencies for Submarine",permalink:"/docs/devDocs/Dependencies"},next:{title:"Development Guide",permalink:"/docs/devDocs/Development"}},u=[{value:"Prerequisites",id:"prerequisites",children:[]},{value:"Quick Start",id:"quick-start",children:[{value:"Build Your Custom Submarine Docker Images",id:"build-your-custom-submarine-docker-images",children:[]},{value:"Building source code / binary distribution",id:"building-source-code--binary-distribution",children:[]},{value:"Building source code / binary distribution with Maven Wrapper",id:"building-source-code--binary-distribution-with-maven-wrapper",children:[]}]}],l={toc:u};function b(e){var r=e.components,t=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(n.a)({},l,t,{components:r,mdxType:"MDXLayout"}),Object(i.b)("h2",{id:"prerequisites"},"Prerequisites"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"JDK 1.8"),Object(i.b)("li",{parentName:"ul"},"Maven 3.3 or later ( < 3.8.1 )"),Object(i.b)("li",{parentName:"ul"},"Docker")),Object(i.b)("h2",{id:"quick-start"},"Quick Start"),Object(i.b)("h3",{id:"build-your-custom-submarine-docker-images"},"Build Your Custom Submarine Docker Images"),Object(i.b)("p",null,"Submarine provides default Docker image in the release artifacts, sometimes you would like to do some modifications on the images. You can rebuild Docker image after you make changes."),Object(i.b)("blockquote",null,Object(i.b)("p",{parentName:"blockquote"},"Note that you need to make sure the images built above can be accessed in k8s\nUsually this needs to rename and push to a proper Docker registry.")),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-bash"},"mvn clean package -DskipTests\n")),Object(i.b)("p",null,"Build submarine server image:"),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-bash"},"./dev-support/docker-images/submarine/build.sh\n")),Object(i.b)("p",null,"Build submarine database image:"),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-bash"},"./dev-support/docker-images/database/build.sh\n")),Object(i.b)("h3",{id:"building-source-code--binary-distribution"},"Building source code / binary distribution"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Checking releases for licenses")),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre"},"mvn clean org.apache.rat:apache-rat-plugin:check\n")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Create binary distribution with default hadoop version")),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre"},"mvn clean package -DskipTests\n")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Create binary distribution with hadoop-2.9.x version")),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre"},"mvn clean package -DskipTests -Phadoop-2.9\n")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Create binary distribution with hadoop-2.10.x version")),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre"},"mvn clean package -DskipTests -Phadoop-2.10\n")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Create binary distribution with hadoop-3.1.x version")),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre"},"mvn clean package -DskipTests -Phadoop-3.1\n")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Create binary distribution with hadoop-3.2.x version")),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre"},"mvn clean package -DskipTests -Phadoop-3.2\n")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Create source code distribution")),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre"},"mvn clean package -DskipTests -Psrc\n")),Object(i.b)("h3",{id:"building-source-code--binary-distribution-with-maven-wrapper"},"Building source code / binary distribution with Maven Wrapper"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Maven Wrapper (Optional): Maven Wrapper can help you avoid dependencies problem about Maven version.")),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre"},"# Setup Maven Wrapper (Maven 3.6.1)\nmvn -N io.takari:maven:0.7.7:wrapper -Dmaven=3.6.1\n\n# Check Maven Wrapper\n./mvnw -version\n\n# Replace 'mvn' with 'mvnw'. Example:\n./mvnw clean package -DskipTests\n")))}b.isMDXComponent=!0},144:function(e,r,t){"use strict";t.d(r,"a",(function(){return s})),t.d(r,"b",(function(){return m}));var n=t(0),a=t.n(n);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function c(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach((function(r){i(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function u(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var l=a.a.createContext({}),b=function(e){var r=a.a.useContext(l),t=r;return e&&(t="function"==typeof e?e(r):c(c({},r),e)),t},s=function(e){var r=b(e.components);return a.a.createElement(l.Provider,{value:r},e.children)},p={inlineCode:"code",wrapper:function(e){var r=e.children;return a.a.createElement(a.a.Fragment,{},r)}},d=a.a.forwardRef((function(e,r){var t=e.components,n=e.mdxType,i=e.originalType,o=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),s=b(t),d=n,m=s["".concat(o,".").concat(d)]||s[d]||p[d]||i;return t?a.a.createElement(m,c(c({ref:r},l),{},{components:t})):a.a.createElement(m,c({ref:r},l))}));function m(e,r){var t=arguments,n=r&&r.mdxType;if("string"==typeof e||n){var i=t.length,o=new Array(i);o[0]=d;var c={};for(var u in r)hasOwnProperty.call(r,u)&&(c[u]=r[u]);c.originalType=e,c.mdxType="string"==typeof e?e:n,o[1]=c;for(var l=2;l<i;l++)o[l]=t[l];return a.a.createElement.apply(null,o)}return a.a.createElement.apply(null,t)}d.displayName="MDXCreateElement"}}]);