• No results found

fedora-infra-map Documentation

N/A
N/A
Protected

Academic year: 2022

Share "fedora-infra-map Documentation"

Copied!
25
0
0

Loading.... (view fulltext now)

Full text

(1)

Michal Kone ˇcný

Mar 18, 2022

(2)
(3)

1 fedora-infra-map 1

1.1 Features. . . 1

1.2 Credits . . . 1

2 Installation 3 2.1 Stable release. . . 3

2.2 From sources . . . 3

3 Usage 5 4 Contributing 7 4.1 Types of Contributions . . . 7

4.2 Get Started!. . . 8

4.3 Pull Request Guidelines . . . 9

4.4 Tips . . . 9

4.5 Deploying . . . 9

5 Credits 11 5.1 Development Lead . . . 11

5.2 Contributors . . . 11

6 History 13 6.1 0.1.0 (2020-03-27) . . . 13

7 Fedora Infra Map requirements 15 7.1 List of requirements . . . 15

8 Fedora Infra Map app design 17 8.1 Entities . . . 17

8.2 Use cases . . . 18

8.3 External systems . . . 19

9 Indices and tables 21

(4)

ii

(5)

fedora-infra-map

Fedora Infra Map is interactive map of the applications hosted by Fedora Infrastructure. The map allows users to get information about applications and the relations between them. The map will be represented by graph consisting of nodes and edges.

• Free software: GNU General Public License v3

• Documentation:https://fedora-infra-map.readthedocs.io.

1.1 Features

• TODO

1.2 Credits

This package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.

(6)

fedora-infra-map Documentation, Release 0.1.0

2 Chapter 1. fedora-infra-map

(7)

Installation

2.1 Stable release

To install fedora-infra-map, run this command in your terminal:

$ pip install fedora_infra_map

This is the preferred method to install fedora-infra-map, as it will always install the most recent stable release.

If you don’t havepipinstalled, thisPython installation guidecan guide you through the process.

2.2 From sources

The sources for fedora-infra-map can be downloaded from theGithub repo.

You can either clone the public repository:

$ git clone git://github.com/zlopez/fedora_infra_map

Or download thetarball:

$ curl -OJL https://github.com/zlopez/fedora_infra_map/tarball/master

Once you have a copy of the source, you can install it with:

$ python setup.py install

(8)

fedora-infra-map Documentation, Release 0.1.0

4 Chapter 2. Installation

(9)

Usage

To use fedora-infra-map in a project:

import fedora_infra_map

(10)

fedora-infra-map Documentation, Release 0.1.0

6 Chapter 3. Usage

(11)

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

You can contribute in many ways:

4.1 Types of Contributions

4.1.1 Report Bugs

Report bugs athttps://github.com/Zlopez/fedora-infra-map/issues.

If you are reporting a bug, please include:

• Your operating system name and version.

• Any details about your local setup that might be helpful in troubleshooting.

• Detailed steps to reproduce the bug.

4.1.2 Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it.

4.1.3 Implement Features

Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it.

(12)

fedora-infra-map Documentation, Release 0.1.0

4.1.4 Write Documentation

fedora-infra-map could always use more documentation, whether as part of the official fedora-infra-map docs, in docstrings, or even on the web in blog posts, articles, and such.

4.1.5 Submit Feedback

The best way to send feedback is to file an issue athttps://github.com/Zlopez/fedora-infra-map/issues.

If you are proposing a feature:

• Explain in detail how it would work.

• Keep the scope as narrow as possible, to make it easier to implement.

• Remember that this is a volunteer-driven project, and that contributions are welcome :)

4.2 Get Started!

Ready to contribute? Here’s how to set up fedora_infra_map for local development.

1. Fork the fedora_infra_map repo on GitHub.

2. Clone your fork locally:

$ git clone [email protected]:your_name_here/fedora-infra-map.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:

$ mkvirtualenv fedora_infra_map

$ cd fedora_infra_map/

$ python setup.py develop

4. Create a branch for local development:

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:

$ flake8 fedora_infra_map tests

$ python setup.py test or pytest

$ tox

To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub:

$ git add .

$ git commit -m "Your detailed description of your changes."

$ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.

8 Chapter 4. Contributing

(13)

2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.

3. The pull request should work for Python 3.7 and 3.8, and for PyPy. Checkhttps://travis-ci.org/github/Zlopez/

fedora-infra-map/pull_requestsand make sure that the tests pass for all supported Python versions.

4.4 Tips

To run a subset of tests:

$ pytest tests.test_fedora_infra_map

4.5 Deploying

A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in HISTORY.rst). Then run:

$ bump2version patch # possible: major / minor / patch

$ git push

$ git push --tags

Travis will then deploy to PyPI if tests pass.

(14)

fedora-infra-map Documentation, Release 0.1.0

