Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

spec: Rename app name to image name. #397

Merged
merged 1 commit into from
May 21, 2015
Merged

Conversation

yifan-gu
Copy link
Contributor

@yifan-gu yifan-gu commented May 7, 2015

Use app name in this section seems a little bit out of tune to me. How about changing it to image name?

/cc @jonboulle @philips

@jonboulle
Copy link
Contributor

I think by and large this makes sense. One critical omission here: the "apps" field in the "dependencies" list.

@yifan-gu
Copy link
Contributor Author

yifan-gu commented May 8, 2015

Updated.

@@ -447,10 +447,10 @@ When evaluating `ac-discovery` tags, the client MUST first ensure that the prefi

```bash
urltmpl="https://{name}-{version}-{os}-{arch}.{ext}"
curl $(echo "$urltmpl" | sed -e "s/{name}/$appname/" -e "s/{version}/$version/" -e "s/{os}/$os/" -e "s/{arch}/$arch/" -e "s/{ext}/$ext/")
curl $(echo "$urltmpl" | sed -e "s/{name}/$imgname/" -e "s/{version}/$version/" -e "s/{os}/$os/" -e "s/{arch}/$arch/" -e "s/{ext}/$ext/")
Copy link
Contributor

Choose a reason for hiding this comment

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

This should just be name, I think, not sure why it was appname in the first place?

@jonboulle
Copy link
Contributor

@yifan-gu sorry, while you're in there..

@yifan-gu yifan-gu force-pushed the discovery branch 3 times, most recently from 870aa4f to f8b6eea Compare May 8, 2015 02:07
@yifan-gu
Copy link
Contributor Author

yifan-gu commented May 8, 2015

@jonboulle NW. Updated again.

These attributes are expressed in the **labels** field of the [Image Manifest](#image-manifest-schema).
App Container Image Discovery prescribes a discovery process to retrieve an image based on the name and these attributes.


Copy link
Contributor

Choose a reason for hiding this comment

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

superfluous newline

@jonboulle
Copy link
Contributor

@yifan-gu Spec change lgtm. Please update the schema alongside this, sorry I forgot to mention that earlier...
https://github.com/appc/spec/blob/master/schema/types/dependencies.go

@yifan-gu
Copy link
Contributor Author

yifan-gu commented May 8, 2015

@jonboulle Then I found we need to change a bunch of places as well.... I have changed all the appearances of ImageID. PTAL.

@jonboulle
Copy link
Contributor

/cc @krobertson any thoughts on this?

@krobertson
Copy link
Member

LGTM, make more sense than "app name".

@@ -762,8 +764,8 @@ JSON Schema for the Image Manifest (app image manifest, ACI manifest), conformin
* **count** (integer, optional, defaults to 1) specifies a range of ports, starting with "port" and ending with "port" + "count" - 1.
* **socketActivated** (boolean, optional, defaults to "false" if unsupplied) if set to true, the application expects to be [socket activated](http://www.freedesktop.org/software/systemd/man/sd_listen_fds.html) on these ports. The ACE must pass file descriptors using the [socket activation protocol](http://www.freedesktop.org/software/systemd/man/sd_listen_fds.html) that are listening on these ports when starting this app. If multiple apps in the same pod are using socket activation then the ACE must match the sockets to the correct apps using getsockopt() and getsockname().
* **dependencies** (list of objects, optional) dependent application images that need to be placed down into the rootfs before the files from this image (if any). The ordering is significant. See [Dependency Matching](#dependency-matching) for how dependencies are retrieved.
* **app** (string, required) name of the dependent App Container Image.
* **imageID** (string of type [Image ID](#image-id-type), optional) content hash of the dependency. If provided, the retrieved dependency must match the hash. This can be used to produce deterministic, repeatable builds of an App Image that has dependencies.
* **name** (string of type [AC Name](#ac-name-type), required) name of the dependent App Container Image.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would prefer to see this as "image". "name" seems to always be confusing because it is often ambiguous as to whether it is a reference to something else, or the name of the object itself (in this case, the name of the dependency).

Copy link
Contributor

Choose a reason for hiding this comment

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

@cdaylward my initial argument in favour of name would be that it is a key reference. But on thinking about it further it seems like:
a) this field should be optional; one might desire a deterministic set of dependencies (i.e. only referencing by ID) and the name field is not then strictly necessary (provided of course the implementation supports lookups based on ID alone)
b) a qualified imageName / imageID might be preferable since these are not actually image objects (rather, dependency objects)

@yifan-gu thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonboulle
For a), if the user also specifies the labels, then we can identify the image deterministically, no? My previous understanding on this is that sha512 is more for machine than for human.

For b), I agree that they are not image objects by definition, but they are still describing images. If that's pretty clear to user, or if images are the dependency object, then I think removing the 'image' part is OK. Furthermore, maybe we can call it "required images" instead of dependencies?

Copy link
Contributor

Choose a reason for hiding this comment

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

@yifan-gu There is nothing to guarantee that labels are deterministic, no. They should be, but we can't mandate it without having a centralised repository.

Copy link
Contributor

Choose a reason for hiding this comment

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

lets see, the content addressed iD presently implies a tar archive, which is an ACI archive.
"Dependencies" could be clarified a bit as "Required Images". This is a common pattern picked up in other packaging formats like RPM ("Requires").

Is there any other type of dependency besides images?

Copy link
Contributor

Choose a reason for hiding this comment

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

@vbatts

Is there any other type of dependency besides images?

Nope.

I'm sympathetic to "required images".

@philips
Copy link
Contributor

philips commented May 15, 2015

lgtm, overall. I will let @jonboulle resolve the image/name discussion with @cdaylward and @yifan-gu

@yifan-gu
Copy link
Contributor Author

@jonboulle I am ok with imageName, imageID, (do we need to change to imageLabels as well)?

"app": "example.com/reduce-worker-base",
"imageID": "sha512-...",
"name": "example.com/reduce-worker-base",
"id": "sha512-...",
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps this ID need a more generic name. It is defined as Image ID, but could likely be CAS ID or similar

Copy link
Contributor

Choose a reason for hiding this comment

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

@vbatts I don't really follow, how does this relate to the discussion below?

Copy link
Contributor

Choose a reason for hiding this comment

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

dropping this to ID here seems too terse. UUID is an ID as well, but that is not what is meant here. Sorry if it's off-topic, it just seems a little too terse. Like the next step would be to loosen up the requirement to be Image ID formatted.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's revert this to "imageID". Right now it does mean something rather strict. If we want to loosen the requirement we can address that separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, I already started down this path but forgot to put up a PR - jonboulle@e343fa9

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonboulle That looks good. You can send as a PR so I can close this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NV, Let me just pull from you commit

@jonboulle jonboulle mentioned this pull request May 18, 2015
@yifan-gu yifan-gu force-pushed the discovery branch 2 times, most recently from e343fa9 to 3496fda Compare May 20, 2015 21:47
@yifan-gu
Copy link
Contributor Author

Keeps the imageID, and change app to imageName.

@jonboulle
Copy link
Contributor

@yifan-gu I don't think you just pulled my commit - the build is broken now :/

Also rename dependency.App to dependency.imageName.
@yifan-gu
Copy link
Contributor Author

@jonboulle I did, and squashed the commits. For some reason we forgot this line :(
https://github.com/jonboulle/spec/blob/jon-imgname/pkg/acirenderer/acirenderer_test.go#L866

Now it's fixed

@jonboulle
Copy link
Contributor

LGTM. Thanks.

jonboulle added a commit that referenced this pull request May 21, 2015
spec: Rename app name to image name.
@jonboulle jonboulle merged commit 52efa17 into appc:master May 21, 2015
@yifan-gu yifan-gu deleted the discovery branch May 21, 2015 17:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants