Problem Statement
This project implements the docker registry storage driver for powergate. This driver can be used to configure a registry server to store images into powergate's tiered storage. (Hot (IPFS) + Cold (Filecoin).
Solution
This project uses the Powergate Go API client to implement a storage driver interface for docker. The powergate API for storing data is a key/value interface, whereas the docker storage driver implements a filesystem-like interface. In order to use powergate, we need to translate the filesystem ops to key/value type ops. In order to achieve this, I have implemented a local DB.Using a local DB, I maintain the filesystem information and push the actual blobs to powergate. This local DB is called a "manifest". I have used another project which provides a simple KV interface over ipfs/go-datastore. Currently, this DB has a separate file that is used for badger, but this could potentially be integrated with IPFS itself in the future.Any client that needs to access the registry will need this manifest file. The manifest file itself can be posted to powergate using an additional command. This can then give us a CID to initialize instead of the entire file. I did not have time to implement this part.The local DB object is called an Inode, which looks liketype PowInode struct {Name string Hash string JobID string Dir bool Sz int64 Children []string Created int64 Updated int64}This object can represent a directory, in which case we will have children populated. Otherwise its a file, in which case, it will have the IPFS hash and powergate cold storage job ID populated.For filesystem ops that don't manipulate the actual file content, all the operations are performed on this manifest DB. If we do backup of manifest onto IPFS, we will need to update it whenever anything changes.Rest is just using the Powergate client to add/remove/replace the data. The following PR shows all the code changes done for this:https://github.com/aloknerurkar/distribution/pull/1The powdocker directory contains a modified version of powergate docker scripts which I have used. Added the registry image as well as change port nos etc.Main parts to look:/registry/storage/driver/powergate => Implementation/cmd/registry/config-dev.yml => Configuring the powergate driver on the docker image/powdocker/docker-compose-localnet.yaml => Adding powdocker image
Hackathon
HackFS
2024
Contributors
- stevvooe
733 contributions
- dmcgowan
364 contributions
- aaronlehmann
146 contributions
- BrianBland
111 contributions
- lebauce
37 contributions
- AndreyKostov
32 contributions
- caervs
32 contributions
- ahmetb
24 contributions
- SvenDowideit
23 contributions
- mikebrow
20 contributions
- denverdino
18 contributions
- thaJeztah
18 contributions
- aibaars
17 contributions
- tt
15 contributions
- tg123
13 contributions
- nwt
12 contributions
- noxiouz
10 contributions
- aoxn
8 contributions
- tifayuki
8 contributions
- dtromb
8 contributions
- tonyhb
8 contributions
- runcom
8 contributions
- hgomez
7 contributions
- Shawnpku
7 contributions
- andrewhsu
6 contributions
- gierschv
6 contributions
- luckyraul
5 contributions
- sargun
5 contributions
- majewsky
5 contributions
- yuwaMSFT2
5 contributions