App
Deploy a web application or dashboard to Datatailr.
This supports Streamlit, Dash, or any framework that can be started via a
standard entrypoint (for example, streamlit run app.py).
Parameters:
-
(namestr) –App display name.
-
(entrypointCallable | str) –Callable that starts the app server.
-
(environmentEnvironment | None, default:DEV) –Target environment for the job.
-
(imageImage | None, default:None) –Container image to use for execution.
-
(run_asstr | User | None, default:None) –User to execute the job as.
-
(resourcesResources | None, default:None) –Resource requirements for the job.
-
(aclACL | None, default:None) –Access control settings for the job.
-
(frameworkstr | None, default:None) –Framework to use for the app.
-
(python_versionstr, default:'3.12') –Python version to use.
-
(python_requirementsstr | list[str], default:'') –Requirements to install (string or list).
-
(build_script_prestr, default:'') –Shell script to run before build.
-
(build_script_poststr, default:'') –Shell script to run after build.
-
(env_varsdict[str, str | int | float | bool] | None, default:None) –Environment variables to set.
-
(get_existingbool, default:False) –Update an existing job with the same name.
Examples:
Minimal Streamlit app.
# app.py
import streamlit as st
def main():
st.title("Hello Datatailr App")
if __name__ == "__main__":
main()
Test locally.
streamlit run app.py
Deploy to Datatailr.
from app import main
from datatailr import App
app = App(
name="Simple Dashboard App",
entrypoint=main,
python_requirements="streamlit")
app.run()
Parameters:
-
(namestr) –Display name for the app.
-
(entrypointCallable | str) –The callable (function) that starts the application.
-
(environmentEnvironment | None, default:DEV) –Target environment for the deployment.
-
(imageImage | None, default:None) –Pre-configured container Image. When
None, an image is built from python_version, python_requirements, and the build scripts. -
(run_asstr | User | None, default:None) –User or username to run the app as. Defaults to the currently signed-in user.
-
(resourcesResources | None, default:None) –CPU, memory, and optional GPU memory for the container. Defaults to
Resources()(128 MB, 0.25 CPU, no GPU request). Set GPU memory withvram, using the same size strings as memory. Ifvramis omitted, the job JSON omitsvram. -
(aclACL | None, default:None) –Access control list. Defaults to standard permissions for the current user.
-
(frameworkstr | None, default:None) –Optional framework name (e.g., 'streamlit', 'dash', 'flask'). If not provided, the framework is inferred from the entrypoint.
-
(python_versionstr, default:'3.12') –Python version for the container image.
-
(python_requirementsstr | list[str], default:'') –Python dependencies (see
Image). -
(build_script_prestr, default:'') –Dockerfile commands to run before installing requirements.
-
(build_script_poststr, default:'') –Dockerfile commands to run after installing requirements.
-
(env_varsdict[str, str | int | float | bool] | None, default:None) –Environment variables passed to the running container.
-
(get_existingbool, default:False) –If
True, load and update an existing job definition with the same name instead of creating a new one. -
(app_sectionstr, default:'') –The section to which the app belongs. If not provided, the app will be assigned to the default section. This affects the app launcher page.
-
(budgetBudget | str | None, default:None) –Optional spend budget as
Budget("name")or a namestr. Will be set to the 'default' budget if not provided.