Skip to content

Output image ID at end of build/push #804

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

Closed
wants to merge 1 commit into from

Conversation

bfirsh
Copy link
Member

@bfirsh bfirsh commented Nov 15, 2022

Also -- keep a handle on a unique image name during the build process to
avoid race conditions.

Closes #802

Also -- keep a handle on a unique image name during the build process to
avoid race conditions.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
@bfirsh bfirsh force-pushed the output-image-id-at-end-of-build branch from 6db6e0a to 22d5947 Compare November 15, 2022 22:15
@bfirsh bfirsh requested a review from zeke November 15, 2022 22:15
@bfirsh
Copy link
Member Author

bfirsh commented Nov 15, 2022

@zeke you might want test build and push still work as expected... I haven't fully tested this...

Also not sure if this is the only thing output on stdout. In theory should be, but we might need to clean up some other stuff. There is a test for cog predict that ensures that only output is output on stdout, which is kinda neat.

@zeke
Copy link
Member

zeke commented Nov 15, 2022

Works for me! Here's how I tested it:

~/git/replicate/cog output-image-id-at-end-of-build
$ make install
...
~/git/zeke/cog-haiku main
$ cog --version
cog version v0.4.4+dev (built 2022-11-15T15:11:30-0800)
~/git/zeke/cog-haiku main
$ cog push
Building Docker image from environment in cog.yaml as r8.im/zeke/haiku-standard...
...
4ed121b04368: Layer already exists 
d9d07d703dd5: Layer already exists 
latest: digest: sha256:8ab3c4ed267b3badd9ff4b638693a000a19800987a7d863007d5b44df89444c4 size: 3269
Image 'r8.im/zeke/haiku-standard' pushed

Run your model on Replicate:
    https://replicate.com/zeke/haiku-standard
sha256:795173aa5b619f9cdb69d32cd344986327cda5da2d295597ef33b16419128bdc
$ STDOUT=$(cog push)
...
$ echo $STDOUT | tail -n1 |  sed -e 's/sha256://'
91467606ad24771b3a9555f8a30028a6986334b09e0bc2134d70909e6e4550bf

@zeke zeke mentioned this pull request Nov 15, 2022
5 tasks
Copy link
Member

@zeke zeke left a comment

Choose a reason for hiding this comment

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

Tested. Works! Seem like we might want some docs for this?

If not, we can document it down the line with CLI docs. #433

@bfirsh
Copy link
Member Author

bfirsh commented Nov 15, 2022

This is not the only thing output on stdout -- we should fix that. We might also want to remove sha256: prefix.

@bfirsh
Copy link
Member Author

bfirsh commented Nov 16, 2022

Screenshot 2022-11-15 at 18 16 05

I don't think this does work -- wrong IDs.

@nickstenning
Copy link
Contributor

I guess we're abandoning this for now?

@mattt mattt deleted the output-image-id-at-end-of-build branch September 22, 2023 13:39
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

Successfully merging this pull request may close these issues.

getting the version ID after cog push
3 participants