# imnicoo7/jenkins-pipeline architecture

> Architecture diagram of the GitHub repository imnicoo7/jenkins-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imnicoo7/jenkins-pipeline
- Repository: https://github.com/imnicoo7/jenkins-pipeline

## Overview

##### Project Type and Purpose
- The project appears to be a standalone Python-based application that processes data (likely using dataframes and CSV reading/parsing) and manages scheduled tasks.
- The README’s table indicates a scheduling/triggering mechanism for different data “consultations” (e.g., “Consulta Programada” and “Knime”) with detailed frequency and timing settings.
- The presence of multiple Jenkinsfiles (in the root and within directories like “hijo1” and “hijo2”) suggests that Continuous Integration (CI) and possibly deployment pipelines are integrated, which might trigger different parts of the workflow or handle different environments/sub-tasks.

##### File Structure
- Core Python scripts:
- dataframe.py: Likely contains routines for handling or manipulating dataframes.
- leer_csv.py and leer_readme.py: These scripts are probably responsible for reading CSV files and parsing the README (or similar configuration) content respectively.
- readme_functions.py: Likely holds auxiliary functions, possibly used to process the scheduling table or perform transformations.
- Jenkins Pipelines:
- A Jenkinsfile at the project root and one each inside “hijo1” and “hijo2” suggest that the project is set up for automated build and deployment (or scheduled job execution) using Jenkins.
- readme.md:
- Contains a table that defines various job or data collection schedules, settings, and dependent executions.

##### High-Level Architectural Components
a. Data Ingestion/Parsing Components:
- “leer_csv.py” – Reads input CSV files.
- “leer_readme.py” – Parses the readme details which include scheduling and configuration data.
b. Data Processing / Transformation:
- “dataframe.py” – Likely forms the heart of the data transformation/manipulation logic.
- “readme_functions.py” – Provides supporting functions, possibly used by the other scripts to process the scheduling or to standardize transformations.
c. Job Scheduling and Pipeline Management:
- Jenkins Pipelines (represented by the Jenkinsfile in the root and those within “hijo1” and “hijo2”) – These may trigger and orchestrate the execution of the Python scripts based on schedules defined in the readme table.
- The configuration in the readme table (which includes frequency, days, and times) acts as a scheduling configuration that the pipelines or underlying scheduling tools (like cron jobs or Jenkins scheduled jobs) can use.
d. Configuration and Documentation:
- “readme.md” – Serves as both documentation and a loose configuration guide for scheduling or operational parameters.

##### Relationships and Interactions
- Data flows from raw sources into the data ingestion components (“leer_csv.py” & “leer_readme.py”).
- Parsed and ingested data is then processed by “dataframe.py” and functions in “readme_functions.py”, which transform the data as needed.
- Jenkins pipelines are set up to monitor or trigger these processes, potentially using the scheduling definitions found in readme.md.
- There is an orchestration flow where the pipelines (possibly defined separately for different tasks in “hijo1” and “hijo2”) initiate the processing jobs, ensuring that tasks (like “Consulta Programada” and “Knime”) run at the prescribed times.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Clearly segregating data ingestion, processing, and pipeline orchestration.
- Modularity: Independent Python modules (scripts) each handling a distinct part of the workflow.
- CI/CD Integration: Use of Jenkins files to support automated, scheduled runs and possibly deployment or reporting of results.
- Config-Driven Behavior: The scheduling details in the README serve as a pseudo-configuration layer that drives when and how certain functions or jobs run.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Configuration & Documentation"
        config["readme.md (Scheduling Configuration)"]:::config
    end

    subgraph "Job Scheduling & Orchestration"
        main["Main Jenkins Pipeline (jenkinsfile)"]:::jenkins
        child1["Child Pipeline 1 (hijo1/jenkinsfile)"]:::jenkins
        child2["Child Pipeline 2 (hijo2/jenkinsfile)"]:::jenkins
    end

    subgraph "Data Ingestion"
        csv["CSV Reader (leer_csv.py)"]:::python
        parser["Readme Parser (leer_readme.py)"]:::python
    end

    subgraph "Data Processing"
        transformer["Data Transformer (dataframe.py)"]:::python
        helper["Helper Functions (readme_functions.py)"]:::python
    end

    %% Configuration triggers Jenkins pipelines
    config -->|"schedules"| main
    config -->|"schedules"| child1
    config -->|"schedules"| child2

    %% Jenkins pipelines trigger data ingestion modules
    main -->|"triggers"| csv
    main -->|"triggers"| parser
    child1 -->|"triggers"| csv
    child1 -->|"triggers"| parser
    child2 -->|"triggers"| csv
    child2 -->|"triggers"| parser

    %% Data Ingestion flows into Data Processing
    csv -->|"feeds"| transformer
    parser -->|"feeds"| helper
    transformer -->|"processes"| helper

    %% Styles
    classDef python fill:#c6f9c6,stroke:#333,stroke-width:2px;
    classDef jenkins fill:#c6e6ff,stroke:#333,stroke-width:2px;
    classDef config fill:#fff2a8,stroke:#333,stroke-width:2px;

    %% Click Events
    click csv "https://github.com/imnicoo7/jenkins-pipeline/blob/master/leer_csv.py"
    click parser "https://github.com/imnicoo7/jenkins-pipeline/blob/master/leer_readme.py"
    click transformer "https://github.com/imnicoo7/jenkins-pipeline/blob/master/dataframe.py"
    click helper "https://github.com/imnicoo7/jenkins-pipeline/blob/master/readme_functions.py"
    click main "https://github.com/imnicoo7/jenkins-pipeline/tree/master/jenkinsfile"
    click child1 "https://github.com/imnicoo7/jenkins-pipeline/tree/master/hijo1/jenkinsfile"
    click child2 "https://github.com/imnicoo7/jenkins-pipeline/tree/master/hijo2/jenkinsfile"
    click config "https://github.com/imnicoo7/jenkins-pipeline/blob/master/readme.md"
```
