bartender

Middleware web service to schedule jobs on various infrastructures

https://github.com/i-vresse/bartender

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Middleware web service to schedule jobs on various infrastructures

Basic Info
Statistics
  • Stars: 1
  • Watchers: 4
  • Forks: 0
  • Open Issues: 25
  • Releases: 8
Created almost 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

Bartender

fair-software.eu DOI Research Software Directory Badge Documentation Status


Bartender is a middleware web service to schedule jobs on various infrastructures.

It can run command line applications for visitors. The application input should be a configuration file with links to data files in the same directory. After acquiring a JWT token, you can upload your configuration file and data files as an archive to the web service for submission. Once the job has been executed the output files can be browsed with a web browser.

Bartender can be configured to run applications on a Slurm batch scheduler, pilot job framework, the grid or in the cloud. Bartender will take care of moving the input and output files to the right place. To pick where an application should be run you can choose from a list of existing Python functions or supply your own.

Bartender can run quick interactive applications on completed jobs. This is handy if you want to run a quick analysis on the output of a job.

Bartender can be used as the computational backend for a web application, the web application should guide visitors into the submission and show the results. See https://github.com/i-VRESSE/haddock3-webapp for an example.

Documentation for users and developers is available at https://i-vresse-bartender.readthedocs.io .

Quickstart

  1. Install bartender via GitHub:

    ```bash

    Inside an empty directory

    git clone https://github.com/i-VRESSE/bartender.git . pip install . ```

  2. Obtain a copy of the example configuration file

    bash cp config-example.yaml config.yaml

  3. In another terminal, start up a database for storing jobs.

    bash docker run \ -p "5432:5432" \ -e "POSTGRES_PASSWORD=bartender" \ -e "POSTGRES_USER=bartender" \ -e "POSTGRES_DB=bartender" \ --mount type=volume,source=bartender-db,target=/var/lib/postgresql/data \ postgres:15.2-bullseye

    (Use docker volume rm bartender-db to clear the database storage`)

  4. Create tables in the database

    bash alembic upgrade "head"

  5. Generate token to authenticate yourself

    ```bash

    Generate a rsa key pair

    openssl genpkey -algorithm RSA -out privatekey.pem \ -pkeyopt rsakeygenbits:2048 openssl rsa -pubout -in privatekey.pem -out public_key.pem bartender generate-token --username myname ```

  6. Run the application

    bash bartender serve

  7. Go to the interactive API documentation generated by FastAPI

    http://localhost:8000/api/docs

Consuming web service

The interactive API documentation generated by FastAPI is at http://localhost:8000/api/docs

Authentication

To consume the bartender web service you need to authenticate yourself with a JWT token in the

  • HTTP header Authorization: Bearer <token> or
  • query parameter ?token=<token> or
  • Cookie bartenderToken=<token>of the HTTP request.

For more info see Configuration docs

Word count example

Bartender is by default configured with a word count applicaton. Use the following steps to run a job:

  1. Create an archive to submit. The zip file should contain a file called README.md. A zip file could be created in a clone of this repo with zip README.zip README.md.
  2. Start bartender web service and postgresql server
  3. Generate token & authorize
    1. Run bartender generate-token and copy output to clipboard. (Make sure to not to have any newlines in the token)
    2. Goto http://127.0.0.1:8000/api/docs and
    3. Open authorize dialog by pressing authorize button on top of page
      1. Paste token from clipboard in any Value input text box
      2. Press Authorize button and close button.
    4. Try out the GET /api/whoami route. It should return JSON document with someone as username.
  4. Submit archive.
    1. Try out the PUT /api/application/wc route.
    2. Upload the README.zip as request body.
    3. Press execute button
    4. The response contains a job identifier (id property) that can be used to fetch the job state.
  5. Fetch job state
    1. Try out the GET /api/job/{jobid}
    2. Use job identifier retrieved by submit request as jobid parameter value.
      • When job state is equal to ok the job was completed succesfully.
  6. Retrieve result. The word count application (wc) outputs to the stdout.
    1. Try out the GET /api/job/{jobid}/stdout
    2. Use job identifier retrieved by submit request as jobid parameter value.
    3. Should see something like 433 1793 14560 README.md. Where numbers are counts for newlines, words, bytes.

Owner

  • Name: Interactive Virtual Research Environment for Scientific Software Execution
  • Login: i-VRESSE
  • Kind: organization

Project with Netherlands eScience Center and Bonvin Lab

GitHub Events

Total
  • Create event: 6
  • Release event: 2
  • Issues event: 4
  • Watch event: 1
  • Delete event: 4
  • Issue comment event: 2
  • Push event: 5
  • Pull request event: 5
Last Year
  • Create event: 6
  • Release event: 2
  • Issues event: 4
  • Watch event: 1
  • Delete event: 4
  • Issue comment event: 2
  • Push event: 5
  • Pull request event: 5

Dependencies

poetry.lock pypi
  • astor 0.8.1 develop
  • atomicwrites 1.4.1 develop
  • attrs 22.1.0 develop
  • autoflake 1.4 develop
  • bandit 1.7.4 develop
  • black 22.6.0 develop
  • certifi 2022.6.15 develop
  • cfgv 3.3.1 develop
  • charset-normalizer 2.1.1 develop
  • coverage 6.4.4 develop
  • darglint 1.8.1 develop
  • distlib 0.3.5 develop
  • docutils 0.19 develop
  • eradicate 2.1.0 develop
  • filelock 3.8.0 develop
  • flake8 4.0.1 develop
  • flake8-bandit 3.0.0 develop
  • flake8-broken-line 0.4.0 develop
  • flake8-bugbear 22.8.23 develop
  • flake8-commas 2.1.0 develop
  • flake8-comprehensions 3.10.0 develop
  • flake8-debugger 4.1.2 develop
  • flake8-docstrings 1.6.0 develop
  • flake8-eradicate 1.3.0 develop
  • flake8-isort 4.2.0 develop
  • flake8-polyfill 1.0.2 develop
  • flake8-quotes 3.3.1 develop
  • flake8-rst-docstrings 0.2.7 develop
  • flake8-string-format 0.3.0 develop
  • gitdb 4.0.9 develop
  • gitpython 3.1.27 develop
  • httpcore 0.14.7 develop
  • httpx 0.22.0 develop
  • identify 2.5.3 develop
  • iniconfig 1.1.1 develop
  • isort 5.10.1 develop
  • mccabe 0.6.1 develop
  • nodeenv 1.7.0 develop
  • packaging 21.3 develop
  • pathspec 0.9.0 develop
  • pbr 5.10.0 develop
  • pep8-naming 0.12.1 develop
  • platformdirs 2.5.2 develop
  • pluggy 1.0.0 develop
  • pre-commit 2.20.0 develop
  • py 1.11.0 develop
  • pycodestyle 2.8.0 develop
  • pydocstyle 6.1.1 develop
  • pyflakes 2.4.0 develop
  • pygments 2.13.0 develop
  • pyparsing 3.0.9 develop
  • pytest 7.1.2 develop
  • pytest-cov 3.0.0 develop
  • pytest-env 0.6.2 develop
  • restructuredtext-lint 1.4.0 develop
  • rfc3986 1.5.0 develop
  • smmap 5.0.0 develop
  • snowballstemmer 2.2.0 develop
  • stevedore 4.0.0 develop
  • tokenize-rt 4.2.1 develop
  • toml 0.10.2 develop
  • virtualenv 20.16.3 develop
  • wemake-python-styleguide 0.16.1 develop
  • yesqa 1.4.0 develop
  • alembic 1.8.1
  • anyio 3.6.1
  • asgiref 3.5.2
  • asyncpg 0.25.0
  • click 8.1.3
  • colorama 0.4.5
  • fastapi 0.75.2
  • greenlet 1.1.3
  • h11 0.12.0
  • httptools 0.3.0
  • idna 3.3
  • mako 1.2.1
  • markupsafe 2.1.1
  • multidict 6.0.2
  • mypy 0.961
  • mypy-extensions 0.4.3
  • pydantic 1.9.2
  • python-dotenv 0.20.0
  • pyyaml 6.0
  • sniffio 1.2.0
  • sqlalchemy 1.4.40
  • sqlalchemy2-stubs 0.0.2a25
  • starlette 0.17.1
  • tomli 2.0.1
  • typing-extensions 4.3.0
  • ujson 5.4.0
  • uvicorn 0.17.5
  • uvloop 0.16.0
  • watchgod 0.8.2
  • websockets 10.3
  • yarl 1.8.1
pyproject.toml pypi
  • SQLAlchemy ^1.4 develop
  • anyio ^3.6.1 develop
  • autoflake ^1.4 develop
  • black ^22.3.0 develop
  • flake8 ^4.0.1 develop
  • httpx ^0.22.0 develop
  • isort ^5.10.1 develop
  • mypy ^0.961 develop
  • pre-commit ^2.19.0 develop
  • pytest ^7.0 develop
  • pytest-cov ^3.0.0 develop
  • pytest-env ^0.6.2 develop
  • wemake-python-styleguide ^0.16.1 develop
  • yesqa ^1.3.0 develop
  • SQLAlchemy ^1.4
  • alembic ^1.7.7
  • asyncpg ^0.25.0
  • fastapi ^0.75.0
  • httptools ^0.3.0
  • pydantic ^1.9.0
  • python ^3.9
  • ujson ^5.1.0
  • uvicorn ^0.17.0
  • yarl ^1.7.2
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • postgres 13.6-bullseye docker
deploy/Dockerfile docker
  • python 3.9.6-slim-buster build
deploy/docker-compose.yml docker
  • bartender ${BARTENDER_VERSION
  • postgres 13.6-bullseye
.github/workflows/dirac.yml actions
  • actions/checkout v3 composite
deploy/docker-compose.dirac.yml docker
  • bartender-with-dirac ${BARTENDER_VERSION
  • ghcr.io/xenon-middleware/dirac 8.0.18
  • postgres 15.2-bullseye
tests_dirac/Dockerfile docker
  • ghcr.io/xenon-middleware/diracclient 8.0.18 build
tests_dirac/docker-compose.yml docker
  • ghcr.io/xenon-middleware/dirac 8.0.18