Launch a JupyterLab notebook with a dedicated Spark Connect cluster for interactive big data workloads.
TrueFoundry Spark Notebooks provide a JupyterLab environment with a dedicated Spark Connect server running alongside it. This gives you an interactive PySpark and Scala environment backed by a fully managed Spark cluster on Kubernetes — with no external infrastructure to set up.Use Spark Notebooks when you need to:
Explore and transform large datasets interactively
Prototype Spark ETL pipelines before productionizing them
Run distributed computations without managing Spark infrastructure
Getting Started
To launch a Spark Notebook, select Jupyter Notebook with Spark as the workbench type in the deployment form and configure the Spark cluster settings.
Select Jupyter Notebook with Spark as the workbench type
1
Create a new Notebook
Navigate to your workspace and click New Notebook. Select the Jupyter Notebook with Spark type.
2
Choose a Spark image
Select the pre-built Spark image or provide a custom extended image.
Image selection and notebook configuration
3
Configure Spark cluster resources
Set the driver resources, executor count (or dynamic scaling), and executor resources.
Spark Cluster Config — driver resources and executor instances
4
Launch
Click deploy. The notebook and Spark Connect server will start together. A SparkSession is automatically available in every Python and Scala notebook cell.
Pre-built Images
Multiple pre-built images are available, each aligned to a Databricks LTS runtime version:
All images are hosted under public.ecr.aws/truefoundrycloud/. For example, the full URI for the Databricks 17.3 LTS image is public.ecr.aws/truefoundrycloud/jupyter-spark:0.4.10-py3.12.3-sc2.13-spark4.0.2-delta4.0.1-sudo.
Scala kernel (Almond) pre-configured with Spark Connect JARs
Conda for managing multiple Python environments
Using Spark in the Notebook
Spark is preconfigured in the notebook and available via the spark variable.
# `spark` is already available — no setup neededdf = spark.range(1000000).toDF("id")df.filter(df.id % 2 == 0).count()
// SparkSession is pre-initialized in the Scala kernelval df = spark.range(1000000).toDF("id")df.filter($"id" % 2 === 0).count()
The notebook connects to the Spark Connect server via the SPARK_CONNECT_URL environment variable, which is automatically set to point to the co-located Spark Connect server.
The startup script retries the connection up to 5 times (configurable via SPARK_INIT_RETRIES). If the Spark Connect server hasn’t started yet, the session will be created once it becomes available.
Using Delta Lake
Delta Lake is pre-installed, enabling ACID transactions on your data lake:
The Spark cluster is configured through the Spark Cluster Config section in the deployment form.
Driver Resources
The Spark Connect server (driver) runs as a separate pod. Configure its resources based on the complexity of your query plans and the volume of data collected to the driver.
number
default:"1"
Minimum CPU cores for the driver.
number
default:"3"
Maximum CPU cores for the driver.
number
default:"4000"
Minimum memory in MB for the driver.
number
default:"6000"
Maximum memory in MB for the driver.
Executor Instances
Choose between Fixed and Dynamic executor scaling:
Fixed Instances
Dynamic Scaling
A fixed number of executor pods are launched when the Spark cluster starts.
Parameter
Default
Description
count
2
Number of executor pods to start
Executors scale up and down based on workload. Idle executors are removed and new ones are added when tasks are queued.
Parameter
Default
Description
min
1
Minimum number of executors
max
4
Maximum number of executors
Executor Resources
Each executor pod gets its own resource allocation:
number
default:"2"
CPU cores per executor.
number
default:"4000"
Memory in MB per executor.
number
default:"5000"
Ephemeral disk in MB per executor (used for shuffle data).
Spark Configuration Properties
Pass additional Spark configuration as key-value pairs. These are applied to the Spark Connect server and executors.
Some internal configuration (e.g., spark.jars.ivy, connection timeouts, spark.connect packages) is managed automatically. User-supplied spark.jars.packages values are merged with the internal ones.
Spark Image
By default, the Spark Connect server and executors use the apache/spark:4.0.2 image.You can override this with a custom Spark image in the Advanced section of the Spark Cluster Config. The image must have Spark pre-installed and be compatible with the Kubernetes executor model.
Environment Variables
The following environment variables are automatically set or can be overridden:
Variable
Default
Description
SPARK_CONNECT_URL
Auto-generated
gRPC URL of the Spark Connect server
SPARK_INIT_RETRIES
5
Number of connection retries at startup
SPARK_INIT_RETRY_DELAY
3
Seconds between retries
You can also add custom environment variables (plain text or secret references) in the deployment form for your application code.
Service Account
If your Spark jobs need to access cloud storage (S3, GCS, ADLS) or other cloud services, assign a Kubernetes service account with the appropriate IAM role to the notebook. The Spark Connect server and executors inherit this service account for cloud access.Configure the service account in the Advanced section of the deployment form.
Do not overwrite the ENTRYPOINT or CMD instructions. These are built into the base images and are critical for correct operation.
Build and push the image to a registry integrated with TrueFoundry, then select it as a custom image when creating the notebook.
AI Coding Agents
Spark notebook images include AI coding agents (OpenCode and Claude Code) via Jupyter AI v3. These agents can help with Spark code, debug notebook errors, and interact with both Python and Scala kernels.To enable AI agents, set environment variables on your Spark notebook deployment. See the AI Coding Agents in Notebooks section in the Jupyter Notebook guide for setup instructions.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"TrueFoundry Docs","description":"TrueFoundry documentation — enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways to connect, monitor, and govern agentic AI applications across providers from a unified control plane.","colors":{"primary":"#4f46e5","light":"#4f46e5","dark":"#4f46e5"},"logo":{"light":"https://mintcdn.com/truefoundry/e2uUimEwX30qkWxc/logo/light.svg?fit=max\u0026auto=format\u0026n=e2uUimEwX30qkWxc\u0026q=85\u0026s=6068d83664aeda0239bec2422657dd20","dark":"https://mintcdn.com/truefoundry/e2uUimEwX30qkWxc/logo/dark.svg?fit=max\u0026auto=format\u0026n=e2uUimEwX30qkWxc\u0026q=85\u0026s=c1cb26554a546d84500b40f7057bece8"},"favicon":"https://mintcdn.com/truefoundry/6bbtTt95c1iCcyph/favicon.svg?fit=max\u0026auto=format\u0026n=6bbtTt95c1iCcyph\u0026q=85\u0026s=f55bde34214b38034126d05b08ea16c7","appearance":{"default":"light"},"background":{"decoration":"grid"},"navbar":{"links":[{"href":"https://www.truefoundry.com/book-demo","label":"Book Demo"},{"href":"https://www.truefoundry.com/blog","label":"Blog"}],"primary":{"type":"button","label":"Sign Up","href":"https://www.truefoundry.com/register"}},"footer":{"socials":{"x":"https://twitter.com/truefoundry","linkedin":"https://in.linkedin.com/company/truefoundry"}},"seo":{"metatags":{"og:type":"website","og:site_name":"TrueFoundry Docs","og:image":"https://assets.production.truefoundry.com/logo.svg","og:description":"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane.","description":"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane."}},"icons":{"library":"fontawesome"},"styling":{"codeblocks":"dark","latex":true},"integrations":{"ga4":{"measurementId":"G-BSSG699JC1"}},"contextual":{"options":["copy","view","chatgpt","claude","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"truefoundry","hasAudioNarration":false,"actualSubdomain":"truefoundry","customDomains":["www.truefoundry.com"],"gitSource":{"type":"github","owner":"truefoundry","repo":"docs-mintlify","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b05ceb00b3dd7d22f56270b","clientVersion":"0.0.4304","searchFilterCounts":[{"language":"default","tag":"AI Gateway","count":253},{"language":"default","tag":"API Reference","count":202},{"language":"default","tag":"Platform","count":198},{"language":"default","tag":"Integrations","count":138},{"language":"default","tag":"LLM Gateway","count":118},{"language":"default","tag":"AI Deployment","count":109},{"language":"default","tag":"Integrate Models","count":51},{"language":"default","tag":"Guardrails and Security","count":48},{"language":"default","tag":"Observability","count":47},{"language":"default","tag":"MCP Servers","count":44}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"[email protected]","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".line-highlight{background:rgb(var(--primary-light)/.7)!important}.tfy-cat-anchor{scroll-margin-top:6rem;margin-block:1.75rem}.line-highlight:before{background:rgb(var(--primary-light)/.7)!important}.line-highlight:after{background:rgb(var(--primary-light)/.7)!important}"}]}
{"page":{"pagePath":"docs/launch-notebook-with-spark","slug":"/docs/launch-notebook-with-spark","pageMetadata":{"title":"Launch Notebook with Spark","description":"Launch a JupyterLab notebook with a dedicated Spark Connect cluster for interactive big data workloads.","href":"/docs/launch-notebook-with-spark"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Launch a JupyterLab notebook with a dedicated Spark Connect cluster for interactive big data workloads.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Frame,Heading,Info,Note,OptimizedImage,ParamField,Step,Steps,Tab,Table,Tabs,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`TrueFoundry Spark Notebooks provide a JupyterLab environment with a dedicated `,_jsx(_components.a,{href:`https://spark.apache.org/docs/latest/spark-connect-overview.html`,children:`Spark Connect`}),` server running alongside it. This gives you an interactive PySpark and Scala environment backed by a fully managed Spark cluster on Kubernetes — with no external infrastructure to set up.`]}),`\n`,_jsx(_components.p,{children:`Use Spark Notebooks when you need to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Explore and transform large datasets interactively`}),`\n`,_jsx(_components.li,{children:`Prototype Spark ETL pipelines before productionizing them`}),`\n`,_jsx(_components.li,{children:`Run distributed computations without managing Spark infrastructure`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`getting-started`,children:`Getting Started`}),`\n`,_jsxs(_components.p,{children:[`To launch a Spark Notebook, select `,_jsx(_components.strong,{children:`Jupyter Notebook with Spark`}),` as the workbench type in the deployment form and configure the Spark cluster settings.`]}),`\n`,_jsx(Frame,{caption:`Select Jupyter Notebook with Spark as the workbench type`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-select-type.png?fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=3b95c6e558b40b70b900be2dbe9977f7`,alt:``,\"data-og-width\":`1024`,width:`1024`,\"data-og-height\":`596`,height:`596`,\"data-path\":`images/spark-notebook-select-type.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-select-type.png?w=280\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=be5e3398ea24f395b6aedf1606420288 280w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-select-type.png?w=560\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=192c0d80fc4d722e14ded79a163bc7f9 560w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-select-type.png?w=840\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=e6ae1f53d5d568287cee201d2191d37a 840w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-select-type.png?w=1100\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=f0e0a4919124687b1fb6541ed6c69c95 1100w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-select-type.png?w=1650\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=1941e1a9cde6c1d6c43cf1b93830f2a0 1650w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-select-type.png?w=2500\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=6a944f822d4bd2a7a9abdaf1f6e6b68e 2500w`})}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Create a new Notebook`,children:_jsxs(_components.p,{children:[`Navigate to your workspace and click `,_jsx(_components.strong,{children:`New Notebook`}),`. Select the `,_jsx(_components.strong,{children:`Jupyter Notebook with Spark`}),` type.`]})}),_jsxs(Step,{title:`Choose a Spark image`,children:[_jsx(_components.p,{children:`Select the pre-built Spark image or provide a custom extended image.`}),_jsx(Frame,{caption:`Image selection and notebook configuration`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/U0X9_nlHy-6thsfS/images/spark-notebook-image-config.png?fit=max\u0026auto=format\u0026n=U0X9_nlHy-6thsfS\u0026q=85\u0026s=dd526810c73c2104cd0a8c748a3d637b`,alt:``,\"data-og-width\":`1024`,width:`1024`,\"data-og-height\":`610`,height:`610`,\"data-path\":`images/spark-notebook-image-config.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/U0X9_nlHy-6thsfS/images/spark-notebook-image-config.png?w=280\u0026fit=max\u0026auto=format\u0026n=U0X9_nlHy-6thsfS\u0026q=85\u0026s=3757ccbaa05754b310753f1cda817e54 280w, https://mintcdn.com/truefoundry/U0X9_nlHy-6thsfS/images/spark-notebook-image-config.png?w=560\u0026fit=max\u0026auto=format\u0026n=U0X9_nlHy-6thsfS\u0026q=85\u0026s=8b849c0b57ac2e6e542a484fcbc86f82 560w, https://mintcdn.com/truefoundry/U0X9_nlHy-6thsfS/images/spark-notebook-image-config.png?w=840\u0026fit=max\u0026auto=format\u0026n=U0X9_nlHy-6thsfS\u0026q=85\u0026s=8f672f4eefdc615b7555115cf7ac2360 840w, https://mintcdn.com/truefoundry/U0X9_nlHy-6thsfS/images/spark-notebook-image-config.png?w=1100\u0026fit=max\u0026auto=format\u0026n=U0X9_nlHy-6thsfS\u0026q=85\u0026s=f51240bc9a5e03610244d91c76fba03e 1100w, https://mintcdn.com/truefoundry/U0X9_nlHy-6thsfS/images/spark-notebook-image-config.png?w=1650\u0026fit=max\u0026auto=format\u0026n=U0X9_nlHy-6thsfS\u0026q=85\u0026s=0b7b1be14c43d2c7de8c23038a136048 1650w, https://mintcdn.com/truefoundry/U0X9_nlHy-6thsfS/images/spark-notebook-image-config.png?w=2500\u0026fit=max\u0026auto=format\u0026n=U0X9_nlHy-6thsfS\u0026q=85\u0026s=0d57a806330cfd67586f35e97b551924 2500w`})})]}),_jsxs(Step,{title:`Configure Spark cluster resources`,children:[_jsx(_components.p,{children:`Set the driver resources, executor count (or dynamic scaling), and executor resources.`}),_jsx(Frame,{caption:`Spark Cluster Config — driver resources and executor instances`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-cluster-config.png?fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=33b4060faac75fd2167c130ce8f2008f`,alt:``,\"data-og-width\":`1024`,width:`1024`,\"data-og-height\":`688`,height:`688`,\"data-path\":`images/spark-notebook-cluster-config.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-cluster-config.png?w=280\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=923e271fef336b46a8acd15c0af4e675 280w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-cluster-config.png?w=560\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=22c0a9a19a61f37d27787c0f1a4a1f1e 560w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-cluster-config.png?w=840\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=44becc4317700e9f568858eee6f40ed6 840w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-cluster-config.png?w=1100\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=c4f362dda0d50a67f26f16b099467fa7 1100w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-cluster-config.png?w=1650\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=737fea7716ebdc3e3c363a0f47086bdb 1650w, https://mintcdn.com/truefoundry/XtxgxhalGETYdfqO/images/spark-notebook-cluster-config.png?w=2500\u0026fit=max\u0026auto=format\u0026n=XtxgxhalGETYdfqO\u0026q=85\u0026s=64d6a416e483f461cda93444420924b7 2500w`})})]}),_jsx(Step,{title:`Launch`,children:_jsxs(_components.p,{children:[`Click deploy. The notebook and Spark Connect server will start together. A `,_jsx(_components.code,{children:`SparkSession`}),` is automatically available in every Python and Scala notebook cell.`]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`pre-built-images`,children:`Pre-built Images`}),`\n`,_jsx(_components.p,{children:`Multiple pre-built images are available, each aligned to a Databricks LTS runtime version:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Image`}),_jsx(_components.th,{children:`Spark`}),_jsx(_components.th,{children:`Python`}),_jsx(_components.th,{children:`Scala`}),_jsx(_components.th,{children:`Delta Lake`}),_jsx(_components.th,{children:`Databricks LTS`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`jupyter-spark:0.4.10-py3.12.3-sc2.13-spark4.0.2-delta4.0.1-sudo`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`4.0.2`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.12`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2.13`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`4.0.1`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`17.3`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`jupyter-spark:0.4.10-py3.11.14-sc2.12-spark3.5.7-delta3.3.2-sudo`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.5.7`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.11`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2.12`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.3.2`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`16.4`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`jupyter-spark:0.4.10-py3.10.16-sc2.12-spark3.5.7-delta3.3.2-sudo`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.5.7`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.10`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2.12`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.3.2`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`15.4`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`jupyter-spark:0.4.10-py3.10.16-sc2.12-spark3.5.7-delta3.1.0-sudo`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.5.7`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.10`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2.12`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3.1.0`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`14.3`})]})]})]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`All images are hosted under `,_jsx(_components.code,{children:`public.ecr.aws/truefoundrycloud/`}),`. For example, the full URI for the Databricks 17.3 LTS image is `,_jsx(_components.code,{children:`public.ecr.aws/truefoundrycloud/jupyter-spark:0.4.10-py3.12.3-sc2.13-spark4.0.2-delta4.0.1-sudo`}),`.`]})}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`All Jupyter Spark images are available at `,_jsx(_components.a,{href:`https://gallery.ecr.aws/truefoundrycloud/jupyter-spark`,children:`https://gallery.ecr.aws/truefoundrycloud/jupyter-spark`})]})}),`\n`,_jsx(_components.p,{children:`The image includes:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`PySpark`}),` with Spark Connect client`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Delta Lake`}),` for ACID table operations`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Scala kernel`}),` (Almond) pre-configured with Spark Connect JARs`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Conda`}),` for managing multiple Python environments`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`using-spark-in-the-notebook`,children:`Using Spark in the Notebook`}),`\n`,_jsxs(_components.p,{children:[`Spark is preconfigured in the notebook and available via the `,_jsx(_components.code,{children:`spark`}),` variable.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`3`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:\"# `spark` is already available — no setup needed\"})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`df = spark.range(`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1000000`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).toDF(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`df.filter(df.id % `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` == `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).count()`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Scala`,numberOfLines:`3`,language:`scala`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`scala`,children:_jsxs(_components.code,{language:`scala`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// SparkSession is pre-initialized in the Scala kernel`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` df`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = spark.range(`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1000000`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).toDF(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`df.filter($`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` % `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` === `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).count()`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`The notebook connects to the Spark Connect server via the `,_jsx(_components.code,{children:`SPARK_CONNECT_URL`}),` environment variable, which is automatically set to point to the co-located Spark Connect server.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The startup script retries the connection up to 5 times (configurable via `,_jsx(_components.code,{children:`SPARK_INIT_RETRIES`}),`). If the Spark Connect server hasn’t started yet, the session will be created once it becomes available.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`using-delta-lake`,children:`Using Delta Lake`}),`\n`,_jsx(_components.p,{children:`Delta Lake is pre-installed, enabling ACID transactions on your data lake:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`df.write.format(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"delta\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).mode(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"overwrite\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).save(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"s3a://my-bucket/delta-table/\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`delta_df = spark.read.format(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"delta\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).load(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"s3a://my-bucket/delta-table/\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`delta_df.show()`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`spark-cluster-configuration`,children:`Spark Cluster Configuration`}),`\n`,_jsxs(_components.p,{children:[`The Spark cluster is configured through the `,_jsx(_components.strong,{children:`Spark Cluster Config`}),` section in the deployment form.`]}),`\n`,_jsx(Heading,{level:`3`,id:`driver-resources`,children:`Driver Resources`}),`\n`,_jsx(_components.p,{children:`The Spark Connect server (driver) runs as a separate pod. Configure its resources based on the complexity of your query plans and the volume of data collected to the driver.`}),`\n`,_jsx(ParamField,{body:`cpu_request`,type:`number`,default:`1`,id:`param-cpu-request`,children:_jsx(_components.p,{children:`Minimum CPU cores for the driver.`})}),`\n`,_jsx(ParamField,{body:`cpu_limit`,type:`number`,default:`3`,id:`param-cpu-limit`,children:_jsx(_components.p,{children:`Maximum CPU cores for the driver.`})}),`\n`,_jsx(ParamField,{body:`memory_request`,type:`number`,default:`4000`,id:`param-memory-request`,children:_jsx(_components.p,{children:`Minimum memory in MB for the driver.`})}),`\n`,_jsx(ParamField,{body:`memory_limit`,type:`number`,default:`6000`,id:`param-memory-limit`,children:_jsx(_components.p,{children:`Maximum memory in MB for the driver.`})}),`\n`,_jsx(Heading,{level:`3`,id:`executor-instances`,children:`Executor Instances`}),`\n`,_jsxs(_components.p,{children:[`Choose between `,_jsx(_components.strong,{children:`Fixed`}),` and `,_jsx(_components.strong,{children:`Dynamic`}),` executor scaling:`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Fixed Instances`,id:`fixed-instances`,children:[_jsx(_components.p,{children:`A fixed number of executor pods are launched when the Spark cluster starts.`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Description`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`count`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2`}),_jsx(_components.td,{children:`Number of executor pods to start`})]})})]})]}),_jsxs(Tab,{title:`Dynamic Scaling`,id:`dynamic-scaling`,children:[_jsx(_components.p,{children:`Executors scale up and down based on workload. Idle executors are removed and new ones are added when tasks are queued.`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`min`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1`}),_jsx(_components.td,{children:`Minimum number of executors`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`max`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`4`}),_jsx(_components.td,{children:`Maximum number of executors`})]})]})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`executor-resources`,children:`Executor Resources`}),`\n`,_jsx(_components.p,{children:`Each executor pod gets its own resource allocation:`}),`\n`,_jsx(ParamField,{body:`cpu_request`,type:`number`,default:`2`,id:`param-cpu-request-1`,children:_jsx(_components.p,{children:`CPU cores per executor.`})}),`\n`,_jsx(ParamField,{body:`memory_request`,type:`number`,default:`4000`,id:`param-memory-request-1`,children:_jsx(_components.p,{children:`Memory in MB per executor.`})}),`\n`,_jsx(ParamField,{body:`ephemeral_storage_request`,type:`number`,default:`5000`,id:`param-ephemeral-storage-request`,children:_jsx(_components.p,{children:`Ephemeral disk in MB per executor (used for shuffle data).`})}),`\n`,_jsx(Heading,{level:`3`,id:`spark-configuration-properties`,children:`Spark Configuration Properties`}),`\n`,_jsx(_components.p,{children:`Pass additional Spark configuration as key-value pairs. These are applied to the Spark Connect server and executors.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`spark.sql.adaptive.enabled = true`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`spark.sql.shuffle.partitions = 200`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`spark.jars.packages = io.delta:delta-spark_2.12:3.3.2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Some internal configuration (e.g., `,_jsx(_components.code,{children:`spark.jars.ivy`}),`, connection timeouts, `,_jsx(_components.code,{children:`spark.connect`}),` packages) is managed automatically. User-supplied `,_jsx(_components.code,{children:`spark.jars.packages`}),` values are merged with the internal ones.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`spark-image`,children:`Spark Image`}),`\n`,_jsxs(_components.p,{children:[`By default, the Spark Connect server and executors use the `,_jsx(_components.code,{children:`apache/spark:4.0.2`}),` image.`]}),`\n`,_jsxs(_components.p,{children:[`You can override this with a custom Spark image in the `,_jsx(_components.strong,{children:`Advanced`}),` section of the Spark Cluster Config. The image must have Spark pre-installed and be compatible with the Kubernetes executor model.`]}),`\n`,_jsx(Heading,{level:`2`,id:`environment-variables`,children:`Environment Variables`}),`\n`,_jsx(_components.p,{children:`The following environment variables are automatically set or can be overridden:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Variable`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`SPARK_CONNECT_URL`})}),_jsx(_components.td,{children:`Auto-generated`}),_jsx(_components.td,{children:`gRPC URL of the Spark Connect server`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`SPARK_INIT_RETRIES`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`5`})}),_jsx(_components.td,{children:`Number of connection retries at startup`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`SPARK_INIT_RETRY_DELAY`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`3`})}),_jsx(_components.td,{children:`Seconds between retries`})]})]})]}),`\n`,_jsx(_components.p,{children:`You can also add custom environment variables (plain text or secret references) in the deployment form for your application code.`}),`\n`,_jsx(Heading,{level:`2`,id:`service-account`,children:`Service Account`}),`\n`,_jsx(_components.p,{children:`If your Spark jobs need to access cloud storage (S3, GCS, ADLS) or other cloud services, assign a Kubernetes service account with the appropriate IAM role to the notebook. The Spark Connect server and executors inherit this service account for cloud access.`}),`\n`,_jsxs(_components.p,{children:[`Configure the service account in the `,_jsx(_components.strong,{children:`Advanced`}),` section of the deployment form.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`AWS: `,_jsx(_components.a,{href:`/docs/use-aws-services-using-iam-serviceaccount`,children:`Authenticate to AWS services using IAM service account`})]}),`\n`,_jsxs(_components.li,{children:[`GCP: `,_jsx(_components.a,{href:`/docs/authenticate-to-gcp-using-iam-serviceaccount`,children:`Authenticate to GCP using IAM serviceaccount`})]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`custom-images`,children:`Custom Images`}),`\n`,_jsx(_components.p,{children:`You can build custom Spark notebook images by extending the pre-built base images:`}),`\n`,_jsx(CodeGroup,{children:_jsx(CodeBlock,{filename:`Dockerfile`,numberOfLines:`14`,language:`docker`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`docker`,children:_jsxs(_components.code,{language:`docker`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` public.ecr.aws/truefoundrycloud/jupyter-spark:0.4.10-py3.11.14-sc2.12-spark3.5.7-delta3.3.2-sudo`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Install additional pip packages`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`RUN`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` python3 -m pip install --no-cache-dir \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` koalas \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` mlflow \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` scikit-learn`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Install apt packages`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`USER`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` root`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`RUN`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` DEBIAN_FRONTEND=noninteractive apt-get update \u0026\u0026 \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` apt-get install -y --no-install-recommends graphviz \u0026\u0026 \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` apt-get clean \u0026\u0026 rm -rf /var/lib/apt/lists/*`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`USER`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` jovyan`})]}),`\n`]})})})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Do not overwrite the ENTRYPOINT or CMD instructions. These are built into the base images and are critical for correct operation.`})}),`\n`,_jsx(_components.p,{children:`Build and push the image to a registry integrated with TrueFoundry, then select it as a custom image when creating the notebook.`}),`\n`,_jsx(Heading,{level:`2`,id:`ai-coding-agents`,children:`AI Coding Agents`}),`\n`,_jsx(_components.p,{children:`Spark notebook images include AI coding agents (OpenCode and Claude Code) via Jupyter AI v3. These agents can help with Spark code, debug notebook errors, and interact with both Python and Scala kernels.`}),`\n`,_jsxs(_components.p,{children:[`To enable AI agents, set environment variables on your Spark notebook deployment. See the `,_jsx(_components.a,{href:`/docs/launch-notebooks#ai-coding-agents-in-notebooks`,children:`AI Coding Agents in Notebooks`}),` section in the Jupyter Notebook guide for setup instructions.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Launch Notebook with Spark","description":"Launch a JupyterLab notebook with a dedicated Spark Connect cluster for interactive big data workloads.","href":"/docs/launch-notebook-with-spark"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Getting Started","slug":"getting-started","depth":2,"children":[]},{"title":"Pre-built Images","slug":"pre-built-images","depth":2,"children":[]},{"title":"Using Spark in the Notebook","slug":"using-spark-in-the-notebook","depth":2,"children":[{"title":"Using Delta Lake","slug":"using-delta-lake","depth":3,"children":[]}]},{"title":"Spark Cluster Configuration","slug":"spark-cluster-configuration","depth":2,"children":[{"title":"Driver Resources","slug":"driver-resources","depth":3,"children":[]},{"title":"Executor Instances","slug":"executor-instances","depth":3,"children":[]},{"title":"Executor Resources","slug":"executor-resources","depth":3,"children":[]},{"title":"Spark Configuration Properties","slug":"spark-configuration-properties","depth":3,"children":[]},{"title":"Spark Image","slug":"spark-image","depth":3,"children":[]}]},{"title":"Environment Variables","slug":"environment-variables","depth":2,"children":[]},{"title":"Service Account","slug":"service-account","depth":2,"children":[]},{"title":"Custom Images","slug":"custom-images","depth":2,"children":[]},{"title":"AI Coding Agents","slug":"ai-coding-agents","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/truefoundry/9e0085f7ed271180/scripts.js"],"subdomain":"truefoundry","siteName":"TrueFoundry Docs","title":"Launch Notebook with Spark - TrueFoundry Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T07:27:51.532Z","originalFileLocation":"docs/launch-notebook-with-spark.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Launch a JupyterLab notebook with a dedicated Spark Connect cluster for interactive big data workloads.\">\u003cmeta data-mint-head name=\"application-name\" content=\"TrueFoundry Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Launch Notebook with Spark - TrueFoundry Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"TrueFoundry Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://www.truefoundry.com/docs/launch-notebook-with-spark\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://assets.production.truefoundry.com/logo.svg\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Launch Notebook with Spark - TrueFoundry Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://assets.production.truefoundry.com/logo.svg\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"TrueFoundry Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4f46e5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://www.truefoundry.com/docs/launch-notebook-with-spark\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/launch-notebook-with-spark.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.truefoundry.com/#organization\",\"name\":\"TrueFoundry Docs\",\"url\":\"https://www.truefoundry.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/truefoundry/e2uUimEwX30qkWxc/logo/light.svg?fit=max\u0026auto=format\u0026n=e2uUimEwX30qkWxc\u0026q=85\u0026s=6068d83664aeda0239bec2422657dd20\"}},{\"@type\":\"WebSite\",\"@id\":\"https://www.truefoundry.com#website\",\"name\":\"TrueFoundry Docs\",\"url\":\"https://www.truefoundry.com\",\"publisher\":{\"@id\":\"https://www.truefoundry.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://www.truefoundry.com/docs/launch-notebook-with-spark#webpage\",\"url\":\"https://www.truefoundry.com/docs/launch-notebook-with-spark\",\"name\":\"Launch Notebook with Spark\",\"description\":\"Launch a JupyterLab notebook with a dedicated Spark Connect cluster for interactive big data workloads.\",\"dateModified\":\"2026-11-13T07:27:51.532Z\",\"isPartOf\":{\"@id\":\"https://www.truefoundry.com#website\"},\"breadcrumb\":{\"@id\":\"https://www.truefoundry.com/docs/launch-notebook-with-spark#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://www.truefoundry.com/docs/launch-notebook-with-spark#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Train and Deploy Models\",\"item\":\"https://www.truefoundry.com/docs/model-deployment-introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Develop and Iterate\",\"item\":\"https://www.truefoundry.com/docs/launch-notebooks\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Launch Notebook with Spark\",\"item\":\"https://www.truefoundry.com/docs/launch-notebook-with-spark\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://www.truefoundry.com/docs/launch-notebook-with-spark#article\",\"headline\":\"Launch Notebook with Spark\",\"name\":\"Launch Notebook with Spark\",\"description\":\"Launch a JupyterLab notebook with a dedicated Spark Connect cluster for interactive big data workloads.\",\"url\":\"https://www.truefoundry.com/docs/launch-notebook-with-spark\",\"mainEntityOfPage\":{\"@id\":\"https://www.truefoundry.com/docs/launch-notebook-with-spark#webpage\"},\"image\":\"https://assets.production.truefoundry.com/logo.svg\",\"dateModified\":\"2026-11-13T07:27:51.532Z\",\"publisher\":{\"@id\":\"https://www.truefoundry.com/#organization\"},\"isPartOf\":{\"@id\":\"https://www.truefoundry.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"TrueFoundry Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"TrueFoundry Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/launch-notebook-with-spark.md","siteName":"TrueFoundry Docs","nav":{"global":null,"tabs":[{"tab":"AI Gateway","pages":[{"title":"AI Gateway","href":"/docs/ai-gateway/intro-to-llm-gateway"}]},{"tab":"Agent Platform","pages":[{"title":"Agent Platform","href":"/docs/agent-platform/agent-harness/overview"}]},{"tab":"Platform","pages":[{"title":"Platform","href":"/docs/platform/overview"}]},{"tab":"AI Deployment","groups":[{"group":"Introduction","pages":[{"title":"Introduction to AI Deployment","sidebarTitle":"Overview","href":"/docs/ai-deployment-overview"},{"title":"Key Concepts","href":"/docs/key-concepts"}]},{"group":"Train and Deploy Models","pages":[{"title":"Model Deployment Introduction","sidebarTitle":"Introduction","href":"/docs/model-deployment-introduction"},{"group":"Develop and Iterate","pages":[{"title":"Launch Jupyter Notebook","href":"/docs/launch-notebooks"},{"title":"Launch a SSH Server","description":"Launch an SSH server for debugging and secure access.","href":"/docs/launch-an-ssh-server"},{"title":"Launch Notebook with Spark","href":"/docs/launch-notebook-with-spark"}]},{"title":"Model Registry","description":"Store, version, and manage your ML models in the TrueFoundry model registry with stage transitions and metadata.","href":"/docs/model-registry"},{"group":"Deploy Model As API","pages":[{"title":"Model Deployment Overview","sidebarTitle":"Overview","href":"/docs/model-deployment/overview"},{"title":"HuggingFace","href":"/docs/model-deployment/deploy-model-from-huggingface"},{"title":"Scikit Learn / XGBoost","href":"/docs/model-deployment/deploy-sklearn-xgboost"},{"title":"FastAPI","href":"/docs/model-deployment/deploy-model-fastapi"},{"title":"LitServe","href":"/docs/model-deployment/deploy-litserve"},{"title":"AWS Multi-Model Server","href":"/docs/model-deployment/deploy-model-mms"},{"title":"TorchServe","href":"/docs/model-deployment/deploy-torchserve"},{"title":"TensorFlow Serve (TFServe)","href":"/docs/model-deployment/deploy-tfserve"},{"title":"MlFlow","href":"/docs/model-deployment/deploy-model-mlflow"},{"title":"Migrate Sagemaker Pytorch Endpoint","href":"/docs/model-deployment/migrate-from-sagemaker-pytorch-endpoint"}]}]},{"group":"Service Deployment","pages":[{"title":"Introduction","href":"/docs/introduction-to-a-service"},{"title":"Deploy Your First Service","sidebarTitle":"Getting Started","href":"/docs/deploy-first-service"},{"group":"Configuring your service","pages":[{"title":"Dockerize Your Code","href":"/docs/dockerize-code"},{"title":"Define Ports And Domains","href":"/docs/define-ports-and-domains"},{"title":"Add authentication to your Endpoints","sidebarTitle":"Endpoint Authentication","href":"/docs/endpoint-authentication"},{"group":"Resources","pages":[{"title":"Set Resources","href":"/docs/resources-cpu-memory-storage"},{"title":"Using Fractional GPUs","href":"/docs/using-fractional-gpus"},{"title":"Using TPUs","href":"/docs/using-tpus"}]},{"title":"Environment Variables \u0026 Secrets","sidebarTitle":"Environment Variables And Secrets","href":"/docs/environment-variables-and-secrets"},{"title":"Autoscaling Overview","sidebarTitle":"Autoscaling","href":"/docs/autoscaling-overview"},{"title":"Pause / Resume Service","href":"/docs/pause-resume-service"},{"title":"Scale Service to 0","href":"/docs/scale-service-to-0"},{"title":"Liveness/Readiness Probe","href":"/docs/liveness-readiness-probe"},{"title":"Rollout Strategy","href":"/docs/rollout-strategy"},{"title":"Access Cloud Services Like S3","href":"/docs/access-data-from-s3-or-other-clouds-services"},{"title":"Download Models/Artifacts","href":"/docs/download-and-cache-models"},{"title":"Redirect And Mirror Traffic","href":"/docs/intercepts"},{"title":"Kustomize Support","href":"/docs/kustomize"},{"title":"Sticky Routing","href":"/docs/sticky-routing"},{"title":"Mounting Volumes/Files","href":"/docs/mounting-volumes-service"},{"title":"Deploy a Service Programmatically","sidebarTitle":"Deploy Programatically","href":"/docs/deploy-service-programatically"},{"title":"Set Up CI/CD","href":"/docs/setting-up-cicd-for-your-service"},{"title":"Update, Rollback, Promote","href":"/docs/update-rollback-promote-your-service"},{"title":"View Logs, Metrics And Events","href":"/docs/monitor-your-service"},{"title":"Log \u0026 Monitor Custom Metrics","href":"/docs/log-monitor-custom-metrics"},{"title":"Setup Alerts","href":"/docs/setup-alerts"},{"title":"Docker Build Secrets","href":"/docs/docker-build-secrets"}]}]},{"group":"Job Deployment","pages":[{"title":"Jobs Introduction","sidebarTitle":"Introduction","href":"/docs/introduction-to-a-job"},{"title":"Deploy Job from GitHub","sidebarTitle":"Getting Started","href":"/docs/deploy-job-from-a-public-github-repository"},{"group":"Configuring your Job","pages":[{"title":"Parameterize A Job","href":"/docs/deploy-a-job-with-additional-parameters"},{"title":"Env Variables \u0026 Secrets for Jobs","sidebarTitle":"Environment Variables And Secrets","href":"/docs/environment-variables-and-secrets-jobs"},{"title":"Mounting Volumes","href":"/docs/mounting-volumes-job"},{"title":"Set Retries And Timeout","href":"/docs/retries-and-timeout"},{"title":"Set Concurrency Limit","href":"/docs/concurrency-limits"},{"title":"Deploy a Job Programmatically","sidebarTitle":"Deploy Programatically","href":"/docs/deploy-job-programatically"},{"title":"Monitor Your Job","href":"/docs/monitor-your-job"},{"title":"Access Data From S3 Or Other Clouds","href":"/docs/access-data-from-s3-or-other-clouds-jobs"},{"title":"Add Alerts To Your Job","href":"/docs/add-alerts-to-your-job"},{"title":"Logging Data in Job Runs","href":"/docs/job-runs-and-logging"}]},{"group":"Configuring your Spark Job","pages":[{"title":"Use blob storage with your Spark job","href":"/docs/deploy-a-spark-job-with-blob-storage"},{"title":"JVM metrics for Spark jobs","href":"/docs/spark-job-jvm-metrics"}]}]},{"group":"LLM Deployment","pages":[{"title":"Deploying LLMs","href":"/docs/deploying-an-llm-model-from-the-model-catalogue"},{"title":"Deploying NVIDIA NIM Models","href":"/docs/deploying-nvidia-nims"},{"title":"Benchmarking LLMs","href":"/docs/benchmarking-llms"}]},{"group":"LLM Finetuning","pages":[{"title":"Finetuning LLMs","href":"/docs/finetuning-a-model-from-the-model-catalogue"}]},{"group":"MCP Server Deployment","pages":[{"title":"MCP Server Deployment Overview","sidebarTitle":"Overview","href":"/docs/mcp-server-deployment/mcp-server-deployment-overview"},{"title":"Deploy MCP Server From Code","sidebarTitle":"Deploy From Code","href":"/docs/mcp-server-deployment/deploy-mcp-server-from-code"},{"title":"Deploy MCP Server from npx/uvx","sidebarTitle":"Deploy from npx/uvx","href":"/docs/mcp-server-deployment/deploy-mcp-server-from-npx-uvx"}]},{"group":"Workflow Deployment","pages":[{"title":"Introduction To Workflow","href":"/docs/introduction-to-workflow"},{"title":"Creating Your First Workflow","href":"/docs/creating-your-first-workflow"},{"title":"Interacting With Workflow","href":"/docs/interacting-with-workflow"},{"title":"Workflow Concepts","href":"/docs/workflow-concepts"},{"group":"Guides","pages":[{"title":"Creating A Workflow With Different Container Images","href":"/docs/creating-a-workflow-with-gpu-and-non-gpu-image"},{"title":"Using Dockerfile For Python Function Task","href":"/docs/python-function-tasks-with-dockefile"},{"title":"Using Raw Container Task","href":"/docs/container-task"},{"title":"Adding Environment Variable","href":"/docs/adding-environment-variable"},{"title":"Configuring Resources","href":"/docs/configuring-resources"},{"title":"Creating A Conditional Task","href":"/docs/conditional-task"},{"title":"Creating A Map Task","href":"/docs/creating-a-map-task"},{"title":"Creating A Cron Workflow","href":"/docs/cron-workflow"},{"title":"Creating A Spark Task","href":"/docs/spark-task"},{"title":"Creating A Databricks Task","href":"/docs/databricks-task"},{"title":"Creating A Snowflake Task","href":"/docs/snowflake-task"},{"title":"Task Config","href":"/docs/task-config"},{"title":"Attaching Mounts","href":"/docs/attaching-mounts"},{"title":"Passing Files/Artifacts Between Tasks","href":"/docs/passing-filesartifacts-between-tasks"},{"title":"Example Of Task Config With Different Parameters","href":"/docs/example-of-task-config-with-different-parameters"},{"title":"Adding Retries And Handling Failures","href":"/docs/adding-retries-and-handling-failures"},{"title":"Running Workflow Locally","href":"/docs/running-workflow-locally"},{"title":"Adding Alerts For Workflow","href":"/docs/adding-alerts-for-workflow"},{"title":"Handling Failure using Failure Task/Node","href":"/docs/handling-workflow-failure"},{"title":"Recovering a Failed Workflow Execution","href":"/docs/recovering-workflow-execution"}]}]},{"group":"Async Service Deployment","pages":[{"title":"Introduction to Async Service","href":"/docs/introduction-to-async-service"},{"title":"Deploy your first Async Service","href":"/docs/deploy-your-first-asyncservice"},{"group":"Configure async service","pages":[{"title":"Configure Ports","href":"/docs/configure-ports"},{"title":"Configure Queue","href":"/docs/configure-queue"},{"title":"Autoscaling","href":"/docs/autoscaling"},{"title":"Configure Sidecar","href":"/docs/configure-sidecar"}]},{"group":"Queue Integrations","pages":[{"title":"AWS SQS","href":"/docs/aws-sqs"}]},{"title":"Monitor Your Async Service","href":"/docs/monitoring-your-async-service"}]},{"group":"Volumes","pages":[{"title":"Introduction to Volume","href":"/docs/introduction-to-volume"},{"title":"Creating And Using Volumes","href":"/docs/creating-a-volume"}]},{"group":"Experiment Tracking","pages":[{"title":"ML Repo: Getting Started","sidebarTitle":"Getting Started","href":"/docs/ml-repo-quickstart"},{"title":"Create Runs and Log Data","href":"/docs/create-run"},{"title":"Artifacts and Artifact Versions","href":"/docs/log-artifacts"},{"title":"Models and Model Versions","href":"/docs/log-models"},{"title":"Huggingface Trainer Callback","href":"/docs/huggingface-trainer-callback"}]},{"group":"Advanced Features","pages":[{"title":"Secret Management","href":"/docs/manage-secrets"},{"title":"Deployment Guardrails and Policies","href":"/docs/applying-custom-policies"},{"title":"Deploy Helm Charts","href":"/docs/deploy-helm-charts"},{"title":"Deploy Kubernetes Manifests","href":"/docs/deploy-kubernetes-manifests"},{"title":"Ingress Controller Configuration","href":"/docs/ingress-controller-configuration"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/docs/truefoundry_sdk"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/docs/ai-gateway/ecosystem"}]},{"tab":"Changelog","groups":[{"group":" ","pages":[{"title":"Changelog","href":"/docs/changelog"},{"group":"Announcements","pages":[{"title":"Deprecation of Rate Limiting V1 — 2nd November, 2026","href":"/docs/change-announcements/deprecation-of-rate-limiting-v1"},{"title":"Move to Named Guardrail Policies — v0.179","href":"/docs/change-announcements/named-guardrails-config-v0.179"},{"title":"Perplexity Models Move to the Agent API","href":"/docs/change-announcements/perplexity-agent-api-migration"},{"title":"Plan-Based Feature Gating — v0.174.0","href":"/docs/change-announcements/plan-based-feature-gating-v0.174.0"},{"title":"Agent Builder Moving to Trueforge \u0026 Agent APIs Deprecated — v0.172","href":"/docs/change-announcements/agents-moving-to-trueforge"},{"title":"Removing Collaborators from Resources — v0.172.0","href":"/docs/change-announcements/removing-collaborators-from-resources"},{"title":"Deprecation of MCP tool_settings — 26th October, 2026","href":"/docs/change-announcements/deprecation-of-mcp-tool-settings"},{"title":"Deprecation of truefoundry \u003c 0.17.0 and truefoundry-sdk \u003c 0.4.0 packages","sidebarTitle":"Deprecation of truefoundry \u003c 0.17.0 and truefoundry-sdk \u003c 0.4.0 packages - 19th August 2026","href":"/docs/change-announcements/deprecation-of-truefoundry-below-0.17-and-api-ml"},{"title":"Minimum Python Version Raised to 3.10 — truefoundry v0.17.0","href":"/docs/change-announcements/python-3.10-minimum-truefoundry-cli-v0.17.0"},{"title":"Budget Limiting V2 — v0.158.0","href":"/docs/change-announcements/budget-limiting-v2-v0.158.0"},{"title":"Deprecation of MCP Servers APIs — 30th September, 2026","href":"/docs/change-announcements/deprecation-of-mcp-servers-v1-apis"},{"title":"Deprecation of Images and Plots in Job Runs — v0.156.0","href":"/docs/change-announcements/deprecation-of-images-and-plots-in-job-runs-v0.156.0"},{"title":"Moving to External Secrets Operator for Secrets Management — v0.151.5","href":"/docs/change-announcements/moving-to-eso-for-secret-management-v0.151.5"},{"title":"MCP DCR client_id \u0026 Redirect URL Validation — v0.148","href":"/docs/change-announcements/mcp-dcr-client-id-validation-v0.148"},{"title":"Deprecation of Routing Config","href":"/docs/change-announcements/deprecation-of-routing-config"},{"title":"Identity and Access Revamp — v0.143","href":"/docs/change-announcements/identity-and-access-revamp-v0.143"},{"title":"AI Gateway Metrics Rename — v0.136","href":"/docs/change-announcements/refactoring-of-ai-gateway-metrics"},{"title":"Deprecation of MCP Servers in Prompts","href":"/docs/change-announcements/deprecation-of-mcp-servers-in-prompts"},{"title":"Deprecation of Common Tools in Playground and Settings — v0.135","href":"/docs/change-announcements/deprecation-of-common-tools-v0-135-0"},{"title":"x-tfy-routing-config Header Removal — v0.133","href":"/docs/change-announcements/routing-config-header-removal-v0.133"},{"title":"Simplified GitOps CI/CD with tfy apply — v0.132","href":"/docs/change-announcements/simplified-gitops-cicd-v0.132"},{"title":"Legacy MCP OAuth Routes Removal — v0.134","href":"/docs/change-announcements/legacy-mcp-oauth-routes-removal"},{"title":"MCP Gateway URL and Transport Changes — v0.130","href":"/docs/change-announcements/mcp-gateway-url-transport-v0.130"},{"title":"Gemini CLI Model Registration Requirement — v0.118","href":"/docs/change-announcements/gemini-cli-model-registration-v0.118"},{"title":"Guardrails YAML Schema Change — v0.116","href":"/docs/change-announcements/guardrails-yaml-schema-change-v0.116"},{"title":"MCP Server Groups Removal — v0.112","href":"/docs/change-announcements/mcp-server-groups-removal-v0.112"}]}]}]}]},"basePath":"","title":"Launch Notebook with Spark - TrueFoundry Docs","deploymentId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","buildId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-C7yGukkT.js","DynamicMarkdown-XsrWkK-b.js","zoom-image-lightbox-C5J5Gw3i.js","lightbox-handle-r17bVUz3.js"]}