Proxy storage (experimental)

A proxy storage is a storage that is parametrized by another, “reference” storage.

timeline storage

timeline is an example proxy storage. It’s a storage that sorts files according to the modification time. The backend automatically generates a separate subcontainer for each of the files contained in the data container. Each of the files can thus be accessed through a timeline tree generated by the backend. The root of the tree is configurable with a default value of ‘/timeline’. For example, if a file foo.txt has a modification time of 2020-05-01, it will be available under timeline/2020/05/01/foo.txt. Additionally, each of the subcontainers generated by the backend inherits categories from the reference data container. Therefore, if the data container has been initially granted the ‘/bar’ category, the aforementioned foo.txt file will also be available under timeline/2020/05/01/bar/foo.txt.

timeline example (using CLI)

Create a user, if you haven’t done that yet:

$ wl user create User

Create the “reference” container, and directory with files:

$ wl container create Inner --path /reference --category /foo

$ wl storage create local Inner --location $HOME/proxy-data \
    --container Inner
$ mkdir ~/proxy-data
$ touch ~/proxy-data/file1.txt -t 202005010000
$ touch ~/proxy-data/file2.txt -t 201905010000

Create the proxy container storage:

$ wl container create Proxy --path /proxy

$ wl storage create timeline Proxy \
    --reference-container-url file://$HOME/.config/wildland/containers/Inner.container.yaml \
    --container Proxy

Mount:

$ wl start
$ wl container mount Proxy

You should be able to see the files:

$ find ~/wildland/proxy/
/home/user/wildland/proxy/
/home/user/wildland/proxy/2019
/home/user/wildland/proxy/2019/05
/home/user/wildland/proxy/2019/05/01
/home/user/wildland/proxy/2019/05/01/file2.txt
/home/user/wildland/proxy/2020
/home/user/wildland/proxy/2020/05
/home/user/wildland/proxy/2020/05/01
/home/user/wildland/proxy/2020/05/01/file1.txt

timeline example (self-contained manifest)

All manifests can be inlined. You can create a container.yaml file (or edit existing one using wl container edit)

owner: <OWNER>
paths:
  - /.uuid/11e69833-0152-4563-92fc-b1540fc54a69
  - /proxy

backends:
  storage:
    - type: timeline
      container-path: /.uuid/11e69833-0152-4563-92fc-b1540fc54a69
      owner: <OWNER>
      reference-container:
        owner: <OWNER>
        paths:
          - /reference
        backends:
          storage:
            - type: local
              container-path: /.uuid/11e69833-0152-4563-92fc-b1540fc54a69
              owner: <OWNER>
              path: /home/user/proxy-data

This file can be signed with wl container sign (the edit command will do that automatically), then mounted using wl container mount.

delegate storage

This storage allows to put another container (potentially from another user) under own user hierarchy, under another set of paths. Additionally it allows to include only a subdirectory of a linked container. The linked container can be specified either inline, or by using an URL to the manifest. This URL can be also an Wildland URL.

delegate usage

This shows how to place a container of another user under own Wildland hierarchy. You can create a container.yaml file (or edit existing one using wl container edit)

owner: <OWNER>
paths:
  - /.uuid/11e69833-0152-4563-92fc-b1540fc54a69
  - /proxy

backends:
  storage:
    - type: delegate
      container-path: /.uuid/11e69833-0152-4563-92fc-b1540fc54a69
      owner: <OWNER>
      reference-container: 'wildland:<ANOTHER-OWNER>:/container/path:'
      subdirectory: /directory/in/reference-container

This file can be signed with wl container sign (the edit command will do that automatically), then mounted using wl container mount.

In this specific example, the local user is 0xc4c71e09ff71e5f06445 and they want to place a container of 0xee4052832df4976d6445 user under its own tree. To be more specific a subdirectory /directory/in/reference-container from a container with a path /container/path of that user:

$ cat container.yaml
owner: '0xc4c71e09ff71e5f06445'
paths:
  - /.uuid/11e69833-0152-4563-92fc-b1540fc54a69
  - /proxy

backends:
  storage:
    - type: delegate
      container-path: /.uuid/11e69833-0152-4563-92fc-b1540fc54a69
      owner: '0xc4c71e09ff71e5f06445'
      reference-container: 'wildland:0xee4052832df4976d6445:/container/path:'
      subdirectory: /directory/in/reference-container

Sign the above container:

$ wl c sign -i container.yaml

Then mount it:

$ wl c mount container.yaml
new: container.yaml
Mounting 1 container

Here we can see the original container of the 0xee4052832df4976d6445 user (mounted independently, earlier). It is another’s user container, and is available only under .users/0xee4052832df4976d6445 path:

$ tree wildland/.users/0xee4052832df4976d6445/
wildland/.users/0xee4052832df4976d6445/
`-- container
    `-- path
        |-- directory
        |   `-- in
        |       `-- reference-container
        |           `-- reference-file.txt
        `-- file21

5 directories, 2 files

And here we can see a part of that container mounted using delegate storage:

$ tree  wildland/proxy/
wildland/proxy/
`-- reference-file.txt

0 directories, 1 file