https://github.com/chaoss/grimoirelab-kingarthur
King Arthur commands his loyal knight Perceval on the quest to retrieve data from software repositories.
Science Score: 13.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
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.8%) to scientific vocabulary
Keywords from Contributors
Repository
King Arthur commands his loyal knight Perceval on the quest to retrieve data from software repositories.
Basic Info
- Host: GitHub
- Owner: chaoss
- License: gpl-3.0
- Language: Python
- Default Branch: main
- Size: 587 KB
Statistics
- Stars: 22
- Watchers: 14
- Forks: 65
- Open Issues: 14
- Releases: 20
Metadata Files
README.md
Arthur

King Arthur commands his loyal knight Perceval on the quest to fetch data from software repositories.
Arthur is a distributed job queue platform that schedules and executes
Perceval. The platform is composed by two components: arthurd, the server
that schedules the jobs and one or more instances of arthurw, the work horses
that will run each Perceval job.
The repositories whose data will be fetched are added to the platform using a REST API. Then, the server transforms these repositories into Perceval jobs and schedules them between its job queues.
Workers are waiting for new jobs checking these queues. Workers only execute a job at a time. When a new job arrives, an idle worker will take and run it. Once a job is finished, if the result is successful, the server will re-schedule it to retrieve new data.
By default, items fetched by each job will be published using a Redis queue. Additionally, they can be written to an Elastic Search index.
Requirements
- Python >= 3.7
- Redis (>= 2.3 and < 3.0) database will also be needed to schedule and execute Perceval jobs.
You will also need some other libraries for running the tool, you can find the whole list of dependencies in pyproject.toml file.
Installation
There are several ways to install Arthur on your system: packages or source code using Poetry or pip.
PyPI
Arthur can be installed using pip, a tool for installing Python packages.
To do it, run the next command:
$ pip install kingarthur
Source code
To install from the source code you will need to clone the repository first:
$ git clone https://github.com/chaoss/grimoirelab-kingarthur
$ cd grimoirelab-kingarthur
Then use pip or Poetry to install the package along with its dependencies.
Pip
To install the package from local directory run the following command:
$ pip install .
In case you are a developer, you should install kingarthur in editable mode:
$ pip install -e .
Poetry
We use poetry for dependency management and
packaging. You can install it following its documentation.
Once you have installed it, you can install kingarthur and the dependencies in
a project isolated environment using:
$ poetry install
To spaw a new shell within the virtual environment use:
$ poetry shell
Usage
arthurd
```
usage: arthurd [-c
King Arthur commands his loyal knight Perceval on the quest to retrieve data from software repositories.
This command runs an Arthur daemon that waits for HTTP requests on port 8080. Repositories to analyze are added using an REST API. Repositories are transformed into Perceval jobs that will be scheduled and run using a distributed job queue platform.
optional arguments: -?, --help show this help message and exit -c FILE, --config FILE set configuration file -g, --debug set debug mode on -h, --host set the host name or IP address on which to listen for connections -p, --port set listening TCP port (default: 8080) -d, --database URL database connection (default: 'redis://localhost/8') -s, --sync work in synchronous mode (without workers) --es-index output ElasticSearch server index --log-path path where logs are stored --archive-path path to archive manager directory --no-archive do not archive fetched raw data --no-daemon do not run arthur in daemon mode ```
arthurd configuration file
To run arthurd using a configuration file:
$ arthurd [-c <file>]
Where <file> is the path to an ini file which uses the same parameters as in command line, but replacing underscores by hyphens. This configuration file has the following structure:
``` [arthur] archivepath=/tmp/.arthur/archive debug=True logpath=/tmp/logs/arthurd noarchive=True syncmode=True
[connection] host=127.0.0.1 port=8080
[elasticsearch] es_index=http://localhost:9200/items
[redis] database=redis://localhost/8 ```
arthurw
```
usage: arthurw [-g] [-d
King Arthur's worker. It will run Perceval jobs on the quest to retrieve data from software repositories.
positional arguments: queues list of queues this worker will listen for ('create' and 'update', by default)
optional arguments: -?, --help show this help message and exit -g, --debug set debug mode on -d, --database URL database connection (default: 'redis://localhost/8') -b, --burst Run in burst mode (quit after all work is done) ```
How to run it
The first step is to run a Redis server that will be used for communicating Arthur's components. Moreover, an Elastic Search server can be used to store the items generated by jobs. Please refer to their documentation to know how to install and run them both.
To run Arthur server:
$ arthurd -g -d redis://localhost/8 --es-index http://localhost:9200/items --log-path /tmp/logs/arthud --no-archive
To run a worker:
$ arthurw -d redis://localhost/8
Adding tasks
To add tasks to Arthur, create a JSON object containing the tasks needed to fetch data from a set of repositories. Each task will run a Perceval backend, thus, backend parameters will also needed for each task.
$ cat tasks.json
{
"tasks": [
{
"task_id": "arthur.git",
"backend": "git",
"backend_args": {
"gitpath": "/tmp/git/arthur.git/",
"uri": "https://github.com/chaoss/grimoirelab-kingarthur.git",
"from_date": "2015-03-01"
},
"category": "commit",
"scheduler": {
"delay": 10
}
},
{
"task_id": "bugzilla_mozilla",
"backend": "bugzillarest",
"backend_args": {
"url": "https://bugzilla.mozilla.org/",
"from_date": "2016-09-19"
},
"category": "bug",
"archive": {
"fetch_from_archive": true,
"archived_after": "2018-02-26 09:00"
},
"scheduler": {
"delay": 60,
"max_retries": 5
}
}
]
}
Then, send this JSON stream to the server calling add method.
$ curl -H "Content-Type: application/json" --data @tasks.json http://127.0.0.1:8080/add
For this example, items will be stored in the items index on the
Elastic Search server (http://localhost:9200/items).
Listing tasks
The list of tasks currently scheduled can be obtained using the method tasks.
``` $ curl http://127.0.0.1:8080/tasks
{ "tasks": [ { "backendargs": { "fromdate": "2015-03-01T00:00:00+00:00", "uri": "https://github.com/chaoss/grimoirelab-kingarthur.git", "gitpath": "/tmp/santi/" }, "backend": "git", "category": "commit", "createdon": 1480531707.810326, "taskid": "arthur.git", "scheduler": { "max_retries": 3, "delay": 10 } } ] } ```
Removing tasks
Scheduled tasks can also be removed calling to the server using the remove
method. A JSON stream must be provided setting the identifiers of the
tasks to be removed.
``` $ cat taskstoremove.json
{ "tasks": [ { "taskid": "bugzillamozilla" }, { "task_id": "arthur.git" } ] }
$ curl -H "Content-Type: application/json" --data @taskstoremove.json http://127.0.0.1:8080/remove ```
License
Licensed under GNU General Public License (GPL), version 3 or later.
Owner
- Name: CHAOSS
- Login: chaoss
- Kind: organization
- Website: https://chaoss.community/
- Twitter: chaossproj
- Repositories: 64
- Profile: https://github.com/chaoss
GitHub Events
Total
- Watch event: 1
- Delete event: 2
- Push event: 2
- Pull request review event: 1
- Pull request event: 2
- Fork event: 2
- Create event: 2
Last Year
- Watch event: 1
- Delete event: 2
- Push event: 2
- Pull request review event: 1
- Pull request event: 2
- Fork event: 2
- Create event: 2
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Santiago Dueñas | s****s@b****m | 195 |
| Valerio Cosentino | v****s@b****m | 45 |
| Jose Javier Merchante | j****e@b****m | 13 |
| Alvaro del Castillo | a****s@b****m | 10 |
| Miguel Ángel Fernández | m****n@b****m | 8 |
| David Moreno | d****o@b****m | 7 |
| dependabot[bot] | 4****] | 4 |
| paul brown | p****l@w****m | 3 |
| Venu Vardhan Reddy Tekula | v****u@b****m | 2 |
| Jesus M. Gonzalez-Barahona | j****b@g****s | 2 |
| olblak | me@o****m | 1 |
| Cedric Williams | c****s@p****m | 1 |
| Miguel Angel Fernandez | m****n@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 39
- Total pull requests: 69
- Average time to close issues: 5 months
- Average time to close pull requests: 20 days
- Total issue authors: 12
- Total pull request authors: 11
- Average comments per issue: 1.44
- Average comments per pull request: 1.55
- Merged pull requests: 55
- Bot issues: 0
- Bot pull requests: 6
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: about 22 hours
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- sduenas (22)
- olblak (3)
- dlumbrer (3)
- acs (2)
- jgbarah (2)
- valeriocos (1)
- GeorgLink (1)
- Julianbaozi (1)
- FredaPinto (1)
- canasdiaz (1)
- mhauru (1)
- cewilliams (1)
Pull Request Authors
- valeriocos (22)
- sduenas (17)
- jjmerchante (11)
- dependabot[bot] (6)
- dlumbrer (4)
- mafesan (3)
- vchrombie (2)
- whatstherub (1)
- canasdiaz (1)
- cewilliams (1)
- zhquan (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 503 last-month
- Total dependent packages: 3
- Total dependent repositories: 8
- Total versions: 33
- Total maintainers: 2
pypi.org: kingarthur
Distributed job queue platform for scheduling Perceval jobs
- Homepage: https://chaoss.github.io/grimoirelab/
- Documentation: https://kingarthur.readthedocs.io/
- License: GPL-3.0+
-
Latest release: 0.2.5
published over 3 years ago
Rankings
Dependencies
- coverage 6.4.4 develop
- fakeredis 1.9.1 develop
- flake8 4.0.1 develop
- httpretty 0.8.6 develop
- mccabe 0.6.1 develop
- pycodestyle 2.8.0 develop
- pyflakes 2.4.0 develop
- sortedcontainers 2.4.0 develop
- CherryPy 18.8.0
- PyJWT 2.4.0
- autocommand 2.2.1
- beautifulsoup4 4.11.1
- certifi 2022.6.15
- cffi 1.15.1
- charset-normalizer 2.1.1
- cheroot 8.6.0
- click 8.1.3
- colorama 0.4.5
- cryptography 3.4.8
- dulwich 0.20.46
- feedparser 6.0.10
- grimoirelab-toolkit 0.3.1rc1
- idna 3.3
- importlib-metadata 4.2.0
- importlib-resources 5.9.0
- inflect 6.0.0
- jaraco.classes 3.2.2
- jaraco.collections 3.5.2
- jaraco.context 4.1.2
- jaraco.functools 3.5.1
- jaraco.text 3.9.1
- more-itertools 8.14.0
- perceval 0.20.0rc7
- portend 3.1.0
- pycparser 2.21
- pydantic 1.10.2
- python-dateutil 2.8.2
- pytz 2022.2.1
- pywin32 304
- redis 3.0.0
- requests 2.28.1
- rq 1.0
- setuptools 65.3.0
- sgmllib3k 1.0.0
- six 1.16.0
- soupsieve 2.3.2.post1
- tempora 5.0.2
- typing-extensions 4.3.0
- urllib3 1.26.12
- zc.lockfile 2.0
- zipp 3.8.1
- coverage ^6.3.2 develop
- fakeredis ^1.7.1 develop
- flake8 ^4.0.1 develop
- httpretty 0.8.6 develop
- CherryPy >=17.4.2
- cheroot >=8.2.1
- grimoirelab-toolkit >=0.3
- perceval >=0.19
- python ^3.7
- python-dateutil >=2.8.0
- redis 3.0.0
- rq 1.0.0
- bitergia/release-tools-check-changelog master composite
- actions/checkout 93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 composite
- actions/download-artifact fb598a63ae348fa914e94cd0ff38f362e927b741 composite
- actions/setup-python 13ae5bb136fac2878aff31522b9efb785519f984 composite
- chaoss/grimoirelab-github-actions/build master composite
- chaoss/grimoirelab-github-actions/publish master composite
- chaoss/grimoirelab-github-actions/release master composite
- actions/checkout 93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 composite
- actions/setup-python 13ae5bb136fac2878aff31522b9efb785519f984 composite
- debian stretch-slim build