|
| 1 | +# Copyright 2024 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +substitutions: |
| 16 | + _GCSFUSE_VERSION: 'master' |
| 17 | + _GO_VERSION: '1.25.0' |
| 18 | + _UBUNTU_VERSION: '24.04' |
| 19 | + _REGISTRY: 'us-docker.pkg.dev' |
| 20 | + |
| 21 | +steps: |
| 22 | + # Set up buildx to use the docker-container driver, which is necessary for multi-platform builds. |
| 23 | + - name: 'gcr.io/cloud-builders/docker' |
| 24 | + id: 'buildx-setup' |
| 25 | + args: |
| 26 | + - 'buildx' |
| 27 | + - 'create' |
| 28 | + - '--use' |
| 29 | + - '--name' |
| 30 | + - 'multi-platform-builder' |
| 31 | + - '--driver' |
| 32 | + - 'docker-container' |
| 33 | + |
| 34 | + # Build and push the base image for both amd64 and arm64. |
| 35 | + - name: 'gcr.io/cloud-builders/docker' |
| 36 | + id: 'base' |
| 37 | + waitFor: ['buildx-setup'] |
| 38 | + args: |
| 39 | + - 'buildx' |
| 40 | + - 'build' |
| 41 | + - '--push' |
| 42 | + - '-f' |
| 43 | + - 'gcsfuse-perf-base.docker' |
| 44 | + - '--platform' |
| 45 | + - 'linux/amd64,linux/arm64' |
| 46 | + - '--build-arg' |
| 47 | + - 'GCSFUSE_VERSION=${_GCSFUSE_VERSION}' |
| 48 | + - '--build-arg' |
| 49 | + - 'GO_VERSION=${_GO_VERSION}' |
| 50 | + - '--build-arg' |
| 51 | + - 'UBUNTU_VERSION=${_UBUNTU_VERSION}' |
| 52 | + - '-t' |
| 53 | + - '${_REGISTRY}/gcs-fuse-test/gcsfuse-benchmarks/gcsfuse-${_GCSFUSE_VERSION}-perf-base:latest' |
| 54 | + - '.' |
| 55 | + |
| 56 | + # Build and push the read-benchmark image. |
| 57 | + - name: 'gcr.io/cloud-builders/docker' |
| 58 | + id: 'read-benchmark' |
| 59 | + waitFor: ['base'] |
| 60 | + args: |
| 61 | + - 'buildx' |
| 62 | + - 'build' |
| 63 | + - '--push' |
| 64 | + - '-f' |
| 65 | + - 'fio/read.dockerfile' |
| 66 | + - '--platform' |
| 67 | + - 'linux/amd64,linux/arm64' |
| 68 | + - '--build-arg' |
| 69 | + - 'GCSFUSE_VERSION=${_GCSFUSE_VERSION}' |
| 70 | + - '--build-arg' |
| 71 | + - 'GO_VERSION=${_GO_VERSION}' |
| 72 | + - '--build-arg' |
| 73 | + - 'UBUNTU_VERSION=${_UBUNTU_VERSION}' |
| 74 | + - '--build-arg' |
| 75 | + - 'REGISTRY=${_REGISTRY}' |
| 76 | + - '-t' |
| 77 | + - '${_REGISTRY}/gcs-fuse-test/gcsfuse-benchmarks/fio-read-benchmark-${_GCSFUSE_VERSION}:latest' |
| 78 | + - 'fio' |
| 79 | + |
| 80 | + # Build and push the write-benchmark image. |
| 81 | + - name: 'gcr.io/cloud-builders/docker' |
| 82 | + id: 'write-benchmark' |
| 83 | + waitFor: ['base'] |
| 84 | + args: |
| 85 | + - 'buildx' |
| 86 | + - 'build' |
| 87 | + - '--push' |
| 88 | + - '-f' |
| 89 | + - 'fio/write.dockerfile' |
| 90 | + - '--platform' |
| 91 | + - 'linux/amd64,linux/arm64' |
| 92 | + - '--build-arg' |
| 93 | + - 'GCSFUSE_VERSION=${_GCSFUSE_VERSION}' |
| 94 | + - '--build-arg' |
| 95 | + - 'GO_VERSION=${_GO_VERSION}' |
| 96 | + - '--build-arg' |
| 97 | + - 'UBUNTU_VERSION=${_UBUNTU_VERSION}' |
| 98 | + - '--build-arg' |
| 99 | + - 'REGISTRY=${_REGISTRY}' |
| 100 | + - '-t' |
| 101 | + - '${_REGISTRY}/gcs-fuse-test/gcsfuse-benchmarks/fio-write-benchmark-${_GCSFUSE_VERSION}:latest' |
| 102 | + - 'fio' |
| 103 | + |
| 104 | + # Build and push the fullsweep-benchmark image. |
| 105 | + - name: 'gcr.io/cloud-builders/docker' |
| 106 | + id: 'fullsweep-benchmark' |
| 107 | + waitFor: ['base'] |
| 108 | + args: |
| 109 | + - 'buildx' |
| 110 | + - 'build' |
| 111 | + - '--push' |
| 112 | + - '-f' |
| 113 | + - 'fio/fullsweep.dockerfile' |
| 114 | + - '--platform' |
| 115 | + - 'linux/amd64,linux/arm64' |
| 116 | + - '--build-arg' |
| 117 | + - 'GCSFUSE_VERSION=${_GCSFUSE_VERSION}' |
| 118 | + - '--build-arg' |
| 119 | + - 'GO_VERSION=${_GO_VERSION}' |
| 120 | + - '--build-arg' |
| 121 | + - 'UBUNTU_VERSION=${_UBUNTU_VERSION}' |
| 122 | + - '--build-arg' |
| 123 | + - 'REGISTRY=${_REGISTRY}' |
| 124 | + - '-t' |
| 125 | + - '${_REGISTRY}/gcs-fuse-test/gcsfuse-benchmarks/fio-fullsweep-benchmark-${_GCSFUSE_VERSION}:latest' |
| 126 | + - 'fio' |
| 127 | + |
| 128 | + # Build and push the orbax-benchmark image. |
| 129 | + - name: 'gcr.io/cloud-builders/docker' |
| 130 | + id: 'orbax-benchmark' |
| 131 | + waitFor: ['base'] |
| 132 | + args: |
| 133 | + - 'buildx' |
| 134 | + - 'build' |
| 135 | + - '--push' |
| 136 | + - '-f' |
| 137 | + - 'fio/orbax_emulated.dockerfile' |
| 138 | + - '--platform' |
| 139 | + - 'linux/amd64,linux/arm64' |
| 140 | + - '--build-arg' |
| 141 | + - 'GCSFUSE_VERSION=${_GCSFUSE_VERSION}' |
| 142 | + - '--build-arg' |
| 143 | + - 'GO_VERSION=${_GO_VERSION}' |
| 144 | + - '--build-arg' |
| 145 | + - 'UBUNTU_VERSION=${_UBUNTU_VERSION}' |
| 146 | + - '--build-arg' |
| 147 | + - 'REGISTRY=${_REGISTRY}' |
| 148 | + - '-t' |
| 149 | + - '${_REGISTRY}/gcs-fuse-test/gcsfuse-benchmarks/orbax-emulated-benchmark-${_GCSFUSE_VERSION}:latest' |
| 150 | + - 'fio' |
| 151 | + |
| 152 | +options: |
| 153 | + # Using a more powerful machine is recommended for multi-platform builds. |
| 154 | + machineType: 'E2_HIGHCPU_8' |
0 commit comments