Skip to content

Conversation

AnkanSaha
Copy link
Member

@AnkanSaha AnkanSaha commented Jul 13, 2025

This pull request introduces several changes to streamline Docker usage in the setup.sh script and updates the CI workflow configuration. The most significant updates include replacing docker-compose commands with docker compose to align with newer Docker standards, adding an automated Docker installation process, and removing pull request triggers from the CI workflow.

Docker-related improvements:

  • Automated Docker installation: Added a function to install Docker and Docker Compose automatically if not detected, including user prompts and instructions for group changes. This ensures smoother onboarding for users.
  • Migration to docker compose: Replaced all instances of docker-compose with docker compose across various commands in setup.sh to adopt the latest Docker CLI syntax. [1] [2] [3] [4] [5] [6] [7]

CI workflow updates:

  • Removed pull request triggers: The pull_request trigger was removed from the CI workflow configuration in .github/workflows/ci.yml, limiting the workflow to push events on the main branch. This simplifies the CI process.
@AnkanSaha AnkanSaha requested a review from alokemajumder July 13, 2025 16:18
@AnkanSaha AnkanSaha requested a review from Copilot July 13, 2025 18:29
Copy link
Contributor

@Copilot 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 pull request modernizes Docker usage by transitioning from the deprecated docker-compose command to the newer docker compose syntax and adds automated installation capabilities for Docker, Docker Compose, and Git. The changes also streamline the CI workflow by removing pull request triggers.

  • Replaces all docker-compose commands with docker compose throughout the setup script
  • Adds automated installation functions with user prompts for Docker, Docker Compose, and Git
  • Removes pull request triggers from the CI workflow to limit execution to main branch pushes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
setup.sh Updated to use modern Docker Compose syntax and added automated installation functions for dependencies
.github/workflows/ci.yml Removed pull request triggers to limit CI execution to main branch pushes only

# Start production services with HTTPS by default
docker-compose -f docker-compose.prod.yml up -d
docker compose -f docker compose.prod.yml up -d
Copy link

Copilot AI Jul 13, 2025

Choose a reason for hiding this comment

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

Invalid syntax: the command should be 'docker compose -f docker-compose.prod.yml up -d' with hyphens in the filename, not 'docker compose -f docker compose.prod.yml'.

Suggested change
docker compose -f docker compose.prod.yml up -d
docker compose -f docker-compose.prod.yml up -d

Copilot uses AI. Check for mistakes.

Comment on lines +258 to +261
docker compose -f docker compose.yml -f docker compose.genai.yml --profile setup run --rm model-downloader

print_info "Starting GenAI services..."
docker-compose -f docker-compose.yml -f docker-compose.genai.yml up -d
docker compose -f docker compose.yml -f docker compose.genai.yml up -d
Copy link

Copilot AI Jul 13, 2025

Choose a reason for hiding this comment

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

Invalid syntax: the filenames should use hyphens, not spaces. Should be 'docker compose -f docker-compose.yml -f docker-compose.genai.yml --profile setup run --rm model-downloader'.

Copilot uses AI. Check for mistakes.

Comment on lines +258 to +261
docker compose -f docker compose.yml -f docker compose.genai.yml --profile setup run --rm model-downloader

print_info "Starting GenAI services..."
docker-compose -f docker-compose.yml -f docker-compose.genai.yml up -d
docker compose -f docker compose.yml -f docker compose.genai.yml up -d
Copy link

Copilot AI Jul 13, 2025

Choose a reason for hiding this comment

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

Invalid syntax: the filenames should use hyphens, not spaces. Should be 'docker compose -f docker-compose.yml -f docker-compose.genai.yml up -d'.

Copilot uses AI. Check for mistakes.

print_info "Restarting services with Let's Encrypt..."
docker-compose -f docker-compose.yml -f docker-compose.genai.yml down
docker-compose -f docker-compose.prod.yml --profile genai up -d
docker compose -f docker compose.yml -f docker compose.genai.yml down
Copy link

Copilot AI Jul 13, 2025

Choose a reason for hiding this comment

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

Invalid syntax: the filenames should use hyphens, not spaces. Should be 'docker compose -f docker-compose.yml -f docker-compose.genai.yml down'.

Suggested change
docker compose -f docker compose.yml -f docker compose.genai.yml down
docker compose -f docker-compose.yml -f docker-compose.genai.yml down

Copilot uses AI. Check for mistakes.

Comment on lines +81 to +82
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Copy link

Copilot AI Jul 13, 2025

Choose a reason for hiding this comment

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

Downloading and executing content from the internet without verification poses a security risk. Consider adding checksum verification or using package manager alternatives when available.

Suggested change
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
print_info "Downloading Docker's GPG key..."
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /tmp/docker.gpg
print_info "Verifying Docker's GPG key fingerprint..."
EXPECTED_FINGERPRINT="9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88"
DOWNLOADED_FINGERPRINT=$(gpg --with-fingerprint /tmp/docker.gpg | grep -A1 "pub" | tail -n1 | awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}')
if [ "$DOWNLOADED_FINGERPRINT" != "$EXPECTED_FINGERPRINT" ]; then
print_error "Docker's GPG key fingerprint verification failed!"
exit 1
fi
print_success "Docker's GPG key fingerprint verified successfully!"
sudo mkdir -m 0755 -p /etc/apt/keyrings
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg /tmp/docker.gpg

Copilot uses AI. Check for mistakes.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AnkanSaha AnkanSaha merged commit 667e8c5 into main Jul 14, 2025
1 check passed
@AnkanSaha2025 AnkanSaha2025 deleted the fix/setup-prerequisite branch July 14, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants