Skip to main content

basic back-end progress api for the data analytics software framework dasf

Project description

dasf-progress-api

DASF: Progress API is part of the Data Analytics Software Framework (DASF, https://git.geomar.de/digital-earth/dasf), developed at the GFZ German Research Centre for Geosciences (https://www.gfz-potsdam.de). It is funded by the Initiative and Networking Fund of the Helmholtz Association through the Digital Earth project (https://www.digitalearth-hgf.de/).

DASF: Progress API provides a light-weight tree-based structure to be sent via the DASF RCP messaging protocol. It's generic design supports deterministic as well as non-deterministic progress reports. While DASF: Messaging Python provides the necessary implementation to distribute the progress reports from the reporting backend modules, DASF: Web includes ready to use components to visualize the reported progress.

Service Desk

For everyone without a Geomar Gitlab account, we setup the Service Desk feature for this repository. It lets you communicate with the developers via a repository specific eMail address. Each request will be tracked via the Gitlab issuse tracker.

eMail: gitlab+digital-earth-dasf-dasf-progress-api-2274-issue-@git-issues.geomar.de

Usage

A progress report is stored in a tree structure. So there will be one 'root' report instance containing multiple 'sub-reports'.

The root report will be initialized directly. The contructor demands a send_handler argument, so we need to create one first. The dasf-messaging-python module provides a ready to use implementation for the send_handler via the ProgressSendHandler class. In order to instantiate the send handler you need to pass the PulsarMessageConsumer that is used to receive the request that is monitored, as well as the corresponding request message. You might add additional message properties via the msg_props dictionary.

from demessaging.progress_send_handler import ProgressSendHandler

send_handler=ProgressSendHandler(pulsar=self.__pulsar,
                                 request_msg=request_msg,
                                 msg_props={'additional': 'some addtional property'})

Once we have a send_handler we can use it to create the 'root' progress report for the request. In case we already know how many steps (sub-reports) there are going to be on the next level, we can pass it via the optional steps argument.

root_report = ProgressReport(step_message="Label/message of the root report",
                                 send_handler=send_handler,
                                 steps=2)

Once we have the root report instance we create new subreports for it via the create_subreport method. Each created report is published automatically upon creation and completion.

# create a subreport
sub_report = root_report.create_subreport(step_message="Calculating something")

# execute some logic
# ...

# mark the sub-report as compelte
sub_report.complete()

All sub-reports are again instances of ProgressReport, so you can create more sub-reports for each.

error handling

For now there is no distinct error flag in the report. But you can update the step_message prop before marking it as complete to indicate an error.

# some code that raises an exception
# ...
except Exception as e:
    error = str(e)
    progress_report.step_message = "error '{msg}': {err}".format(msg=progress_report.step_message, err=error)
    progress_report.complete()

Recommended Software Citation

Eggert, Daniel; Dransch, Doris (2021): DASF: Progress API: A progress reporting structure for the data analytics software framework. V. v0.1.4. GFZ Data Services. https://doi.org/10.5880/GFZ.1.4.2021.007

License

Copyright 2021 Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences, Potsdam, Germany / DASF Data Analytics Software Framework

Licensed under the Apache License, Version 2.0 (the "License");
you may not use these files except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Contact

Dr.-Ing. Daniel Eggert
eMail: daniel.eggert@gfz-potsdam.de

Helmholtz Centre Potsdam GFZ German Research Centre for Geoscienes
Section 1.4 Remote Sensing & Geoinformatics
Telegrafenberg
14473 Potsdam
Germany

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

deprogressapi-0.2.2.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

deprogressapi-0.2.2-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file deprogressapi-0.2.2.tar.gz.

File metadata

  • Download URL: deprogressapi-0.2.2.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for deprogressapi-0.2.2.tar.gz
Algorithm Hash digest
SHA256 bbcfd0c72427185ffaff4b8c12f2c58bd168ee3b6a0b3e4d07d2bd9f24c135d2
MD5 c3cc771edec6725e0bb1077eb715a6cb
BLAKE2b-256 9816c4d3ce51275a8b537e41ee062899e3f77b175636a265ca9a461b2b977ee4

See more details on using hashes here.

File details

Details for the file deprogressapi-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: deprogressapi-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for deprogressapi-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dfe5caa299ccb9b475919d1f360eaad0bb507036a30b3c0635fc3c5b172b8231
MD5 fc61db713f5d648d3f3a1eec8471cfc8
BLAKE2b-256 0192650d90bdc3761a1b438acb2622c035dc1ba12473a0cccb6b777ee9001fa1

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