Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: DockerCompose@0 no longer functions after removal of Docker Compose v1 from hosted agents. #19711

Closed
4 of 7 tasks
trs1991 opened this issue Apr 2, 2024 · 29 comments
Closed
4 of 7 tasks

Comments

@trs1991
Copy link

trs1991 commented Apr 2, 2024

New issue checklist

Task name

DockerCompose@0

Task version

0.231.0

Issue Description

Now that the removal of docker compose v1 has begun rolling out as per this GitHub issue

The dockercompose@0 task immediately fails with '##[error]Unhandled: Docker Compose was not found. You can provide the path to docker-compose via 'dockerComposePath' due to using the legacy docker-compose v1 command that no longer exists on the Microsoft hosted agents.

The task needs to be updated to use the newer 'docker compose' v2 command.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04, Ubuntu 20.04, Windows Server 2019, Windows Server 2022.

Relevant log output

2024-04-02T15:02:02.8114252Z ##[section]Starting: Build Next app container images
2024-04-02T15:02:02.8120854Z ==============================================================================
2024-04-02T15:02:02.8120983Z Task         : Docker Compose
2024-04-02T15:02:02.8121080Z Description  : Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.
2024-04-02T15:02:02.8121234Z Version      : 0.231.0
2024-04-02T15:02:02.8121300Z Author       : Microsoft Corporation
2024-04-02T15:02:02.8121407Z Help         : https://aka.ms/azpipes-docker-compose-tsg
2024-04-02T15:02:02.8121504Z ==============================================================================
2024-04-02T15:02:03.9655006Z ##[error]Unhandled: Docker Compose was not found. You can provide the path to docker-compose via 'dockerComposePath' 
2024-04-02T15:02:03.9669164Z ##[error]Error: Docker Compose was not found. You can provide the path to docker-compose via 'dockerComposePath' 
    at DockerComposeConnection.setDockerComposePath (/home/vsts/work/_tasks/DockerCompose_6975e2d1-96d3-4afc-8a41-498b5d34ea19/0.231.0/dockercomposeconnection.js:166:23)
    at new DockerComposeConnection (/home/vsts/work/_tasks/DockerCompose_6975e2d1-96d3-4afc-8a41-498b5d34ea19/0.231.0/dockercomposeconnection.js:22:14)
    at success (/home/vsts/work/_tasks/DockerCompose_6975e2d1-96d3-4afc-8a41-498b5d34ea19/0.231.0/dockercompose.js:35:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-04-02T15:02:03.9673048Z ##[section]Finishing: Build Next app container images

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

steps:
- task: DockerCompose@0
  displayName: 'Build container images'
  inputs:
    containerregistrytype: 'Azure Container Registry'
    action: Build services
    projectName: '$(DOCKER-IMAGE-NAME)'
    dockerComposeFile: docker-compose-ci.yml
    qualifyImageNames: true
    additionalImageTags: '$(DOCKER-IMAGE-TAG)'
    includeLatestTag: true
@cgraf-spiria
Copy link

As a workaround until the task is fixed, add this to the task's inputs:

dockerComposePath: '/usr/libexec/docker/cli-plugins/docker-compose'

Also see: #17808

@benlings
Copy link

benlings commented Apr 3, 2024

Docker Compose v2 is also much more strict with project names (eg cannot contain upper case characters), so this bug also needs to be addressed #16361

@fbuser1
Copy link

fbuser1 commented Apr 3, 2024

Wow, my entire company is blown away after this change 😡

Why didn't Microsoft issue any warnings months before the change? For example: 'This task will be deprecated, please migrate to docker-compose v2 before the 1st of April.'

Currently, I have to update about 500 microservices names from 'Company.Project.ServiceName' to 'company-project-servicename', which affects a lot of components/configs/DockerFiles entrypoints

There is my temporary workaround to download and use docker-compose v1:

  - task: Bash@3
    displayName: "Install docker-compose v1"
    inputs:
      targetType: 'inline'
      script: |
        DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
        mkdir -p $DOCKER_CONFIG/cli-plugins
        curl -SL https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
        chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

then add dockerComposePath to DockerCompose@0 task
dockerComposePath: '/home/vsts/.docker/cli-plugins/docker-compose'

@alpapad01
Copy link

docker-compose is deprecated. The functionality is provided by docker command itself. the command should be :

docker, with arguments compose ... rest of args

@laurencenairne-work
Copy link

@fbuser1, would this not solve the problem for you without needing to rename and repath everything?

@peruzzof
Copy link

peruzzof commented Apr 3, 2024

My company is facing the same. Could the task be adjusted to support docker compose v2?

@alpapad01
Copy link

This works:

dockerComposePath: '/usr/libexec/docker/cli-plugins/docker-compose'

that's the cli plugin, which the command "docker compose" would call. Apparently, it is a binary on its own.

Other options I guess, is to have a step to install the "old" docker-compose somewhere (download and install it) as shown above....

@Jacko1394
Copy link

docker-compose is deprecated. The functionality is provided by docker command itself.

So should we start using Docker@2 with command: 'compose'?

And stop using DockerCompose@0

@sandywangkpmg
Copy link

dockerComposePath: '/usr/libexec/docker/cli-plugins/docker-compose' - this is v2, after switching to this path, we started seeing intermittent failure on pulling base image.
image
then I checked the image, the v1 executable is still available just not included in the PATH.
So I changed to dockerComposePath: '/usr/local/bin/docker-compose', it's working for us now.

@SwapnaVersion1
Copy link

Can we have updates on this? As Docker@0 is deprecating in July. Can we start using Docker@2 in our ADO tasks?

@ashishbhatt-afk
Copy link

Can we have updates on this? As Docker@0 is deprecating in July. Can we start using Docker@2 in our ADO tasks?

There is no other version of the task other than 0. Am I missing something here?
image

@sandywangkpmg
Copy link

Can we have updates on this? As Docker@0 is deprecating in July. Can we start using Docker@2 in our ADO tasks?

There is no other version of the task other than 0. Am I missing something here? image

There is no DockerCompose@1 or @2 version, only @0 is available.
image
I think @Jacko1394 @SwapnaVersion1 were referring to Docker task, there are @0/1/2 versions for Docker task, but it does't look like compose is a supported command.
image

@trs1991
Copy link
Author

trs1991 commented Jun 7, 2024

Can we have updates on this? As Docker@0 is deprecating in July. Can we start using Docker@2 in our ADO tasks?

There is no other version of the task other than 0. Am I missing something here? image

There is no DockerCompose@1 or @2 version, only @0 is available. image I think @Jacko1394 @SwapnaVersion1 were referring to Docker task, there are @0/1/2 versions for Docker task, but it does't look like compose is a supported command. image

Yes that is the whole point of the original request, there is no DockerCompose@1/2, but since DockerCompose@0 is now deprecated, there is a need for it to be developed so that support for DockerCompose v2 and above can be implemented as DockerCompose v1 has been removed from hosted agents.

@SwapnaVersion1
Copy link

What is the work-around? Our organisation pipelines would fail after July once @1 docker compose is deprecated.

@sandywangkpmg
Copy link

Can we have updates on this? As Docker@0 is deprecating in July. Can we start using Docker@2 in our ADO tasks?

There is no other version of the task other than 0. Am I missing something here? image

There is no DockerCompose@1 or @2 version, only @0 is available. image I think @Jacko1394 @SwapnaVersion1 were referring to Docker task, there are @0/1/2 versions for Docker task, but it does't look like compose is a supported command. image

Yes that is the whole point of the original request, there is no DockerCompose@1/2, but since DockerCompose@0 is now deprecated, there is a need for it to be developed so that support for DockerCompose v2 and above can be implemented as DockerCompose v1 has been removed from hosted agents.

yep, I understood the point of this issue. I was just answering @ashishbhatt-afk's question.
And pointing out Docker@0/1/2 don't have compose command, so using Docker task is no help.

@sandywangkpmg
Copy link

What is the work-around? Our organisation pipelines would fail after July once @1 docker compose is deprecated.

@SwapnaVersion1 You can use this workaround, it worked for us.
#19711 (comment)

Bear in mind, make sure you have put depends_on when there is dependent image in your docker compose yaml file, otherwise, you would be seeing the error we were seeing due to docker compose v2 is building images in parallel.

dockerComposePath: '/usr/libexec/docker/cli-plugins/docker-compose' - this is v2, after switching to this path, we started seeing intermittent failure on pulling base image. image then I checked the image, the v1 executable is still available just not included in the PATH. So I changed to dockerComposePath: '/usr/local/bin/docker-compose', it's working for us now.

@alec-pinson
Copy link

We started getting the following error for windows yesterday/day before:-

Starting: Build Docker Image
==============================================================================
Task         : Docker Compose
Description  : Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.
Version      : 0.240.2
Author       : Microsoft Corporation
Help         : https://aka.ms/azpipes-docker-compose-tsg
==============================================================================
##[error]The process 'C:\Windows\system32\docker.exe' failed with exit code 15

fix was again the dockerComposePath

dockerComposePath: C:\ProgramData\docker-compose\docker-compose.exe

@sandywangkpmg
Copy link

we noticed the behavior of dockercompose@0 change too in our ubuntu agent.
The default path for docker compose is changed to version 2 after the latest runner-images rolled out. We had to put some fix into docker compose yaml due to the behavior change.
And they are going to deprecate v1 again in 9th July.
actions/runner-images#9692

@sandywangkpmg
Copy link

Saw this message appeared in console output from yesterday.
We've set the dockerComposePath to use V2, to avoid surprise during the removal of v1 executable.
##[warning]The task is utilizing Docker Compose V1, but there are plans to transition to Docker Compose V2. It's necessary to investigate how to adapt your project to Docker Compose V2. For guidance on this migration, you can refer to the official Docker Compose documentation at the provided link: https://docs.docker.com/compose/migrate/

@TripleEmcoder
Copy link

TripleEmcoder commented Jul 4, 2024

Oh my, what a fine job at change management and versioning we have here 🤡

The DockerCompose@0 task is deprecated. The task uses docker-compose v1 which no longer receives update since July 2023. To use docker compose v2, use the DockerCompose@1 task.

That would be reasonable, if not for the fact that none of the message is true, in fact it is wrong in two separate ways:

  • there is no DockerCompose@1 task published in DevOps at the moment at all and work on it according to code in this repository started only a week ago
  • DockerCompose@0 already silently switched from docker-compose (v1) to docker compose (v2) breaking a whole lot of existing pipelines

Well, at least today it happened with a small increment in the task's version number (0.242.0 to 0.242.8), which is a slight improvement over two weeks ago when the new behavior hit without any warning under an unchanged version number (0.240.2) and stayed there for ca. 24 h until it was rolled back as silently as it was introduced.

@sandywangkpmg
Copy link

Oh my, what a fine job at change management and versioning we have here 🤡

The DockerCompose@0 task is deprecated. The task uses docker-compose v1 which no longer receives update since July 2023. To use docker compose v2, use the DockerCompose@1 task.

That would be reasonable, if not for the fact that none of the message is true, in fact it is wrong in two separate ways:

  • there is no DockerCompose@1 task published in DevOps at the moment at all and work on it according to code in this repository started only a week ago
  • DockerCompose@0 already silently switched from docker-compose (v1) to docker compose (v2) breaking a whole lot of existing pipelines

Well, at least today it happened with a small increment in the task's version number (0.242.0 to 0.242.8), which is a slight improvement over two weeks ago when the new behavior hit without any warning under an unchanged version number (0.240.2) and stayed there for ca. 24 h until it was rolled back as silently as it was introduced.

Yeah, we felt the pain too. Too many main stream changes all rushed in around the same time. V1 executable will be gone from MS hosted agent on 9th July, now DockerCompose@0 will be removed (below message is from the task output)

image

but yet, DockerCompose@1 isn't made official yet (there was a commit to master branch 3 days ago d8e6a2e)
image

@sandywangkpmg
Copy link

#20085 This is the ticket to add DockerComposeV1, I left a message there.

@sandywangkpmg
Copy link

ok, turned out DockerCompose@1 task was released but the commit 3 days ago didn't include docs change.
I just tested using DockerCompose@1 in my pipeline and it worked. No more warning message.
And the task version number is 1.242.1
image

@sandywangkpmg
Copy link

sandywangkpmg commented Jul 5, 2024

ok, just learnt that docker compose v1 executable will be removed on 29th July, giving people time to migration to DockerCompose@1 before @0 gets removed on 24th July, I suppose. It makes sense to redundant devops task before removing the executable, not the other way around.

image

@ivanduplenskikh
Copy link
Contributor

@sandywangkpmg, @TripleEmcoder, I would like to clarify what is happening here.
Initially, we planned to migrate DockerComposeV0 task to the docker compose CLI v2 but there were problems with project names due to constraints for a project name.
After that we released the DockerComposeV1 task that uses the docker compose CLI v2, but the DockerComposeV0 task has been rolled back to the docker-compose CLI v1.
I agree that was a little messed up and we had a small amount of time to inform users about the new major version of the task. Now we have the mention only in the release notes but I hope that we see an updated documentation about DockerComposeV1 soon.
Thanks for understanding.

Related to the tasks changes:
As I mentioned above, the DockerComposeV0 task is using compose v1 (if compose v1 is not found the task switches to compose v2) and the DockerComposeV1 task is using compose v2.
If you want to use compose v1 in the DockerCompose after it will be removed from the images you can refer to the instructions that helps you to use compose v1 with the DockerComposeV0 task.

@merovingio96
Copy link

merovingio96 commented Jul 24, 2024

Hi everyone!

In my department we have experienced an issue related with the DockerCompose@1 task. The last week we changed pipeline tasks related with te build and push to ACR images, using the DockerCompose@1.

We changed our services docker-compose.yml in order to omit the "version" statement" and begin directly with the service statements.

But we encountered this message from pipeline:
##[error]time="2024-07-24T13:40:37Z" level=warning msg="/home/vsts/agents/3.241.0/.docker-compose.1721828409324.yml: version is obsolete"

And the docker-compose.yml seems like this:
image

What are we missing up?

Edit (2024-07-24 16:05)
It seems like task is not using the selected docker-compose.yml that can be selected
image

@trs1991
Copy link
Author

trs1991 commented Jul 24, 2024

Hi everyone!

In my department we have experienced an issue related with the DockerCompose@1 task. The last week we changed pipeline tasks related with te build and push to ACR images, using the DockerCompose@1.

We changed our services docker-compose.yml in order to omit the "version" statement" and begin directly with the service statements.

But we encountered this message from pipeline: ##[error]time="2024-07-24T13:40:37Z" level=warning msg="/home/vsts/agents/3.241.0/.docker-compose.1721828409324.yml: version is obsolete"

And the docker-compose.yml seems like this: image

What are we missing up?

You're not missing anything, the DockerCompose tasks add in their own docker compose files by default as extra compose files, the task owner would need to update these to also omit the version statements.

@merovingio96
Copy link

Hi everyone!
In my department we have experienced an issue related with the DockerCompose@1 task. The last week we changed pipeline tasks related with te build and push to ACR images, using the DockerCompose@1.
We changed our services docker-compose.yml in order to omit the "version" statement" and begin directly with the service statements.
But we encountered this message from pipeline: ##[error]time="2024-07-24T13:40:37Z" level=warning msg="/home/vsts/agents/3.241.0/.docker-compose.1721828409324.yml: version is obsolete"
And the docker-compose.yml seems like this: image
What are we missing up?

You're not missing anything, the DockerCompose tasks add in their own docker compose files by default as extra compose files, the task owner would need to update these to also omit the version statements.

Hi @trs1991! We are using the classic editor (please take a look the image in edit of my last message). How we can achieve omit or prevent DockerCompose task add its own docker compose files?

Thanks in advance

@trs1991
Copy link
Author

trs1991 commented Jul 24, 2024

Hi everyone!
In my department we have experienced an issue related with the DockerCompose@1 task. The last week we changed pipeline tasks related with te build and push to ACR images, using the DockerCompose@1.
We changed our services docker-compose.yml in order to omit the "version" statement" and begin directly with the service statements.
But we encountered this message from pipeline: ##[error]time="2024-07-24T13:40:37Z" level=warning msg="/home/vsts/agents/3.241.0/.docker-compose.1721828409324.yml: version is obsolete"
And the docker-compose.yml seems like this: image
What are we missing up?

You're not missing anything, the DockerCompose tasks add in their own docker compose files by default as extra compose files, the task owner would need to update these to also omit the version statements.

Hi @trs1991! We are using the classic editor (please take a look the image in edit of my last message). How we can achieve omit or prevent DockerCompose task add its own docker compose files?

Thanks in advance

The short answer is you can't. It's only a warning anyway and won't stop your compose files from building correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests