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

Internal organization for this repository (internal, core, shell, http, cmd, test) #1158

Closed
wking opened this issue Apr 28, 2015 · 4 comments

Comments

@wking
Copy link
Contributor

wking commented Apr 28, 2015

On Mon, Apr 27, 2015 at 11:17:18PM -0700, Jeromy Johnson wrote:

In my perfect awesome world where I wrote all the code and spent
lots of time making the interfaces perfect, We would have the
importer, with all its knobs and switches on the low end (probably),
and coreunix.Add being all nice and user friendly on top, and then
the commands.Add would just call into coreunix.Add.

I guess the further refinement of that idea is that all commands
are just UX wrappers over the core* methods, and the core*
methods handle a bunch of logic in order to make calls to the low
level importer style, raw methods.

maybe we should rename core -> mantle, and call the lowest level type API commands the core...

So after a fairly brief chat on IRC with @jbenet, my understanding was
that we wanted something like:

  • internal/… Really low-level stuff where we reserve the right to
    break interfaces as often as we like.
  • core/… The official, low-level API that gives consumers all the
    knobs they need, which we try hard to keep stable.
  • shell/… The official, high-level API that gives consumers easy
    access to common operations (e.g. create a file node from a reader
    without wrapping with metadata
    ). We work really hard to keep
    this stable.

Then on top of the core/… and shell/… Go APIs, we'd build:

  • http/… The REST API
  • cmd/… The command-line API
  • test/… Integration tests, etc.

To avoid cyclic imports (see part of my commit message in ccb3f39
(util/testutil/addcat/addcat: Factor out add/cat/verify helper,
2015-04-26), I'd jump through whatever hoops had to be jumped through
to ensure imports never cut further down in that stack. For example,
you could import all of core and shell from cmd/… or test/…, but you
couldn't import any of shell/… from core/….

Spun off from ipfs/team-mgmt#6.

@jbenet
Copy link
Member

jbenet commented Apr 28, 2015

all SGTM.

except one comment:

  • we currently have some internal/ packages, but i'm strongly against them and want to get rid of them. they can cause really, really bad situations. (fun story: https://github.com/jbenet/go-fd-mutex -- this isn't quite internal/, but there are similar cases). these can just be packages and users can vendor them to avoid breaking on api changes. (i.e. we can be clear about what packages we promise not to change and which we do. internal/ is a very very annoying way to signal that to the user.

@wking
Copy link
Contributor Author

wking commented Apr 29, 2015

On Tue, Apr 28, 2015 at 04:53:28PM -0700, Juan Batiz-Benet wrote:

  • we currently have some internal/ packages, but i'm strongly
    against them and want to get rid of them.

I expect we'll have stuff that's so low-level that we can't imagine
folks using it directly that we don't want to commit to stabilizing.
It takes some work to deprecate nicely (see #1159), and if that
applies to all of our package-public interfaces I think it would be
too big a drag. But maybe we don't want anything that low-level ;).
Anyhow, I'm fine moving stuff into “we commit to trying to keep this
stable, and will work hard to help you migrate smoothly when we do
break backwards compatibility” locations as we see fit, and just
letting the internal stuff about which we don't make those guarantees
wither away.

wking added a commit to wking/go-ipfs that referenced this issue Apr 29, 2015
Starting to use the core/... (low-level, all the knobs you need)
shell/... (high-level, handle the common case easily) disctinction
laid out in [1].

Creating a file node from a reader is hard to do right, because
there's a lot of filesystem metadata that we don't have access to
(access mode, ownership, etc.).  You can guess at those based on the
adding process's umask, effective user, etc., but figuring out what
you want guessed at or what you want set explicitly, or whether you
want wrapping metadata at all is complicated.  This function isn't
going to do any of that [2], it's just a high-level wrapper to create
a minimal file object with the default chunking, pinning, etc. all
taken care of in ways that will probably work for you ;).

[1]: ipfs#1158
[2]: ipfs#1136 (comment)
wking added a commit to wking/go-ipfs that referenced this issue Apr 29, 2015
Folks should be using the node-returning AddFromReader defined in
shell/fsnode instead, since that creates the same node but returns the
dag.Node object itself, instead of the stringified key.  It's cheaper
to go from Node to stringified key than it is to go the other way
around, and you need the Node to do anything besides printing the
stringified key, so the shell/fsnode version has a better API and we
want to push people in that direction.  The shell/fsnode version also
uses our intended high-/low-level API distinction (core/... is for
low-level stuff) [1].  This commit starts the deprecation/migration
using the procedure outlined here [2].

[1]: ipfs#1158
[2]: ipfs#1159
wking added a commit to wking/go-ipfs that referenced this issue Apr 29, 2015
Starting to use the core/... (low-level, all the knobs you need)
shell/... (high-level, handle the common case easily) disctinction
laid out in [1].

Creating a file node from a reader is hard to do right, because
there's a lot of filesystem metadata that we don't have access to
(access mode, ownership, etc.).  You can guess at those based on the
adding process's umask, effective user, etc., but figuring out what
you want guessed at or what you want set explicitly, or whether you
want wrapping metadata at all is complicated.  This function isn't
going to do any of that [2], it's just a high-level wrapper to create
a minimal file object with the default chunking, pinning, etc. all
taken care of in ways that will probably work for you ;).

[1]: ipfs#1158
[2]: ipfs#1136 (comment)
wking added a commit to wking/go-ipfs that referenced this issue Apr 29, 2015
Folks should be using the node-returning AddFromReader defined in
shell/fsnode instead, since that creates the same node but returns the
dag.Node object itself, instead of the stringified key.  It's cheaper
to go from Node to stringified key than it is to go the other way
around, and you need the Node to do anything besides printing the
stringified key, so the shell/fsnode version has a better API and we
want to push people in that direction.  The shell/fsnode version also
uses our intended high-/low-level API distinction (core/... is for
low-level stuff) [1].  This commit starts the deprecation/migration
using the procedure outlined here [2].

[1]: ipfs#1158
[2]: ipfs#1159
wking added a commit to wking/go-ipfs that referenced this issue Apr 30, 2015
Starting to use the core/... (low-level, all the knobs you need)
shell/... (high-level, handle the common case easily) disctinction
laid out in [1].

Creating a file node from a reader is hard to do right, because
there's a lot of filesystem metadata that we don't have access to
(access mode, ownership, etc.).  You can guess at those based on the
adding process's umask, effective user, etc., but figuring out what
you want guessed at or what you want set explicitly, or whether you
want wrapping metadata at all is complicated.  This function isn't
going to do any of that [2], it's just a high-level wrapper to create
a minimal file object with the default chunking, pinning, etc. all
taken care of in ways that will probably work for you ;).

I'm not clear on where the 'unix' part of the name comes from (these
seem like pretty generic filesystem nodes to me, or if anything,
they're POSIX filesystem nodes), but:

On Wed, Apr 29, 2015 at 01:30:04PM -0700, Juan Batiz-Benet wrote [3]:
> > package fsnode
>
> i think this package should be called unixfs as that's the
> abstraction that this is calling to.

So that's what we're going with.

[1]: ipfs#1158
[2]: ipfs#1136 (comment)
[3]: ipfs#1136 (comment)
wking added a commit to wking/go-ipfs that referenced this issue Apr 30, 2015
Folks should be using the node-returning AddFromReader defined in
shell/unixfs instead, since that creates the same node but returns the
dag.Node object itself, instead of the stringified key.  It's cheaper
to go from Node to stringified key than it is to go the other way
around, and you need the Node to do anything besides printing the
stringified key, so the shell/unixfs version has a better API and we
want to push people in that direction.  The shell/unixfs version also
uses our intended high-/low-level API distinction (core/... is for
low-level stuff) [1].  This commit starts the deprecation/migration
using the procedure outlined here [2].

[1]: ipfs#1158
[2]: ipfs#1159
wking added a commit to wking/go-ipfs that referenced this issue May 1, 2015
Starting to use the core/... (low-level, all the knobs you need)
shell/... (high-level, handle the common case easily) disctinction
laid out in [1].

