Skip to content

Commit

Permalink
Try workaround missing Docker Compose v1 in hosted runners
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlock committed Apr 3, 2024
1 parent 2d8755a commit e4b0775
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .azure-pipelines/steps/run-snapshot-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ parameters:
type: string
default: ''

- name: 'dockerComposePath'
type: string
default: ''

steps:
- bash: |
echo "##vso[task.setvariable variable=TOKEN]$(System.JobId)"
Expand Down Expand Up @@ -102,6 +106,7 @@ steps:
dockerComposeCommand: logs $(TEST_AGENT_TARGET)
projectName: ddtrace_$(Build.BuildNumber)
dockerComposeFile: $(COMPOSE_PATH)
dockerComposePath: ${{ parameters.dockerComposePath }}
env:
DD_LOGGER_DD_API_KEY: ${{ parameters.apiKey }}
condition: succeededOrFailed()
Expand All @@ -114,6 +119,7 @@ steps:
dockerComposeCommand: down
projectName: ddtrace_$(Build.BuildNumber)
dockerComposeFile: $(COMPOSE_PATH)
dockerComposePath: ${{ parameters.dockerComposePath }}
env:
DD_LOGGER_DD_API_KEY: ${{ parameters.apiKey }}
condition: succeededOrFailed()
Expand Down
86 changes: 86 additions & 0 deletions .azure-pipelines/ultimate-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4649,6 +4649,19 @@ stages:
vmImage: ubuntu-latest

steps:
# Install docker-compose v1
# https://github.com/microsoft/azure-pipelines-tasks/issues/19711
# We can't use docker-compose v2 universally yet (our custom runners and the DockerCompose@0 task don't support it)
- 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
- template: steps/clone-repo.yml
parameters:
targetShaId: $(targetShaId)
Expand Down Expand Up @@ -4700,6 +4713,8 @@ stages:
parameters:
target: 'dd-dotnet-smoke-tests'
snapshotPrefix: "smoke_test"
dockerComposePath: '/home/vsts/.docker/cli-plugins/docker-compose'

- publish: tracer/build_data
artifact: _$(System.StageName)_$(Agent.JobName)_logs_$(System.JobAttempt)
condition: succeededOrFailed()
Expand Down Expand Up @@ -4733,6 +4748,19 @@ stages:
vmImage: ubuntu-latest

steps:
# Install docker-compose v1
# https://github.com/microsoft/azure-pipelines-tasks/issues/19711
# We can't use docker-compose v2 universally yet (our custom runners and the DockerCompose@0 task don't support it)
- 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
- template: steps/clone-repo.yml
parameters:
targetShaId: $(targetShaId)
Expand Down Expand Up @@ -4785,6 +4813,7 @@ stages:
parameters:
target: 'dd-dotnet-chiseled-smoke-tests'
snapshotPrefix: "smoke_test"
dockerComposePath: '/home/vsts/.docker/cli-plugins/docker-compose'

- publish: tracer/build_data
artifact: _$(System.StageName)_$(Agent.JobName)_logs_$(System.JobAttempt)
Expand Down Expand Up @@ -4812,6 +4841,19 @@ stages:
vmImage: ubuntu-latest

steps:
# Install docker-compose v1
# https://github.com/microsoft/azure-pipelines-tasks/issues/19711
# We can't use docker-compose v2 universally yet (our custom runners and the DockerCompose@0 task don't support it)
- 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
- template: steps/clone-repo.yml
parameters:
targetShaId: $(targetShaId)
Expand Down Expand Up @@ -4851,6 +4893,7 @@ stages:
parameters:
target: 'nuget-smoke-tests'
snapshotPrefix: "smoke_test"
dockerComposePath: '/home/vsts/.docker/cli-plugins/docker-compose'

- script: |
docker-compose -p ddtrace_$(Build.BuildNumber) build \
Expand All @@ -4869,6 +4912,7 @@ stages:
parameters:
target: 'nuget-dddotnet-smoke-tests'
snapshotPrefix: "smoke_test"
dockerComposePath: '/home/vsts/.docker/cli-plugins/docker-compose'

- publish: tracer/build_data
artifact: _$(System.StageName)_$(Agent.JobName)_logs_$(System.JobAttempt)
Expand Down Expand Up @@ -4902,6 +4946,19 @@ stages:
vmImage: ubuntu-latest

steps:
# Install docker-compose v1
# https://github.com/microsoft/azure-pipelines-tasks/issues/19711
# We can't use docker-compose v2 universally yet (our custom runners and the DockerCompose@0 task don't support it)
- 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
- template: steps/clone-repo.yml
parameters:
targetShaId: $(targetShaId)
Expand Down Expand Up @@ -4933,6 +4990,7 @@ stages:
parameters:
target: 'dotnet-tool-nuget-smoke-tests'
snapshotPrefix: "smoke_test"
dockerComposePath: '/home/vsts/.docker/cli-plugins/docker-compose'

- publish: tracer/build_data
artifact: _$(System.StageName)_$(Agent.JobName)_logs_$(System.JobAttempt)
Expand Down Expand Up @@ -4966,6 +5024,19 @@ stages:
vmImage: ubuntu-latest

steps:
# Install docker-compose v1
# https://github.com/microsoft/azure-pipelines-tasks/issues/19711
# We can't use docker-compose v2 universally yet (our custom runners and the DockerCompose@0 task don't support it)
- 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
- template: steps/clone-repo.yml
parameters:
targetShaId: $(targetShaId)
Expand Down Expand Up @@ -5001,6 +5072,7 @@ stages:
parameters:
target: 'dotnet-tool-smoke-tests'
snapshotPrefix: "smoke_test"
dockerComposePath: '/home/vsts/.docker/cli-plugins/docker-compose'

- publish: tracer/build_data
artifact: _$(System.StageName)_$(Agent.JobName)_logs_$(System.JobAttempt)
Expand Down Expand Up @@ -5038,6 +5110,19 @@ stages:
vmImage: ubuntu-latest

steps:
# Install docker-compose v1
# https://github.com/microsoft/azure-pipelines-tasks/issues/19711
# We can't use docker-compose v2 universally yet (our custom runners and the DockerCompose@0 task don't support it)
- 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
- template: steps/clone-repo.yml
parameters:
targetShaId: $(targetShaId)
Expand Down Expand Up @@ -5079,6 +5164,7 @@ stages:
parameters:
target: 'dotnet-tool-self-instrument-smoke-tests'
snapshotPrefix: "smoke_test"
dockerComposePath: '/home/vsts/.docker/cli-plugins/docker-compose'

- publish: tracer/build_data
artifact: _$(System.StageName)_$(Agent.JobName)_logs_$(System.JobAttempt)
Expand Down

0 comments on commit e4b0775

Please sign in to comment.