Skip to content

Add Makefile, GH actions, incremental build configs#183

Merged
locriandev merged 1 commit intoopenshift-eng:art-build-historyfrom
locriandev:art-build-history
Feb 11, 2026
Merged

Add Makefile, GH actions, incremental build configs#183
locriandev merged 1 commit intoopenshift-eng:art-build-historyfrom
locriandev:art-build-history

Conversation

@locriandev
Copy link

@locriandev locriandev commented Feb 11, 2026

Modernize build and deployment infrastructure

Summary

Complete overhaul of the build and deployment infrastructure to improve developer experience, reduce build times, and streamline OpenShift deployments.

Key Changes

Build System Modernization

  • Migrated to uv for faster, more reliable dependency management
  • Two-stage Docker builds to optimize build times:
    • Base image with dependencies (~2-3 min, rebuilt only when dependencies change)
    • App image with code (~10-20 sec, rebuilt on every code change)
  • Minimal configuration files - Cleaned up pyproject.toml and Makefile to essentials only

Repository Organization

Reorganized directory structure for clarity:

├── ansible/           # Deployment automation playbooks
├── docker/           # Dockerfiles (base and app)
├── openshift/        # OpenShift manifests
├── static/           # Static assets
├── templates/        # HTML templates
├── app.py
├── Makefile
└── pyproject.toml

Deployment Automation

Created Ansible playbooks for complete deployment workflow:

  • ansible/deploy.yaml - Full deployment (setup + build all)
  • ansible/setup.yaml - Create all resources (run once)
  • ansible/build-base.yaml - Build base image when dependencies change
  • ansible/update.yaml - Fast app rebuild for code changes
  • ansible/build-all.yaml - Build both images in sequence

OpenShift Integration

  • Two BuildConfigs for base and app images
  • Automated builds with ImageChange triggers
  • Secrets management via Ansible (redis, GCP credentials)
  • Complete deployment resources (Service, Route, DeploymentConfig, ImageStream)

Developer Experience

  • Simple local development:

    make venv          # Setup environment
    make lint          # Check code
    make fix           # Auto-fix issues
    make docker-build  # Fast local builds
    make docker-run    # Run locally
  • Simple deployment:

    export OPENSHIFT_NAMESPACE=$(oc project -q)
    export REDIS_PASSWORD="..."
    export GOOGLE_APPLICATION_CREDENTIALS="/path/to/creds.json"
    ansible-playbook ansible/deploy.yaml

Documentation

  • DEPLOYMENT.md - Comprehensive deployment guide with architecture diagrams, workflows, and troubleshooting
  • README.md - Updated with new structure and quick start guide
  • All playbooks include helpful error messages and next-step guidance

Benefits

  1. Faster builds - 2-stage builds mean code changes rebuild in ~10-20 seconds
  2. Reproducible - uv.lock ensures identical dependencies across environments
  3. Safer deployments - Explicit namespace requirement prevents accidental deployments
  4. Better DX - Clear separation of concerns, minimal configuration, comprehensive docs
  5. Production-ready - Non-root user in containers, proper secret management, health checks

Breaking Changes

  • Replaced manual oc apply commands with Ansible playbooks
  • Changed from resources/ to openshift/ directory
  • Requires OPENSHIFT_NAMESPACE environment variable (no defaults)

Testing

  • Local development with make docker-run
  • OpenShift deployment via Ansible
  • Base image build completes successfully
  • App image build completes successfully
  • Application runs and serves traffic

Migration Guide

For existing deployments, see DEPLOYMENT.md section "Initial Deployment" for step-by-step instructions.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 11, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@locriandev locriandev merged commit 0989899 into openshift-eng:art-build-history Feb 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant