Originate / exosphere

A modern cloud-based micro-service framework
MIT License
17 stars 6 forks source link

simplify output #699

Closed charlierudolph closed 7 years ago

charlierudolph commented 7 years ago

Stop parsing the docker compose output and instead just output it directly. With #698, we shouldn't be injecting any more output into the docker-compose up process.

For other processes, like exo clean and exo deploy, output the child command directly (this will probably mean stop using go-execplus) and instead only add banner rows to signify that something is being run.

This may result in a complete removal of the logger.

@alexdavid @hugobho please review

hugoesthere commented 7 years ago

I think we'll still need to logger for logging things like exo clean removing test containers or something, we can simply pipe the docker-compose output to the logger without parsing it.

This might mess up the indentation though - I'm not sure how important that is.

charlierudolph commented 7 years ago

That would be a banner row to me which separates calls to child processes). Another example would be for exo run which has four sections docker-compose pull, docker-compose build, docker-compose up, and docker-compose down

charlierudolph commented 7 years ago

See printHeader in src/cmd/template for an example of what I am considering a banner row

charlierudolph commented 7 years ago

For breaking this up lets do this one command at a time.

Pass in an io.Writer instead of a logger and use fmt.Fprint and assign child process stdout / stderr to it

hugoesthere commented 7 years ago

When you say pipe the output directly do you mean use this simplified logger which takes in io.Writer and uses fmt.Fprint?

charlierudolph commented 7 years ago

For pipe the output directly I mean we will switch from using go-execplus and instead be using the ordinary exec. When you create a Cmd instance, you can assign as io.Writer to Stdout and Stderr https://golang.org/pkg/os/exec/#Cmd

hugoesthere commented 7 years ago

When do we decide to switch from go-execplus to exec? Didn't we mostly use go-execplus for monitoring online text? Does that mean we won't need go-execplus either?

charlierudolph commented 7 years ago

I don't think we'll need go-execplus in the source code anymore, but will continue to use it in the exosphere tests. Please start with exo clean / exo deploy since those don't touch online text. Lets not cleanup the output in exo run / exo test until #698 is done

charlierudolph commented 7 years ago

698 is done. In reference to how to deal with the tests waiting for text, check out the docker-compose up cli option: --abort-on-container-exit https://docs.docker.com/compose/reference/up/. That way we let up run until the test container exits and thus can pipe all output directly to stdout