| 1 | name: Build and test image |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | workflow_dispatch: |
| 6 | |
| 7 | concurrency: |
| 8 | group: falkordb-node-branch-${{ github.ref_name }} |
| 9 | cancel-in-progress: false |
| 10 | |
| 11 | env: |
| 12 | NODE_IMAGE_NAME: falkordb-node |
| 13 | CLUSTER_IMAGE_NAME: falkordb-cluster |
| 14 | CLUSTER_REBALANCE_IMAGE_NAME: falkordb-cluster-rebalance |
| 15 | FALKORDB_VERSION: v4.2.1 |
| 16 | FREE_PLAN_NAME: free-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 17 | PRO_PLAN_NAME: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 18 | |
| 19 | jobs: |
| 20 | build-and-push: |
| 21 | runs-on: ubuntu-latest |
| 22 | strategy: |
| 23 | fail-fast: true |
| 24 | matrix: |
| 25 | include: |
| 26 | - dockerfile: ./falkordb-node/Dockerfile |
| 27 | image-name: falkordb-node |
| 28 | - dockerfile: ./falkordb-cluster/Dockerfile |
| 29 | image-name: falkordb-cluster |
| 30 | - dockerfile: ./falkordb-cluster-rebalance/Dockerfile |
| 31 | image-name: falkordb-cluster-rebalance |
| 32 | steps: |
| 33 | - name: Checkout |
| 34 | uses: actions/checkout@v4 |
| 35 | |
| 36 | - name: Set up Docker Buildx |
| 37 | uses: docker/setup-buildx-action@v3 |
| 38 | |
| 39 | - name: Login to Docker Hub |
| 40 | uses: docker/login-action@v3 |
| 41 | with: |
| 42 | username: ${{ secrets.DOCKER_USERNAME }} |
| 43 | password: ${{ secrets.DOCKER_PASSWORD }} |
| 44 | |
| 45 | - name: Build and push |
| 46 | uses: docker/build-push-action@v6 |
| 47 | with: |
| 48 | build-args: FALKORDB_VERSION=${{ env.FALKORDB_VERSION }} |
| 49 | context: . |
| 50 | file: ${{ matrix.dockerfile }} |
| 51 | push: true |
| 52 | tags: falkordb/${{ matrix.image-name }}:dev-${{ github.event.head_commit.id }} |
| 53 | |
| 54 | omnistrate-update-plans: |
| 55 | needs: build-and-push |
| 56 | runs-on: ubuntu-latest |
| 57 | strategy: |
| 58 | fail-fast: false |
| 59 | max-parallel: 1 |
| 60 | matrix: |
| 61 | plans: |
| 62 | - service-name: FalkorDB |
| 63 | plan-name: FalkorDB Free |
| 64 | file: omnistrate.free.yaml |
| 65 | key: free |
| 66 | tier-name: free-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 67 | - service-name: FalkorDB |
| 68 | plan-name: FalkorDB Pro |
| 69 | file: omnistrate.pro.yaml |
| 70 | key: pro |
| 71 | tier-name: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 72 | steps: |
| 73 | - name: Checkout |
| 74 | uses: actions/checkout@v4 |
| 75 | |
| 76 | - name: Replace Variables |
| 77 | run: | |
| 78 | sed -i 's/$GcpProjectId/${{ vars.GCP_PROJECT_ID }}/g' ${{ matrix.plans.file }} |
| 79 | sed -i 's/$GcpProjectNumber/${{ vars.GCP_PROJECT_NUMBER }}/g' ${{ matrix.plans.file }} |
| 80 | sed -i 's/$GcpServiceAccountEmail/${{ vars.GCP_SERVICE_ACCOUNT_EMAIL }}/g' ${{ matrix.plans.file }} |
| 81 | sed -i 's/$AwsAccountId/${{ vars.AWS_ACCOUNT_ID }}/g' ${{ matrix.plans.file }} |
| 82 | sed -i 's|$AwsBootstrapRoleAccountArn|${{ vars.AWS_BOOTSTRAP_ROLE_ACCOUNT_ARN }}|g' ${{ matrix.plans.file }} |
| 83 | sed -i 's/$FalkorDBNodeImage/falkordb\/${{ env.NODE_IMAGE_NAME }}:dev-${{ github.event.head_commit.id }}/g' ${{ matrix.plans.file }} |
| 84 | sed -i 's/$FalkorDBClusterImage/falkordb\/${{ env.CLUSTER_IMAGE_NAME }}:dev-${{ github.event.head_commit.id }}/g' ${{ matrix.plans.file }} |
| 85 | sed -i 's/$FalkorDBClusterRebalanceImage/falkordb\/${{ env.CLUSTER_REBALANCE_IMAGE_NAME }}:dev-${{ github.event.head_commit.id }}/g' ${{ matrix.plans.file }} |
| 86 | sed -i 's/${{ matrix.plans.plan-name }}/${{ matrix.plans.tier-name }}/g' ${{ matrix.plans.file }} |
| 87 | |
| 88 | - name: Upload yaml as artifact |
| 89 | uses: actions/upload-artifact@v4 |
| 90 | with: |
| 91 | name: ${{ matrix.plans.file }} |
| 92 | path: ${{ matrix.plans.file }} |
| 93 | |
| 94 | - name: Create FALKORDB_PASSWORD/ADMIN_PASSWORD files |
| 95 | run: | |
| 96 | export sec=$(grep '^secrets' omnistrate.free.yaml) |
| 97 | if [[ -n "$sec" ]];then |
| 98 | mkdir -p secrets || { echo "Failed to create secrets directory"; exit 1; } |
| 99 | echo '{{ $var.falkordbPassword }}' > ./secrets/falkordbpassword || { echo "Failed to write falkordbpassword"; exit 1; } |
| 100 | echo '{{ $func.random(string, 16, $sys.deterministicSeedValue) }}' > ./secrets/adminpassword || { echo "Failed to write adminpassword"; exit 1; } |
| 101 | else |
| 102 | echo "secrets option was not used" |
| 103 | exit 0 |
| 104 | fi |
| 105 | |
| 106 | - name: Update Omnistrate plan |
| 107 | uses: ./.github/actions/update-omnistrate-plan |
| 108 | id: update_omnistrate_plan |
| 109 | with: |
| 110 | username: ${{ secrets.OMNISTRATE_USERNAME }} |
| 111 | password: ${{ secrets.OMNISTRATE_PASSWORD }} |
| 112 | file: ${{ matrix.plans.file }} |
| 113 | service-name: ${{ matrix.plans.service-name }} |
| 114 | environment: testing |
| 115 | environment-type: qa |
| 116 | |
| 117 | tests: |
| 118 | needs: omnistrate-update-plans |
| 119 | runs-on: ubuntu-latest |
| 120 | strategy: |
| 121 | fail-fast: false |
| 122 | matrix: |
| 123 | instances: |
| 124 | ###################### GCP ###################### |
| 125 | - name: Free - GCP/us-central1 - Failover & Persistence |
| 126 | if: "true" |
| 127 | testFile: test_standalone.py |
| 128 | tierName: free-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 129 | cloudProvider: gcp |
| 130 | cloudRegion: us-central1 |
| 131 | subscriptionId: sub-GJPV3NoNC0 |
| 132 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 133 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 134 | extraParams: "--resource-key 'free' --replica-id 'node-f-0' --instance-name 'test-free-failover' --instance-description 'test-free-failover' --instance-type 'none' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 135 | - name: PRO/Standalone - GCP/us-central1 - Failover & Persistence |
| 136 | if: "true" |
| 137 | testFile: test_standalone.py |
| 138 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 139 | cloudProvider: gcp |
| 140 | cloudRegion: us-central1 |
| 141 | subscriptionId: sub-GJPV3NoNC0 |
| 142 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 143 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 144 | extraParams: "--resource-key 'standalone' --replica-id 'node-s-0' --instance-name 'test-standalone-failover' --instance-description 'test-standalone-failover' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 145 | - name: PRO/SingleZone - GCP/us-central1 - Failover & Persistence |
| 146 | if: "true" |
| 147 | testFile: test_replication.py |
| 148 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 149 | cloudProvider: gcp |
| 150 | cloudRegion: us-central1 |
| 151 | subscriptionId: sub-GJPV3NoNC0 |
| 152 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 153 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 154 | extraParams: "--resource-key 'single-Zone' --instance-name 'test-sz-failover' --instance-description 'test-sz-failover' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 155 | - name: PRO/MultiZone - GCP/us-central1 - Failover & Persistence |
| 156 | if: "true" |
| 157 | testFile: test_replication.py |
| 158 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 159 | cloudProvider: gcp |
| 160 | cloudRegion: us-central1 |
| 161 | subscriptionId: sub-GJPV3NoNC0 |
| 162 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 163 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 164 | extraParams: "--resource-key 'multi-Zone' --instance-name 'test-mz-failover' --instance-description 'test-mz-failover' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 165 | - name: PRO/Standalone - GCP/us-central1 - Failover & Persistence With TLS |
| 166 | if: "true" |
| 167 | testFile: test_standalone.py |
| 168 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 169 | cloudProvider: gcp |
| 170 | cloudRegion: us-central1 |
| 171 | subscriptionId: sub-GJPV3NoNC0 |
| 172 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 173 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 174 | extraParams: "--resource-key 'standalone' --replica-id 'node-s-0' --instance-name 'test-standalone-failover-tls' --instance-description 'test-standalone-failover-tls' --instance-type 'e2-medium' --storage-size '30' --tls --rdb-config 'medium' --aof-config 'always'" |
| 175 | - name: PRO/SingleZone - GCP/us-central1 - Failover & Persistence With TLS |
| 176 | if: "true" |
| 177 | testFile: test_replication.py |
| 178 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 179 | cloudProvider: gcp |
| 180 | cloudRegion: us-central1 |
| 181 | subscriptionId: sub-GJPV3NoNC0 |
| 182 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 183 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 184 | extraParams: "--resource-key 'single-Zone' --instance-name 'test-sz-failover-tls' --instance-description 'test-sz-failover-tls' --instance-type 'e2-medium' --storage-size '30' --tls --rdb-config 'medium' --aof-config 'always'" |
| 185 | - name: PRO/MultiZone - GCP/us-central1 - Failover & Persistence With TLS |
| 186 | if: "true" |
| 187 | testFile: test_replication.py |
| 188 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 189 | cloudProvider: gcp |
| 190 | cloudRegion: us-central1 |
| 191 | subscriptionId: sub-GJPV3NoNC0 |
| 192 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 193 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 194 | extraParams: "--resource-key 'multi-Zone' --instance-name 'test-mz-failover-tls' --instance-description 'test-mz-failover-tls' --instance-type 'e2-medium' --storage-size '30' --tls --rdb-config 'medium' --aof-config 'always'" |
| 195 | - name: PRO/Standalone - GCP/us-central1 - Update Memory |
| 196 | if: "true" |
| 197 | testFile: test_update_memory.py |
| 198 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 199 | cloudProvider: gcp |
| 200 | cloudRegion: us-central1 |
| 201 | subscriptionId: sub-GJPV3NoNC0 |
| 202 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 203 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 204 | extraParams: "--resource-key 'standalone' --instance-name 'test-standalone-update-memory' --instance-description 'test-standalone-update-memory' --instance-type 'e2-medium' --new-instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 205 | - name: PRO/SingleZone - GCP/us-central1 - Update Memory |
| 206 | if: "true" |
| 207 | testFile: test_update_memory.py |
| 208 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 209 | cloudProvider: gcp |
| 210 | cloudRegion: us-central1 |
| 211 | subscriptionId: sub-GJPV3NoNC0 |
| 212 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 213 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 214 | extraParams: "--resource-key 'single-Zone' --instance-name 'test-replication-update-memory' --instance-description 'test-replication-update-memory' --instance-type 'e2-medium' --new-instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 215 | - name: PRO/ClusterSingleZone - GCP/us-central1 - Update Memory |
| 216 | if: "true" |
| 217 | testFile: test_update_memory.py |
| 218 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 219 | cloudProvider: gcp |
| 220 | cloudRegion: us-central1 |
| 221 | subscriptionId: sub-GJPV3NoNC0 |
| 222 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 223 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 224 | extraParams: "--resource-key 'cluster-Single-Zone' --instance-name 'test-cluster-update-memory' --instance-description 'test-cluster-update-memory' --instance-type 'e2-medium' --new-instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --cluster-replicas '1' --host-count '6'" |
| 225 | - name: PRO/Standalone - GCP/us-central1 - Upgrade Version |
| 226 | if: ${{ contains(github.ref, 'refs/tags/v') || contains(github.ref, 'main') }} |
| 227 | testFile: test_upgrade_version.py |
| 228 | tierName: pro-main |
| 229 | cloudProvider: gcp |
| 230 | cloudRegion: us-central1 |
| 231 | subscriptionId: sub-GJPV3NoNC0 |
| 232 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 233 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 234 | extraParams: "--resource-key 'standalone' --instance-name 'test-standalone-upgrade' --instance-description 'test-standalone-upgrade' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 235 | - name: PRO/SingleZone - GCP/us-central1 - Upgrade Version |
| 236 | if: ${{ contains(github.ref, 'refs/tags/v') || contains(github.ref, 'main') }} |
| 237 | testFile: test_upgrade_version.py |
| 238 | tierName: pro-main |
| 239 | cloudProvider: gcp |
| 240 | cloudRegion: us-central1 |
| 241 | subscriptionId: sub-GJPV3NoNC0 |
| 242 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 243 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 244 | extraParams: "--resource-key 'single-Zone' --instance-name 'test-replication-upgrade' --instance-description 'test-replication-upgrade' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 245 | - name: PRO/ClusterSingleZone - GCP/us-central1 - Upgrade Version |
| 246 | if: ${{ contains(github.ref, 'refs/tags/v') || contains(github.ref, 'main') }} |
| 247 | testFile: test_upgrade_version.py |
| 248 | tierName: pro-main |
| 249 | cloudProvider: gcp |
| 250 | cloudRegion: us-central1 |
| 251 | subscriptionId: sub-GJPV3NoNC0 |
| 252 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 253 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 254 | extraParams: "--resource-key 'cluster-Single-Zone' --instance-name 'test-cluster-upgrade' --instance-description 'test-cluster-upgrade' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --cluster-replicas '1' --host-count '6'" |
| 255 | - name: PRO/ClusterSingleZone - GCP/us-central1 - Failover & Persistence |
| 256 | if: "true" |
| 257 | testFile: test_cluster.py |
| 258 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 259 | cloudProvider: gcp |
| 260 | cloudRegion: us-central1 |
| 261 | subscriptionId: sub-GJPV3NoNC0 |
| 262 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 263 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 264 | extraParams: "--resource-key 'cluster-Single-Zone' --replica-id 'cluster-sz-1' --instance-name 'test-cluster-sz-failover' --instance-description 'test-cluster-sz-failover' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1'" |
| 265 | - name: PRO/ClusterMultiZone - GCP/us-central1 - Failover & Persistence |
| 266 | if: "true" |
| 267 | testFile: test_cluster.py |
| 268 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 269 | cloudProvider: gcp |
| 270 | cloudRegion: us-central1 |
| 271 | subscriptionId: sub-GJPV3NoNC0 |
| 272 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 273 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 274 | extraParams: "--resource-key 'cluster-Multi-Zone' --replica-id 'cluster-mz-1' --instance-name 'test-cluster-mz-failover' --instance-description 'test-cluster-mz-failover' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1' --ensure-mz-distribution" |
| 275 | - name: PRO/ClusterSingleZone - GCP/us-central1 - Failover & Persistence With TLS |
| 276 | if: "true" |
| 277 | testFile: test_cluster.py |
| 278 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 279 | cloudProvider: gcp |
| 280 | cloudRegion: us-central1 |
| 281 | subscriptionId: sub-GJPV3NoNC0 |
| 282 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 283 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 284 | extraParams: "--resource-key 'cluster-Single-Zone' --replica-id 'cluster-sz-1' --instance-name 'test-cluster-sz-failover-tls' --instance-description 'test-cluster-sz-failover' --instance-type 'e2-medium' --storage-size '30' --tls --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1'" |
| 285 | - name: PRO/ClusterMultiZone - GCP/us-central1 - Failover & Persistence With TLS |
| 286 | if: "true" |
| 287 | testFile: test_cluster.py |
| 288 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 289 | cloudProvider: gcp |
| 290 | cloudRegion: us-central1 |
| 291 | subscriptionId: sub-GJPV3NoNC0 |
| 292 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 293 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 294 | extraParams: "--resource-key 'cluster-Multi-Zone' --replica-id 'cluster-mz-1' --instance-name 'test-cluster-mz-failover-tls' --instance-description 'test-cluster-mz-failover' --instance-type 'e2-medium' --storage-size '30' --tls --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1' --ensure-mz-distribution" |
| 295 | # - name: PRO/ClusterSingleZone - GCP/us-central1 - Add/Remove Shards |
| 296 | # if: "true" |
| 297 | # testFile: test_cluster_shards.py |
| 298 | # tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 299 | # cloudProvider: gcp |
| 300 | # cloudRegion: us-central1 |
| 301 | # subscriptionId: sub-GJPV3NoNC0 |
| 302 | # serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 303 | # environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 304 | # extraParams: "--resource-key 'cluster-Single-Zone' --instance-name 'test-cluster-sz-shards' --instance-description 'test-cluster-sz-shards' --instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1'" |
| 305 | # - name: PRO/ClusterMultiZone - GCP/us-central1 - Add/Remove Shards |
| 306 | # if: "true" |
| 307 | # testFile: test_cluster_shards.py |
| 308 | # tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 309 | # cloudProvider: gcp |
| 310 | # cloudRegion: us-central1 |
| 311 | # subscriptionId: sub-GJPV3NoNC0 |
| 312 | # serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 313 | # environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 314 | # extraParams: "--resource-key 'cluster-Multi-Zone' --instance-name 'test-cluster-mz-shards' --instance-description 'test-cluster-mz-shards' --instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1' --ensure-mz-distribution" |
| 315 | # - name: PRO/ClusterSingleZone - GCP/us-central1 - Add/Remove Replicas |
| 316 | # if: "true" |
| 317 | # testFile: test_cluster_replicas.py |
| 318 | # tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 319 | # cloudProvider: gcp |
| 320 | # cloudRegion: us-central1 |
| 321 | # subscriptionId: sub-GJPV3NoNC0 |
| 322 | # serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 323 | # environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 324 | # extraParams: "--resource-key 'cluster-Single-Zone' --instance-name 'test-cluster-sz-replicas' --instance-description 'test-cluster-sz-replicas' --instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1' --shards '3'" |
| 325 | # - name: PRO/ClusterMultiZone - GCP/us-central1 - Add/Remove Replicas |
| 326 | # if: "true" |
| 327 | # testFile: test_cluster_replicas.py |
| 328 | # tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 329 | # cloudProvider: gcp |
| 330 | # cloudRegion: us-central1 |
| 331 | # subscriptionId: sub-GJPV3NoNC0 |
| 332 | # serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 333 | # environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 334 | # extraParams: "--resource-key 'cluster-Multi-Zone' --instance-name 'test-cluster-mz-replicas' --instance-description 'test-cluster-mz-replicas' --instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1' --shards '3' --ensure-mz-distribution" |
| 335 | - name: PRO/SingleZone - GCP/us-central1 - Test add/remove replica |
| 336 | if: "true" |
| 337 | testFile: test_replication_replicas.py |
| 338 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 339 | cloudProvider: gcp |
| 340 | cloudRegion: us-central1 |
| 341 | subscriptionId: sub-GJPV3NoNC0 |
| 342 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 343 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 344 | extraParams: "--resource-key 'single-Zone' --replica-id 'node-sz-0' --instance-name 'test-sz-add-remove-replica' --instance-description 'test-replication-add-remove' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 345 | - name: PRO/MultiZone - GCP/us-central1 - Test add/remove replica |
| 346 | if: "true" |
| 347 | testFile: test_replication_replicas.py |
| 348 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 349 | cloudProvider: gcp |
| 350 | cloudRegion: us-central1 |
| 351 | subscriptionId: sub-GJPV3NoNC0 |
| 352 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 353 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 354 | extraParams: "--resource-key 'multi-Zone' --replica-id 'node-mz-0' --instance-name 'test-mz-add-remove-replica' --instance-description 'test-replication-add-remove' --instance-type 'e2-medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 355 | |
| 356 | ###################### AWS ###################### |
| 357 | - name: PRO/Standalone - AWS/us-east-2 - Failover & Persistence |
| 358 | if: "true" |
| 359 | testFile: test_standalone.py |
| 360 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 361 | cloudProvider: aws |
| 362 | cloudRegion: us-east-2 |
| 363 | subscriptionId: sub-GJPV3NoNC0 |
| 364 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 365 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 366 | extraParams: "--resource-key 'standalone' --replica-id 'node-s-1' --instance-name 'test-standalone-failover' --instance-description 'test-standalone-failover' --instance-type 't2.medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 367 | - name: PRO/SingleZone - AWS/us-east-2 - Failover & Persistence |
| 368 | if: "true" |
| 369 | testFile: test_replication.py |
| 370 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 371 | cloudProvider: aws |
| 372 | cloudRegion: us-east-2 |
| 373 | subscriptionId: sub-GJPV3NoNC0 |
| 374 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 375 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 376 | extraParams: "--resource-key 'single-Zone' --instance-name 'test-sz-failover' --instance-description 'test-sz-failover' --instance-type 't2.medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 377 | - name: PRO/MultiZone - AWS/us-east-2 - Failover & Persistence |
| 378 | if: "true" |
| 379 | testFile: test_replication.py |
| 380 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 381 | cloudProvider: aws |
| 382 | cloudRegion: us-east-2 |
| 383 | subscriptionId: sub-GJPV3NoNC0 |
| 384 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 385 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 386 | extraParams: "--resource-key 'multi-Zone' --instance-name 'test-mz-failover' --instance-description 'test-mz-failover' --instance-type 't2.medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always'" |
| 387 | - name: PRO/ClusterSingleZone - AWS/us-east-2 - Failover & Persistence |
| 388 | if: "true" |
| 389 | testFile: test_cluster.py |
| 390 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 391 | cloudProvider: aws |
| 392 | cloudRegion: us-east-2 |
| 393 | subscriptionId: sub-GJPV3NoNC0 |
| 394 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 395 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 396 | extraParams: "--resource-key 'cluster-Single-Zone' --replica-id 'cluster-sz-1' --instance-name 'test-cluster-sz-failover' --instance-description 'test-cluster-sz-failover' --instance-type 't2.medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1'" |
| 397 | - name: PRO/ClusterMultiZone - AWS/us-east-2 - Failover & Persistence |
| 398 | if: "true" |
| 399 | testFile: test_cluster.py |
| 400 | tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }} |
| 401 | cloudProvider: aws |
| 402 | cloudRegion: us-east-2 |
| 403 | subscriptionId: sub-GJPV3NoNC0 |
| 404 | serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} |
| 405 | environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}} |
| 406 | extraParams: "--resource-key 'cluster-Multi-Zone' --replica-id 'cluster-mz-1' --instance-name 'test-cluster-mz-failover' --instance-description 'test-cluster-mz-failover' --instance-type 't2.medium' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --host-count '6' --cluster-replicas '1' --ensure-mz-distribution" |
| 407 | |
| 408 | steps: |
| 409 | - name: Checkout |
| 410 | if: matrix.instances.if == 'true' || matrix.instances.if == true |
| 411 | uses: actions/checkout@v3 |
| 412 | |
| 413 | - name: Setup python |
| 414 | if: matrix.instances.if == 'true' || matrix.instances.if == true |
| 415 | uses: actions/setup-python@v2 |
| 416 | with: |
| 417 | python-version: "3.x" |
| 418 | |
| 419 | - name: Cache Poetry virtualenv |
| 420 | if: matrix.instances.if == 'true' || matrix.instances.if == true |
| 421 | id: cache |
| 422 | uses: actions/cache@v4 |
| 423 | with: |
| 424 | path: ~/.poetry/virtualenvs |
| 425 | key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} |
| 426 | restore-keys: | |
| 427 | ${{ runner.os }}-poetry- |
| 428 | |
| 429 | - name: Install Poetry |
| 430 | if: steps.cache.outputs.cache-hit != true && (matrix.instances.if == 'true' || matrix.instances.if == true) |
| 431 | env: |
| 432 | if: ${{ matrix.instances.if }} |
| 433 | if_equal_bool: ${{ matrix.instances.if == true }} |
| 434 | if_equal_str: ${{ matrix.instances.if == 'true' }} |
| 435 | run: | |
| 436 | curl -sSL https://install.python-poetry.org | python3 - |
| 437 | |
| 438 | - name: Install dependencies |
| 439 | if: matrix.instances.if == 'true' || matrix.instances.if == true |
| 440 | run: poetry install |
| 441 | |
| 442 | - name: ${{ matrix.instances.name }} |
| 443 | if: matrix.instances.if == 'true' || matrix.instances.if == true |
| 444 | env: |
| 445 | SERVICE_ID: ${{ matrix.instances.serviceId }} |
| 446 | ENVIRONMENT_ID: ${{ matrix.instances.environmentId }} |
| 447 | CLOUD_PROVIDER: ${{ matrix.instances.cloudProvider }} |
| 448 | CLOUD_REGION: ${{ matrix.instances.cloudRegion }} |
| 449 | extraParams: ${{ matrix.instances.extraParams }} |
| 450 | SUBSCRIPTION_ID: ${{ matrix.instances.subscriptionId }} |
| 451 | REF_NAME: ${{ matrix.instances.tierName }} |
| 452 | run: | |
| 453 | poetry run python -u ./omnistrate_tests/${{ matrix.instances.testFile }} ${{ secrets.OMNISTRATE_USERNAME }} ${{ secrets.OMNISTRATE_PASSWORD }} ${{ env.CLOUD_PROVIDER }} ${{ env.CLOUD_REGION }} --service-id ${{ env.SERVICE_ID }} --environment-id ${{ env.ENVIRONMENT_ID }} ${{ env.extraParams }} |