Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrastructure setup: CI/CD Integration, CLI tools, containerization, and more. #9

Merged
merged 11 commits into from
Apr 23, 2024

Conversation

mango-habanero
Copy link
Owner

@mango-habanero mango-habanero commented Apr 23, 2024

Purpose

This pull request integrates a robust CI/CD pipeline using GitHub Actions, enhances the development experience with new CLI tools, adds critical configuration for versioning and dependencies, and containerizes the application for consistent deployment environments. The aim is to streamline development workflows, automate deployment processes, and ensure the application's scalability and maintainability.

List of Changes

  • GitHub Actions CI/CD Workflow: Implemented a complete CI/CD workflow using GitHub Actions to automate testing, linting, and deployment processes.
  • Dependency Management and Configuration Enhancements:
    • Added necessary development dependencies including click for CLI operations, pre-commit for git hooks, and python-semantic-release for automated version management.
    • Updated pyproject.toml with configurations for new tools and dependencies.
  • CLI for Server Operations: Developed a generic mh CLI tool to streamline server-related operations such as starting the server.
  • Versioning Configuration: Configured the project to utilize python-semantic-release for automated version control.
  • Custom App Exceptions Module: Added a module for custom application exceptions to handle errors more effectively.
  • Project Structure Refinement: Restructured the project by moving all modules into a parent package named app.
  • Containerization with Docker:
    • Created a Dockerfile and docker-compose.yml to containerize the application, ensuring consistency across different environments.
    • Added a .dockerignore file to exclude unnecessary files from the Docker image.

Linked Issues

There are no specific issues linked to this pull request. This is an initiative to enhance the overall infrastructure and development process.

How to Test

  • Pull the latest changes from the philip/feat/python-style-guide branch.
  • Install the updated dependencies using poetry install.
  • Run pre-commit install to set up the Git hooks.
  • Execute the mhcli with mhcli server start app.main:app to start the server and verify CLI functionality.
  • Build the Docker image using docker compose build and run the application with docker compose up to ensure the containerized environment is set up correctly.
  • Trigger a push or pull request to GitHub to test the GitHub Actions workflows, ensuring that all tests pass and the deployment proceeds as configured.
  • Check the automatic versioning by making a commit that follows the semantic versioning rules and observe if the version is updated correctly.

Additional Information

This PR includes a significant overhaul of the development and deployment processes to align with modern best practices for Python applications. It introduces tools and processes that automate many aspects of development, reduce potential errors, and ensure a high standard of code quality and deployment readiness.

Closes #7

- Adds Dockerfile to containerize application.
- Adds docker-compose file to spin up docker image instance.
- Adds .dockerignore file for files to exclude from docker image.
- Implements a CLI to handle starting the server.
…g pyproject.toml configurations.

- Explicitly defined app as package to include with poetry install.
- Adds click for cli definition.
- Adds pre-commit to implement git pre-commit hooks.
- Adds python-semantic release to handle semantic release in CI-CD
workflow.
- Implements configurations for mypy, ruff and semantic-release dependencies.
- Implements GitHub Actions CI-CD workflow.
@mango-habanero mango-habanero added the feature Requests for new features or enhancements to existing features in the application. label Apr 23, 2024
@mango-habanero mango-habanero self-assigned this Apr 23, 2024
@mango-habanero mango-habanero merged commit 5e8d609 into main Apr 23, 2024
2 checks passed
@mango-habanero mango-habanero deleted the philip/feat/ci-cd branch April 23, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Requests for new features or enhancements to existing features in the application.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

23-04-2024: Implement comprehensive CI/CD pipeline.
1 participant