anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: hpcaitech/colossalai
Issue: [BUG]: [chat] Unable to run train_prompts.sh by single card

### 🐛 Describe the bug

Missing definition for prompt_sampler and pretrain_sampler in `examples/train_prompts.py` when dist.get_world_size() == 1.

### Environment

_No response_

Changed files:
applications/Chat/examples/train_prompts.py

diff --git a/applications/Chat/examples/train_prompts.py b/applications/Chat/examples/train_prompts.py
index 5ded6d84..2086ff00 100644
--- a/applications/Chat/examples/train_prompts.py
+++ b/applications/Chat/examples/train_prompts.py
@@ -8,7 +8,7 @@ from coati.models.bloom import BLOOMRM, BLOOMActor, BLOOMCritic
 from coati.models.gpt import GPTRM, GPTActor, GPTCritic
 from coati.models.llama import LlamaActor, LlamaCritic, LlamaRM
 from coati.models.opt import OPTRM, OPTActor, OPTCritic
-from coati.models.roberta import RoBERTaRM, RoBERTaActor, RoBERTaCritic
+from coati.models.roberta import RoBERTaActor, RoBERTaCritic, RoBERTaRM
 from coati.trainer import PPOTrainer
 from coati.trainer.strategies import ColossalAIStrategy, DDPStrategy, NaiveStrategy
 from coati.utils import prepare_llama_tokenizer_and_embedding
@@ -143,6 +143,8 @@ def main(args):
     prompt_dataset = PromptDataset(tokenizer=tokenizer, data_path=args.prompt_path, max_datasets_size=16384)
     if dist.is_initialized() and dist.get_world_size() > 1:
         prompt_sampler = DistributedSampler(prompt_dataset, shuffle=True, seed=42, drop_last=True)
