Skip to content

Use Docker images locally and in CI#6671

Merged
EngHabu merged 33 commits intov2from
enghabu/dockerize-ci
Oct 16, 2025
Merged

Use Docker images locally and in CI#6671
EngHabu merged 33 commits intov2from
enghabu/dockerize-ci

Conversation

@EngHabu
Copy link
Contributor

@EngHabu EngHabu commented Oct 10, 2025

Signed-off-by: Haytham Abuelfutuh [email protected]

Tracking issue

Why are the changes needed?

What changes were proposed in this pull request?

How was this patch tested?

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Signed-off-by: Haytham Abuelfutuh <[email protected]>
@flyte-bot
Copy link
Collaborator

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 10, 2025

🐳 Docker CI Image Built

The CI Docker image has been built and pushed for this PR!

Image: ghcr.io/flyteorg/flyte/ci:pr-6671

This image will be automatically used by CI workflows in this PR.

To test locally:

docker pull ghcr.io/flyteorg/flyte/ci:pr-6671
docker run --rm -it -v $(pwd):/workspace -w /workspace ghcr.io/flyteorg/flyte/ci:pr-6671 bash

Signed-off-by: Haytham Abuelfutuh <[email protected]>
@bito-code-review
Copy link

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@bito-code-review
Copy link

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@bito-code-review
Copy link

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Signed-off-by: Haytham Abuelfutuh <[email protected]>
@bito-code-review
Copy link

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@bito-code-review
Copy link

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

@EngHabu EngHabu marked this pull request as ready for review October 14, 2025 02:41
@bito-code-review
Copy link

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces Docker-based development and CI workflows to ensure consistent environments across local development and CI. The changes standardize tool versions and eliminate "works on my machine" issues by containerizing the development environment.

Key changes:

  • Creates a unified Docker image (ci.Dockerfile) with pinned tool versions for Go, Python, Node.js, Rust, and Buf
  • Implements intelligent CI workflows that automatically build PR-specific Docker images when the Dockerfile is modified
  • Updates the Makefile to support both Docker-based (default) and local tool-based development workflows

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/docker-dev.sh Helper script to simplify Docker container usage for development
ci.Dockerfile Multi-stage Docker image with development tools and optimized caching
Makefile Updated with Docker-based targets as defaults, local tool targets as alternatives
.github/workflows/build-ci-image.yml Workflow to build and publish Docker images with PR-specific tagging
.github/workflows/check-generate.yml Updated to use Docker containers and wait for PR-specific images
docs/ Comprehensive documentation for Docker workflows and development environment

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@bito-code-review
Copy link

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@flyteorg flyteorg deleted a comment from bito-code-review bot Oct 15, 2025
gen: buf mocks go_tidy ## Generates everything in the 'gen' directory
@echo '⚡ Finished generating everything in the gen directory'
gen: buf mocks go-tidy ## Generate everything (uses Docker - no local tools required)
@echo '⚡ Finished generating everything in the gen directory (Docker)'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use:

$(DOCKER_RUN) bash -c "git config --global --add safe.directory /workspace && make gen-local"

Same as what we did in docker-gen-local? In this case we do not need buf-... and buf-...-local. We can just have buf-... as what we have originally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was keeping it so you can continue to run individual commands (but now using docker).... I'll follow your guidance and we can bring them back if needed.

Makefile Outdated

# Docker CI image configuration
DOCKER_CI_IMAGE := ghcr.io/flyteorg/flyte/ci:v2
DOCKER_LOCAL_IMAGE := flyte-ci:local
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also name the image built locally as ghcr.io/flyteorg/flyte/ci:v2?

In this case, no matter using remote image or build locally, we can run make gen. If no changes in ci.Dockerfile, we use make docker-pull before make gen, otherwise use make docker-build.

The process will become:

  • typical usage:
  1. pull CI image make docker-pull
  2. run make gen
  • If there's modification in ci.Dockerfile:
  1. build the CI image make docker-build
  2. also run make gen

I think it can make the process easier to follow and also make the Makefile cleaner

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use name gen.Dockerfile instead? As I think this is mainly for generating

Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@EngHabu EngHabu requested review from Copilot and machichima October 15, 2025 20:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +16 to +17
│ check-generate workflow triggers │
│ • Checks if Dockerfile.ci modified: NO │
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation references Dockerfile.ci, but the repository adds gen.Dockerfile; update all occurrences to avoid confusion.

Copilot uses AI. Check for mistakes.

### Image Detection Logic

Workflows check if `Dockerfile.ci` or `.github/workflows/build-ci-image.yml` were modified:
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example detection logic uses Dockerfile.ci instead of gen.Dockerfile; this is inconsistent with the actual file name and will mislead users.

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +68
docker run --rm -it \
-v "$REPO_ROOT:$WORKSPACE" \
-w "$WORKSPACE" \
"$IMAGE" \
bash
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Running as root in the container will create root-owned files on the host, complicating cleanup. Consider adding --user $(id -u):$(id -g) to preserve host ownership.

Copilot uses AI. Check for mistakes.
Comment on lines +102 to +103
| Context | Image Tag | When Created |
|--------------------|----------------------------------------|---------------------------------|
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table rows start with double pipe characters, which can break Markdown table rendering. Remove the extra leading pipe on these lines.

Copilot uses AI. Check for mistakes.
EngHabu and others added 6 commits October 15, 2025 13:35
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@flyte-bot
Copy link
Collaborator

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Copy link
Member

@machichima machichima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not familiar with github action YAML, but tried running make docker-pull gen DOCKER_CI_IMAGE=ghcr.io/flyteorg/flyte/ci:pr-6671 locally and it works.

Overall LGTM! Just some small nits on docs

EngHabu and others added 3 commits October 15, 2025 18:55
Co-authored-by: Nary Yeh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Co-authored-by: Nary Yeh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@EngHabu EngHabu requested a review from machichima October 16, 2025 01:58
@flyte-bot
Copy link
Collaborator

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Copy link
Member

@machichima machichima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I miss this. I think it should be master instead of main branch

on:
push:
branches:
- main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- main
- master

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I created a main branch.. it's where I deleted everything from the master branch... I think what we will do is when we are ready to switch over, we will switch the default branch for the repo from master to main... and let master be the v1 stuff

# Use PR number for pull requests
type=ref,event=pr
# Use 'latest' tag for main branch
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}

echo "tag=pr-${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" == "refs/heads/v2" ]; then
echo "tag=v2" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
elif [ "${{ github.ref }}" == "refs/heads/master" ]; then

type=ref,event=branch
# Use PR number for pull requests
type=ref,event=pr
# Use 'latest' tag for main branch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Use 'latest' tag for main branch
# Use 'latest' tag for master branch


1. **`.github/workflows/build-ci-image.yml`**
- Builds Docker image
- Runs on: PR with Dockerfile changes, push to main/v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Runs on: PR with Dockerfile changes, push to main/v2
- Runs on: PR with Dockerfile changes, push to master/v2

| Regular PR | `v2` or `latest` | Uses existing branch image |
| PR with Dockerfile | `pr-123` | Built when PR is created/updated|
| v2 branch push | `v2` | Built on every push to v2 |
| main branch push | `latest` | Built on every push to master |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| main branch push | `latest` | Built on every push to master |
| master branch push | `latest` | Built on every push to master |

@EngHabu EngHabu merged commit 2378cd5 into v2 Oct 16, 2025
5 checks passed
@EngHabu EngHabu deleted the enghabu/dockerize-ci branch October 16, 2025 19:02
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.

5 participants