Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added new service #176

Closed
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
44 changes: 23 additions & 21 deletions .github/workflows/build-test-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ jobs:
if [[ -n "$sec" ]];then
mkdir -p secrets || { echo "Failed to create secrets directory"; exit 1; }
echo '{{ $var.falkordbPassword }}' > ./secrets/falkordbpassword || { echo "Failed to write falkordbpassword"; exit 1; }
echo '{{ $var.falkordbPasswordSZReplica }}' > ./secrets/falkordbpasswordreplicasz || { echo "Failed to write falkordbpassword"; exit 1; }
echo '{{ $var.falkordbPasswordMZReplica }}' > ./secrets/falkordbpasswordreplicamz || { echo "Failed to write falkordbpassword"; exit 1; }
echo '{{ $func.random(string, 16, $sys.deterministicSeedValue) }}' > ./secrets/adminpassword || { echo "Failed to write adminpassword"; exit 1; }
echo '{{ $var.adminPassword }}' > ./secrets/grafana_admin_password || { echo "Failed to write grafana_admin_password"; exit 1; }
echo '{{ $func.random(string, 16, $sys.deterministicSeedValue) }}' > ./secrets/grafana_secret_key || { echo "Failed to write grafana_secret_key"; exit 1; }
Expand Down Expand Up @@ -210,7 +212,7 @@ jobs:
subscriptionId: sub-GJPV3NoNC0
serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
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'"
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'"
- name: PRO/MultiZone - GCP/us-central1 - Failover & Persistence
if: "true"
testFile: test_replication.py
Expand Down Expand Up @@ -444,26 +446,26 @@ jobs:
# serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
# environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
# 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"
- name: PRO/SingleZone - GCP/us-central1 - Test add/remove replica
if: "true"
testFile: test_replication_replicas.py
tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
cloudProvider: gcp
cloudRegion: us-central1
subscriptionId: sub-GJPV3NoNC0
serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
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'"
- name: PRO/MultiZone - GCP/us-central1 - Test add/remove replica
if: "true"
testFile: test_replication_replicas.py
tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
cloudProvider: gcp
cloudRegion: us-central1
subscriptionId: sub-GJPV3NoNC0
serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
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'"
# - name: PRO/SingleZone - GCP/us-central1 - Test add/remove replica
# if: "true"
# testFile: test_replication_replicas.py
# tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
# cloudProvider: gcp
# cloudRegion: us-central1
# subscriptionId: sub-GJPV3NoNC0
# serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
# environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
# 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'"
# - name: PRO/MultiZone - GCP/us-central1 - Test add/remove replica
# if: "true"
# testFile: test_replication_replicas.py
# tierName: pro-${{ contains(github.ref, 'refs/tags/v') && 'main' || github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
# cloudProvider: gcp
# cloudRegion: us-central1
# subscriptionId: sub-GJPV3NoNC0
# serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
# environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
# 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'"

###################### AWS ######################
- name: Free - AWS/us-east-2 - Failover & Persistence
Expand Down
29 changes: 23 additions & 6 deletions falkordb-node/node-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

FALKORDB_USER=${FALKORDB_USER:-falkordb}
#FALKORDB_PASSWORD=${FALKORDB_PASSWORD:-''}
if [[ -f "/run/secrets/falkordbpassword" ]] && [[ -s "/run/secrets/falkordbpassword" ]]; then
FALKORDB_PASSWORD=$(cat "/run/secrets/falkordbpassword")
elif [[ -n "$FALKORDB_PASSWORD" ]]; then
FALKORDB_PASSWORD=$FALKORDB_PASSWORD


if [[ $HOSTNAME =~ node-sz-replica.* ]]; then
SECRET_PATH="/run/secrets/falkordbpasswordreplicasz"
elif [[ $HOSTNAME =~ node-mz-replica.* ]];then
SECRET_PATH="/run/secrets/falkordbpasswordreplicamz"
else
SECRET_PATH="/run/secrets/falkordbpassword"
fi

if [[ -f "$SECRET_PATH" && -s "$SECRET_PATH" ]]; then
# Use `read` instead of `cat` for better performance
FALKORDB_PASSWORD=$(cat "$SECRET_PATH")
else
FALKORDB_PASSWORD=''
fi
Expand All @@ -20,6 +29,7 @@ else
export ADMIN_PASSWORD=''
fi


RUN_SENTINEL=${RUN_SENTINEL:-0}
RUN_NODE=${RUN_NODE:-1}
RUN_METRICS=${RUN_METRICS:-1}
Expand Down Expand Up @@ -407,11 +417,18 @@ if [ "$RUN_NODE" -eq "1" ]; then
echo "dir $DATA_DIR" >>$NODE_CONF_FILE

is_replica
if [[ $IS_REPLICA -eq 1 ]]; then
#check if the hostname has a replica string in it then it is a replica no need for the is_replica
if [[ $HOSTNAME =~ .*replica.* ]];then
echo "replicaof $FALKORDB_MASTER_HOST $FALKORDB_MASTER_PORT_NUMBER" >>$NODE_CONF_FILE
echo "replica-priority 0" >> $NODE_CONF_FILE
echo "Starting Replica"
else
echo "Starting Master"
if [[ $IS_REPLICA -eq 1 ]]; then
echo "replicaof $FALKORDB_MASTER_HOST $FALKORDB_MASTER_PORT_NUMBER" >>$NODE_CONF_FILE
echo "Starting Replica"
else
echo "Starting Master"
fi
fi

if [[ $TLS == "true" ]]; then
Expand Down
Loading
Loading