Skip to content

Commit

Permalink
DOCS: CE-659 chroot limitations for isolated fork/exec driver (#23739)
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeeu authored Aug 5, 2024
1 parent 0b9defe commit cbacdb2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
15 changes: 7 additions & 8 deletions website/content/docs/configuration/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,8 @@ client {

### `chroot_env` Parameters

Drivers based on [isolated fork/exec](/nomad/docs/drivers/exec) implement file
system isolation using chroot on Linux. The `chroot_env` map allows the chroot
environment to be configured using source paths on the host operating system.
On Linux, drivers based on [isolated fork/exec](/nomad/docs/drivers/exec) implement file system isolation using chroot. The `chroot_env` map lets you configure the chroot environment using source paths on the host operating system.

The mapping format is:

```text
Expand All @@ -240,13 +239,13 @@ client {
}
```

When `chroot_env` is unspecified, the `exec` driver will use a default chroot
environment with the most commonly used parts of the operating system. Please
see the [Nomad `exec` driver documentation](/nomad/docs/drivers/exec#chroot) for
@include 'chroot-limitations.mdx'

When `chroot_env` is unspecified, the `exec` driver uses a default chroot
environment with the most commonly used parts of the operating system. Refer to the [Nomad `exec` driver documentation](/nomad/docs/drivers/exec#chroot) for
the full list.

Nomad will never attempt to embed the `alloc_dir` in the
chroot as doing so would cause infinite recursion.
Nomad never attempts to embed the `alloc_dir` in the chroot as doing so would cause infinite recursion.

### `options` Parameters

Expand Down
19 changes: 10 additions & 9 deletions website/content/docs/drivers/exec.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: docs
page_title: 'Drivers: Exec'
description: The Exec task driver is used to run binaries using OS isolation primitives.
description: The Exec task driver runs binaries using OS isolation primitives.
---

# Isolated Fork/Exec Driver
Expand Down Expand Up @@ -229,8 +229,9 @@ on [cgroup controller requirements][] for more details.

### Chroot

The chroot is populated with data in the following directories from the host
machine:
Chroot changes the root directory of the current process and all its child processes. Nomad uses a chroot environment to implement file system isolation.

Nomad populates the chroot environment with data in the following host machine directories:

```
[
Expand All @@ -245,13 +246,13 @@ machine:
]
```

The task's chroot is populated by linking or copying the data from the host into
the chroot. Note that this can take considerable disk space. Since Nomad v0.5.3,
the client manages garbage collection locally which mitigates any issue this may
create.
Nomad populates the task's chroot environment by linking or copying the data from the host into the chroot. Note that this can take considerable disk space.
The client manages garbage collection locally, which mitigates any issue this may create.

@include 'chroot-limitations.mdx'

This list is configurable through the agent client
[configuration file](/nomad/docs/configuration/client#chroot_env).
Configure the chroot environment list through the agent client's
[`chroot_env` attribute](/nomad/docs/configuration/client#chroot_env).

### CPU

Expand Down
3 changes: 3 additions & 0 deletions website/content/partials/chroot-limitations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!> **Warning chroot limitations:** Nomad by default doesn't copy the ephemeral runtime files in the `/run` directory. For exampe, on Ubuntu, `/etc/resolv.conf` is a symlink to `/run/systemd/resolve/stub-resolv.conf`, so Nomad doesn't copy `resolv.conf` to the chroot environment.

In these cases, configure your job's [network block](/nomad/docs/job-specification/network) for each chroot task.

0 comments on commit cbacdb2

Please sign in to comment.