diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2024-02-26 09:10:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-26 09:10:14 -0500 |
commit | 4b7d920b44302adcc7c733bcea3bc5cf8fc3c63f (patch) | |
tree | ba4d8fbee47cc6b7f1cc18f43ee5cc1bdfd5a594 /integrations | |
parent | 0e7cde465cc456dd5a35ce7aba5b2e00631bca62 (diff) |
Integrate Go plugin with build system. (#17005)
* Integrate Go plugin with build system.
* Fix Debian packaging rules.
* Add FreeBSD support to Go toolchain handling.
* Add Go ldflags handling.
* Fix version detection when GCCGO is used.
* Fix Go ldflags handling.
* Correctly fix Go toolchain version detection.
* Properly mark Go as a required dependency in CMake.
* Disable VCS stamping as it does not work correctly on some platforms.
* Autodetect minimum required Go version from go.mod files.
This allows us to avoid needing to update the CMakeLists.txt file when
the required version changes in a Go component’s go.mod file.
* Prefix GoTools module name with Netdata to ensure we get our local module.
* Update integrations code to use new Go plugin location.
* Remove old go packaging files.
* keep old logic for initial cleanup that is working
* Re-sync Go plugin sources.
* Fix search order for finding Go toolchain.
* update module name
* fix /usr/local/go overwrite condition
---------
Co-authored-by: Fotis Voutsas <fotis@netdata.cloud>
Co-authored-by: ilyam8 <ilya@netdata.cloud>
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/gen_docs_integrations.py | 34 | ||||
-rwxr-xr-x | integrations/gen_integrations.py | 9 |
2 files changed, 17 insertions, 26 deletions
diff --git a/integrations/gen_docs_integrations.py b/integrations/gen_docs_integrations.py index b52500bdda..caceb9cc9c 100644 --- a/integrations/gen_docs_integrations.py +++ b/integrations/gen_docs_integrations.py @@ -5,30 +5,26 @@ import re # Dictionary responsible for making the symbolic links at the end of the script's run. symlink_dict = {} -am_i_inside_go = "go.d.plugin" in str(Path.cwd()) def cleanup(): """ clean directories that are either data collection or exporting integrations """ - if am_i_inside_go: - for element in Path("modules").glob('**/*/'): - if "integrations" in str(element): - shutil.rmtree(element) - else: - for element in Path("src/collectors").glob('**/*/'): - # print(element) - if "integrations" in str(element): - shutil.rmtree(element) - - for element in Path("src/exporting").glob('**/*/'): - if "integrations" in str(element): - shutil.rmtree(element) - for element in Path("integrations/cloud-notifications").glob('**/*/'): - if "integrations" in str(element) and not "metadata.yaml" in str(element): - shutil.rmtree(element) - + for element in Path("src/go/collectors/go.d.plugin/modules").glob('**/*/'): + if "integrations" in str(element): + shutil.rmtree(element) + for element in Path("src/collectors").glob('**/*/'): + # print(element) + if "integrations" in str(element): + shutil.rmtree(element) + + for element in Path("src/exporting").glob('**/*/'): + if "integrations" in str(element): + shutil.rmtree(element) + for element in Path("integrations/cloud-notifications").glob('**/*/'): + if "integrations" in str(element) and not "metadata.yaml" in str(element): + shutil.rmtree(element) def generate_category_from_name(category_fragment, category_array): """ @@ -368,7 +364,7 @@ for integration in integrations: path = build_path(meta_yaml) write_to_file(path, md, meta_yaml, sidebar_label, community) - elif not am_i_inside_go: + else: # kind of specific if clause, so we can avoid running excessive code in the go repo if integration['integration_type'] == "exporter": diff --git a/integrations/gen_integrations.py b/integrations/gen_integrations.py index 938ae735cc..2b188b630f 100755 --- a/integrations/gen_integrations.py +++ b/integrations/gen_integrations.py @@ -14,7 +14,6 @@ from referencing.jsonschema import DRAFT7 from ruamel.yaml import YAML, YAMLError AGENT_REPO = 'netdata/netdata' -GO_REPO = 'netdata/go.d.plugin' INTEGRATIONS_PATH = Path(__file__).parent TEMPLATE_PATH = INTEGRATIONS_PATH / 'templates' @@ -23,7 +22,6 @@ JSON_PATH = INTEGRATIONS_PATH / 'integrations.json' CATEGORIES_FILE = INTEGRATIONS_PATH / 'categories.yaml' REPO_PATH = INTEGRATIONS_PATH.parent SCHEMA_PATH = INTEGRATIONS_PATH / 'schemas' -GO_REPO_PATH = REPO_PATH / 'go.d.plugin' DISTROS_FILE = REPO_PATH / '.github' / 'data' / 'distros.yml' METADATA_PATTERN = '*/metadata.yaml' @@ -31,7 +29,7 @@ COLLECTOR_SOURCES = [ (AGENT_REPO, REPO_PATH / 'src' / 'collectors', True), (AGENT_REPO, REPO_PATH / 'src' / 'collectors' / 'charts.d.plugin', True), (AGENT_REPO, REPO_PATH / 'src' / 'collectors' / 'python.d.plugin', True), - (GO_REPO, GO_REPO_PATH / 'modules', True), + (AGENT_REPO, REPO_PATH / 'src' / 'go' / 'collectors' / 'go.d.plugin' / 'modules', True), ] DEPLOY_SOURCES = [ @@ -399,10 +397,7 @@ def make_id(meta): def make_edit_link(item): - if item['_repo'] == 'netdata/go.d.plugin': - item_path = item['_src_path'].relative_to(GO_REPO_PATH) - else: - item_path = item['_src_path'].relative_to(REPO_PATH) + item_path = item['_src_path'].relative_to(REPO_PATH) return f'https://github.com/{ item["_repo"] }/blob/master/{ item_path }' |