CircleCI-Public / aws-ecs-orb

An orb that simplifies deployment to Amazon's Elastic Container Service (ECS). Supports both EC2 and Fargate launch types.
https://circleci.com/orbs/registry/orb/circleci/aws-ecs
MIT License
51 stars 80 forks source link

Tags variable usage missing $ #98

Closed alekhrycaiko closed 4 years ago

alekhrycaiko commented 4 years ago

Orb version

1.1.0

What happened

Trying to use aws-ecs-orb/update-service in order to perform an update-service on a blue-green deployment. But, I fail at the step when grabbing my previous task definition, e.g. of step name Retrieve previous task definition and prepare new task definition values

The error I get is

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help

Unknown options: --include, TAGS

The problem I'm now having, is when I look through the code for how this job is run; I'm left quite confused to the implementation of TAGS.

It's exported to an environment variable here: https://github.com/CircleCI-Public/aws-ecs-orb/blob/585892f8211e0082983a2b5c4f3da5ed843461f3/src/orb.yml.hbs#L740

But, the keyword TAGS is not used as an environment variable here (instead there's no $ usage). Example of that is here: https://github.com/CircleCI-Public/aws-ecs-orb/blob/585892f8211e0082983a2b5c4f3da5ed843461f3/src/orb.yml.hbs#L703

Expected behavior

Clarity around why my failure is happening, as I can't currently decipher it between the errors thrown, or the source code.

lokst commented 4 years ago

Hi @alekhrycaiko, the value of the TAGS environment variable is used to set the value of the CCI_ORB_AWS_ECS_TAGS environment variable which gets used subsequently. --include TAGS is an option for the aws command and is unrelated to the TAGS environment variable.

Could you share the version of the aws cli you are using? A possible cause could be that the version is too old to support the --include TAGS option.

alekhrycaiko commented 4 years ago

Oh interesting! I'm currently on version 0.1.13 for the CLI orb.

On Thu, Apr 23, 2020 at 11:48 AM Stella Lok notifications@github.com wrote:

Hi @alekhrycaiko https://github.com/alekhrycaiko, the value of the TAGS environment variable is used to set the value of the CCI_ORB_AWS_ECS_TAGS environment variable which gets used subsequently. --include TAGS is an option for the aws command and is unrelated to the TAGS environment variable.

Could you share the version of the aws cli you are using? A possible cause could be that the version is too old to support the --include TAGS option.

ā€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CircleCI-Public/aws-ecs-orb/issues/98#issuecomment-618587144, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3RWJ745ACTX35BSS7DECDROCERPANCNFSM4MPIQWUQ .

-- Alek Hrycaiko Lead Infrastructure Engineer Sokanu Interactive Inc.

lokst commented 4 years ago

@alekhrycaiko Thanks for sharing! I would recommend SSH-ing into a rerun of the job and running aws --version to check on the cli version installed as there can be circumstances in which a different aws cli is used (e.g. there is already one pre-installed in the image) If you could share a link to your job or what image is being used that would be helpful too!

alekhrycaiko commented 4 years ago

Thanks for the follow up @lokst! I appreciate the really prompt responses :bow:

The version is aws-cli/1.11.16 on the machine currently; I presume this is much out of date. Despite a reinstall of the cli with the latest orb, I wasn't able to proceed further.

However, I was able to unblock myself here by using deploy-service-update job instead of the update-service command. This worked without any complications, however, I was forced to regress some internal functionality on my end (which isn't super ideal either).

lokst commented 4 years ago

@alekhrycaiko Since the deploy-service-update job worked and the command didn't, it seems that the issue is with the version of the aws cli being used to execute the ecs commands.

It sounds like you are using the latest circleci/aws-cli orb on the machine executor, which comes with the aws cli pre-installed. The orb by default skips installation of the CLI if an existing CLI is detected. To force a reinstallation, I would recommend using the skip-install-check parameter as below:

- aws-cli/install:
     skip-install-check: true

Another thing that might resolve the issue is to use the latest version of the machine executor image which was just released (ubuntu-1604:202004-01), as it would have a newer version of the AWS CLI than the other machine executor images.

alekhrycaiko commented 4 years ago

Good to know, thanks @lokst I'll look into upgrading my machines to the latest ubuntu.

alekhrycaiko commented 4 years ago

Also, @lokst what do you think about adding a minimum viable AWS and Ubuntu version into the README docs? If what's uncovered is true, I'm sure this could happen to others down the line :thinking:

lokst commented 4 years ago

Also, @lokst what do you think about adding a minimum viable AWS and Ubuntu version into the README docs? If what's uncovered is true, I'm sure this could happen to others down the line šŸ¤”

That's a good idea! I filed an issue for it šŸ™‚

gmemstr commented 4 years ago

Considering this issue resolved, but feel free to reopen if I've misread!