Creating a file node from a reader is hard to do right, because
there's a lot of filesystem metadata that we don't have access to
(access mode, ownership, etc.).  You can guess at those based on the
adding process's umask, effective user, etc., but figuring out what
you want guessed at or what you want set explicitly, or whether you
want wrapping metadata at all is complicated.  This function isn't
going to do any of that [2], it's just a high-level wrapper to create
a minimal file object with the default chunking, pinning, etc. all
taken care of in ways that will probably work for you ;).

I'm not clear on where the 'unix' part of the name comes from (these
seem like pretty generic filesystem nodes to me, or if anything,
they're POSIX filesystem nodes), but:

On Wed, Apr 29, 2015 at 01:30:04PM -0700, Juan Batiz-Benet wrote [3]:
> > package fsnode
>
> i think this package should be called unixfs as that's the
> abstraction that this is calling to.

So that's what we're going with.

[1]: ipfs#1158
[2]: ipfs#1136 (comment)
[3]: ipfs#1136 (comment)
wking added a commit to wking/go-ipfs that referenced this issue May 1, 2015
Folks should be using the node-returning AddFromReader defined in
shell/unixfs instead, since that creates the same node but returns the
dag.Node object itself, instead of the stringified key.  It's cheaper
to go from Node to stringified key than it is to go the other way
around, and you need the Node to do anything besides printing the
stringified key, so the shell/unixfs version has a better API and we
want to push people in that direction.  The shell/unixfs version also
uses our intended high-/low-level API distinction (core/... is for
low-level stuff) [1].  This commit starts the deprecation/migration
using the procedure outlined here [2], with the API-release-notes
directory proposed here [3] and accepted here [4].

[1]: ipfs#1158
[2]: ipfs#1159
[3]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29379579
[4]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29498385
wking added a commit to wking/go-ipfs that referenced this issue May 2, 2015
wking added a commit to wking/go-ipfs that referenced this issue May 2, 2015
wking added a commit to wking/go-ipfs that referenced this issue May 2, 2015
Starting to use the core/... (low-level, all the knobs you need)
shell/... (high-level, handle the common case easily) disctinction
laid out in [1].

Creating a file node from a reader is hard to do right, because
there's a lot of filesystem metadata that we don't have access to
(access mode, ownership, etc.).  You can guess at those based on the
adding process's umask, effective user, etc., but figuring out what
you want guessed at or what you want set explicitly, or whether you
want wrapping metadata at all is complicated.  This function isn't
going to do any of that [2], it's just a high-level wrapper to create
a minimal file object with the default chunking, pinning, etc. all
taken care of in ways that will probably work for you ;).

I'm not clear on where the 'unix' part of the name comes from (these
seem like pretty generic filesystem nodes to me, or if anything,
they're POSIX filesystem nodes), but:

On Wed, Apr 29, 2015 at 01:30:04PM -0700, Juan Batiz-Benet wrote [3]:
> > package fsnode
>
> i think this package should be called unixfs as that's the
> abstraction that this is calling to.

So that's what we're going with.

[1]: ipfs#1158
[2]: ipfs#1136 (comment)
[3]: ipfs#1136 (comment)
wking added a commit to wking/go-ipfs that referenced this issue May 2, 2015
Folks should be using the node-returning AddFromReader defined in
shell/unixfs instead, since that creates the same node but returns the
dag.Node object itself, instead of the stringified key.  It's cheaper
to go from Node to stringified key than it is to go the other way
around, and you need the Node to do anything besides printing the
stringified key, so the shell/unixfs version has a better API and we
want to push people in that direction.  The shell/unixfs version also
uses our intended high-/low-level API distinction (core/... is for
low-level stuff) [1].  This commit starts the deprecation/migration
using the procedure outlined here [2], with the API-release-notes
directory proposed here [3] and accepted here [4].

[1]: ipfs#1158
[2]: ipfs#1159
[3]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29379579
[4]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29498385
@wking
Copy link
Contributor Author

wking commented May 2, 2015 via email

@jbenet
Copy link
Member

jbenet commented May 2, 2015

