fix: embed compose files, fix PostgreSQL refs, align Go module path#46
fix: embed compose files, fix PostgreSQL refs, align Go module path#46mohit-nagaraj wants to merge 4 commits intomainfrom
Conversation
- Embed docker-compose files into binary via go:embed and write them during orchcli init (both production and dev modes) - Replace all PostgreSQL references with MongoDB (waitForMongoDB, container names, exec service map, next-steps output) - Change Go module path from github.com/kubeorchestra/cli to github.com/kubeorch/cli to match the GitHub org and fix version injection via ldflags in release workflow - Update all imports, Makefile, and test files accordingly Fixes #45
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
| for i := 0; i < maxRetries; i++ { | ||
| for _, name := range containerNames { | ||
| cmd := exec.Command("docker", "exec", name, "pg_isready", "-U", "kubeorchestra", "-d", "kubeorchestra") | ||
| cmd := exec.Command("docker", "exec", name, "mongosh", "--eval", "db.adminCommand('ping')") |
| return fmt.Errorf("failed to read embedded file %s: %w", entry.Name(), err) | ||
| } | ||
| dest := filepath.Join(targetDir, entry.Name()) | ||
| if err := os.WriteFile(dest, data, 0644); err != nil { |
There was a problem hiding this comment.
Code Review
This pull request renames the project organization from kubeorchestra to kubeorch, updates the database from PostgreSQL to MongoDB, and introduces embedded Docker Compose configurations for various development and production environments. Key feedback includes updating image registry paths in the new Compose files to reflect the organization change, ensuring consistent environment variable naming for the UI service, and addressing hardcoded container names in the exec command that currently prevent it from working correctly in development or hybrid modes.
| command: air | ||
|
|
||
| ui: | ||
| image: ghcr.io/kubeorchestra/ui:latest |
| start_period: 10s | ||
|
|
||
| core: | ||
| image: ghcr.io/kubeorchestra/core:latest |
cmd/docker/docker-compose.prod.yml
Outdated
| start_period: 10s | ||
|
|
||
| core: | ||
| image: ghcr.io/kubeorchestra/core:latest |
cmd/docker/docker-compose.prod.yml
Outdated
| condition: service_healthy | ||
|
|
||
| ui: | ||
| image: ghcr.io/kubeorchestra/ui:latest |
| environment: | ||
| # Both use internal Docker network names | ||
| NEXT_PUBLIC_API_URL: http://localhost:3000 | ||
| API_URL: http://core:3000 |
There was a problem hiding this comment.
| containerName, valid := validServices[service] | ||
| if !valid { | ||
| return fmt.Errorf("invalid service: %s. Valid services: postgres, core, ui", service) | ||
| return fmt.Errorf("invalid service: %s. Valid services: mongodb, core, ui", service) |
There was a problem hiding this comment.
The exec command logic currently uses hardcoded container names (e.g., kubeorchestra-mongodb) which will fail when running in development or hybrid modes where containers have suffixes like -dev or -hybrid. Consider updating the logic to detect the actual running container name based on the service prefix.
- Auto-generate core/config.yaml with random JWT_SECRET and ENCRYPTION_KEY during orchcli init (dev modes with --fork-core) - Auto-generate ui/.env.local with NEXT_PUBLIC_API_URL during orchcli init (dev modes with --fork-ui) - Update all compose files: ghcr.io/kubeorchestra/* -> ghcr.io/kubeorch/* to match the GitHub org and new GHCR workflows - Config files are skipped if they already exist (safe to re-run)
Summary
go:embedsoorchcli initwrites them todocker/— fixes the brokenorchcli init+orchcli startflowwaitForMongoDB, exec service map, next-steps output) to match actual compose filesgithub.com/kubeorchestra/clitogithub.com/kubeorch/clito match the GitHub org and fix version injection via ldflags in the release workflowTest plan
go buildcompiles successfullyorchcli initcreates compose files indocker/orchcli start -dstarts services without "compose file not found" errororchcli statusshows MongoDB health, not PostgreSQLorchcli exec mongodbopens mongoshorchcli --versionshows actual version instead ofdevFixes #45
Related: KubeOrch/docs#14