8000 GitHub - ai4os/docker-storage: Docker image for the storage task in Nomad
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ai4os/docker-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Storage container

Build image

This is the container that will be deployed as a side task (storagetask) in a Nomad job.

Right now we are using rclone to mount a remote file system (therefore privileged permissions, or similar, are needed in the Nomad task). In the future this same container could be adapted to use Alluxio or any other storage solution we decide to support.

The Docker image is available in the project's Harbor registry:

  • registry.services.ai4os.eu/ai4os/docker-storage:latest

Usage

When launching this Dockerfile you should pass appropriate RCLONE configuration as ENV variables as well as mounting a volume in the provided LOCAL_PATH

⚠️ If several containers are using that volume, this container has to be ran first.

Mounting a remote filesystem requires either privileged flag or set of little more restrictive permissions [cap-add|device|security-opt] (ref).

docker run \
-e RCLONE_CONFIG='/srv/.rclone/rclone.conf' \
-e RCLONE_CONFIG_RSHARE_TYPE='webdav' \
-e RCLONE_CONFIG_RSHARE_URL='https://data-deep.a.incd.pt/remote.php/webdav/' \
-e RCLONE_CONFIG_RSHARE_VENDOR='nextcloud' \
-e RCLONE_CONFIG_RSHARE_USER='**my-nextcloud-token-user**' \
-e RCLONE_CONFIG_RSHARE_PASS='**my-nextcloud-token-pass**' \
-e REMOTE_PATH='rshare:/' \
-e LOCAL_PATH='/storage' \
-v /home/iheredia/demo-data:/storage:shared \
--device /dev/fuse \
--cap-add SYS_ADMIN \
--security-opt apparmor:unconfined \
-ti ignacioheredia/ai4-docker-storage /bin/bash

In the example above the RCLONE mounted dir will be accessed in the host machine at /home/iheredia/demo-data (root permissions needed to access).

After exiting the container, you will need to unmount the folder:

umount /home/iheredia/demo-data
rmdir /home/iheredia/demo-data

Implementation notes

RCLONE version
Latest RCLONE (1.63.1) did not work due to bug. We settled with (1.62.2).

Base image
We do not start from official RCLONE images because we also need [sh|bash|curl] (not provided)

Nomad task

  • If the user inputs the wrong USER/PASS, the job still runs fine. Only when trying to access the storage folder from his task they will see:

    `ls: reading directory '/storage/': Input/output error`

    When the job finishes, you still need to unmount the folder before deleting.

  • the rclone mount command never finishes so the job can still be run in principle as type service. But the docker start will fail the second time (at restart) because the volume folder has already been created.

    Error while creating mount source path '/etc/nomad.d/storage/some-random-uuid5': mkdir /etc/nomad.d/storage/some-random-uuid5: file exists

    So we need to either:

    • use allow_other in RCLONE (ref), still with service mode.
    • run it in batch mode (this means suboptimal placement).

    We choose the first option.

About

Docker image for the storage task in Nomad

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0