August 2024 Summaries
3 posts from Blacksmith
Filter
Month:
Year:
Post Summaries
Back to Blog
Stacked diffs are a Git workflow that divides a large feature into a sequence of small, dependent pull requests, allowing each change to be reviewed, tested, and merged independently while development continues on later parts of the feature. Advocates argue that this approach reduces context switching, encourages more detailed reviews, and ensures each commit passes continuous integration checks, which can simplify debugging and regression analysis. Although stacked branches can be managed manually with Git, updating a lower branch requires rebasing dependent branches and resolving any resulting conflicts, a process that becomes difficult for longer stacks. Tools such as Graphite automate branch restacking, pull-request submission, conflict handling, visualization, and synchronization with the main branch. The approach can also increase CI usage and costs because each small pull request and restack may trigger additional workflows, leading the text to suggest selectively running checks through CI configuration or using faster, lower-cost CI infrastructure.
Aug 30, 2024
1,373 words in the original blog post.
Docker build performance and image size can be improved by understanding core Dockerfile instructions such as FROM, RUN, COPY, and CMD, as well as Docker’s layer-based build cache, which reuses unchanged steps but rebuilds all subsequent layers after a modification. Efficient Dockerfiles place stable instructions and dependency installation before frequently changing application code, such as copying package manifests and running dependency installation before copying the full source tree. Related commands should be combined into fewer RUN layers, while multi-stage builds separate build-time tools and artifacts from lightweight runtime images, reducing final image size and enabling BuildKit to run independent build stages in parallel. Further optimization includes selecting minimal base images, cleaning package-manager caches during installation, using COPY rather than ADD in most cases, and defining a .dockerignore file to exclude source-control metadata, temporary files, local dependencies, build artifacts, secrets, and other unnecessary content from the build context.
Aug 26, 2024
1,563 words in the original blog post.
Remote BuildKit on AWS can accelerate Docker builds by offloading compute-intensive work to a powerful EC2 instance and persisting Docker layer caches on an attached EBS volume, allowing shared reuse across an organization’s CI workflows. The proposed Terraform setup provisions a c5a.4xlarge instance, configures GitHub Actions authentication through AWS OIDC and IAM roles, and exposes the BuildKit daemon on port 9999 for use with Docker Buildx in GitHub Actions. After configuring repository secrets with the AWS account information and instance address, workflows can direct builds to the remote builder; an example showed a first uncached build taking 6 minutes 22 seconds and a subsequent cached build taking 1 minute 34 seconds. This approach is most useful when base Docker layers change infrequently, but a single always-running instance has limitations for larger teams, including no autoscaling during concurrent demand, ongoing infrastructure costs, and potential security risks from sharing one build environment across projects.
Aug 12, 2024
1,337 words in the original blog post.