Skip to content

Commit

Permalink
Merge pull request #42 from ai4os/fix_docker_conf
Browse files Browse the repository at this point in the history
Fix docker conf #41
  • Loading branch information
micafer authored Oct 29, 2024
2 parents a7883cd + 6594921 commit c99f1a9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/site_ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ Specifically, modify the following variables:
The node volume may not be mounted correctly. Check within the file `/etc/nomad.d/nomad.hcl` where the nomad plugin is being searched. Check that the referenced volume is mounted correctly.

```vim
# data_dir points to /mnt/data if mounted volume (noamd_volume or nomad_new_volume) and /opt/nomad otherwise
# data_dir points to /mnt/data if mounted volume (nomad_volume or nomad_new_volume) and /opt/nomad otherwise
data_dir = "/mnt/data"
```

Expand Down
19 changes: 9 additions & 10 deletions roles/nomad/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
when: ("nomad_gpu_clients" in groups and inventory_hostname in groups["nomad_gpu_clients"]) or
("nomad_new_gpu_clients" in groups and inventory_hostname in groups["nomad_new_gpu_clients"])


# Set docker daemon configuration
- set_fact:
docker_config_values:
registry-mirrors: ["{{ docker_registry }}"]
exec-opts: ["native.cgroupdriver=cgroupfs"]

# Configure volumes
- block:

# Set docker daemon configuration
- set_fact:
docker_config_values:
registry-mirrors: ["{{ docker_registry }}"]

# Add data root in case of volume nodes
- set_fact:
docker_config_values:
data-root: "{{ mount_dir }}"
registry-mirrors: ["{{ docker_registry }}"]
when: vol_name is defined
docker_config_values: "{{ docker_config_values | combine({'data-root': mount_dir}) }}"

# Configure swap capabilities
- name: "Enable swap limit capabilities"
Expand All @@ -44,7 +44,6 @@
vars:
docker_nvidia_support: "{{ nvidia_support }}"
docker_compose_version: "1.29.2"
docker_config_values: { "exec-opts": ["native.cgroupdriver=cgroupfs"] }

- name: "Install CNI plugins"
include_tasks: install_cni.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/nomad/templates/nomad.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ region = "{{ nomad_region }}"

name = "{{ nomad_hostname }}"

# data_dir points to {{mount_dir}} if mounted volume (noamd_volume or nomad_new_volume) and {{nomad_data_dir}} otherwise
# data_dir points to {{mount_dir}} if mounted volume (nomad_volume or nomad_new_volume) and {{nomad_data_dir}} otherwise
{% if ('nomad_volume' in groups and inventory_hostname in groups['nomad_volume']) or ('nomad_new_volume' in groups and inventory_hostname in groups['nomad_new_volume']) %}
data_dir = "{{ mount_dir }}"
{% else %}
Expand Down

0 comments on commit c99f1a9

Please sign in to comment.