10 Chapter 4. Contributing

(15)

Credits

5.1 Development Lead

• Michal Koneˇcný <[email protected]>

5.2 Contributors

None yet. Why not be the first?

(16)

fedora-infra-map Documentation, Release 0.1.0

12 Chapter 5. Credits

(17)

History

6.1 0.1.0 (2020-03-27)

• First release on PyPI.

(18)

fedora-infra-map Documentation, Release 0.1.0

14 Chapter 6. History

(19)

Fedora Infra Map requirements

This is the list of requirements for fedora-infra-map app.

7.1 List of requirements

• Interactive web interface

• Map of the fedora infra represented by nodes and edges

• Querying of the specific nodes, edges by attributes

• Node represents app itself (name, description, ownership, url)

• Edge represents relationship between apps (type, description)

(20)

fedora-infra-map Documentation, Release 0.1.0

16 Chapter 7. Fedora Infra Map requirements

(21)

Fedora Infra Map app design

Fedora Infra Map is using clean architecture design and directories structure based on the requirements. Clean archi- tecture was chosen to allow Fedora Infra Map parts to be easily replaceable and easily maintainable.

The design will be split to three parts relevant to three layers Entities, Use Cases and External systems.

8.1 Entities

Inner definitions of objects we will work with and their serializers. This is the core of the whole application. Bellow is the directory structure.

fedora_infra_map +-- entities

+-- init.py +-- node.py +-- edge.py +-- serializers

+-- init.py

+-- node_json_serializer.py +-- edge_json_serializer.py

8.1.1 node.py

Internal representation of node in the map. One node = one app.

8.1.2 edge.py

Internal representation of edge in the map. One edge = one relationship between two apps.

(22)

fedora-infra-map Documentation, Release 0.1.0

8.1.3 node_json_serializer

JSON serializer for node object. This allows us to use json.dumps on the Node object.

8.1.4 edge_json_serializer

JSON serializer for edge object. This allows us to use json.dumps on the Edge object.

8.2 Use cases

Use cases corresponds to requirements. This layer will define what the application can do. Bellow is the directory structure for this layer. This layer also contains abstract classes which will be inherited by external systems and response/requests definition with any exceptions.

fedora_infra_map +-- use_cases

+-- init.py

+-- node_edge_list.py +-- request_objects

+-- init.py

+-- node_edge_list_request.py +-- response_objects

+-- init.py +-- response.py

+-- response_success.py +-- response_failure.py +-- database

+-- init.py +-- database.py

8.2.1 node_edge_list

This class returns the list of nodes and list of edges connecting them or error. It calls abstract Database class, request a query and handle response from external system.

8.2.2 node_edge_list_request

Request passed to node_edge_list it contains a list of filters to apply.

8.2.3 response

Abstract class which is inherited by other responses. This class also defines constants for any response code. Defines __bool__method.

8.2.4 response_success

This class is inherited from Response and is returned when use case finishes successfully. Implements __bool__

method that returns True and value attribute, which contains return value from use case if any.

18 Chapter 8. Fedora Infra Map app design

(23)

8.2.6 database

Abstract class that defines the API for database. It needs to be inherited by any external database class.

8.3 External systems

This is the outer layer of clean architecture and contains wrappers that are calling external systems and any helper class used by the wrappers. Wrappers will inherit abstract class defined in use cases layer.

fedora_infra_map +-- database

+-- csv.py +-- config.py

8.3.1 csv

This class implements database wrapper around CSV files.

8.3.2 config

This class is centralized implementation of application configuration.

(24)

fedora-infra-map Documentation, Release 0.1.0

20 Chapter 8. Fedora Infra Map app design

(25)

Indices and tables

• genindex

• modindex

• search

References

Related documents

Postgres DSpace, Postgres Solr yes sometimes Deep Blue Data depositor, source Samvera, Fedora Fedora Solr yes sometimes Fulcrum depositor, source Samvera, Fedora Fedora Solr

➔ (*) if it was not built-in but “only” in Repo there are methods to block specific packages: &lt;read article&gt; ; for long-term solution ask/tweet distro to remove

Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to.. dask-distance Documentation, Release 0.2.0+0.g0b36556.dirty. 5.1.4

This guide shows you how to download a Fedora 19 live CD image, burn this image to a disc, and use this disc to install Fedora 19 on a typical desktop or notebook computer.. This

Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to.. lsdviztools Documentation, Release 0.1.0. 4.1.4

Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it... 10.1.4 Write Documentation.. Lazy

Windows Microsoft® Windows Server® 2012 Foundation Microsoft® Windows Server® 2012 Essentials Microsoft® Windows Server® 2012 Standard Microsoft® Windows Server® 2012

Aforementioned example will ensure that the following state starts containers in the required order and maps host volumes to the web_server container, and each of the