IntersectMBO / IntersectMBO/govtool

CI/CD optimization

Open
#167 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
21
Forks
29
Avg merge
2d 22h
Merged PRs (30d)
7

Description

# Why
Currently, deployment lasts for circa 30min or more because we are building backend application with clean cabal build without caching.

# What
We should utilize Nix configuration and some cache to optimize that process to only compile the backend sourcecode instead of building all dependencies each time the deploy is triggered. This is dependent of the previous step and will significantly shorten the build process and testing.

_Copied from discussion #176_

### Nix configuration for all the modules

- [x] #186
- Review the existing Nix configuration for the backend module.
- Determine the status of the Nix configuration for the frontend and other modules.
- Identify any gaps or discrepancies in the current setup.
- [x] #187
- Review and refine the existing backend Nix configuration to ensure it meets current project requirements.
- Explicitly define the backend development environment, including dependencies, toolchains, and any specific version requirements.
- [x] #188
- Create a Nix configuration for the frontend module that mirrors the setup and dependencies required.
- Define development environments explicitly, including all necessary dependencies and toolchains.
- [x] #189
- Review Nix configurations for infrastructure setup and deployment processes.
- Include specifics for cloud resources, networking configurations, storage, and any other infrastructure components.
- Ensure deployment configurations include necessary scripts and commands for automated deployments.
- [x] #190
- Create Nix expressions that define Docker images for the backend, frontend, and any other necessary services.
- Ensure Docker images are optimized for size and build efficiency, incorporating best practices for layer caching.
- [ ] Incorporate Nix Flakes for project-wide configuration management
- Integrate @johnalotoski's proposed Nix flakes solution (#53), ensuring it is operational and meets project requirements.
- Utilize Nix Flakes to encapsulate the entire project's Nix configurations as build targets.
- Ensure the flake.nix file is properly set up to reference backend, frontend, infra, and deployment configurations.
- [ ] Source Nix configuration on the latest stable Nixpkgs version
- Ensure that all Nix configurations are based on the latest stable version of nixpkgs.
- Update any outdated Nix packages or configurations to align with the latest stable release.
- [ ] Documentation and knowledge sharing
- Ensure documentation of all Nix configurations mentioned above, including the rationale behind specific decisions and configurations.
- Share knowledge and documentation with the development team to ensure everyone is up to speed with the Nix setup.
- Provide training or workshops if necessary to help team members become proficient with Nix.
- [ ] Review and testing
- Conduct thorough testing of all Nix configurations to ensure they work as expected across different environments.
- Review configurations with the development team and stakeholders to gather feedback and make adjustments as needed.
- [ ] Continuous improvement
- Establish a process for continuously reviewing and improving the Nix configurations as project requirements evolve.

### CI/CD optimization

- [x] #191
- Move as much deployment configuration as possible from imperative, GNU Make driven scripts to declarative, Nix driven statements.
- [x] #192
- Set up a Nix cache to speed up build times and improve developer productivity.
- [x] #193
- Adapt Nix configurations to be compatible with GitHub Actions workflows.
- Create specific CI/CD pipelines that leverage Nix for building, testing, and deploying applications.
- Ensure pipelines are optimized for performance and reliability.
- [ ] Continuous improvement
- Monitor the performance and efficiency of the CI/CD pipelines to identify opportunities for optimization.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.