hopsworks.core.app_api #
AppApi #
Returned by
create_app #
create_app(
name: str,
app_path: str | None = None,
environment: str = "python-app-pipeline",
memory: int = 2048,
cores: float = 1.0,
env_vars: dict[str, str] | None = None,
app_kind: str = "STREAMLIT",
entrypoint_command: str | None = None,
app_port: int | None = None,
description: str | None = None,
git_url: str | None = None,
git_provider: str | None = None,
git_branch: str | None = None,
git_auto_redeploy: bool = False,
entrypoint_script: str | None = None,
app_base_path: str | None = None,
readiness_probe_path: str | None = None,
db_access: bool = True,
idle_scale_to_zero: bool | None = None,
idle_cooldown_seconds: int | None = None,
cold_start_timeout_seconds: int | None = None,
) -> app.App
Create a new app.
Example
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the app. TYPE: |
app_path | Path to the app file in HopsFS. TYPE: |
environment | Python environment name (default: "python-app-pipeline"). TYPE: |
memory | Memory in MB (default: 2048). TYPE: |
cores | CPU cores (default: 1.0). TYPE: |
env_vars | Per-runtime env vars applied when the app is started. These override account-level env vars for this app's executions. |
app_kind | What the app is, which decides how it is started. TYPE: |
entrypoint_command | Startup command for TYPE: |
app_port | Port the app listens on, for every kind but TYPE: |
description | Optional app description. TYPE: |
git_url | Optional Git repository URL. When set, the app is cloned on every start. TYPE: |
git_provider | Git provider for git-backed apps (GitHub, GitLab or BitBucket). TYPE: |
git_branch | Optional branch to clone for git-backed apps. TYPE: |
git_auto_redeploy | Roll the app to the branch HEAD whenever a new commit is pushed. Only valid for git-backed apps. The running app keeps serving until the new version is ready. TYPE: |
entrypoint_script | The app file relative to the repository root, for git repository apps of every kind but TYPE: |
app_base_path | Public mount path for the app, for example TYPE: |
readiness_probe_path | Optional readiness probe path to use instead of the platform default. TYPE: |
db_access | Give the app access to the project's online feature store database. Defaults to True: starting the app creates the database if the project does not have one yet and injects the TYPE: |
idle_scale_to_zero | Scale the app to zero when idle. The app's pod goes away once no request has been in flight for TYPE: |
idle_cooldown_seconds | Seconds without a request before the app scales to zero. Turns the option on when given; the default is the cluster's TYPE: |
cold_start_timeout_seconds | Seconds the first request waits for the app to wake. Turns the option on when given; the default and ceiling is the cluster's TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
app.App | The created App object. |
get_app #
Get an app by name.
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the app. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
app.App | None | App object, or |
app.App | None | reuse-if-exists guard does not have to catch a 404. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error other than a 404. |