Elffuss BraidHub

kikocis/falkordb-omnistrate public

Merge pull request #100 from FalkorDB/55-add-aws-support

55 add aws support
Changeset2769334f6fd8f2adfa34009173f8f5e55cbe9799ef6e31ef51e27a726042f8ca
AuthorDudi <16744955+dudizimber@users.noreply.github.com> · 2024-09-25 18:21 +03:00
CommitterGitHub <noreply@github.com> · 2024-09-25 18:21 +03:00
Parentsec7cc69c0ba4, 92fe6ecd8cb3

Browse the files at this changeset

6 files changed

modified .github/workflows/build-release-image.yaml +4 −1
@@ -81,14 +81,17 @@
8181 sed -i 's/$GcpProjectId/${{ vars.GCP_PROJECT_ID }}/g' ${{ matrix.plans.file }}
8282 sed -i 's/$GcpProjectNumber/${{ vars.GCP_PROJECT_NUMBER }}/g' ${{ matrix.plans.file }}
8383 sed -i 's/$GcpServiceAccountEmail/${{ vars.GCP_SERVICE_ACCOUNT_EMAIL }}/g' ${{ matrix.plans.file }}
84+ sed -i 's/$AwsAccountId/${{ vars.AWS_ACCOUNT_ID }}/g' ${{ matrix.plans.file }}
85+ sed -i 's|$AwsBootstrapRoleAccountArn|${{ vars.AWS_BOOTSTRAP_ROLE_ACCOUNT_ARN }}|g' ${{ matrix.plans.file }}
8486 sed -i 's/$FalkorDBNodeImage/falkordb\/${{ env.NODE_IMAGE_NAME }}:${{ github.event.workflow_run.head_branch }}/g' ${{ matrix.plans.file }}
8587 sed -i 's/$FalkorDBClusterImage/falkordb\/${{ env.CLUSTER_IMAGE_NAME }}:${{ github.event.workflow_run.head_branch }}/g' ${{ matrix.plans.file }}
8688 sed -i 's/$FalkorDBClusterRebalanceImage/falkordb\/${{ env.CLUSTER_REBALANCE_IMAGE_NAME }}:${{ github.event.workflow_run.head_branch }}/g' ${{ matrix.plans.file }}
8789
88- - name: Remove e2-machine from pro
90+ - name: Remove e2-machine and t2.medium from pro
8991 if: ${{ contains( vars.OMNISTRATE_RELEASE_PLANS, matrix.plans.key) && matrix.plans.key == 'pro' }}
9092 run: |
9193 sed -i 's/- e2-medium//g' ${{ matrix.plans.file }}
94+ sed -i 's/- t2.medium//g' ${{ matrix.plans.file }}
9295
9396 - name: Upload yaml to artifacts
9497 if: ${{ contains(vars.OMNISTRATE_RELEASE_PLANS, matrix.plans.key) }}
modified .github/workflows/build-test-image.yaml +58 −2
@@ -71,13 +71,15 @@
7171 tier-name: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.ref_name }}
7272 steps:
7373 - name: Checkout
74- uses: actions/checkout@v3
74+ uses: actions/checkout@v4
7575
7676 - name: Replace Variables
7777 run: |
7878 sed -i 's/$GcpProjectId/${{ vars.GCP_PROJECT_ID }}/g' ${{ matrix.plans.file }}
7979 sed -i 's/$GcpProjectNumber/${{ vars.GCP_PROJECT_NUMBER }}/g' ${{ matrix.plans.file }}
8080 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 }}
8183 sed -i 's/$FalkorDBNodeImage/falkordb\/${{ env.NODE_IMAGE_NAME }}:dev-${{ github.event.head_commit.id }}/g' ${{ matrix.plans.file }}
8284 sed -i 's/$FalkorDBClusterImage/falkordb\/${{ env.CLUSTER_IMAGE_NAME }}:dev-${{ github.event.head_commit.id }}/g' ${{ matrix.plans.file }}
8385 sed -i 's/$FalkorDBClusterRebalanceImage/falkordb\/${{ env.CLUSTER_REBALANCE_IMAGE_NAME }}:dev-${{ github.event.head_commit.id }}/g' ${{ matrix.plans.file }}
@@ -112,13 +114,14 @@
112114 environment: testing
113115 environment-type: qa
114116
115- test:
117+ tests:
116118 needs: omnistrate-update-plans
117119 runs-on: ubuntu-latest
118120 strategy:
119121 fail-fast: false
120122 matrix:
121123 instances:
124+ ###################### GCP ######################
122125 - name: Free - GCP/us-central1 - Failover & Persistence
123126 if: "true"
124127 testFile: test_standalone.py
@@ -349,6 +352,59 @@
349352 serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
350353 environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
351354 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+
352408 steps:
353409 - name: Checkout
354410 if: matrix.instances.if == 'true' || matrix.instances.if == true
modified falkordb-cluster/cluster-entrypoint.sh +11 −4
@@ -143,18 +143,25 @@
143143 ["e2-custom-8-16384"]="13GB"
144144 ["e2-custom-16-32768"]="30GB"
145145 ["e2-custom-32-65536"]="62GB"
146+ ["t2.medium"]="2GB"
147+ ["c6i.xlarge"]="6GB"
148+ ["c6i.2xlarge"]="13GB"
149+ ["c6i.4xlarge"]="30GB"
150+ ["c6i.8xlarge"]="62GB"
146151 )
147152 if [[ -z $INSTANCE_TYPE ]]; then
148153 echo "INSTANCE_TYPE is not set"
149154 return
150155 fi
151156
152- memory_limit=$(echo $memory_limit_instance_type_map | jq -r ".\"$INSTANCE_TYPE\"")
157+ MEMORY_LIMIT=${memory_limit_instance_type_map[$INSTANCE_TYPE]}
153158
154- if [[ ! -z $memory_limit ]]; then
155- echo "Setting maxmemory to $memory_limit"
156- redis-cli -p $NODE_PORT $AUTH_CONNECTION_STRING $TLS_CONNECTION_STRING CONFIG SET maxmemory $MEMORY_LIMIT
159+ if [[ ! -z $MEMORY_LIMIT ]]; then
160+ MEMORY_LIMIT="100MB"
157161 fi
162+
163+ echo "Setting maxmemory to $MEMORY_LIMIT"
164+ redis-cli -p $NODE_PORT $AUTH_CONNECTION_STRING $TLS_CONNECTION_STRING CONFIG SET maxmemory $MEMORY_LIMIT
158165 }
159166
160167 set_rdb_persistence_config() {
modified falkordb-node/node-entrypoint.sh +19 −9
@@ -187,18 +187,28 @@
187187 }
188188
189189 get_memory_limit() {
190-
191- memory_limit_instance_type_map="{\"e2-custom-small-1024\":\"100MB\",\"e2-medium\":\"2GB\",\"e2-custom-4-8192\":\"6GB\",\"e2-custom-8-16384\":\"13GB\",\"e2-custom-16-32768\":\"30GB\",\"e2-custom-32-65536\":\"62GB\"}"
192-
193- if [[ -z $INSTANCE_TYPE ]]; then
194- echo "INSTANCE_TYPE is not set"
195- return
190+ declare -A memory_limit_instance_type_map
191+ memory_limit_instance_type_map=(
192+ ["e2-custom-small-1024"]="100MB"
193+ ["e2-medium"]="2GB"
194+ ["e2-custom-4-8192"]="6GB"
195+ ["e2-custom-8-16384"]="13GB"
196+ ["e2-custom-16-32768"]="30GB"
197+ ["e2-custom-32-65536"]="62GB"
198+ ["t2.medium"]="2GB"
199+ ["c6i.xlarge"]="6GB"
200+ ["c6i.2xlarge"]="13GB"
201+ ["c6i.4xlarge"]="30GB"
202+ ["c6i.8xlarge"]="62GB"
203+ )
204+
205+ MEMORY_LIMIT=${memory_limit_instance_type_map[$INSTANCE_TYPE]}
206+ if [[ -z $MEMORY_LIMIT ]]; then
207+ echo "INSTANCE_TYPE is not set. Setting 100MB"
208+ MEMORY_LIMIT="100MB"
196209 fi
197210
198- MEMORY_LIMIT=$(echo $memory_limit_instance_type_map | jq -r ".\"$INSTANCE_TYPE\"")
199-
200211 echo "Memory Limit: $MEMORY_LIMIT"
201-
202212 }
203213
204214 wait_until_sentinel_host_resolves() {
modified omnistrate.free.yaml +0 −3
@@ -77,9 +77,6 @@
7777 image: $FalkorDBNodeImage
7878 x-omnistrate-compute:
7979 replicaCount: 1
80- instanceTypes:
81- - cloudProvider: gcp
82- name: e2-custom-small-1024
8380 x-omnistrate-api-params:
8481 - key: name
8582 description: The name of the FalkorDB instance
modified omnistrate.pro.yaml +74 −6
@@ -8,6 +8,8 @@
88 GcpProjectId: "$GcpProjectId"
99 GcpProjectNumber: "$GcpProjectNumber"
1010 GcpServiceAccountEmail: "$GcpServiceAccountEmail"
11+ AwsAccountId: "$AwsAccountId"
12+ AwsBootstrapRoleAccountArn: "$AwsBootstrapRoleAccountArn"
1113
1214 x-omnistrate-load-balancer:
1315 tcp:
@@ -243,6 +245,11 @@
243245 - e2-custom-8-16384
244246 - e2-custom-16-32768
245247 - e2-custom-32-65536
248+ - t2.medium
249+ - c6i.xlarge
250+ - c6i.2xlarge
251+ - c6i.4xlarge
252+ - c6i.8xlarge
246253 - key: enableTLS
247254 description: Whether to enable TLS for the database
248255 name: Enable TLS
@@ -390,13 +397,17 @@
390397 modifiable: true
391398 required: true
392399 export: true
393- defaultValue: e2-custom-4-8192
394400 options:
395401 - e2-medium
396402 - e2-custom-4-8192
397403 - e2-custom-8-16384
398404 - e2-custom-16-32768
399405 - e2-custom-32-65536
406+ - t2.medium
407+ - c6i.xlarge
408+ - c6i.2xlarge
409+ - c6i.4xlarge
410+ - c6i.8xlarge
400411 parameterDependencyMap:
401412 node-s: nodeInstanceType
402413 - key: enableTLS
@@ -554,6 +565,8 @@
554565 instanceTypes:
555566 - cloudProvider: gcp
556567 apiParam: nodeInstanceType
568+ - cloudProvider: aws
569+ apiParam: nodeInstanceType
557570 x-omnistrate-api-params:
558571 - key: nodeInstanceType
559572 description: The size of the node instance. Check the documentation for more information.
@@ -562,13 +575,17 @@
562575 modifiable: true
563576 required: true
564577 export: true
565- defaultValue: e2-custom-4-8192
566578 options:
567579 - e2-medium
568580 - e2-custom-4-8192
569581 - e2-custom-8-16384
570582 - e2-custom-16-32768
571583 - e2-custom-32-65536
584+ - t2.medium
585+ - c6i.xlarge
586+ - c6i.2xlarge
587+ - c6i.4xlarge
588+ - c6i.8xlarge
572589 - key: enableTLS
573590 description: Whether to enable TLS for the database
574591 name: Enable TLS
@@ -693,6 +710,9 @@
693710 gcp:
694711 instanceStorageType: GCP::PD_BALANCED
695712 instanceStorageSizeGi: 200
713+ aws:
714+ instanceStorageType: AWS::EBS_GP3
715+ instanceStorageSizeGi: 200
696716 secrets:
697717 - source: adminpasspath
698718 target: /run/secrets/adminpassword
@@ -756,13 +776,17 @@
756776 modifiable: true
757777 required: true
758778 export: true
759- defaultValue: e2-custom-4-8192
760779 options:
761780 - e2-medium
762781 - e2-custom-4-8192
763782 - e2-custom-8-16384
764783 - e2-custom-16-32768
765784 - e2-custom-32-65536
785+ - t2.medium
786+ - c6i.xlarge
787+ - c6i.2xlarge
788+ - c6i.4xlarge
789+ - c6i.8xlarge
766790 parameterDependencyMap:
767791 node-sz: nodeInstanceType
768792 - key: numReplicas
@@ -933,6 +957,8 @@
933957 instanceTypes:
934958 - cloudProvider: gcp
935959 apiParam: nodeInstanceType
960+ - cloudProvider: aws
961+ apiParam: nodeInstanceType
936962 x-omnistrate-api-params:
937963 - key: nodeInstanceType
938964 description: The size of the node instance. Check the documentation for more information.
@@ -941,13 +967,17 @@
941967 modifiable: true
942968 required: true
943969 export: true
944- defaultValue: e2-custom-4-8192
945970 options:
946971 - e2-medium
947972 - e2-custom-4-8192
948973 - e2-custom-8-16384
949974 - e2-custom-16-32768
950975 - e2-custom-32-65536
976+ - t2.medium
977+ - c6i.xlarge
978+ - c6i.2xlarge
979+ - c6i.4xlarge
980+ - c6i.8xlarge
951981 - key: numReplicas
952982 description: Number of Replicas
953983 name: Number of Replicas
@@ -1087,6 +1117,9 @@
10871117 gcp:
10881118 instanceStorageType: GCP::PD_BALANCED
10891119 instanceStorageSizeGi: 200
1120+ aws:
1121+ instanceStorageType: AWS::EBS_GP3
1122+ instanceStorageSizeGi: 200
10901123 secrets:
10911124 - source: adminpasspath
10921125 target: /run/secrets/adminpassword
@@ -1209,6 +1242,9 @@
12091242 gcp:
12101243 instanceStorageType: GCP::PD_BALANCED
12111244 instanceStorageSizeGi: 10
1245+ aws:
1246+ instanceStorageType: AWS::EBS_GP3
1247+ instanceStorageSizeGi: 10
12121248 secrets:
12131249 - source: adminpasspath
12141250 target: /run/secrets/adminpassword
@@ -1284,13 +1320,17 @@
12841320 modifiable: true
12851321 required: true
12861322 export: true
1287- defaultValue: e2-custom-4-8192
12881323 options:
12891324 - e2-medium
12901325 - e2-custom-4-8192
12911326 - e2-custom-8-16384
12921327 - e2-custom-16-32768
12931328 - e2-custom-32-65536
1329+ - t2.medium
1330+ - c6i.xlarge
1331+ - c6i.2xlarge
1332+ - c6i.4xlarge
1333+ - c6i.8xlarge
12941334 parameterDependencyMap:
12951335 node-mz: nodeInstanceType
12961336 - key: numReplicas
@@ -1461,6 +1501,8 @@
14611501 instanceTypes:
14621502 - cloudProvider: gcp
14631503 apiParam: nodeInstanceType
1504+ - cloudProvider: aws
1505+ apiParam: nodeInstanceType
14641506 x-omnistrate-api-params:
14651507 - key: nodeInstanceType
14661508 description: The size of the node instance. Check the documentation for more information.
@@ -1469,13 +1511,17 @@
14691511 modifiable: true
14701512 required: true
14711513 export: true
1472- defaultValue: e2-custom-4-8192
14731514 options:
14741515 - e2-medium
14751516 - e2-custom-4-8192
14761517 - e2-custom-8-16384
14771518 - e2-custom-16-32768
14781519 - e2-custom-32-65536
1520+ - t2.medium
1521+ - c6i.xlarge
1522+ - c6i.2xlarge
1523+ - c6i.4xlarge
1524+ - c6i.8xlarge
14791525 - key: numReplicas
14801526 description: Number of Replicas
14811527 name: Number of Replicas
@@ -1615,6 +1661,9 @@
16151661 gcp:
16161662 instanceStorageType: GCP::PD_BALANCED
16171663 instanceStorageSizeGi: 200
1664+ aws:
1665+ instanceStorageType: AWS::EBS_GP3
1666+ instanceStorageSizeGi: 200
16181667 secrets:
16191668 - source: adminpasspath
16201669 target: /run/secrets/adminpassword
@@ -1737,6 +1786,9 @@
17371786 gcp:
17381787 instanceStorageType: GCP::PD_BALANCED
17391788 instanceStorageSizeGi: 10
1789+ aws:
1790+ instanceStorageType: AWS::EBS_GP3
1791+ instanceStorageSizeGi: 10
17401792 secrets:
17411793 - source: adminpasspath
17421794 target: /run/secrets/adminpassword
@@ -1817,6 +1869,11 @@
18171869 - e2-custom-8-16384
18181870 - e2-custom-16-32768
18191871 - e2-custom-32-65536
1872+ - t2.medium
1873+ - c6i.xlarge
1874+ - c6i.2xlarge
1875+ - c6i.4xlarge
1876+ - c6i.8xlarge
18201877 parameterDependencyMap:
18211878 cluster-sz: nodeInstanceType
18221879 - key: enableTLS
@@ -1986,6 +2043,9 @@
19862043 gcp:
19872044 instanceStorageType: GCP::PD_BALANCED
19882045 instanceStorageSizeGi: 200
2046+ aws:
2047+ instanceStorageType: AWS::EBS_GP3
2048+ instanceStorageSizeGi: 200
19892049 secrets:
19902050 - source: adminpasspath
19912051 target: /run/secrets/adminpassword
@@ -2118,6 +2178,11 @@
21182178 - e2-custom-8-16384
21192179 - e2-custom-16-32768
21202180 - e2-custom-32-65536
2181+ - t2.medium
2182+ - c6i.xlarge
2183+ - c6i.2xlarge
2184+ - c6i.4xlarge
2185+ - c6i.8xlarge
21212186 parameterDependencyMap:
21222187 cluster-mz: nodeInstanceType
21232188 - key: enableTLS
@@ -2286,6 +2351,9 @@
22862351 gcp:
22872352 instanceStorageType: GCP::PD_BALANCED
22882353 instanceStorageSizeGi: 200
2354+ aws:
2355+ instanceStorageType: AWS::EBS_GP3
2356+ instanceStorageSizeGi: 200
22892357 secrets:
22902358 - source: adminpasspath
22912359 target: /run/secrets/adminpassword