amazon-ecs-cli icon indicating copy to clipboard operation
amazon-ecs-cli copied to clipboard

warning not relevant: Skipping unsupported YAML option for service... option name=build

Open diablodale opened this issue 6 years ago • 4 comments

Summary

ecs-cli compose service up, ecs-cli compose create, and perhaps other commands used with service in docker-compose.yml having build section, causes irrelevant warning to appear

WARN[0000] Skipping unsupported YAML option for service...  option name=build service name=myservice

This warning is not relevant to the command compose service up or ecs-cli compose create. Only warnings that are relevant to the command being used should appear. As in life, the context in which a communication occurs is of most importance. It is distracting to provide warning feedback when the context has nothing to do with the warning.

Setup

Ubuntu 18.04.3 LTS on x86_64 ecs-cli version 1.16.0 (5c02c34) GO is not installed.

Config files

docker-compose.yml

version: '2'
services:
  myservice:
    build:
      context: .
      dockerfile: myservice.dockerfile
    image: myservice
    read_only: true
    hostname: myservice

ecs-params.yml

(blank)

Expected Behavior

No warnings about a build section. Since ecs-cli does not support a build command, then this warning should never appear in any scenario of ecs-cli.

Observed Behavior

WARN[0000] Skipping unsupported YAML option for service...  option name=build service name=myservice

diablodale avatar Sep 26 '19 13:09 diablodale

In balance, a warning also appears when docker-compose.yml has a services: with a value network_mode: bridge. Such a value is needed to simulate/align local testing of containers. Of course, such a value can also be put into a separate dc.yml file and the two merged together using two --file options for local and not merged for deploy to EC2-ECS.

For this value, it is relevant since the command is compose service up. I would lean towards keeping this warning since it is ?helpfully? warning that given the command, a relevant section/value is being skipped.

diablodale avatar Sep 30 '19 09:09 diablodale

Hi @diablodale thanks for opening this issue! The intent of these warnings was to inform customers the fact that ECS CLI (regardless of which subcommand) is being used with a Docker compose file which contains unsupported fields to the ECS service.

It might be helpful to think of this as a warning that some (helpful) compilers may generate when you declare an unused variable instead of something that only gets printed out when you provide a specific flag to your compiler. Closing for now, feel free to reopen if you wish to discuss further.

hencrice avatar Sep 30 '19 23:09 hencrice

I understand the good intention to help, yet that should be balanced with what seems (to me) overhelping.

I'm not expecting ecs-cli to be as flexible as a 20 year-seasoned compiler. Still, using your example... compilers do not issue warnings for code that it doesn't compile. For example, preprocessor #ifdef and a matching -D aka command aka context will cause whole sections of code to be skipped and therefore warnings/errors in that code will not be displayed. Compiler warning levels can be changed and/or pragmas can ignore specific lines of code.

This seems to me a P3 (nice to have) changeset topic, so I'm ok to stop our discussion at this point. There are workarounds (grep -v ecs-cli output, separate docker-compile files, etc.). Perhaps, please keep this topic in mind as future toolsets/features are made.

diablodale avatar Oct 01 '19 08:10 diablodale

Ah that makes sense! Thanks for the feedback on (potentially overly verbose) help messages.

hencrice avatar Oct 01 '19 20:10 hencrice