diff --git a/.gitignore b/.gitignore index 02004ee..783381a 100644 --- a/.gitignore +++ b/.gitignore @@ -139,7 +139,7 @@ cython_debug/ # custom folders .idea -lab +labs .aws .docker .deta diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..c10780c --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13.1 diff --git a/Dockerfile b/Dockerfile index 48e06b1..696253d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN echo ${GIT_BRANCH} RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts ENV WORKDIR="/opt/pygentic_ai" -RUN --mount=type=ssh git clone -b ${GIT_BRANCH} git@github.com:fsecada01/Ranked-Jobs-API-Micro-Service.git ${WORKDIR} +RUN --mount=type=ssh git clone -b ${GIT_BRANCH} git@github.com:fsecada01/Pygentic-AI.git ${WORKDIR} #COPY . ${WORKDIR} WORKDIR ${WORKDIR} diff --git a/README.md b/README.md new file mode 100644 index 0000000..f901133 --- /dev/null +++ b/README.md @@ -0,0 +1,633 @@ +
PYGENTIC-AI/
++โฆฟ __root__
++ +
+ + + ++ + +File Name +Summary ++ +compose.yaml +- Define services and configurations for web and celery_service containers in the compose.yaml file to orchestrate the deployment of the Pygentic AI application +
- The file specifies resource limits, environment variables, ports, volumes, labels for Traefik routing, health checks, and network settings
- It ensures proper service communication and scalability within the architecture.+ +core_requirements.in +- Generate a list of essential Python packages required for the projects core functionality +
- The filecore_requirements.in
specifies the dependencies necessary for running the codebase, including libraries for async operations, database connectivity, API development, task queuing, and more.+ +core_requirements.txt +- Generate a list of core project dependencies and their versions +
- The list is automatically created by uv using the command uv pip compile--strip-extras core_requirements.in-o core_requirements.txt
- The file core_requirements.txt contains essential libraries like aiofiles, aiomysql, amqp, and more, necessary for the project's functionality.+ +dev_requirements.in +- Enhance development productivity by managing project dependencies efficiently +
- This file specifies required packages for development, ensuring a streamlined workflow
- It includes tools like Alembic for database migrations, Black for code formatting, and FastAPI Debug Toolbar for debugging
- By defining essential dependencies, developers can maintain code quality and boost collaboration.+ +dev_requirements.txt +- Generate a list of development requirements for the project by compiling dependencies specified in various configuration files +
- The file dev_requirements.txt serves as a consolidated reference for tools and libraries essential for development tasks
- This compilation aids in managing and ensuring consistent development environments across the project.+ +Dockerfile +- Builds a Docker image for a Python application, setting up necessary environment variables and dependencies +
- Clones a specific branch from a GitHub repository, configures user permissions, and prepares the environment for running the application
- The final image is ready to execute the Python application using predefined scripts.+ +pyproject.toml +Define linting rules and project dependencies in pyproject.toml for the agentic_ai_service project. ++bin
+++โฆฟ bin
++ +
+ + + ++ + +File Name +Summary ++ +build.sh +Update project dependencies and install required packages using the provided build script. ++ +linux_build.sh +- Install necessary dependencies and tools for the project on a Linux system using the provided script +
- The script sets up the environment by updating packages, installing essential tools, adding repositories, and configuring locales
- It ensures a smooth setup process for development and deployment on a Linux machine.+ +python_build.sh +- Automates Python virtual environment setup and dependency management using pip-tools +
- Sets up a virtual environment, installs necessary packages, and synchronizes dependencies for core and development requirements
- Facilitates streamlined project setup and maintenance.+ +start.sh +Execute script to start the application, activating the virtual environment and launching the server with specified configurations. ++labs
+++โฆฟ labs
++ +
+ + + ++ + +File Name +Summary ++ +Untitled.ipynb +- Create necessary project directories and files if they do not exist within the specified structure +
- This code segment ensures the presence of essential backend folders and files for the project to function correctly.+src
+++โฆฟ src
++ +
+ ++ + +File Name +Summary ++ +app.py +Implement a RESTful API endpoint in src\app.py to handle user authentication for the project. ++ +cworker.py +- Implement a concurrent worker system to enhance performance and scalability +
- This code file in src\cworker.py manages worker threads efficiently within the project structure.+backend
+++โฆฟ src.backend
++ +
+ ++ + +File Name +Summary ++ +logger.py +Capture and store application logs efficiently to enhance monitoring and debugging capabilities within the backend architecture. ++ +utils.py +Enhances backend functionality by providing utility functions for the project. ++core
+++โฆฟ src.backend.core
++ +
+ + + ++ + +File Name +Summary ++ +consts.py +Define and centralize core constants for the backend architecture. ++ +core.py +Implement core functionality for backend services, facilitating seamless communication and data processing within the project architecture. ++ +main.py +- Implement core functionality for backend operations in the main.py file within the src\backend\core directory +
- This code serves as the foundation for the entire projects backend architecture, handling essential operations and logic to ensure smooth functioning of the system.+ +utils.py +- Enhance backend functionality by providing essential utility functions +
- This code file in the core directory plays a crucial role in supporting various backend operations
- It offers a collection of utility functions that streamline common tasks and enhance the overall efficiency of the backend system.+db
+++โฆฟ src.backend.db
++ +
+ + + ++ + +File Name +Summary ++ +consts.py +Define database constants for backend operations in the project structure. ++ +core.py +Manage core database operations for the backend system, ensuring efficient data handling and storage. ++ +main.py +Implement database connection and query functions to manage data persistence for the backend services. ++ +utils.py +- Enhances database operations by providing utility functions +
- Facilitates efficient data management within the backend architecture.+server
+++โฆฟ src.backend.server
++ +
+ + + ++ + +File Name +Summary ++ +consts.py +Define and store constant values used throughout the backend server architecture. ++ +core.py +Implement core server functionality to handle incoming requests and manage data operations within the backend architecture. ++ +main.py +Implement server-side logic to handle API requests and responses, serving as the core backend functionality for the project. ++ +utils.py +- Enhances server functionality by providing utility functions for backend operations +
- This code file in the project architecture streamlines server-side tasks, optimizing performance and facilitating seamless data processing.+settings
+++โฆฟ src.backend.settings
++ +
+ + + ++ + +File Name +Summary ++ +consts.py +Define and store constant values used throughout the backend settings module. ++ +core.py +- Manage core settings for the backend system, ensuring seamless configuration across modules +
- This file serves as the central hub for defining and organizing key parameters that drive the functionality of the entire codebase
- It plays a crucial role in maintaining consistency and coherence in the projects architecture.+ +main.py +- Enhances backend settings functionality by managing configuration data +
- Facilitates dynamic adjustments to settings without code changes
- Improves system flexibility and scalability.+ +utils.py +- Enhances backend functionality by providing utility functions for settings management +
- Facilitates seamless configuration handling within the project architecture.+site
+++โฆฟ src.backend.site
++ +
+ + + + + + + ++ + +File Name +Summary ++ +consts.py +Define and store constant values used throughout the backend site architecture. ++ +core.py +Implement core functionality for the site backend, facilitating key operations within the project architecture. ++ +main.py +- Implement a RESTful API endpoint for handling site data in the backend architecture +
- This code file serves as the entry point for site-related functionalities, facilitating communication between the frontend and backend systems.+ +utils.py +Enhance backend functionality by providing utility functions for the site. ++docker
+++โฆฟ docker
+ ++celery
+++โฆฟ docker.celery
++ +
+ + + ++ + +File Name +Summary ++ +start.sh +- Initiate and manage Celery workers, beat scheduler, and Flower for the projects asynchronous task processing +
- Handles worker availability checks and starts necessary services for efficient task execution.+ranked_jobs_ms
+++โฆฟ docker.ranked_jobs_ms
++ +
+ + + + + + +--- + +## Getting Started + +### Prerequisites + +This project requires the following dependencies: + +- **Programming Language:** Python +- **Package Manager:** Pip, Uv +- **Container Runtime:** Docker + +### Installation + +Build Pygentic-AI from the source and intsall dependencies: + +1. **Clone the repository:** + + ```sh + โฏ git clone https://github.com/fsecada01/Pygentic-AI + ``` + +2. **Navigate to the project directory:** + + ```sh + โฏ cd Pygentic-AI + ``` + +3. **Install the dependencies:** + + + + + + + + **Using [docker](https://www.docker.com/):** + + ```sh + โฏ docker build -t fsecada01/Pygentic-AI . + ``` + + + + + + + **Using [pip](https://pypi.org/project/pip/):** + + ```sh + โฏ pip install -r core_requirements.in, core_requirements.txt, dev_requirements.in, dev_requirements.txt + ``` + + + + + + + **Using [uv](https://docs.astral.sh/uv/):** + + ```sh + โฏ uv sync --all-extras --dev + ``` + +### Usage + +Run the project with: + +**Using [docker](https://www.docker.com/):** +```sh +docker run -it {image_name} +``` +**Using [pip](https://pypi.org/project/pip/):** +```sh +python {entrypoint} +``` +**Using [uv](https://docs.astral.sh/uv/):** +```sh +uv run python {entrypoint} +``` + +### Testing + +Pygentic-ai uses the {__test_framework__} test framework. Run the test suite with: + +**Using [pip](https://pypi.org/project/pip/):** +```sh +pytest +``` +**Using [uv](https://docs.astral.sh/uv/):** +```sh +uv run pytest tests/ +``` + +--- + +## Roadmap + +- [X] **`Task 1`**:+ + +File Name +Summary ++ +build.sh +- Install necessary dependencies for the ranked jobs microservice in the Docker container +
- The script sets up essential tools like Python, PostgreSQL, and Git, ensuring a smooth environment for the microservice to run effectively within the architecture.+ +python_build.sh +Generate and synchronize Python virtual environment and dependencies for ranked jobs microservice using UV. ++ +python_start.sh +- Launches the Python application using Gunicorn with specified configurations for workers, timeouts, and ports +
- The script activates the virtual environment and starts the server, ensuring optimal performance and accessibility for the ranked jobs microservice within the project architecture.Implement feature one.+- [ ] **`Task 2`**: Implement feature two. +- [ ] **`Task 3`**: Implement feature three. + +--- + +## Contributing + +- **๐ฌ [Join the Discussions](https://github.com/fsecada01/Pygentic-AI/discussions)**: Share your insights, provide feedback, or ask questions. +- **๐ [Report Issues](https://github.com/fsecada01/Pygentic-AI/issues)**: Submit bugs found or log feature requests for the `Pygentic-AI` project. +- **๐ก [Submit Pull Requests](https://github.com/fsecada01/Pygentic-AI/blob/main/CONTRIBUTING.md)**: Review open PRs, and submit your own PRs. + +++ + + +--- + +## License + +Pygentic-ai is protected under the [LICENSE](https://choosealicense.com/licenses) License. For more details, refer to the [LICENSE](https://choosealicense.com/licenses/) file. + +--- + +## Acknowledgments + +- Credit `contributors`, `inspiration`, `references`, etc. + + + +--- diff --git a/labs/Untitled.ipynb b/labs/Untitled.ipynb deleted file mode 100644 index 1ad44f4..0000000 --- a/labs/Untitled.ipynb +++ /dev/null @@ -1,102 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "11b8593d-dea7-44e0-beee-c0c6ffea7d1a", - "metadata": {}, - "outputs": [], - "source": [ - "from pathlib import Path" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "2b9388f3-c7e0-401d-8d0b-9ef43b78bd73", - "metadata": {}, - "outputs": [], - "source": [ - "work_dir = Path(__name__).resolve().parent.parent / \"src\"" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "c0625c16-9e78-4525-aa84-2194480aaf0c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "WindowsPath('C:/dev/python/interview_eval_project/highmark_agentic_ai/src')" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "work_dir" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "481c534a-5120-457c-8f5e-3dbb2a5f1c3d", - "metadata": {}, - "outputs": [], - "source": [ - "backend = work_dir / \"backend\"" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "69c64859-7ad8-4e04-b974-ad54c8647bbf", - "metadata": {}, - "outputs": [], - "source": [ - "if backend.exists():\n", - " for folder in (\"core\", \"db\", \"server\", \"settings\", \"site\"):\n", - " directory = backend / folder\n", - " if not directory.exists():\n", - " directory.mkdir(exist_ok=True)\n", - " for file in (\"__init__\", \"core\", \"main\", \"utils\", \"consts\"):\n", - " file_path = directory / file\n", - " # file_path.touch(exist_ok=True)\n", - " file_path.unlink(missing_ok=True)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "50e9ff3d-f23a-402d-8bad-5f7f821d6b84", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Pydantic Agent AI", - "language": "python", - "name": "agentic_ai" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.8" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}Contributing Guidelines
+ +1. **Fork the Repository**: Start by forking the project repository to your github account. +2. **Clone Locally**: Clone the forked repository to your local machine using a git client. + ```sh + git clone https://github.com/fsecada01/Pygentic-AI + ``` +3. **Create a New Branch**: Always work on a new branch, giving it a descriptive name. + ```sh + git checkout -b new-feature-x + ``` +4. **Make Your Changes**: Develop and test your changes locally. +5. **Commit Your Changes**: Commit with a clear message describing your updates. + ```sh + git commit -m 'Implemented new feature x.' + ``` +6. **Push to github**: Push the changes to your forked repository. + ```sh + git push origin new-feature-x + ``` +7. **Submit a Pull Request**: Create a PR against the original project repository. Clearly describe the changes and their motivations. +8. **Review**: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution! +