-
Notifications
You must be signed in to change notification settings - Fork 7
Prepare repo for PyPI packaging #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ahmedsobeh
wants to merge
7
commits into
main
Choose a base branch
from
prepare-repo-for-packaging
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f4d45bd
preparing repo for packaging
ahmedsobeh 5508671
preparing repo for packaging
ahmedsobeh 9b0c41e
preparing repo for packaging
ahmedsobeh 06140ea
fixed script and conf
ftisiot b2c01a3
added subfolder to conf
ftisiot 75523ae
fixing service creation and deletion
ftisiot 8d90c82
Update README.md
ahmedsobeh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from aiven_metadata_parser import ( | ||
add_grafana_dashboard, | ||
app, | ||
backup, | ||
explore_service, | ||
flink, | ||
grafana, | ||
integration, | ||
kafka, | ||
kafka_connect, | ||
mysql, | ||
opensearch, | ||
pg, | ||
pyvis_display, | ||
redis, | ||
sql, | ||
tag, | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 3 additions & 8 deletions
11
src/explore_service.py → aiven_metadata_parser/explore_service.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
from aiven.client import client | ||
import explore_service | ||
import pyvis_display as pyvis_display | ||
import configparser | ||
|
||
|
||
def main(): | ||
# Reading conf.env configuration file | ||
with open("aiven_metadata_parser/conf/conf.env", "r") as f: | ||
config_string = "[DEFAULT]\n" + f.read() | ||
config = configparser.ConfigParser() | ||
config.read_string(config_string) | ||
|
||
# Creating Aiven client instance | ||
myclient = client.AivenClient(base_url=config["DEFAULT"]["BASE_URL"]) | ||
|
||
# Authenticating and storing the token | ||
# result = myclient.authenticate_user(email=config['DEFAULT']['USERNAME'], password=config['DEFAULT']['PASSWORD']) | ||
myclient.auth_token = config["DEFAULT"]["TOKEN"] | ||
|
||
# Creating empty nodes and edges lists | ||
nodes = [] | ||
edges = [] | ||
|
||
# The service order helps analysis first "standalone" services and then connection services, this might be useful | ||
# to parse first services which can be either source or sink of other services (e.g. Kafka connect might use a PG | ||
# table as a source) | ||
|
||
services_order = { | ||
"opensearch": 1, | ||
"elasticsearch": 1, | ||
"pg": 1, | ||
"redis": 1, | ||
"mysql": 1, | ||
"clickhouse": 1, | ||
"cassandra": 1, | ||
"m3db": 1, | ||
"m3aggregator": 1, | ||
"m3coordinator": 1, | ||
"influxdb": 1, | ||
"kafka": 2, | ||
"kafka_connect": 3, | ||
"kafka_mirrormaker": 3, | ||
"flink": 3, | ||
"grafana": 3, | ||
} | ||
|
||
# Listing the services | ||
services = myclient.get_services(project=config["DEFAULT"]["PROJECT"]) | ||
|
||
# Ordering based on service_order | ||
services.sort(key=lambda x: services_order[x["service_type"]]) | ||
|
||
# Initial loop to find all ip/hostname of existing services | ||
print("Locate IP/hostname of each service") | ||
for i, service in enumerate(services, start=1): | ||
# if service["service_name"]!='test': | ||
print( | ||
f"{i}/{len(services)} {service['service_name']} {service['service_type']}" | ||
) | ||
# if service["service_type"]=='grafana': | ||
explore_service.populate_service_map( | ||
myclient, | ||
service["service_type"], | ||
service["service_name"], | ||
project=config["DEFAULT"]["PROJECT"], | ||
) | ||
|
||
# Second loop to find details of each service | ||
print() | ||
print("Find details of each service") | ||
for i, service in enumerate(services, start=1): | ||
print( | ||
f"{i}/{len(services)} Query {service['service_name']} {service['service_type']}" | ||
) | ||
# if service["service_name"] != 'test': | ||
(newnodes, newedges) = explore_service.explore( | ||
myclient, | ||
service["service_type"], | ||
service["service_name"], | ||
project=config["DEFAULT"]["PROJECT"], | ||
) | ||
nodes = nodes + newnodes | ||
edges = edges + newedges | ||
|
||
(newnodes, newedges) = explore_service.explore_ext_endpoints( | ||
myclient, project=config["DEFAULT"]["PROJECT"] | ||
) | ||
nodes = nodes + newnodes | ||
edges = edges + newedges | ||
|
||
# Creating viz with pyviz | ||
pyvis_display.pyviz_graphy(nodes, edges) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
scripts/delete_services.sh → ...etadata_parser/scripts/delete_services.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[metadata] | ||
description-file = README.md |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth explaining that one can use
pip install -r aiven_metadata_parser/requirements.txt
to install the Python packages (perhaps in the list item that mentions that file)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's mentioned in line #46 already