Docker Commands

Using this via AWS Marketplace? Replace wyflow/mapfs:2.4.2 in the commands below with AWS Marketplace ECR image address (709825985650.dkr.ecr.<region>.amazonaws.com/wyflow/mapfs:2.4.2).

Start Channel Server

Channel Server is used to fanout/broadcast metadata changes among registered mapfs daemons in a cluster.

Usage:

  $ docker run --rm -d \
	--name channeld \
	-p 7777:7777 \
	wyflow/mapfs:2.4.2 channeld start

  $ docker run --rm -d \
	--name channeld \
	-p 8000:8000 \
	wyflow/mapfs:2.4.2 channeld start -p 8000

  $ docker stop channeld

  $ docker exec channeld channeld show

Show currently connected clients (mapfs mount daemons doing cache-invalidation metadata exchange through this ChannelServer). This has to be docker exec into the already-running channeld container from the start command above, not a fresh docker run — a new container has no access to the running one's client state:

  $ docker exec channeld channeld show
  Channel                 Index   IP              Joined
  a1b2c3d4e5f6a7b8         5       10.0.1.23       Yes
  a1b2c3d4e5f6a7b8         7       10.0.2.45       Yes
  c9d8e7f6a5b4c3d2         9       10.0.3.12       No

Each row is one connected client: Channel is the cache-invalidation group's fingerprint (clients mounting the same volume share one, so an invalidation fans out only within that group, not to every connected client); Index is the client's internal socket index; Joined is whether it has completed its join handshake yet. The total number of currently connected clients is just the row count below the header:

  $ docker exec channeld channeld show | tail -n +2 | wc -l

If nothing is connected, it prints No clients connected instead of the table.


Help / Version

  $ docker run --rm wyflow/mapfs:2.4.2 mapfs
  $ docker run --rm wyflow/mapfs:2.4.2 mapfs help
  $ docker run --rm wyflow/mapfs:2.4.2 mapfs version

License

  # list the current license
  $ docker run --rm \
	-v /etc/mapfs:/etc/mapfs:ro \
	wyflow/mapfs:2.4.2 \
	mapfs license list

  # import a license
  $ docker run --rm \
	-v /etc/mapfs:/etc/mapfs \
	wyflow/mapfs:2.4.2 \
	mapfs license import <email> <token>

  $ docker run --rm \
	-v /etc/mapfs:/etc/mapfs \
	wyflow/mapfs:2.4.2 \
	mapfs license import <email> <token>

Add a volume

  $ docker run --rm \
	-v /etc/mapfs:/etc/mapfs \
	wyflow/mapfs:2.4.2 \
	mapfs add <VolumeName> <CloudOptions> <CacheOptions>
Note: the directory used in "-v /var/cache/mapfs/my-volume:..." must already exist — docker will not create it automatically.
  # for example
  $ docker run --rm \
	-v /etc/mapfs:/etc/mapfs \
	-v /var/cache/mapfs/my-volume:/var/cache/mapfs/my-volume \
	wyflow/mapfs:2.4.2 \
	mapfs add my-volume S3Compatible \
	-i admin -k administrator -b ulb.test \
	-e http://192.168.97.128:9000 -d /var/cache/mapfs/my-volume -z 1

Configure cache parameters

  $ docker run --rm \
	-v /etc/mapfs:/etc/mapfs \
	-v <CacheDir>:<CacheDir> \
	wyflow/mapfs:2.4.2 \
	mapfs configure <VolumeName> cache_size=<GB>

  $ docker run --rm \
	-v /etc/mapfs:/etc/mapfs \
	-v <CacheDir>:<CacheDir> \
	wyflow/mapfs:2.4.2 \
	mapfs configure <VolumeName> cache_size=<GB>

  $ docker run --rm \
	-v /etc/mapfs:/etc/mapfs \
	wyflow/mapfs:2.4.2 \
	mapfs configure <VolumeName> cache_timeout=<seconds>

List configured volumes

  $ docker run --rm \
	-v /etc/mapfs:/etc/mapfs:ro \
	wyflow/mapfs:2.4.2 \
	mapfs list

Delete a volume

  $ docker run --rm -it \
	-v /etc/mapfs:/etc/mapfs \
	-v /var/cache/mapfs/my-volume:/var/cache/mapfs/my-volume \
	wyflow/mapfs:2.4.2 \
	mapfs delete <VolumeName>

Mount a volume

Note: "-v /sys/module/fuse/parameters/enable_uring:/sys/module/fuse/parameters/enable_uring" only works on Linux distributions running kernel 6.18+.
  $ docker run --rm -d \
      --name mapfs-<VolumeName> \
      -v /etc/mapfs:/etc/mapfs:ro \
      -v /etc/os-release:/etc/os-release:ro \
      -v <CacheDir>:<CacheDir> \
      -v /var/run/mapfs:/var/run/mapfs \
      -v /proc/meminfo:/proc/meminfo:ro \
      [-v /sys/module/fuse/parameters/enable_uring:/sys/module/fuse/parameters/enable_uring] \
      -v <MountPoint>:<MountPoint>:shared \
      --device /dev/fuse \
      --cap-add SYS_ADMIN \
      wyflow/mapfs:2.4.2 \
      mapfs mount <VolumeName> <MountPoint> \
      [--channel IP/DNS[:Port]] [--iouring]

  # for example
  $ docker run --rm -d \
      --name mapfs-my-volume \
      -v /etc/mapfs:/etc/mapfs:ro \
      -v /etc/os-release:/etc/os-release:ro \
      -v /var/cache/mapfs/my-volume:/var/cache/mapfs/my-volume \
      -v /var/run/mapfs:/var/run/mapfs \
      -v /proc/meminfo:/proc/meminfo:ro \
      -v /mnt/fuse:/mnt/fuse:shared \
      --device /dev/fuse \
      --cap-add SYS_ADMIN \
      wyflow/mapfs:2.4.2 \
      mapfs mount my-volume /mnt/fuse

warm up cache

  $ docker run --rm \
	wyflow/mapfs:2.4.2 \
	mapfs load <filename>

Get volume runtime status

  $ docker run --rm \
	-v /var/run/mapfs:/var/run/mapfs:ro \
	wyflow/mapfs:2.4.2 \
	mapfs stat

Unmount a volume

  $ docker stop mapfs-<VolumeName>

List running mapfs containers

  $ docker ps --filter 'name=mapfs-' \
      --format 'table {{.Names}}\t{{.Status}}\t{{.Size}}\t{{.Mounts}}'

Check whether a container is running

  $ docker inspect mapfs-<VolumeName>
  $ docker inspect -f '{{.State.Running}}' mapfs-<VolumeName>

Logs

  $ docker logs [-f] mapfs-<VolumeName>
  $ tail -f <CacheDir>/mapfs.log