{"id":25239409,"url":"https://github.com/neptun-software/neptun.data.generators","last_synced_at":"2025-07-30T05:03:49.959Z","repository":{"id":271639589,"uuid":"914097381","full_name":"neptun-software/neptun.data.generators","owner":"neptun-software","description":"Send scraped data from neptun-scraper to CHATGPT to generate training data for NEPTUN.AI.","archived":false,"fork":false,"pushed_at":"2025-01-15T11:10:42.000Z","size":1602,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-05T19:43:25.459Z","etag":null,"topics":["data","generator"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neptun-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-09T00:14:58.000Z","updated_at":"2025-01-15T11:10:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"54b5c150-79a8-494f-b3d1-10e983cc98cf","html_url":"https://github.com/neptun-software/neptun.data.generators","commit_stats":null,"previous_names":["neptun-software/neptun.data.generators"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neptun-software/neptun.data.generators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neptun-software%2Fneptun.data.generators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neptun-software%2Fneptun.data.generators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neptun-software%2Fneptun.data.generators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neptun-software%2Fneptun.data.generators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neptun-software","download_url":"https://codeload.github.com/neptun-software/neptun.data.generators/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neptun-software%2Fneptun.data.generators/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267814292,"owners_count":24148327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","generator"],"created_at":"2025-02-11T18:27:48.863Z","updated_at":"2025-07-30T05:03:49.870Z","avatar_url":"https://github.com/neptun-software.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockerfile Processor\n\n## Overview\nThis repository contains a Python-based tool for analyzing and processing Dockerfiles. It is designed to generate user-friendly questions and outputs in JSONL format for training or other applications. The tool uses the Hugging Face Inference API to interact with a language model, providing meaningful outputs based on the content of the Dockerfiles.\n\n---\n\n## Features\n- **Automated Dockerfile Analysis:** Parses and validates Dockerfiles for processing.\n- **Hugging Face Integration:** Uses `mistralai/Mistral-7B-Instruct-v0.3` for generating prompts and responses.\n- **Error Handling \u0026 Retry Mechanism:** Handles API failures with retry logic and logs failures for later review.\n- **Logging:** Tracks success and failure statistics in both console output and log files.\n- **JSONL Output:** Generates well-structured JSONL files with system-user interactions for each Dockerfile.\n\n---\n\n## File Structure\n\n```\n.\n├── dockerfiles\n│   └── sources-gold       # Directory containing input Dockerfiles\n├── data\n│   └── dockerfiles.jsonl  # Output file storing processed data in JSONL format\n├── logs\n│   ├── success.log        # Logs filenames successfully processed\n│   └── failure.log        # Logs filenames that failed processing\n├── .env                   # Environment variables (e.g., API_TOKEN)\n├── main.py                # Main Python script for processing Dockerfiles\n├── README.md              # Repository documentation (this file)\n└── requirements.txt       # Python dependencies\n```\n\n---\n\n## How It Works\n1. **Dockerfile Parsing:**\n   - The tool reads Dockerfiles from the `dockerfiles/sources-gold` directory.\n   - Validates each file using the `dockerfile` library to ensure compatibility.\n\n2. **Prompt Generation:**\n   - Constructs a prompt based on the content of the Dockerfile.\n   - Sends the prompt to the Hugging Face Inference API for processing.\n\n3. **Response Handling:**\n   - Validates and cleans the model's response.\n   - Retries up to a defined limit if the response is invalid or empty.\n\n4. **Output Generation:**\n   - Creates a JSONL entry with the Dockerfile content and the generated user question.\n   - Logs each file's success or failure into separate log files.\n\n---\n\n## Usage\n\n### Prerequisites\n1. Python 3.8+\n2. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n3. Set up the `.env` file with your Hugging Face API token:\n   ```\n   API_TOKEN=your_hugging_face_api_token\n   ```\n\n### Running the Script\nExecute the main script to process Dockerfiles:\n```bash\npython main.py\n```\n\n### Outputs\n- **Processed Data:**\n  - Saved in `data/dockerfiles.jsonl` as structured JSONL.\n- **Logs:**\n  - Successful files: `logs/success.log`\n  - Failed files: `logs/failure.log`\n\n---\n\n## Example JSONL Entry\n```json\n{\n  \"text\": \"System: You are a Dockerfile generator.\\n\\nUser: Create a Dockerfile using...\\n\\nAssistant: FROM alpine:3.10\\nRUN ...\"\n}\n```\n\n---\n\n## Contributing\n1. Fork the repository.\n2. Create a new branch:\n   ```bash\n   git checkout -b feature-branch\n   ```\n3. Make your changes and commit them:\n   ```bash\n   git commit -m \"Add new feature\"\n   ```\n4. Push to your branch:\n   ```bash\n   git push origin feature-branch\n   ```\n5. Open a pull request.\n\n---\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Contact\nFor questions or feedback, please create an issue in this repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneptun-software%2Fneptun.data.generators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneptun-software%2Fneptun.data.generators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneptun-software%2Fneptun.data.generators/lists"}