Skip to content

Commit b94df71

Browse files
vishal-avHarness
authored andcommitted
[PL-68044] update: Docker configuration for container-based steps (#100903)
* 636bd4 [PL-68044] update: Docker configuration for container-based steps
1 parent 381ad7c commit b94df71

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

docs/platform/delegates-v2/delegate-overview.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ sidebar_label: Overview
77

88
:::warning Closed Beta
99

10-
The new Harness Delegate is currently in closed beta and is available to select customers only. Access is determined by the product team based on current [supported use cases and steps](./install-delegate-2-0#whats-supported).
10+
The new Harness Delegate is currently in closed beta and available only to select customers. The product team determines access based on current [supported use cases and steps](./install-delegate-2-0#whats-supported).
1111

1212
:::
1313

14-
The new Harness Delegate is a lightweight service that runs in your infrastructure to execute pipeline work. Unlike the legacy delegate, which is deployed as a container application in Kubernetes or Docker environments, the new delegate uses a transaction-based execution model where stages are executed as a sequence of initialization, execution, and cleanup tasks. This model provides consistent stage execution across different infrastructure types and ensures reliable cleanup of resources created during stage execution.
14+
The new Harness Delegate is a lightweight service that runs in your infrastructure to execute pipeline work. Unlike the legacy delegate, which is deployed as a container application in Kubernetes or Docker environments, the new delegate uses a transaction-based execution model, with stages executed as a sequence of initialization, execution, and cleanup tasks. This model provides consistent stage execution across different infrastructure types and ensures reliable cleanup of resources created during stage execution.
1515

16-
The new delegate operates alongside the legacy delegate. The legacy delegate continues to support the full range of Harness modules and capabilities, while the new delegate focuses on CI pipelines with a unified task framework optimized for local machine execution.
16+
The new delegate operates alongside the legacy delegate. The legacy delegate continues to support the full range of Harness modules and capabilities. In contrast, the new delegate focuses on CI pipelines with a unified task framework optimized for local machine execution.
1717

1818
## Architecture overview
1919

@@ -23,15 +23,15 @@ The new delegate implements a multi-layered task execution framework that separa
2323

2424
The delegate task framework consists of three distinct layers:
2525

26-
- **Transportation layer**: Handles routing of tasks to delegates and manages scheduling configuration including timeouts, retries, and cron settings. This layer operates in Harness Manager.
26+
- **Transportation layer**: Handles routing of tasks to delegates and manages scheduling configuration, including timeouts, retries, and cron settings. This layer operates in Harness Manager.
2727
- **Driver layer**: Manages launching and executing tasks on different platforms and infrastructures such as local Docker, VM pools, and Kubernetes clusters. This layer is implemented in the delegate.
2828
- **Task layer**: Executes the actual step logic through module services and plugins. This layer is shared between Harness Manager and the delegate.
2929

3030
This separation ensures each component is responsible for a focused set of concerns, making the system more maintainable and extensible.
3131

3232
### Transactional execution model
3333

34-
The core concept in the new delegate is that each CI stage is modeled as a **transaction**. A transaction provides a shared state boundary for all tasks within a stage and guarantees cleanup of resources created during execution.
34+
The core concept in the new delegate is that each CI stage is modeled as a **transaction**. A transaction provides a shared state boundary for all tasks within a stage and guarantees the cleanup of resources created during execution.
3535

3636
Transactional execution is implemented through three task types:
3737

@@ -61,16 +61,18 @@ For more information about selector-based routing, go to [Use delegate selectors
6161

6262
## Secrets management
6363

64-
The new delegate integrates with customer secret engines to fetch and inject secrets into task execution. Secret identifiers are provided as part of the task request, and secret expressions in the task payload are automatically replaced with decrypted values at runtime. Secrets are never persisted to disk or written to logs in plain text. The delegate automatically masks sensitive strings in all log output to prevent accidental disclosure.
64+
The new delegate integrates with customer secret engines to fetch and inject secrets into the task execution process. Secret identifiers are provided as part of the task request, and secret expressions in the task payload are automatically replaced with decrypted values at runtime. Secrets are never persisted to disk or written to logs in plain text. The delegate automatically masks sensitive strings in all log output to prevent accidental disclosure.
6565

6666
## Capacity management and queuing
6767

6868
The new delegate introduces stage-level capacity management through the `MAX_STAGES` configuration setting. This setting limits the number of concurrent stages a delegate can execute. When a delegate reaches its capacity limit, additional stage requests are queued on the server side until capacity becomes available.
6969

70-
This approach prevents resource exhaustion on the host machine and provides predictable performance characteristics. The queuing mechanism ensures work is not lost and will be processed as soon as delegate capacity frees up.
70+
This approach prevents resource exhaustion on the host machine and provides consistent performance. The queuing mechanism ensures work is not lost and is processed as soon as delegate capacity becomes available.
7171

7272
Task cancellation is supported for local (Docker) infrastructure, allowing running tasks to be terminated when a pipeline is aborted or canceled.
7373

74+
![Queuing](./static/queuing.png)
75+
7476
## Standalone tasks
7577

7678
Not all delegate tasks fit the transactional model. The new delegate supports standalone tasks through the CGI (Common Gateway Interface) driver. CGI is a protocol for executing binaries through an HTTP interface, suitable for lightweight synchronous operations that don't require the full transaction lifecycle.
@@ -85,7 +87,7 @@ Remote logging to centralized services can be enabled through configuration. All
8587

8688
## Legacy task support
8789

88-
When integration with legacy delegate functionality is required, the new delegate can utilize a delegate sidecar mechanism. The sidecar runs alongside the new delegate and handles execution of specific tasks that require legacy delegate implementations. This bridge mechanism enables gradual migration and ensures compatibility during the transition period.
90+
When integration with legacy delegate functionality is required, the new delegate can use a delegate-sidecar mechanism. The sidecar runs alongside the new delegate and handles execution of specific tasks that require legacy delegate implementations. This bridge mechanism enables gradual migration and ensures compatibility during the transition period.
8991

9092
## System requirements
9193

docs/platform/delegates-v2/install-delegate-2-0.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,24 @@ The delegate runs as a user service (LaunchAgent), not a system service. It only
254254
2. Edit the config: `nano ~/.harness-delegate/config.env`
255255
3. Start the service: `./delegate start`
256256

257+
**Docker configuration for container-based steps:**
258+
259+
If you plan to use Docker with container-based CI steps on macOS, you need to configure your Docker Desktop or Rancher Desktop settings to avoid permission-related issues. The delegate requires proper filesystem access between your local machine and the Docker VM.
260+
261+
For optimal compatibility, configure the following settings in your Docker runtime preferences:
262+
263+
1. **Filesystem Mount Type**: Select **reverse-sshfs** as your mount type
264+
- In Rancher Desktop: Go to **Preferences** > **Virtual Machine** > **Volumes** tab
265+
- Choose reverse-sshfs instead of 9p or virtiofs
266+
267+
2. **Virtual Machine Type**: Select **QEMU** as your emulation type
268+
- In Rancher Desktop: Go to **Preferences** > **Virtual Machine** > **Emulation** tab
269+
- Choose the QEMU option instead of VZ (Apple Virtualization framework)
270+
271+
![Rancher Desktop Preferences Configuration](./static/rancher-desktop-preferences.png)
272+
273+
These settings ensure proper permission mapping between your local filesystem and the Docker VM. Without them, you may encounter "Permission denied" errors when running containerized steps, as the default mount configurations don't always map filesystem permissions correctly.
274+
257275
**Proxy configuration:**
258276

259277
If you need proxy settings, add them to `~/.harness-delegate/config.env`. See [Configure Delegate Proxy Settings](/docs/platform/delegates/manage-delegates/configure-delegate-proxy-settings).
24.1 KB
Loading
320 KB
Loading

0 commit comments

Comments
 (0)