-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[registry-facade] Add IPFS support #9005
Conversation
588b77c
to
c65b289
Compare
I see an error when trying to test gitpod /tmp/go-ipfs $ ipfs daemon
Initializing daemon...
go-ipfs version: 0.12.0
Repo version: 12
System version: amd64/linux
Golang version: go1.16.12
2022/03/30 07:41:34 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.
2022/03/30 07:41:34 [zeroconf] no suitable IPv4 interface: udp4: failed to join any of these interfaces: []
2022/03/30 07:41:34 [zeroconf] no suitable IPv6 interface: udp6: failed to join any of these interfaces: []
2022-03-30T07:41:34.105Z ERROR cmd/ipfs ipfs/daemon.go:430 error from node construction: no supported interface
Error: no supported interface also, there might be a mismatch in jq version as it complains that the flag gitpod /tmp/go-ipfs $ jq '.Discovery.MDNS.Enabled=true' ~/.ipfs/config > ~/.ipfs/config-new && mv ~/.ipfs/config-new ~/.ipfs/config Can you share which cluster you tested this in? When I try to increase the buffer size I see an error: gitpod /sys/fs/cgroup/net_cls $ sysctl -w net.core.rmem_max=2500000
sysctl: cannot stat /proc/sys/net/core/rmem_max: No such file or directory
gitpod /sys/fs/cgroup/net_cls $ |
c65b289
to
58d7cde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks all for the reviews :)
Had another go.
my bad. Wrong line comment. |
/hold |
38bf5ff
to
5ed43ff
Compare
Code looks good, but like Prince I cannot test this for some reason, getting same error:
@csweichel am I missing a step? I an doing this in gitpod workspace, opening this PR. |
My bad: I had the ipfs settings wrong in the description. The line should read:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Looks good.
@@ -29,6 +29,19 @@ type WorkspaceConfig struct { | |||
Limit resource.Quantity `json:"limit"` | |||
BurstLimit resource.Quantity `json:"burstLimit"` | |||
} | |||
|
|||
RegistryFacade struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why registryFacade
is inside workspace
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here workspace
refers to the workspace team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. From an Installer point of view, do we want to add an in-cluster Redis, or is that something that we're only explicitly supporting an external resource?
Also, I think this will be a good candidate as the first component that has "graduated" from experimental
to the stable config. We're probably not there yet, but this is definitely going to be a useful addition for many of the bigger/enterprise self-hosted users
8c74744
to
b62a974
Compare
/werft run with-clean-slate 👍 started the job as gitpod-build-cw-regfac-ipfs.28 |
Rebased this on top of Simon's replicated changes, so that the werft build passes again. |
cac1118
to
4d5d20e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR adds IPFS support to registry-facade. This is an optional feature and
GET
on each manifest production incurs.Really, this is something that came out of a four our session from a hackathon.
How it works
Whenever a blob gets pulled through registry-facade, registry-facade will upload that blob to IPFS and record the IPFS CID in Redis with the sha hash of the blob as key. The next time a manifest which contains the blob is produced, we'll add an
ipfs://
URL to the OCI descriptor of that blob.If the snapshotter supports IPFS URLs (like the stargz snapshotter does), image pulls should be accelerated. If the snapshotter does not support IFPS (like most other snapshoters), the image pull will likely fail because the snapshotter cannot handle ipfs URLs.
Related Issue(s)
Fixes #8186
How to test
This PR is best tested locally (i.e. in a Gitpod workspace):
IPFS setup:
Redis setup:
Tool setup:
Start registry-facade
Pull an image for the first time (make sure your docker damon cache is empty so that Docker actually pulls the blobs):
Release Notes