skip to Main Content

My Azure DevOps Pipeine getting below warning:

##[warning]Task 'Amazon ECR Push' version 1 (ECRPushImage@1) is dependent on a Node version (10) that is end-of-life. Contact the extension owner for an updated version of the task. Task maintainers should review Node upgrade guidance: https://aka.ms/node-runner-guidance

My Pipeline tasks:

     - task: AWSShellScript@1
     displayName: Docker build ${{ appService.name }}
      inputs:
        regionName: '${{ parameters.ecrRegion }}'
        scriptType: 'inline'
        inlineScript: |
          aws ecr get-login-password --region ${{ parameters.ecrRegion }}| docker login --username AWS --password-stdin $(ecrURL)
          echo -e "FROM ${{ parameters.openJDKImage }} nRUN mkdir /artifact && apk add openssl nCOPY ${{ appService.name }}-$(JAR_SNAPSHOT_VERSION).jar /artifact/service.jar nCMD ["/bin/sh", "-c", "java -jar /artifact/service.jar"]" > Dockerfile | docker build . -t $(ecrURL)/${{ appService.ecrRepo }}:$(VERSION)-$(COMMIT)
        disableAutoCwd: true
        workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: ECRPushImage@1
        displayName: Push ${{ appService.name }} image to DEV ECR
        inputs:
          regionName: '${{ parameters.ecrRegion }}'
          sourceImageName: '$(ecrURL)/${{ appService.ecrRepo }}'
          sourceImageTag: '$(VERSION)-$(COMMIT)'
          repositoryName: '${{ appService.ecrRepo }}'
          pushTag: '$(VERSION)-$(COMMIT)'
          outputVariable: '$(ecrURL)/${{ appService.ecrRepo }}:$(VERSION)-$(COMMIT)'

We are using Azure DevOps default agents for pipeline runs.
i also tried to update the task to 2 but its not working.

Pls any one have the information, let me know.

2

Answers


  1. @brucewayne

    The warning error you are seeing is a known issue with the AWS Toolkit for Azure DevOps extension and you can follow discussions: ECRPushImage warning in Azure Devops due to Node10 dependency

    ##[warning]Task ‘Amazon ECR Push’ version 1 (ECRPushImage@1) is dependent on a Node version (10) that is end-of-life. Contact the extension owner for an updated version of the task. Task maintainers should review Node upgrade guidance: https://aka.ms/node-runner-guidance

    If this becomes a significant problem, consider using alternative tasks, such as Bash@3 and Docker@2 and avoid using tasks from the extension, while this is been fixed.

    I have tried a simple pipeline with Docker task:
    The full yaml file is here: https://github.com/iheanacho-chukwu/aks-hellowebapi/blob/deploy-to-ecr/docker-task-aws.yml

    - script: |
        echo "Logging in to AWS ECR"
        aws ecr get-login-password --region $(AWS_REGION) | docker login --username AWS --password-stdin $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com
      displayName: 'Login to AWS'
      env:
        AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
        AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
    
    - task: Docker@2
      displayName: Build and Push Docker Image
      inputs:
        repository: $(DOCKER_REPOSITORY)
        command: buildAndPush
        Dockerfile: Dockerfile
        tags: |
          $(TAG)
    

    enter image description here
    another one using entirely bash: https://github.com/iheanacho-chukwu/aks-hellowebapi/blob/deploy-to-ecr/push-docker-image-ecr-using-bash.yml

    - script: |
        echo "Logging in to AWS ECR"
        aws ecr get-login-password --region $(AWS_REGION) | docker login --username AWS --password-stdin $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com
      displayName: 'Login to AWS'
      env:
        AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
        AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
    
    - script: |
        docker build -t $(DOCKER_REPOSITORY):$(TAG) .
        docker tag $(DOCKER_REPOSITORY):$(TAG) $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com/$(DOCKER_REPOSITORY_NAME):$(TAG)
        docker push $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com/$(DOCKER_REPOSITORY_NAME):$(TAG)
      displayName: 'Build and Push Docker Image using Bash Script'
      env:
        AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
        AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
    

    I passed my AWS credential as Azure DevOps variable group, so I dont have to hardcode to repo.

    enter image description here

    Login or Signup to reply.
  2. Azure DevOps already posted the announce about Remove Node 6 and Node 10 runners from Microsoft-hosted agents in 2022.
    enter image description here

    As mentioned by @nacho, this is a known issue in AWS. AWS is working on migrating to Node 16.

    I like to acknowledge that we are aware of this problem. In our past attempts to address this, we got blocked by a shelljs related JS bundler issue which prevented us from updating azure-pipelines-task-lib. We are looking into this again and will post an update once we have more information.

    This is the extension published by AWS and haven’t been fixed. Based on the current situation, I would suggest you use AWS CLI in the pipeline directly instead of using the extension.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search