Skip to content

Commit ab92b4f

Browse files
committed
ipfs: move to net/http-based implementation instead of binary-based one
Signed-off-by: Kohei Tokunaga <[email protected]>
1 parent e3fca3c commit ab92b4f

16 files changed

+78
-301
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG CNI_PLUGINS_VERSION=v1.1.1
2525
# Extra deps: Build
2626
ARG BUILDKIT_VERSION=v0.11.0
2727
# Extra deps: Lazy-pulling
28-
ARG STARGZ_SNAPSHOTTER_VERSION=v0.13.0
28+
ARG STARGZ_SNAPSHOTTER_VERSION=v0.14.1
2929
# Extra deps: Nydus Lazy-pulling
3030
ARG NYDUS_VERSION=v2.1.1
3131
# Extra deps: Encryption

Dockerfile.d/SHA256SUMS.d/stargz-snapshotter-v0.13.0

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fc3a2d4ef29885342f352330ef8c0b69bdadaf110be55fb0c31f20403cd7b9e9 stargz-snapshotter-v0.14.1-linux-amd64.tar.gz
2+
910e5f7bd8c5173e81283bcc83782ff0f67f571a65ff3eb1fb306cd0e80498ce stargz-snapshotter-v0.14.1-linux-arm64.tar.gz
3+
f1cf855870af16a653d8acb9daa3edf84687c2c05323cb958f078fb148af3eec stargz-snapshotter.service

cmd/nerdctl/image_encrypt_linux_test.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626

2727
"github.com/containerd/containerd"
2828
"github.com/containerd/containerd/content"
29-
"github.com/containerd/containerd/images"
3029
"github.com/containerd/nerdctl/pkg/buildkitutil"
3130
"github.com/containerd/nerdctl/pkg/testutil"
3231
"github.com/containerd/nerdctl/pkg/testutil/testregistry"
@@ -97,15 +96,8 @@ func rmiAll(base *testutil.Base) {
9796
}
9897

9998
base.T.Logf("Pruning all images (again?)")
100-
is := client.ImageService()
101-
imgs, err := is.List(ctx)
102-
assert.NilError(base.T, err)
103-
for _, img := range imgs {
104-
base.T.Logf("Pruning image %+v", img)
105-
if err := is.Delete(ctx, img.Name, images.SynchronousDelete()); err != nil {
106-
base.T.Log(err)
107-
}
108-
}
99+
imageIDs = base.Cmd("images", "--no-trunc", "-a", "-q").OutLines()
100+
base.Cmd(append([]string{"rmi", "-f"}, imageIDs...)...).AssertOK()
109101
}
110102
}
111103

cmd/nerdctl/ipfs_build_linux_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131

3232
func TestIPFSBuild(t *testing.T) {
3333
testutil.DockerIncompatible(t)
34-
testutil.RequireExecutable(t, "ipfs")
3534
testutil.RequiresBuild(t)
3635
base := testutil.NewBase(t)
3736
defer base.Cmd("builder", "prune").Run()

cmd/nerdctl/ipfs_compose_linux_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
)
3030

3131
func TestIPFSComposeUp(t *testing.T) {
32-
testutil.RequireExecutable(t, "ipfs")
3332
testutil.DockerIncompatible(t)
3433
base := testutil.NewBase(t)
3534
ipfsaddr, done := runIPFSDaemonContainer(t, base)
@@ -111,7 +110,6 @@ volumes:
111110
}
112111

113112
func TestIPFSComposeUpBuild(t *testing.T) {
114-
testutil.RequireExecutable(t, "ipfs")
115113
testutil.DockerIncompatible(t)
116114
testutil.RequiresBuild(t)
117115
base := testutil.NewBase(t)

cmd/nerdctl/ipfs_linux_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
)
3131

3232
func TestIPFS(t *testing.T) {
33-
testutil.RequireExecutable(t, "ipfs")
3433
testutil.DockerIncompatible(t)
3534
base := testutil.NewBase(t)
3635
ipfsCID := pushImageToIPFS(t, base, testutil.AlpineImage)
@@ -62,7 +61,6 @@ func TestIPFS(t *testing.T) {
6261
var iplineRegexp = regexp.MustCompile(`"([0-9\.]*)"`)
6362

6463
func TestIPFSAddress(t *testing.T) {
65-
testutil.RequireExecutable(t, "ipfs")
6664
testutil.DockerIncompatible(t)
6765
base := testutil.NewBase(t)
6866
ipfsaddr, done := runIPFSDaemonContainer(t, base)
@@ -90,7 +88,6 @@ func runIPFSDaemonContainer(t *testing.T, base *testutil.Base) (ipfsAddress stri
9088
}
9189

9290
func TestIPFSCommit(t *testing.T) {
93-
testutil.RequireExecutable(t, "ipfs")
9491
// cgroup is required for nerdctl commit
9592
if rootlessutil.IsRootless() && infoutil.CgroupsVersion() == "1" {
9693
t.Skip("test skipped for rootless containers on cgroup v1")
@@ -115,7 +112,6 @@ func TestIPFSCommit(t *testing.T) {
115112
}
116113

117114
func TestIPFSWithLazyPulling(t *testing.T) {
118-
testutil.RequireExecutable(t, "ipfs")
119115
testutil.DockerIncompatible(t)
120116
base := testutil.NewBase(t)
121117
requiresStargz(base)
@@ -127,7 +123,6 @@ func TestIPFSWithLazyPulling(t *testing.T) {
127123
}
128124

129125
func TestIPFSWithLazyPullingCommit(t *testing.T) {
130-
testutil.RequireExecutable(t, "ipfs")
131126
// cgroup is required for nerdctl commit
132127
if rootlessutil.IsRootless() && infoutil.CgroupsVersion() == "1" {
133128
t.Skip("test skipped for rootless containers on cgroup v1")

cmd/nerdctl/ipfs_registry_linux_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
)
2626

2727
func TestIPFSRegistry(t *testing.T) {
28-
testutil.RequireExecutable(t, "ipfs")
2928
testutil.DockerIncompatible(t)
3029

3130
base := testutil.NewBase(t)
@@ -41,7 +40,6 @@ func TestIPFSRegistry(t *testing.T) {
4140
}
4241

4342
func TestIPFSRegistryWithLazyPulling(t *testing.T) {
44-
testutil.RequireExecutable(t, "ipfs")
4543
testutil.DockerIncompatible(t)
4644

4745
base := testutil.NewBase(t)

docs/ipfs.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ IPFS support is completely optional. Your host is NOT connected to any P2P netwo
99

1010
## Prerequisites
1111

12-
### ipfs command
13-
14-
nerdctl requires `ipfs` command available on the node via PATH.
15-
1612
### ipfs daemon
1713

1814
Make sure an IPFS daemon such as [Kubo](https://github.com/ipfs/kubo) (former go-ipfs) is running on your host.

go.mod

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ require (
1414
github.com/containerd/go-cni v1.1.7
1515
github.com/containerd/imgcrypt v1.1.7
1616
github.com/containerd/nydus-snapshotter v0.5.0
17-
github.com/containerd/stargz-snapshotter v0.13.0
18-
github.com/containerd/stargz-snapshotter/estargz v0.13.0
19-
github.com/containerd/stargz-snapshotter/ipfs v0.13.1-0.20230106161838-6844dbb4c428
17+
github.com/containerd/stargz-snapshotter v0.14.1
18+
github.com/containerd/stargz-snapshotter/estargz v0.14.1
19+
github.com/containerd/stargz-snapshotter/ipfs v0.14.1
2020
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67
2121
github.com/containernetworking/cni v1.1.2
2222
github.com/containernetworking/plugins v1.2.0
@@ -90,12 +90,14 @@ require (
9090
github.com/mattn/go-shellwords v1.0.12 // indirect
9191
github.com/miekg/pkcs11 v1.1.1 // indirect
9292
github.com/minio/sha256-simd v1.0.0 // indirect
93+
github.com/mitchellh/go-homedir v1.1.0 // indirect
9394
github.com/moby/locker v1.0.1 // indirect
9495
github.com/moby/sys/mountinfo v0.6.2 // indirect
9596
github.com/moby/sys/sequential v0.5.0 // indirect
9697
github.com/mr-tron/base58 v1.2.0 // indirect
9798
github.com/multiformats/go-base32 v0.1.0 // indirect
9899
github.com/multiformats/go-base36 v0.1.0 // indirect
100+
github.com/multiformats/go-multiaddr v0.8.0 // indirect
99101
github.com/multiformats/go-multibase v0.1.1 // indirect
100102
github.com/multiformats/go-multihash v0.2.1 // indirect
101103
github.com/multiformats/go-varint v0.0.6 // indirect
@@ -121,7 +123,7 @@ require (
121123
golang.org/x/mod v0.6.0 // indirect
122124
golang.org/x/tools v0.2.0 // indirect
123125
google.golang.org/genproto v0.0.0-20221206210731-b1a01be3a5f6 // indirect
124-
google.golang.org/grpc v1.51.0 // indirect
126+
google.golang.org/grpc v1.52.1 // indirect
125127
google.golang.org/protobuf v1.28.1 // indirect
126128
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
127129
gopkg.in/yaml.v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)