blob: 0db33860084b9dd80ddd86a8cd4897d920f06510 [file] [log] [blame]
"use strict";(self.webpackChunkdocs_v_2=self.webpackChunkdocs_v_2||[]).push([[7228],{95788:(e,t,n)=>{n.d(t,{Iu:()=>p,yg:()=>g});var a=n(11504);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),d=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=d(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=d(n),m=r,g=u["".concat(s,".").concat(m)]||u[m]||c[m]||i;return n?a.createElement(g,l(l({ref:t},p),{},{components:n})):a.createElement(g,l({ref:t},p))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=m;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[u]="string"==typeof e?e:r,l[1]=o;for(var d=2;d<i;d++)l[d]=n[d];return a.createElement.apply(null,l)}return a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},41680:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>c,frontMatter:()=>i,metadata:()=>o,toc:()=>d});var a=n(45072),r=(n(11504),n(95788));const i={},l="Docker builds, images and tags",o={unversionedId:"installation/docker",id:"installation/docker",title:"Docker builds, images and tags",description:"The Apache Superset community extensively uses Docker for development, release,",source:"@site/docs/installation/docker.mdx",sourceDirName:"installation",slug:"/installation/docker",permalink:"/docs/installation/docker",draft:!1,editUrl:"https://github.com/apache/superset/edit/master/docs/docs/installation/docker.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Setup SSH Tunneling",permalink:"/docs/installation/setup-ssh-tunneling"},next:{title:"Creating Your First Dashboard",permalink:"/docs/creating-charts-dashboards/creating-your-first-dashboard"}},s={},d=[{value:"Key tags examples",id:"key-tags-examples",level:2},{value:"Caching",id:"caching",level:2},{value:"About database drivers",id:"about-database-drivers",level:2},{value:"On supporting different platforms (namely arm64 AND amd64)",id:"on-supporting-different-platforms-namely-arm64-and-amd64",level:2},{value:"Working with Apple silicon",id:"working-with-apple-silicon",level:3}],p={toc:d},u="wrapper";function c(e){let{components:t,...n}=e;return(0,r.yg)(u,(0,a.c)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"docker-builds-images-and-tags"},"Docker builds, images and tags"),(0,r.yg)("p",null,"The Apache Superset community extensively uses Docker for development, release,\nand productionizing Superset. This page details our Docker builds and tag naming\nschemes to help users navigate our offerings."),(0,r.yg)("p",null,"Images are built and pushed to the ",(0,r.yg)("a",{parentName:"p",href:"https://hub.docker.com/r/apache/superset"},"Superset Docker Hub repository")," using GitHub Actions.\nDifferent sets of images are built and/or published at different times:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Published releases")," (",(0,r.yg)("inlineCode",{parentName:"li"},"release"),"): published using\ntags like ",(0,r.yg)("inlineCode",{parentName:"li"},"3.0.0")," and the ",(0,r.yg)("inlineCode",{parentName:"li"},"latest")," tag."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Pull request iterations")," (",(0,r.yg)("inlineCode",{parentName:"li"},"pull_request"),"): for each pull request, while\nwe actively build the docker to validate the build, we do\nnot publish those images for security reasons, we simply ",(0,r.yg)("inlineCode",{parentName:"li"},"docker build --load")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Merges to the main branch")," (",(0,r.yg)("inlineCode",{parentName:"li"},"push"),"): resulting in new SHAs, with tags\nprefixed with ",(0,r.yg)("inlineCode",{parentName:"li"},"master")," for the latest ",(0,r.yg)("inlineCode",{parentName:"li"},"master")," version.")),(0,r.yg)("h1",{id:"build-presets"},"Build presets"),(0,r.yg)("p",null,'We have a set of build "presets" that each represent a combination of\nparameters for the build, mostly pointing to either different target layer\nfor the build, and/or base image.'),(0,r.yg)("p",null,"Here are the build presets that are exposed through the ",(0,r.yg)("inlineCode",{parentName:"p"},"build_docker.py")," script:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"lean"),": The default Docker image, including both frontend and backend. Tags\nwithout a build_preset are lean builds, e.g., ",(0,r.yg)("inlineCode",{parentName:"li"},"latest"),"."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"dev"),": For development, with a headless browser, dev-related utilities and root access."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"py310"),", e.g., Py310: Similar to lean but with a different Python version (in this example, 3.10)."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"ci"),": For certain CI workloads."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"websocket"),": For Superset clusters supporting advanced features."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"dockerize"),": Used by Helm.")),(0,r.yg)("h2",{id:"key-tags-examples"},"Key tags examples"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"latest"),": The latest official release build"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"latest-dev"),": the ",(0,r.yg)("inlineCode",{parentName:"li"},"-dev")," image of the latest official release build, with a\nheadless browser and root access."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"master"),": The latest build from the ",(0,r.yg)("inlineCode",{parentName:"li"},"master")," branch, implicitly the lean build\npreset"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"master-dev"),": Similar to ",(0,r.yg)("inlineCode",{parentName:"li"},"master")," but includes a headless browser and root access."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"pr-5252"),": The latest commit in PR 5252."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"30948dc401b40982cb7c0dbf6ebbe443b2748c1b-dev"),": A build for\nthis specific SHA, which could be from a ",(0,r.yg)("inlineCode",{parentName:"li"},"master")," merge, or release."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"websocket-latest"),": The WebSocket image for use in a Superset cluster.")),(0,r.yg)("p",null,"For insights or modifications to the build matrix and tagging conventions,\ncheck the ",(0,r.yg)("a",{parentName:"p",href:"https://github.com/apache/superset/blob/master/scripts/build_docker.py"},"build_docker.py"),"\nscript and the ",(0,r.yg)("a",{parentName:"p",href:"https://github.com/apache/superset/blob/master/.github/workflows/docker.yml"},"docker.yml"),"\nGitHub action."),(0,r.yg)("h2",{id:"caching"},"Caching"),(0,r.yg)("p",null,"To accelerate builds, we follow Docker best practices and use ",(0,r.yg)("inlineCode",{parentName:"p"},"apache/superset-cache"),"."),(0,r.yg)("h2",{id:"about-database-drivers"},"About database drivers"),(0,r.yg)("p",null,"Our docker images come with little to zero database driver support since\neach envrionment requires different drivers, and mataining a build with\nwide database support would be both challenging (dozens of databases,\npython drivers, and os dependencies) and inefficient (longer\nbuild times, larger images, lower layer cache hit rate, ...)."),(0,r.yg)("p",null,"For production use cases, we recommend that you derive our ",(0,r.yg)("inlineCode",{parentName:"p"},"lean")," image(s) and\nadd database support for the database you need."),(0,r.yg)("h2",{id:"on-supporting-different-platforms-namely-arm64-and-amd64"},"On supporting different platforms (namely arm64 AND amd64)"),(0,r.yg)("p",null,"Currently all automated builds are multi-platform, supporting both ",(0,r.yg)("inlineCode",{parentName:"p"},"linux/arm64"),"\nand ",(0,r.yg)("inlineCode",{parentName:"p"},"linux/amd64"),". This enables higher level constructs like ",(0,r.yg)("inlineCode",{parentName:"p"},"helm")," and\ndocker-compose to point to these images and effectively be multi-platform\nas well."),(0,r.yg)("p",null,"Pull requests and master builds\nare one-image-per-platform so that they can be parallized and the\nbuild matrix for those is more sparse as we don't need to build every\nbuild preset on every platform, and generally can be more selective here.\nFor those builds, we suffix tags with ",(0,r.yg)("inlineCode",{parentName:"p"},"-arm")," where it applies."),(0,r.yg)("h3",{id:"working-with-apple-silicon"},"Working with Apple silicon"),(0,r.yg)("p",null,"Apple's current generation of computers uses ARM-based CPUs, and Docker\nrunning on MACs seem to require ",(0,r.yg)("inlineCode",{parentName:"p"},"linux/arm64/v8")," (at least one user's M2 was\nconfigured in that way). Setting the environment\nvariable ",(0,r.yg)("inlineCode",{parentName:"p"},"DOCKER_DEFAULT_PLATFORM")," to ",(0,r.yg)("inlineCode",{parentName:"p"},"linux/amd64")," seems to function in\nterm of leveraging, and building upon the Superset builds provided here."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre"},"export DOCKER_DEFAULT_PLATFORM=linux/amd64\n")),(0,r.yg)("p",null,"Presumably, ",(0,r.yg)("inlineCode",{parentName:"p"},"linux/arm64/v8")," would be more optimized for this generation\nof chips, but less compatible across the ARM ecosystem."))}c.isMDXComponent=!0}}]);