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,
entrypoint_script: str | None = None,
) -> app.App
Create a new Python app.
Example
import hopsworks
project = hopsworks.login()
apps = project.get_app_api()
app = apps.create_app(
"my_dashboard",
app_path="Resources/app.py",
)
app.run()
print(app.app_url)
| 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 | App kind to create. Defaults to TYPE: |
entrypoint_command | Startup command for non-Streamlit apps. TYPE: |
app_port | Port exposed by non-Streamlit apps. 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: |
entrypoint_script | Relative entrypoint script for Streamlit git apps. 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. |