this is good enough for now

@jbenet jbenet closed this as completed May 2, 2015
wking added a commit to wking/go-ipfs that referenced this issue May 2, 2015
Starting to use the core/... (low-level, all the knobs you need)
shell/... (high-level, handle the common case easily) disctinction
laid out in [1].

Creating a file node from a reader is hard to do right, because
there's a lot of filesystem metadata that we don't have access to
(access mode, ownership, etc.).  You can guess at those based on the
adding process's umask, effective user, etc., but figuring out what
you want guessed at or what you want set explicitly, or whether you
want wrapping metadata at all is complicated.  This function isn't
going to do any of that [2], it's just a high-level wrapper to create
a minimal file object with the default chunking, pinning, etc. all
taken care of in ways that will probably work for you ;).

I'm not clear on where the 'unix' part of the name comes from (these
seem like pretty generic filesystem nodes to me, or if anything,
they're POSIX filesystem nodes), but:

On Wed, Apr 29, 2015 at 01:30:04PM -0700, Juan Batiz-Benet wrote [3]:
> > package fsnode
>
> i think this package should be called unixfs as that's the
> abstraction that this is calling to.

So that's what we're going with.

[1]: ipfs#1158
[2]: ipfs#1136 (comment)
[3]: ipfs#1136 (comment)
wking added a commit to wking/go-ipfs that referenced this issue May 2, 2015
Folks should be using the node-returning AddFromReader defined in
shell/unixfs instead, since that creates the same node but returns the
dag.Node object itself, instead of the stringified key.  It's cheaper
to go from Node to stringified key than it is to go the other way
around, and you need the Node to do anything besides printing the
stringified key, so the shell/unixfs version has a better API and we
want to push people in that direction.  The shell/unixfs version also
uses our intended high-/low-level API distinction (core/... is for
low-level stuff) [1].  This commit starts the deprecation/migration
using the procedure outlined here [2], with the API-release-notes
directory proposed here [3] and accepted here [4].

[1]: ipfs#1158
[2]: ipfs#1159
[3]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29379579
[4]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29498385
wking added a commit to wking/go-ipfs that referenced this issue May 4, 2015
Starting to use the core/... (low-level, all the knobs you need)
shell/... (high-level, handle the common case easily) disctinction
laid out in [1].

Creating a file node from a reader is hard to do right, because
there's a lot of filesystem metadata that we don't have access to
(access mode, ownership, etc.).  You can guess at those based on the
adding process's umask, effective user, etc., but figuring out what
you want guessed at or what you want set explicitly, or whether you
want wrapping metadata at all is complicated.  This function isn't
going to do any of that [2], it's just a high-level wrapper to create
a minimal file object with the default chunking, pinning, etc. all
taken care of in ways that will probably work for you ;).

I'm not clear on where the 'unix' part of the name comes from (these
seem like pretty generic filesystem nodes to me, or if anything,
they're POSIX filesystem nodes), but:

On Wed, Apr 29, 2015 at 01:30:04PM -0700, Juan Batiz-Benet wrote [3]:
> > package fsnode
>
> i think this package should be called unixfs as that's the
> abstraction that this is calling to.

So that's what we're going with.

[1]: ipfs#1158
[2]: ipfs#1136 (comment)
[3]: ipfs#1136 (comment)
wking added a commit to wking/go-ipfs that referenced this issue May 4, 2015
Folks should be using the node-returning AddFromReader defined in
shell/unixfs instead, since that creates the same node but returns the
dag.Node object itself, instead of the stringified key.  It's cheaper
to go from Node to stringified key than it is to go the other way
around, and you need the Node to do anything besides printing the
stringified key, so the shell/unixfs version has a better API and we
want to push people in that direction.  The shell/unixfs version also
uses our intended high-/low-level API distinction (core/... is for
low-level stuff) [1].  This commit starts the deprecation/migration
using the procedure outlined here [2], with the API-release-notes
directory proposed here [3] and accepted here [4].

[1]: ipfs#1158
[2]: ipfs#1159
[3]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29379579
[4]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29498385
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants