Skip to content
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

ipfs: move to net/http-based implementation instead of binary-based one #1917

Merged
merged 1 commit into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ARG CNI_PLUGINS_VERSION=v1.1.1
# Extra deps: Build
ARG BUILDKIT_VERSION=v0.11.0
# Extra deps: Lazy-pulling
ARG STARGZ_SNAPSHOTTER_VERSION=v0.13.0
ARG STARGZ_SNAPSHOTTER_VERSION=v0.14.1
# Extra deps: Nydus Lazy-pulling
ARG NYDUS_VERSION=v2.1.1
# Extra deps: Encryption
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile.d/SHA256SUMS.d/stargz-snapshotter-v0.13.0

This file was deleted.

3 changes: 3 additions & 0 deletions Dockerfile.d/SHA256SUMS.d/stargz-snapshotter-v0.14.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fc3a2d4ef29885342f352330ef8c0b69bdadaf110be55fb0c31f20403cd7b9e9 stargz-snapshotter-v0.14.1-linux-amd64.tar.gz
910e5f7bd8c5173e81283bcc83782ff0f67f571a65ff3eb1fb306cd0e80498ce stargz-snapshotter-v0.14.1-linux-arm64.tar.gz
f1cf855870af16a653d8acb9daa3edf84687c2c05323cb958f078fb148af3eec stargz-snapshotter.service
12 changes: 2 additions & 10 deletions cmd/nerdctl/image_encrypt_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (

"github.com/containerd/containerd"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/images"
"github.com/containerd/nerdctl/pkg/buildkitutil"
"github.com/containerd/nerdctl/pkg/testutil"
"github.com/containerd/nerdctl/pkg/testutil/testregistry"
Expand Down Expand Up @@ -97,15 +96,8 @@ func rmiAll(base *testutil.Base) {
}

base.T.Logf("Pruning all images (again?)")
is := client.ImageService()
imgs, err := is.List(ctx)
assert.NilError(base.T, err)
for _, img := range imgs {
base.T.Logf("Pruning image %+v", img)
if err := is.Delete(ctx, img.Name, images.SynchronousDelete()); err != nil {
base.T.Log(err)
}
}
imageIDs = base.Cmd("images", "--no-trunc", "-a", "-q").OutLines()
base.Cmd(append([]string{"rmi", "-f"}, imageIDs...)...).AssertOK()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like that the recent nerdctl rmi strictlly requires each container's image exists in the image service and it has a logic to avoid removing images of existing containers.
This part of code didn't seem to meet this requirement and it seems to result in CI failures that report a container's corresponding image doesn't exist in the image store.
So this part tries to fix it by using nerdctl rmi.

}

Expand Down
1 change: 0 additions & 1 deletion cmd/nerdctl/ipfs_build_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (

func TestIPFSBuild(t *testing.T) {
testutil.DockerIncompatible(t)
testutil.RequireExecutable(t, "ipfs")
testutil.RequiresBuild(t)
base := testutil.NewBase(t)
defer base.Cmd("builder", "prune").Run()
Expand Down
2 changes: 0 additions & 2 deletions cmd/nerdctl/ipfs_compose_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
)

func TestIPFSComposeUp(t *testing.T) {
testutil.RequireExecutable(t, "ipfs")
testutil.DockerIncompatible(t)
base := testutil.NewBase(t)
ipfsaddr, done := runIPFSDaemonContainer(t, base)
Expand Down Expand Up @@ -111,7 +110,6 @@ volumes:
}

func TestIPFSComposeUpBuild(t *testing.T) {
testutil.RequireExecutable(t, "ipfs")
testutil.DockerIncompatible(t)
testutil.RequiresBuild(t)
base := testutil.NewBase(t)
Expand Down
5 changes: 0 additions & 5 deletions cmd/nerdctl/ipfs_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
)

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

func TestIPFSAddress(t *testing.T) {
testutil.RequireExecutable(t, "ipfs")
testutil.DockerIncompatible(t)
base := testutil.NewBase(t)
ipfsaddr, done := runIPFSDaemonContainer(t, base)
Expand Down Expand Up @@ -90,7 +88,6 @@ func runIPFSDaemonContainer(t *testing.T, base *testutil.Base) (ipfsAddress stri
}

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

func TestIPFSWithLazyPulling(t *testing.T) {
testutil.RequireExecutable(t, "ipfs")
testutil.DockerIncompatible(t)
base := testutil.NewBase(t)
requiresStargz(base)
Expand All @@ -127,7 +123,6 @@ func TestIPFSWithLazyPulling(t *testing.T) {
}

func TestIPFSWithLazyPullingCommit(t *testing.T) {
testutil.RequireExecutable(t, "ipfs")
// cgroup is required for nerdctl commit
if rootlessutil.IsRootless() && infoutil.CgroupsVersion() == "1" {
t.Skip("test skipped for rootless containers on cgroup v1")
Expand Down
2 changes: 0 additions & 2 deletions cmd/nerdctl/ipfs_registry_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
)

func TestIPFSRegistry(t *testing.T) {
testutil.RequireExecutable(t, "ipfs")
testutil.DockerIncompatible(t)

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

func TestIPFSRegistryWithLazyPulling(t *testing.T) {
testutil.RequireExecutable(t, "ipfs")
testutil.DockerIncompatible(t)

base := testutil.NewBase(t)
Expand Down
4 changes: 0 additions & 4 deletions docs/ipfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ IPFS support is completely optional. Your host is NOT connected to any P2P netwo

## Prerequisites

### ipfs command

nerdctl requires `ipfs` command available on the node via PATH.

### ipfs daemon

Make sure an IPFS daemon such as [Kubo](https://github.com/ipfs/kubo) (former go-ipfs) is running on your host.
Expand Down
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ require (
github.com/containerd/go-cni v1.1.7
github.com/containerd/imgcrypt v1.1.7
github.com/containerd/nydus-snapshotter v0.5.0
github.com/containerd/stargz-snapshotter v0.13.0
github.com/containerd/stargz-snapshotter/estargz v0.13.0
github.com/containerd/stargz-snapshotter/ipfs v0.13.1-0.20230106161838-6844dbb4c428
github.com/containerd/stargz-snapshotter v0.14.1
github.com/containerd/stargz-snapshotter/estargz v0.14.1
github.com/containerd/stargz-snapshotter/ipfs v0.14.1
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67
github.com/containernetworking/cni v1.1.2
github.com/containernetworking/plugins v1.2.0
Expand Down Expand Up @@ -90,12 +90,14 @@ require (
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr v0.8.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
Expand All @@ -121,7 +123,7 @@ require (
golang.org/x/mod v0.6.0 // indirect
golang.org/x/tools v0.2.0 // indirect
google.golang.org/genproto v0.0.0-20221206210731-b1a01be3a5f6 // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/grpc v1.52.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading