Repository navigation
Unify commands and centralize logging - #703
Conversation
33bcce6 to
91ea5c9
Compare
DavidGOrtega
left a comment
There was a problem hiding this comment.
Very nice!!!! 🚀
I think that we could do another iteration.
- Args mostly repeats --repo --token etc...
- I would put everything under CML.js exporting the parameters
What do you think?
DavidGOrtega
left a comment
There was a problem hiding this comment.
Also, winston should cover every log, we do not have to it here but would be awesome if we do not forget a technical debt ticket
Yes, #22 states that we should «change every |
Yes, I'm leaving that for another pull request, but we could move all the common arguments to the top level |
I would rather separate the command–line interface from |
Thats what I say, ideally we just only need one cli file if we expose the ARGS the CML.js module. |
Ooops! My bad, I thought you mean Yes, we could move all the commands to the latter instead of having separate files, but I still would prefer to keep separate files for each subcommand; it feels cleaner to me. Nevertheless, we could extract the common options to |
91ea5c9 to
8c1e5dc
Compare
8c1e5dc to
26be40d
Compare
casperdcl
left a comment
There was a problem hiding this comment.
would've been better to split into separate PRs but whatever
| # COMMAND | ||
| ENV IN_DOCKER=1 | ||
| CMD ["cml-runner"] | ||
| CMD ["cml"] |
There was a problem hiding this comment.
perhaps something like this?
| CMD ["cml"] | |
| ENTRYPOINT ["/usr/bin/cml"] | |
| CMD ["runner"] |
There was a problem hiding this comment.
Absolutely for using ENTRYPOINT as the entry point. 💯 Absolutely not for using runner as the default command; it doesn't make any sense (to my mind) and that behavior is not even documented.
There was a problem hiding this comment.
| CMD ["cml"] | |
| ENTRYPOINT ["/usr/bin/cml"] |
There was a problem hiding this comment.
sure but one thing to note is pple who were overriding CMD with e.g. /bin/bash will now get an error. They'll have to switch to using --entrypoint /bin/bash instead.
There was a problem hiding this comment.
docker run iterativeai/cml cml publish # CMD
docker run iterativeai/cml publish # ENTRYPOINTThere was a problem hiding this comment.
I fiind this better:
docker run iterativeai/cml cml publish # CMD
than this:
docker exec myimage sh -c nvidia-smi
There was a problem hiding this comment.
Why not have the best of both worlds?
docker run iterativeai/cml publish
docker run iterativeai/cml nvidia-smiThere was a problem hiding this comment.
I think that a536f07 is misleading. cml does not support those commands, how is the user going to guess that docker hack? He is not be able to do that with standalone CML.
I do not think is is a good change. What do you think @casperdcl ?
|
not worth the effort now :) |
26be40d to
540d16e
Compare
540d16e to
afa0f3d
Compare
afa0f3d to
8b0c76a
Compare
Co-authored-by: Helio Machado <[email protected]>
3756e81 to
e27d337
Compare
|
@0x2b3bfa0 I'll leave you to open follow up issue(s)/epics |
|
I was doing exactly that 😄 |
|
To be honest, I do not consider the docker issue fixed to have merged this. |
…-termination * Port all the changes over #703
Changes
Fixes Better logging #22 by using
winstonas a logging library instead of manually monkey–patching and aliasingconsole.logandconsole.errorto custom identifiers. Running commands on a TTY will print colorized, human readable logs; other scenarios (like piping) will produce machine-readable JSONL like in theghcommand-line tool. Now there is a single exception handler common for all the command-line interface, eliminating all the duplicate code and delegating the exception formatting on the logging library.Fixes Unify commands under a single entry point #699 by moving all the separate commands until a single command named
cmland setting up aliases for backwards comaptibility.Partially fixes (this is not a closing keyword) Add documentation links and helpful descriptions to error messages #606, but needs additional work from the documentation side so we can link it from the error messages.
Introduces automatic environment variable processing with
yargs.envsocml --long-option=valueis equivalent toCML_LONG_OPTION=value cmlwithout any maintenance overhead.Introduces plugin support, allowing executables on the
PATHto be called as subcommands from the newcmlcommand; e.g. callingcml somethingwill try to find and executecml-somethingif it's in your path. As inghextensions, external commands can't override internal ones under any circumstance.Removes the default
CMDon our container images (was set tocml-runnerfor no apparent reason) and sets a smartENTRYPOINTthat interprets unknown commands ascmlcommands. It didn't make too much sense to favor a tool over the rest and have seven similar ways of checking the installed CML version.Fixes an appearance of Tests hang forever #694 caused by an infinite loop on
pipe-args.jsthat doesn't break when there is no piped data;fs.readSyncthrowsEAGAINbut it was being silently ignored.Follow-ups
pinoinstead ofwinstonfor logging #709Note: this time I am erring on the opposite side and packing many loosely related changes together, because shipping them separately would involve lots of intermediate commits with useless, hand-tailored workarounds to keep everything working until the next one.