Skip to main content

A UI for darq

Project description

darq-ui

UI for darq async task manager - https://github.com/seedofjoy/darq

Installation

pip install darq-ui

Or with extra dependencies:

pip install darq-ui[aiohttp]
# or
pip install darq-ui[fastapi]

Integration

Use setup function like this from darq_ui.integration.<framework> import setup to integrate darq-ui with your application.

For example, to integrate with FastAPI:

from fastapi import FastAPI
from darq.app import Darq
from darq_ui.integration.fastapi import setup

app = FastAPI()
darq = Darq()

setup(app, darq)

Web UI

Once you have your server running, you can access the web UI at http://host:port/darq.

You can pass the base_path parameter to the setup function in order to change the base path of the UI.

setup(app, darq, base_path="/my-path")

Logging link

If you have a logging system (kibana for example), you can pass logs_url to setup function. One requirement is that the url should have the ${taskName} placeholder which will be replaced with the task name.

setup(app, darq, logs_url="https://mylogserver.com/taskname=${taskName}")

Kibana url example

If you have kibana, you can use the following url:

https://kibana.corp/app/discover#/?_g=(time:(from:now-15m,to:now))&_a=(filters:!((('$state':(store:appState),meta:(key:task_name,params:(query:'%22${taskName}%22')),query:(match_phrase:(task_name:’${taskName}')))))

In this url, task_name is a field name and ${taskName} will be replaced with the task name value. (This is just an example. You may need to adjust it according to your kibana configuration.)

Securing the UI

Since darq-ui is a part of your application, and can run any task, you should consider protecting it with authorization middleware or firewall.

Examples

In order to run examples you need to install the dependencies:

cd examples
pdm install

And then run the server:

lets run-fastapi 
# or 
lets run-aiohttp

Development

Run linters, formatters and other checks

pdm run ruff
pdm run ruff-fmt
pdm run mypy

Changelog

When developing, add notes to CHANGELOG.md to Unreleased section.

After we decided to release new version, we must rename Unreleased to new tag version and add new Unreleased section.

Publishing

darq-ui supports semver versioning.

  • Update the version number in the src/darq_ui/__init__.py file.
  • Update the changelog in the CHANGELOG.md file.
  • Merge changes into master.
  • Create a tag git tag -a v0.0.X -m 'your tag message'.
  • Push the tag git push origin --tags.

All of the above steps can be done with the following command:

lets release <version> -m 'your release message'

When new tag pushed, new release action on GitHub will publish new package to pypi.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

darq_ui-0.0.1rc3.tar.gz (326.8 kB view details)

Uploaded Source

Built Distribution

darq_ui-0.0.1rc3-py3-none-any.whl (328.7 kB view details)

Uploaded Python 3

File details

Details for the file darq_ui-0.0.1rc3.tar.gz.

File metadata

  • Download URL: darq_ui-0.0.1rc3.tar.gz
  • Upload date:
  • Size: 326.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.19.1 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for darq_ui-0.0.1rc3.tar.gz
Algorithm Hash digest
SHA256 4492ba8e8596ef5768f9f277c4d08dcc210e75dba4c80382f217d43486971fd0
MD5 34dcf7975550d9ca2f877fb8af7a61a3
BLAKE2b-256 e67db47e68db5c46a7667f00f580b3bf86a74dd1668c84d72235728895d4ef6a

See more details on using hashes here.

File details

Details for the file darq_ui-0.0.1rc3-py3-none-any.whl.

File metadata

  • Download URL: darq_ui-0.0.1rc3-py3-none-any.whl
  • Upload date:
  • Size: 328.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.19.1 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for darq_ui-0.0.1rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 337281f5817faebd74e628c846ce2b404c2c423b2f954a53822aef43e7ac2838
MD5 5f14dc3991b6506ab0fe4e3b12f8f5a4
BLAKE2b-256 510582d206266552a1556960ffe92afdc3985c7ac37000cc7e22e0cf269d71db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page