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.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

darq_ui-0.0.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file darq_ui-0.0.0.tar.gz.

File metadata

  • Download URL: darq_ui-0.0.0.tar.gz
  • Upload date:
  • Size: 9.3 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.0.tar.gz
Algorithm Hash digest
SHA256 20f5332f71cd12ffe94a354f03801f40f9968f4a78a53997e8129aee07641d6b
MD5 dba65a3c1c0fb9073ff86195e950e0c8
BLAKE2b-256 2162cffa13725d950f45963be3d59b94b6c70713e16f3b828fbfa141c462d55a

See more details on using hashes here.

File details

Details for the file darq_ui-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: darq_ui-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b9db2930fe8fc2916b7dd4da09fd0ab629bbca2067e2b85812d23e776853a00
MD5 c6a23a0f8d11c2998437b91682ebfac6
BLAKE2b-256 aaaab2c09015e83fc4689dfff065e76213334b0f99c2e1f584e34eaa6fe11fca

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