Skip to content

docker local environment #10993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bri-harris
Copy link

@bri-harris bri-harris commented Jun 10, 2025

Description

This PR...
As a MacOS user, I need a Docker environment which packages all the necessary dependencies in order to locally work on cloudstack. This PR introduces containerization of services like cloudstack and mysql.
Feature Request: #10967

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

I have run this on my local machine, I am able to spin up a container with the Cloudstack Project and connect a MySQL container with the correct table and information

Copy link

@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 PR introduces a containerized local development environment for CloudStack and MySQL on macOS.

  • Adds a MySQL initialization script and an entrypoint script to set up and start MySQL and CloudStack services.
  • Provides a Docker Compose configuration and a Dockerfile to build and orchestrate the containers.

Reviewed Changes

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

File Description
docker-local-environment/init-mysql.sh Bash script to wait for and initialize MySQL, creating the required database and user.
docker-local-environment/docker-entrypoint.sh Bash script to start MySQL, run initialization, start CloudStack, and keep the container running.
docker-local-environment/docker-compose.yml Compose file to set up the MySQL and CloudStack services with proper dependency handling and networking.
docker-local-environment/Dockerfile Dockerfile to build an Ubuntu-based image, install dependencies, and compile CloudStack from source.

service cloudstack-management start

# Keep the container running
exec bash
Copy link
Preview

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

The command 'exec bash' at line 24 will replace the current shell, making the subsequent 'tail -f /dev/null' unreachable. Consider removing one of these commands to keep the container running as intended.

Suggested change
exec bash

Copilot uses AI. Check for mistakes.

gnupg \
openjdk-17-jdk \
maven \
python3 \
Copy link
Preview

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

Ensure there is no trailing whitespace after the backslash in this installation command to prevent potential build issues. This can help avoid unexpected errors during the Docker build process.

Suggested change
python3 \
python3 \

Copilot uses AI. Check for mistakes.

Copy link

codecov bot commented Jun 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.57%. Comparing base (41b4f0a) to head (6b6bbb8).
Report is 21 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10993      +/-   ##
============================================
- Coverage     16.57%   16.57%   -0.01%     
+ Complexity    13870    13869       -1     
============================================
  Files          5719     5719              
  Lines        507200   507200              
  Branches      61574    61574              
============================================
- Hits          84093    84089       -4     
- Misses       413688   413692       +4     
  Partials       9419     9419              
Flag Coverage Δ
uitests 3.96% <ø> (ø)
unittests 17.45% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@weizhouapache
Copy link
Member

thanks for the sharing @bri-harris

my opinions

  • ubuntu 20.04 is too old, try with ubuntu 24.04
  • better to move the code to tools/ directory, instead of root directory of the repo
  • to be frank, I think it is better to create a repo and put the files there, instead of official cloudstack repo.

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.

2 participants