+    else:
+        prompt_sampler = None
     prompt_dataloader = DataLoader(prompt_dataset,
                                    shuffle=(prompt_sampler is None),
                                    sampler=prompt_sampler,
@@ -151,6 +153,8 @@ def main(args):
     pretrain_dataset = SupervisedDataset(tokenizer=tokenizer, data_path=args.pretrain_dataset, max_datasets_size=16384)
     if dist.is_initialized() and dist.get_world_size() > 1:
         pretrain_sampler = DistributedSampler(pretrain_dataset, shuffle=True, seed=42, drop_last=True)
+    else:
+        pretrain_sampler = None
     pretrain_dataloader = DataLoader(pretrain_dataset,
                                      shuffle=(pretrain_sampler is None),
                                      sampler=pretrain_sampler,
Repository: docker/compose
Issue: docker-compose exec: v1.28 started showing "ERROR: <retval>" on exec error

## Description of the issue

If you have a running docker-compose project and do an exec to it and the exec fails, you get extraneous output "ERROR: <returnval>" that didn't use to be there. The return value of docker-compose is set correctly.

For example, use `docker-compose up` with this docker-compose.yaml:
```
version: "3.6"
services:
  mariadb:
    image: mariadb:10.3
    environment:
      - MYSQL_ROOT_PASSWORD=junker99
```

Now create a simple error with `docker-compose exec mariadb bash -c 'ls | grep nothing'`
```
$ docker-compose exec mariadb bash -c 'ls | grep nothing'
ERROR: 1
$ echo $?
1
```

That "ERROR: 1" looks like it's an inadvertent piece of debugging code left in perhaps? It wasn't there in docker-compose before v1.28 - I went back and tried the old versions.

## Context information (for bug reports)

**Output of `docker-compose version`**
```
$ docker-compose version
docker-compose version 1.28.5, build c4eb3a1f
docker-py version: 4.4.4
CPython version: 3.9.0
OpenSSL version: OpenSSL 1.1.1h  22 Sep 2020
```

**Output of `docker version`**
```
$ docker version
Client: Docker Engine - Community
 Cloud integration: 1.0.9
 Version:           20.10.3
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        48d30b5
 Built:             Fri Jan 29 14:28:27 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.3
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       46229ca
  Built:            Fri Jan 29 14:31:38 2021
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
```

**Output of `docker-compose config`**
(Make sure to add the relevant `-f` and other flags)

```
services:
  mariadb:
    environment:
      MYSQL_ROOT_PASSWORD: junker99
    image: mariadb:10.3
version: '3.6'

```




Changed files:
compose/cli/main.py

diff --git a/compose/cli/main.py b/compose/cli/main.py
index 33c2ba8c..ea82dd11 100644
--- a/compose/cli/main.py
+++ b/compose/cli/main.py
@@ -137,7 +137,7 @@ def get_filtered_args(args):
 
 
 def exit_with_metrics(command, log_msg=None, status=Status.SUCCESS, exit_code=1):
-    if log_msg:
+    if log_msg and command != 'exec':
         if not exit_code:
             log.info(log_msg)
         else:
Repository: docker/compose
Issue: "docker-compose logs" should not fail if not specifying directly the service with non-readable logging driver

<!--
Welcome to the docker-compose issue tracker! Before creating an issue, please heed the following:

1. This tracker should only be used to report bugs and request features / enhancements to docker-compose
    - For questions and general support, use https://forums.docker.com
    - For documentation issues, use https://github.com/docker/docker.github.io
    - For issues with the `docker stack` commands and the version 3 of the Compose file, use
      https://github.com/docker/cli
2. Use the search function before creating a new issue. Duplicates will be closed and directed to
   the original discussion.
3. When making a bug report, make sure you provide all required information. The easier it is for
   maintainers to reproduce, the faster it'll be fixed.
-->

## Description of the issue

This is an usability issue. After https://github.com/docker/compose/pull/8082, running `docker-compose logs` will quit with `ERROR: configured logging driver does not support reading`, if any of the services has `logging.driver: none`. I would expect:

+  `docker-compose logs` (without service name) to automatically ignore those containers (like `docker-compose up`), possibly showing a warning instead of error.
+ `docker-compose logs service-name` will fail if the service has `logging.driver: none`

## Context information (for bug reports)

**Output of `docker-compose version`**
```
docker-compose version 1.28.3, build 14736152
```

**Output of `docker version`**
```
Docker version 20.10.3, build 48d30b5
```

**Output of `docker-compose config`**
```
services:
  nginx:
    image: openresty/openresty:alpine
    logging:
        driver: 'none'
  echo:
    image: node:alpine
    command: [npx, http-echo-server]
```


## Steps to reproduce the issue

1. Run `docker-compose up -d`
2. Run `docker-compose logs -f`
3.

### Observed result

```
Attaching to test-project_nginx_1, test-project_echo_1
ERROR: configured logging driver does not support reading
```

### Expected result

docker-compose can attach to logs of `echo` service, ignoring `nginx` service.


Changed files:
compose/cli/main.py

diff --git a/compose/cli/main.py b/compose/cli/main.py
index 53c9c42b..494e8562 100644
--- a/compose/cli/main.py
+++ b/compose/cli/main.py
@@ -1482,7 +1482,7 @@ def log_printer_from_project(
         keep_prefix=True,
 ):
     return LogPrinter(
-        containers,
+        [c for c in containers if c.log_driver not in (None, 'none')],
         build_log_presenters(project.service_names, monochrome, keep_prefix),
         event_stream or project.events(),
         cascade_stop=cascade_stop,
Repository: docker/compose
Issue: Annoying warning message

Since #7978, an annoying info messages is displayed eveytime docker-compose is being used.

While the intent is praiseworthy, the consequences are pretty annoying. It would have been better to have a message only being displayed on the first subsequent launch after update.

Is there a way to deactivate this message now polluting *every* us of the tool?

Changed files:
compose/project.py

diff --git a/compose/project.py b/compose/project.py
index 0f112c9c..e862464d 100644
--- a/compose/project.py
+++ b/compose/project.py
@@ -490,8 +490,6 @@ class Project:
                 log.info('%s uses an image, skipping' % service.name)
 
         if cli:
-            log.info("Building with native build. Learn about native build in Compose here: "
-                     "https://docs.docker.com/go/compose-native-build/")
             if parallel_build:
                 log.warning("Flag '--parallel' is ignored when building with "
                             "COMPOSE_DOCKER_CLI_BUILD=1")
@@ -651,10 +649,6 @@ class Project:
            override_options=None,
            ):
 
-        if cli:
-            log.info("Building with native build. Learn about native build in Compose here: "
-                     "https://docs.docker.com/go/compose-native-build/")
-
         self.initialize()
         if not ignore_orphans:
             self.find_orphan_containers(remove_orphans)