Repository navigation
Devops mvp - #1
Merged
Merged
Conversation
Use the official Debian slim Python image for a simple build and broad Python package compatibility. Alpine uses musl, which can require additional compatibility work. Distroless reduces runtime components but requires a separate dependency installation stage for this application. Its lack of a shell also makes interactive debugging less convenient. Docker Hardened Images are another option, but require registry authentication. Keep the single-stage slim build for this MVP. Update the Python dependencies and pin the tested versions in requirements.txt. Run Gunicorn as a non-root user to limit the application's permissions. Replace the local shell commands with just recipes. Recreate the virtual environment when requirements change and record successful installation so unchanged dependencies are reused. Enable code reload for local development on loopback only. Bootstrap a pinned just binary for Linux and macOS, verifying its checksum. Keep downloaded tools outside version control. Build the local image through Docker's cache and reuse its tag. Document the local workflow and sourcing init.sh so its PATH change applies to the current shell. Keep shared shell code portable for use from Bash and Zsh.
Define the pinned version once and clear it after setup. Verify downloads before installation, then remove temporary files from .tools/downloads on success or failure. Keep cleanup traps in a subshell to preserve the caller's shell state. Use quoted, braced shell variable references.
Load the pinned just binary's native completion script when init.sh is sourced in an interactive shell. Initialize Zsh completion only when needed, without writing a cache. Skip insecure completion directories.
Deploy one replica behind a ClusterIP Service with HTTP readiness and liveness probes. Make the image, replica count, and CPU/memory requests and limits configurable. Run as non-root with dropped capabilities, no privilege escalation, runtime seccomp, and no API token. Use a read-only root filesystem and bounded writable /tmp for Gunicorn. Use Kind with Docker for local deployment without a registry. Install pinned, checksum-verified tools under .tools/bin and remove temporary downloads. Add k8s-* recipes for deployment, HTTP verification, port forwarding, and cleanup. Keep cluster credentials local and ignored; document KUBECONFIG for direct kubectl access. Report a missing cluster with a deployment hint during verification. Restart Pods after deployment to pick up the reused local image tag. Keep conflict checks on normal upgrades. Add k8s-redeploy to reset release values and replace resource definitions, discarding manual edits.
Run GitHub Actions on branch pushes, pull requests to master, and version tags. Use a temporary Kind cluster to verify deployment without an external cluster or image registry. Check Python, shell recipes, the justfile, workflow, and chart. Test and scan one built image before deploying it and checking HTTP. Block fixable high and critical vulnerabilities, retain full scan reports and failure diagnostics, and clean up Kind. Pin actions by commit and upstream tool images by digest. Share tool versions with local just recipes to keep checks aligned. Cache build layers and scan databases while running checks on every change. Limit repository permissions to read access. Tag images with the source commit and version tag when present. Document local checks and where to find CI results.
Treat HIGH and lower findings as review work for this MVP. Block every CRITICAL finding, including those without a fix, and retain the complete report. Use Trivy's severity filter to keep the gate simple. Align CI and local scans and document the threshold. Existing HIGH findings remain remediation follow-ups.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make the existing Flask application deployable and verify each change
through GitHub Actions.
resource requests/limits, and restricted container permissions.
Kind cluster, verify HTTP, and clean up the cluster.
and checks, with setup and usage instructions in the README.
CI blocks all CRITICAL vulnerabilities, including unfixed ones.
HIGH and lower findings remain in the full report for review.
CI deployments are temporary and require no external cluster or registry.
Validation: branch CI passed, including image tests, scanning,
deployment, HTTP verification, report upload, and cleanup.
Local checks passed on Linux using Bash and Zsh; native macOS
execution remains unverified.