CircleCI-Public / aws-cli-orb

Install and configure the AWS command-line interface (awscli)
https://circleci.com/orbs/registry/orb/circleci/aws-cli
MIT License
58 stars 51 forks source link

Node missing in v4.0.0 #135

Closed ryanwalters closed 1 year ago

ryanwalters commented 1 year ago

After upgrading from circleci/aws-cli@3.1.5 to circleci/aws-cli@4.0.0, builds are failing.

config.yml snippet:

version: 2.1
orbs:
  aws-cli: circleci/aws-cli@4.0.0

jobs:
  build-and-deploy: &build-and-deploy
    executor: aws-cli/default
    steps:
      - checkout
      - run: node --version
      - run: python --version
      - aws-cli/install
      - aws-cli/setup
      ...

Error message:

#!/bin/bash -eo pipefail
node --version
/bin/bash: line 1: node: command not found

Exited with code exit status 127
CircleCI received exit code 127
batovpasha commented 1 year ago

@ryanwalters Hi! Facing the same issue. It's because in the v4.0.0 aws-cli/default executor has switched from the cimg/python(with default tag 3.9-node) image to the cimg/base which doesn't have node pre-installed. I couldn't find a cimg/base tag that includes node.js, so the possible solution is to add the node install command to your job.

batovpasha commented 1 year ago

@brivu Hello! Maybe it would be better to update the aws-cli/default executor description "Highly cached minimal Ubuntu docker designed for CircleCI with Python and NodeJS installed." cause currently it doesn't have NodeJS installed?

brivu commented 1 year ago

@batovpasha, thanks for the catching that. I'll make the changes.

I'm huddling up with the team to see if we can add a node executor as well since so many folks seem to be using it.

batovpasha commented 1 year ago

@brivu thank you for looking. Are there any considerations for returning to the cimg/python base image with the 3.9-node default tag?

brivu commented 1 year ago

Hey everyone!

After consulting with the team, we're going to keep the default executor using the cimg/base docker image as it's the most widely used.

As a work around, you can define an executor with the executor key in your config.yml file.

For example, in @ryanwalters's case you can do:

executors:
  node:
    docker:
      - image: cimg/node:20.3.0

and the job would look like this:

version: 2.1
orbs:
  aws-cli: circleci/aws-cli@4.0.0
**executors:
  node:
    docker:
      - image: cimg/node:20.3.0**
jobs:
  build-and-deploy: &build-and-deploy
    executor: **node**
    steps:
      - checkout
      - run: node --version
      - run: python --version
      - aws-cli/install
      - aws-cli/setup
      ...

@batovpasha - in your case you can define the executor in your config like below:

executors:
  python-node:
    docker:
      - image: cimg/python:3.0-node

For reference, you can find information on all of our images here including tags and variants here: https://circleci.com/developer/images

Hope that helps!

batovpasha commented 1 year ago

@brivu Nice, thanks for help!