How lgskoko/dckr_service works
1. Project role
- Dckr_Service is a standalone Spring Boot backend service packaged as a runnable JAR.
- Its purpose is to support the broader Dckr system by handling “backend request services” related to Docker-to-platform deployment workflows.
2. Runtime boundary
- The service is started directly with java -jar Dckr_Service-1.0.0.jar.
- It expects the host environment to have JDK installed and the Kompose CLI available on the server, which is a key external dependency in the architecture.
3. Application entrypoint
- DckrApplication.java is the Spring Boot bootstrap class.
- It wires the HTTP layer, service layer, and utility layer into a single server process.
4. HTTP/API layer
- The main request boundary is implemented by:
- KubernetesController
- RancherController
- These controllers likely expose endpoints for uploading or transforming deployment definitions for the two target environments.
5. Core service layer
- Business logic is split by deployment target:
- KubernetesService
- RancherService
- This separation suggests two parallel flows with shared lower-level utilities but different output formats or deployment behavior.
6. Request/response models
- DTOs under domain/dto define the data contract between controllers and services:
- UploadStructure
- KubernetesUploadStructure
- RancherUploadStructure
- ReturnStructure
- The naming implies:
- a common upload/request shape,
- target-specific request variants,
- and a standardized response wrapper.
7. Command execution boundary
- CmdUtil indicates the service executes external system commands rather than relying only on in-process logic.
- This is likely where Kompose or deployment-related shell commands are invoked.
- Architecturally, this is the main bridge from the Spring Boot process to host-level tooling.
8. File handling boundary
- FileUtil suggests the service reads/writes intermediate files, likely uploaded compose files, generated manifests, or temporary deployment artifacts.
- This means the system is not purely stateless; file I/O is part of the deployment pipeline.
9. Kompose mapping/support
- KomposeMap is a domain utility that likely maps or normalizes Kompose-generated output into the project’s expected Kubernetes/Rancher structures.
- This hints that part of the service’s job is to adapt generated deployment artifacts into platform-specific forms.
10. Configuration separation
- The presence of application.properties, application-develop.properties, and application-produce.properties shows environment-specific runtime configuration.
- This usually means different endpoints, file paths, or command settings between development and production.
11. Probable data flow
- A client sends an upload or conversion request to one of the controllers.
- The controller validates and passes the payload to the matching service.
- The service uses file utilities to persist or inspect input, then uses command utilities to invoke external tooling such as Kompose.
- The result is mapped into a response DTO and returned to the caller.
12. Main system boundaries for an architecture diagram
- External client → Spring Boot HTTP controllers
- Controllers → target-specific services
- Services → file/command utilities
- Utilities → host OS / Kompose CLI / filesystem
- The output boundary is a structured response returned to the caller, likely containing status and generated deployment data.
13. Deployment model
- This repo is a backend service rather than a frontend or a library.
- Its operational dependency on host-installed Kompose and filesystem access is central to the design, so those should be shown explicitly in any diagram.
Main entry points: KubernetesService.java Kubernetes svc · RancherService.java Rancher svc · DckrApplication.java Boot app · KubernetesController.java Kubernetes API
Components 17
Runtime
Service process and host dependencies
- Boot app · Application bootstrap and wiring
src/main/java/com/esunny/dckr/DckrApplication.java - Filesystem · Temporary and generated artifact storage
- Kompose CLI · External conversion command available on host
- JDK · Required host Java runtime
HTTP API
Inbound request boundary
- Kubernetes API · HTTP boundary for Kubernetes flows
src/main/java/com/esunny/dckr/controller/KubernetesController.java - Rancher API · HTTP boundary for Rancher flows
src/main/java/com/esunny/dckr/controller/RancherController.java
Domain
Target-specific request handling and DTO contracts
- Kubernetes svc · Converts and prepares Kubernetes outputs
src/main/java/com/esunny/dckr/service/KubernetesService.java - Rancher svc · Converts and prepares Rancher outputs
src/main/java/com/esunny/dckr/service/RancherService.java - Upload DTO · Common upload request contract
src/main/java/com/esunny/dckr/domain/dto/UploadStructure.java - K8s upload DTO · Kubernetes-specific request contract
src/main/java/com/esunny/dckr/domain/dto/KubernetesUploadStructure.java - Rancher upload DTO · Rancher-specific request contract
src/main/java/com/esunny/dckr/domain/dto/RancherUploadStructure.java - Return DTO · Standard response wrapper
src/main/java/com/esunny/dckr/domain/dto/ReturnStructure.java
Utilities
File, command, and mapping helpers
- Cmd util · Runs host command-line tools
src/main/java/com/esunny/dckr/util/CmdUtil.java - File util · Reads and writes deployment files
src/main/java/com/esunny/dckr/util/FileUtil.java - Kompose map · Normalizes Kompose output structures
src/main/java/com/esunny/dckr/util/KomposeMap.java - Service error · Shared service-layer failure type
src/main/java/com/esunny/dckr/util/ServiceException.java
Other components
- Client · Sends upload and conversion requests
Connections 27
- Client → Kubernetes API: requests · Submits Kubernetes-related uploads or conversions
- Client → Rancher API: requests · Submits Rancher-related uploads or conversions
- Kubernetes API → Kubernetes svc: delegates · Passes validated request data to business logic
- Rancher API → Rancher svc: delegates · Passes validated request data to business logic
- Kubernetes API → K8s upload DTO: binds · Maps incoming payloads to Kubernetes DTOs
- Rancher API → Rancher upload DTO: binds · Maps incoming payloads to Rancher DTOs
- Kubernetes svc → Upload DTO: uses · Consumes common upload shape
- Rancher svc → Upload DTO: uses · Consumes common upload shape
- Kubernetes svc → Return DTO: returns · Builds standardized response payloads
- Rancher svc → Return DTO: returns · Builds standardized response payloads
- Kubernetes svc → File util: reads/writes · Persists inputs and generated artifacts
- Rancher svc → File util: reads/writes · Persists inputs and generated artifacts
- Kubernetes svc → Cmd util: executes · Invokes external conversion commands
- Rancher svc → Cmd util: executes · Invokes external conversion commands
- Cmd util → Kompose CLI: calls · Bridges to host-installed Kompose
- File util → Filesystem: stores · Uses host filesystem for intermediate files
- Kompose map → Kubernetes svc: supports · Shapes generated artifacts for Kubernetes flow
- Kompose map → Rancher svc: supports · Shapes generated artifacts for Rancher flow
- Kubernetes svc → Kompose map: maps · Normalizes Kompose output
- Rancher svc → Kompose map: maps · Normalizes Kompose output
- Kubernetes svc → Service error: throws · Signals service failures
- Rancher svc → Service error: throws · Signals service failures
- Boot app → Kubernetes API: wires · Bootstraps HTTP controller beans
- Boot app → Rancher API: wires · Bootstraps HTTP controller beans
- Boot app → Kubernetes svc: wires · Bootstraps service beans
- Boot app → Rancher svc: wires · Bootstraps service beans
- Boot app → JDK: runs on · Requires host JDK to start the JAR