Skip to content

hopsworks.app #

App #

Represents a Hopsworks Python App.

app_kind property #

app_kind: str | None

Configured app kind.

app_path property #

app_path: str | None

Path to the app file in HopsFS.

app_port property #

app_port: int | None

Configured app port.

app_url property #

app_url: str | None

URL to the Streamlit UI, or None if not serving.

Example
apps = project.get_app_api()
app = apps.get_app("my_dashboard")
if app.serving:
    print(app.app_url)

cpu_requested property #

cpu_requested: str | None

Requested CPU cores.

description property #

description: str | None

App description.

entrypoint_command property #

entrypoint_command: str | None

Configured startup command.

entrypoint_script property #

entrypoint_script: str | None

Configured Git-backed Streamlit entrypoint script.

environment_name property #

environment_name: str | None

Python environment name.

execution_id property #

execution_id: int | None

ID of the current/latest execution.

git_branch property #

git_branch: str | None

Configured Git branch.

git_provider property #

git_provider: str | None

Configured Git provider.

git_url property #

git_url: str | None

Configured Git repository URL.

latest_commit property #

latest_commit: str | None

Latest deployed Git commit.

memory_requested property #

memory_requested: str | None

Requested memory.

name property #

name: str

Name of the app.

public_access property #

public_access: bool

Whether the app is publicly accessible without a Hopsworks login.

public_url property #

public_url: str | None

Public share URL.

None when the app is not public, or when the caller is not a data owner (only data owners receive the share token from the backend).

serving property #

serving: bool

Whether the app is serving (Streamlit health check passed).

state property #

state: str

Current state of the app (RUNNING, KILLED, FAILED, STOPPED, etc.).

delete #

delete()

Delete the app entirely.

This stops the app if running and removes the job configuration.

get_logs #

get_logs() -> dict[str, str]

Get stdout and stderr logs for the latest app execution.

RETURNS DESCRIPTION
dict[str, str]

Dictionary with stdout and stderr log content.

RAISES DESCRIPTION
hopsworks.client.exceptions.JobExecutionException

If the app has no execution.

hopsworks.client.exceptions.RestAPIError

If the backend encounters an error when retrieving logs.

get_url #

get_url() -> str

Get URL to view the app in Hopsworks UI.

RETURNS DESCRIPTION
str

The URL to the app page in the Hopsworks UI.

make_private #

make_private() -> None

Revoke public access.

Every outstanding public link stops working immediately.

make_public #

make_public() -> str | None

Make this Streamlit app reachable without a Hopsworks login.

RETURNS DESCRIPTION
str | None

str. The share URL to give out.

Danger

Anyone with the link can use the app with the app's own credentials, data access, and secrets. This is not read-only access. Only data owners can enable it, and only Streamlit apps are eligible.

redeploy #

redeploy(await_serving: bool = True) -> App

Redeploy the app by rolling its Kubernetes deployment.

This stops the current running execution and starts a new one using the same app configuration and runtime parameters.

PARAMETER DESCRIPTION
await_serving

If True, wait until the app is serving before returning.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
App

Self, with updated state.

run #

run(await_serving: bool = True) -> App

Start the app.

Example
apps = project.get_app_api()
app = apps.get_app("my_dashboard")
app.run()
print(app.app_url)
PARAMETER DESCRIPTION
await_serving

If True, wait until the app is serving before returning.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
App

Self, with updated state.

RAISES DESCRIPTION
hopsworks.client.exceptions.JobExecutionException

If the app fails to start or the serving timeout is exceeded.

stop #

stop() -> App

Stop the app.

RETURNS DESCRIPTION
App

Self, with updated state.