-
Notifications
You must be signed in to change notification settings - Fork 611
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: use ipfs binary instead of library #1653
Conversation
Thanks, you can retain go-cid and call it a day |
cmd/nerdctl/ipfs_linux_test.go
Outdated
c, err := cid.Decode(lines[len(lines)-2]) | ||
assert.NilError(t, err) | ||
return "ipfs://" + c.String() | ||
return "ipfs://" + lines[len(lines)-2] | ||
} | ||
|
||
func requiresIPFS(t *testing.T) { |
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.
maybe put in testutil
, similar to other RequireXXXX
.
docs/ipfs.md
Outdated
@@ -159,14 +167,19 @@ When you specify `--ipfs` option to `nerdctl build`, it automatically starts the | |||
By default, nerdctl exposes the registry at `localhost:5050`. | |||
You can change the address and can manually restart the registry using `nerdctl ipfs registry up` and `nerdctl ipfs registry down`. | |||
|
|||
To make these commands work correctly, you need to install `nerdctl ipfs registry serve` command as a systemd service named `nerdctl-ipfs-registry-serve`. |
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.
Maybe we can have a sample systemd service
file that can be used directly by users?
efc03a3
to
cd9f43c
Compare
Description=nerdctl ipfs registry for integration test | ||
|
||
[Service] | ||
EnvironmentFile=/run/nerdctl-ipfs-registry-serve/args |
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.
s/args/env/ maybe
|
cmd/nerdctl/ipfs_registry_up.go
Outdated
Instead of using this command, you can also directly launch the registry using "nerdctl ipfs registry serve". | ||
|
||
Use "nerdctl ipfs registry down" to stop the registry service launced by "nerdctl ipfs registry up". | ||
`, |
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.
Maybe we can just drop the up/down command and let the user install the systemd unit by themselves
6d4c784
to
72b95ea
Compare
|
||
```console | ||
> nerdctl build --ipfs -t hello . |
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.
The document may note that this flag (and up/down) is being removed in nerdctl v1.2.0.
cmd/nerdctl/build.go
Outdated
@@ -70,7 +70,7 @@ If Dockerfile is not present and -f is not specified, it will look for Container | |||
buildCommand.RegisterFlagCompletionFunc("platform", shellCompletePlatforms) | |||
// #endregion | |||
|
|||
buildCommand.Flags().Bool("ipfs", false, "Allow pulling base images from IPFS") | |||
// buildCommand.Flags().Bool("ipfs", false, "Allow pulling base images from IPFS") |
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.
Remove
ce532c0
to
52d3859
Compare
Still draft? |
Thank you for the review. |
pkg/testutil/testutil.go
Outdated
@@ -604,6 +604,12 @@ func RequireExecutable(t testing.TB, name string) { | |||
} | |||
} | |||
|
|||
func RequireIPFS(t *testing.T) { |
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.
nit: maybe this function can be replaced by just using RequireExecutable("ipfs")
above.
It looks like the ipfs registry sometimes breaks. I'll fix it.
|
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
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
Fixes: #1578
This commit reduces dependencies for ipfs library by using ipfs binary.
nerdctl ipfs registry up
andnerdctl ipfs registry down
now uses systemd for managingnerdctl ipfs registry serve
because it now depends on ipfs command available on the host rootfs.update exampleswill be done after we release the next versionremovegit.luolix.top/ipfs/go-cid v0.3.2
(CID parser) dependency (following up PR?)