Skip to content
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

[#6026] Added -q, --quiet option to 'up' and 'down' commands to suppress parallel stream messages. #6194

Closed
wants to merge 1 commit into from

Conversation

BEllis
Copy link

@BEllis BEllis commented Sep 14, 2018

Added -q, --quiet option to 'up' and 'down' commands to suppress parallel stream messages.

Resolves #6026

… suppress parallel stream messages.

Signed-off-by: Ben Ellis <ben.ellis@softweyr.co.uk>
@shin-
Copy link

shin- commented Sep 14, 2018

Thanks for the contribution @BEllis !
However, I would rather we fix --log-level to apply to everything Compose produces, rather than add more flags with overlapping functionality. I don't think this PR approaches the problem in the right way.

@BEllis
Copy link
Author

BEllis commented Sep 17, 2018

I did actually do that first, but then I thought it would cause side-effects for backwards compatibility.

I'm happy to change it back to take effect when logging-level < WARNING

@BEllis
Copy link
Author

BEllis commented Sep 17, 2018

I'll raise a separate PR with that approach.

@BEllis
Copy link
Author

BEllis commented Sep 24, 2018

Closing as superseded by #6217

@BEllis BEllis closed this Sep 24, 2018
pypt added a commit to mediacloud/docker-compose-just-quieter that referenced this pull request Nov 19, 2019
This Docker Compose CLI utility wrapper allows users to hide *Starting <...>* / *Stopping <...>* and similar messages from `docker-compose`'s output.

Docker Compose is overly verbose when starting containers for a service:

```bash
$ docker-compose --project-name test run --rm test_service bash
Creating network "test-bash_default" with the default driver
Creating test-bash_postgresql-server_1         ... done
Creating test-bash_solr-zookeeper_1            ... done
Creating test-bash_extract-article-from-page_1 ... done
Creating test-bash_rabbitmq-server_1           ... done
Creating test-bash_solr-shard-01_1             ... done
Creating test-bash_import-solr-data-for-testing_1 ... done

$ docker-compose --project-name test down --volumes
Stopping test-bash_import-solr-data-for-testing_1 ... done
Stopping test-bash_solr-shard-01_1                ... done
Stopping test-bash_postgresql-server_1            ... done
Stopping test-bash_solr-zookeeper_1               ... done
Stopping test-bash_extract-article-from-page_1    ... done
Stopping test-bash_rabbitmq-server_1              ... done
Removing test-bash_import-solr-data-for-testing_1 ... done
Removing test-bash_solr-shard-01_1                ... done
Removing test-bash_postgresql-server_1            ... done
Removing test-bash_solr-zookeeper_1               ... done
Removing test-bash_extract-article-from-page_1    ... done
Removing test-bash_rabbitmq-server_1              ... done
Removing network test-bash_default
```

Setting `--log-level` to `WARNING` doesn't seem to help, and multiple issues and PRs to address the issue have been unsuccessful so far:

* <docker/compose#6217>
* <docker/compose#6194>
* <docker/compose#6026>

This wrapper monkey-patches [`ParallelStreamWriter`](https://github.com/docker/compose/blob/master/compose/parallel.py#L259-L320) for it to take into account `--log-level` setting and make the output quieter, and then runs Compose's CLI normally.
pypt added a commit to mediacloud/backend that referenced this pull request Nov 19, 2019
Docker Compose is overly verbose when starting containers for a service:

```
$ docker-compose --project-name test run --rm test_service bash
Creating network "test-bash_default" with the default driver
Creating test-bash_postgresql-server_1         ... done
Creating test-bash_solr-zookeeper_1            ... done
Creating test-bash_extract-article-from-page_1 ... done
Creating test-bash_rabbitmq-server_1           ... done
Creating test-bash_solr-shard-01_1             ... done
Creating test-bash_import-solr-data-for-testing_1 ... done
```

Setting `--log-level` to `WARNING` doesn't seem to help, and multiple issues and PRs to address the issue have been unsuccessful so far:

* docker/compose#6217
* docker/compose#6194
* docker/compose#6026

So, use a wrapper for `docker-compose` that monkey-patches Docker Compose for it to respect `--log-level`.

The wrapper is basically this script:

https://github.com/docker/compose/blob/master/bin/docker-compose

with some extra sauce to shut up the extra verbose logging; that makes it 100% compatible with vanilla `docker-compose` utility.

Scripts under `./dev/` will run in "quiet mode" by default unless an extra `-v` (`--verbose`) flag gets passed, e.g.:

```
$ ./dev/run.py postgresql-server pwd
/
$
```

Wrapper itself is available as a separate repo as it's potentially useful to others and could count as one of our open-source projects:

https://github.com/berkmancenter/mediacloud-docker-compose-just-quieter
pypt added a commit to mediacloud/backend that referenced this pull request Nov 19, 2019
Docker Compose is overly verbose when starting containers for a service:

```
$ docker-compose --project-name test run --rm test_service bash
Creating network "test-bash_default" with the default driver
Creating test-bash_postgresql-server_1         ... done
Creating test-bash_solr-zookeeper_1            ... done
Creating test-bash_extract-article-from-page_1 ... done
Creating test-bash_rabbitmq-server_1           ... done
Creating test-bash_solr-shard-01_1             ... done
Creating test-bash_import-solr-data-for-testing_1 ... done
```

Setting `--log-level` to `WARNING` doesn't seem to help, and multiple issues and PRs to address the issue have been unsuccessful so far:

* docker/compose#6217
* docker/compose#6194
* docker/compose#6026

So, use a wrapper for `docker-compose` that monkey-patches Docker Compose for it to respect `--log-level`.

The wrapper is basically this script:

https://github.com/docker/compose/blob/master/bin/docker-compose

with some extra sauce to shut up the extra verbose logging; that makes it 100% compatible with vanilla `docker-compose` utility.

Scripts under `./dev/` will run in "quiet mode" by default unless an extra `-v` (`--verbose`) flag gets passed, e.g.:

```
$ ./dev/run.py postgresql-server pwd
/
$
```

Wrapper itself is available as a separate repo as it's potentially useful to others and could count as one of our open-source projects:

https://github.com/berkmancenter/mediacloud-docker-compose-just-quieter
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.

None yet

2 participants