-
Notifications
You must be signed in to change notification settings - Fork 341
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
Integrate cml publish
with cml send-comment
#1026
Conversation
btw shouldn't |
@casperdcl, $ echo one > file
$ cml publish file
https://host/4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865
$ echo two > file
$ cml publish file
https://host/53c234e5e8472b6ac51c1ae1cab3fe06fad053beb8ebfd8977b010655bfdd3c3
$ echo two > file
$ cml publish file # same CONTENT, thus same URL
https://host/53c234e5e8472b6ac51c1ae1cab3fe06fad053beb8ebfd8977b010655bfdd3c3 Location-addressed storage is probably what you’re looking for with $ echo one > file
$ cml publish file
https://host/file
$ echo two > file
$ cml publish file
https://host/file
$ echo three > file
$ cml publish --update file # same PATH, thus same URL
https://host/file However, paths generated this second way are:
Footnotes
|
An intermediate solution to avoid clutter and preserve desirable properties of storage is:
|
I mean this: $ echo one > file
$ ONE_URL=$(cml publish file)
$ curl -I $ONE_URL | head -n1
HTTP/1.1 200 OK
$ echo two > file
$ TWO_URL=$(cml publish file)
warn: CML detected subsequent publish of same filename in same session. Deleting old file.
$ curl -I $TWO_URL | head -n1
HTTP/1.1 200 OK
$ curl -I $ONE_URL | head -n1
HTTP/1.1 404 Not Found To avoid us hosting 1M images per training run. |
Sounds like #1026 (comment)? |
Related to iterative/dvclive#91 (comment) |
30d35c0
to
eaf33bc
Compare
eaf33bc
to
85374e4
Compare
85374e4
to
88d15df
Compare
88d15df
to
869ad75
Compare
After #1026 (comment) and some other limitations1 of the file event interface, I wonder if this is the right approach to integrate CML with other tools. 🤔 Footnotes
|
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.
Code LGTM, functionality I'll defer to others. 😁 🥼
763b4ff
to
484143d
Compare
@iterative/cml, shall we merge this? |
}, | ||
triggerFile: { | ||
type: 'string', | ||
description: 'File used to trigger the watcher', |
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.
Trigger how?
description: 'File used to trigger the watcher', | |
description: 'If specified, --watch will trigger only when the lockfile is present, and will delete the lockfile', |
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.
Exactly as stated in the “using a trigger file” section on #1026 (comment)
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.
It's hard to describe in a help text. 😅
- Takes a path to a regular file that doesn't exist yet
- Creating a regular file in that path triggers an
--update
- Once the
--update
finishes, the file gets automatically deleted
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.
description: 'File used to trigger the watcher', | |
description: 'Path to the watcher trigger; create a file on that path to triger an update, then wait until the file disappears', |
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.
Need to do #762 before rewording this again :)
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.
update: If you'd prefer to do #762 immediately after this PR please do feel free to leave this unresolved here @0x2b3bfa0
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.
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.
Given that this is a hidden
option and we don't know if DVCLive is going to use it, I'd rather not care too much about rewording (?)
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.
resolving unresolved
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.
only had a super quick glance, just checking - is this "solution to avoid clutter and preserve desirable properties of storage" or equivalent implemented?
|
Use
npm install --global github:iterative/cml#7bd9257
to use this feature.Usage
When using locally (as opposed to running from CI/CD), provide also
--repo https://github.com/user/repository
,--token ghp_personal_access_token
and--commit-sha a1b2c3d
pointing to a commit on that repository, preferably part of an open pull request.Behavior
--publish
— uploads and replaces all the local paths onreport.md
(e.g. links & images)![description](outputs/plot.png)
becomes![description](https://assets.cml.dev/...)
--watch
— watchesreport.md
and all the local paths it containsExperimental
--trigger-file
— specify a trigger file with the same behavior as DVC checkpoint file-based API1--watch
Using a trigger file
Pending
report.md
doesn't yet exist when starting the watcherpaths
instead of pollingawaitWriteFinish
totrue
triggers infinitechange
events paulmillr/chokidar#1224Reverted
Questions
cml publish
directly after we implement this?Footnotes
As the DVC team may know, a file-based API needs synchronization to avoid all sorts of pitfalls; e.g. like lost events, rate limits, corrupted files... et cetera. This makes me question whether we should follow this approach or not. ↩ ↩2