Skip to content

Commit

Permalink
Changed feedback_pipeline to content_resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan committed Nov 21, 2024
1 parent 55b7033 commit 4593abe
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: mkdir -p output/history

- name: Run the build
run: ./feedback_pipeline.py --dev-buildroot test_configs output
run: ./content_resolver.py --dev-buildroot test_configs output

- name: Run tests
run: |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Please use the `refresh.sh` script as a reference for deployment.

## Developer preview

If you want to contribute and test your changes, run the `feedback_pipeline.py` script with test configs in the `test_configs` directory.
If you want to contribute and test your changes, run the `content_resolver.py` script with test configs in the `test_configs` directory.

To run the script, you'll need Python 3 and the following dependencies:

Expand All @@ -124,7 +124,7 @@ $ podman run --rm -it --cap-add CAP_SYS_CHROOT --tmpfs /dnf_cachedir -v $(pwd):/

```
# mkdir -p output/history
# ./feedback_pipeline.py --dev-buildroot --dnf-cache-dir /dnf_cachedir test_configs output
# ./content_resolver.py --dev-buildroot --dnf-cache-dir /dnf_cachedir test_configs output
```

The output will be generated in the `output` directory. Open the `output/index.html` in your web browser of choice to see the result.
Expand All @@ -140,7 +140,7 @@ $ docker run --rm -it --tmpfs /dnf_cachedir -v $(pwd):/workspace content-resolve

```
# mkdir -p output/history
# ./feedback_pipeline.py --dev-buildroot --dnf-cache-dir /dnf_cachedir test_configs output
# ./content_resolver.py --dev-buildroot --dnf-cache-dir /dnf_cachedir test_configs output
```

The output will be generated in the `output` directory. Open the `output/index.html` in your web browser of choice to see the result.
14 changes: 7 additions & 7 deletions feedback_pipeline.py → content_resolver.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/python3

import datetime
from feedback_pipeline.analyzer import Analyzer
from feedback_pipeline.data_generation import generate_data_files
from feedback_pipeline.historia_data import generate_historic_data
from feedback_pipeline.page_generation import generate_pages
from feedback_pipeline.query import Query
from feedback_pipeline.utils import load_data, log, datetime_now_string, dump_data
from feedback_pipeline.config_manager import ConfigManager
from content_resolver.analyzer import Analyzer
from content_resolver.data_generation import generate_data_files
from content_resolver.historia_data import generate_historic_data
from content_resolver.page_generation import generate_pages
from content_resolver.query import Query
from content_resolver.utils import load_data, log, datetime_now_string, dump_data
from content_resolver.config_manager import ConfigManager



Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import tempfile, os, json, datetime, dnf, urllib.request, sys, koji

import multiprocessing, asyncio
from feedback_pipeline.utils import dump_data, load_data, log, err_log, pkg_id_to_name, size, workload_id_to_conf_id, url_to_id
from feedback_pipeline.exceptions import RepoDownloadError, BuildGroupAnalysisError, KojiRootLogError, AnalysisError
from content_resolver.utils import dump_data, load_data, log, err_log, pkg_id_to_name, size, workload_id_to_conf_id, url_to_id
from content_resolver.exceptions import RepoDownloadError, BuildGroupAnalysisError, KojiRootLogError, AnalysisError


def pkg_placeholder_name_to_id(placeholder_name):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import yaml
import argparse

from feedback_pipeline.utils import err_log, log
from content_resolver.utils import err_log, log

from feedback_pipeline.exceptions import SettingsError, ConfigError
from content_resolver.exceptions import SettingsError, ConfigError

class ConfigManager:
def __init__(self, config_file=None):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from feedback_pipeline.utils import dump_data, log
from content_resolver.utils import dump_data, log


def _generate_json_file(data, page_name, settings):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import json
import os
import re
from feedback_pipeline.data_generation import _generate_json_file
from feedback_pipeline.utils import dump_data, err_log, log
from content_resolver.data_generation import _generate_json_file
from content_resolver.utils import dump_data, err_log, log


def _save_current_historic_data(query):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import subprocess
import jinja2
from feedback_pipeline.utils import dump_data, log
from content_resolver.utils import dump_data, log


def _generate_html_page(template_name, template_data, page_name, settings):
Expand Down
2 changes: 1 addition & 1 deletion feedback_pipeline/query.py → content_resolver/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from functools import lru_cache

from feedback_pipeline.utils import pkg_id_to_name
from content_resolver.utils import pkg_id_to_name


class Query():
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions refresh.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# This script runs the feedback_pipeline.py with the right configs and pushes out the results
# This script runs the content_resolvere.py with the right configs and pushes out the results



Expand Down Expand Up @@ -41,7 +41,7 @@ echo ""
echo "Building..."
echo "$build_started"
echo "(Logging into ~/logs/$build_started.log)"
CMD="./feedback_pipeline.py --dnf-cache-dir /dnf_cachedir content-resolver-input/configs out" || exit 1
CMD="./content_resolver.py --dnf-cache-dir /dnf_cachedir content-resolver-input/configs out" || exit 1
podman run --rm -it --tmpfs /dnf_cachedir -v $WORK_DIR/content-resolver:/workspace:z localhost/asamalik/fedora-env $CMD > ~/logs/$build_started.log || exit 1

# Save the root log cache
Expand Down
5 changes: 3 additions & 2 deletions test_config_files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3

import feedback_pipeline
import content_resolver.config_manager

def create_mock_settings():
settings = {}
Expand All @@ -11,7 +11,8 @@ def create_mock_settings():
return settings

def main():
feedback_pipeline.get_configs(create_mock_settings())
config_manager = content_resolver.config_manager.ConfigManager()
config_manager.get_configs(create_mock_settings())

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion test_feedback_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3

import feedback_pipeline
import content_resolver

def test_build_completion():
assert 1 == 1
2 changes: 1 addition & 1 deletion test_root_log_function.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/python3

from feedback_pipeline import Analyzer
from content_resolver.analyzer import Analyzer
import sys
import urllib

Expand Down

0 comments on commit 4593abe

Please sign in to comment.