Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions .azure-pipelines/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,31 @@ parameters:
displayName: "CI target"
type: string
default: bazel.release
- name: artifactSuffix
displayName: "Suffix of artifact"
type: string
default: ""
- name: rbe
displayName: "Enable RBE"
type: boolean
default: true
- name: managedAgent
type: boolean
default: true
- name: bazelBuildExtraOptions
type: string
default: "--flaky_test_attempts=2"

steps:
- task: CacheBeta@1
- task: Cache@2
inputs:
key: '"${{ parameters.ciTarget }}" | ./WORKSPACE | **/*.bzl'
path: $(Build.StagingDirectory)/repository_cache
continueOnError: true

- bash: .azure-pipelines/cleanup.sh
displayName: "Removing tools from agent"
condition: ${{ parameters.managedAgent }}

- bash: |
echo "disk space at beginning of build:"
Expand All @@ -26,18 +42,23 @@ steps:
}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
displayName: "Enable IPv6"
condition: ${{ parameters.managedAgent }}

- script: ci/run_envoy_docker.sh 'ci/do_ci.sh ${{ parameters.ciTarget }}'
workingDirectory: $(Build.SourcesDirectory)
env:
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
ENVOY_RBE: "true"
# Use https://docs.bazel.build/versions/master/command-line-reference.html#flag--experimental_repository_cache_hardlinks
# to save disk space.
BAZEL_BUILD_EXTRA_OPTIONS: "--config=remote-ci --jobs=$(RbeJobs) --curses=no --experimental_repository_cache_hardlinks"
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
${{ if parameters.rbe }}:
ENVOY_RBE: "1"
# Use https://docs.bazel.build/versions/master/command-line-reference.html#flag--experimental_repository_cache_hardlinks
# to save disk space.
BAZEL_BUILD_EXTRA_OPTIONS: "--config=remote-ci --jobs=$(RbeJobs) --curses=no --experimental_repository_cache_hardlinks ${{ parameters.bazelBuildExtraOptions }}"
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
${{ if eq(parameters.rbe, false) }}:
BAZEL_BUILD_EXTRA_OPTIONS: "--curses=no --experimental_repository_cache_hardlinks ${{ parameters.bazelBuildExtraOptions }}"

displayName: "Run CI script"

- bash: |
Expand Down
5 changes: 3 additions & 2 deletions .azure-pipelines/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
set -e

# Temporary script to remove tools from Azure pipelines agent to create more disk space room.
sudo apt-get -y update
sudo apt-get purge -y 'ghc-*' 'zulu-*-azure-jdk' 'libllvm*' 'mysql-*' 'dotnet-*' 'cpp-*'
sudo apt-get update -y
sudo apt-get purge -y --no-upgrade 'ghc-*' 'zulu-*-azure-jdk' 'libllvm*' 'mysql-*' 'dotnet-*' 'libgl1' \
'adoptopenjdk-*' 'azure-cli' 'google-chrome-stable' 'firefox' 'hhvm'

dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn
Loading