Skip to content

Commit beb0ddb

Browse files
committed
starting quickstart
1 parent b2a502c commit beb0ddb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+180
-41
lines changed
-39 Bytes
Binary file not shown.
-129 KB
Binary file not shown.
-269 KB
Binary file not shown.
Binary file not shown.

.gradle/7.6.1/dependencies-accessors/gc.properties

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
-1 Bytes
Binary file not shown.
-32.5 KB
Binary file not shown.
-39 Bytes
Binary file not shown.
Binary file not shown.

.gradle/7.6.1/gc.properties

Whitespace-only changes.
-17 Bytes
Binary file not shown.
-40.8 KB
Binary file not shown.
-128 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1 Bytes
Binary file not shown.
-23.4 KB
Binary file not shown.
-17 Bytes
Binary file not shown.
-19.3 KB
Binary file not shown.

.gradle/8.11.1/gc.properties

Whitespace-only changes.

.gradle/8.4/checksums/checksums.lock

-17 Bytes
Binary file not shown.
-24.7 KB
Binary file not shown.
-25.1 KB
Binary file not shown.
Binary file not shown.

.gradle/8.4/dependencies-accessors/gc.properties

Whitespace-only changes.
-19.2 KB
Binary file not shown.
-17 Bytes
Binary file not shown.
-1 Bytes
Binary file not shown.

.gradle/8.4/fileHashes/fileHashes.bin

-18.3 KB
Binary file not shown.
-17 Bytes
Binary file not shown.

.gradle/8.4/gc.properties

Whitespace-only changes.
Binary file not shown.
18 Bytes
Binary file not shown.

.gradle/file-system.probe

0 Bytes
Binary file not shown.

.idea/compiler.xml

Lines changed: 32 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/autoscaler/redis-cloud-autoscaler/redis-cloud-autoscaler.redis-cloud-autoscaler.test.iml

Lines changed: 0 additions & 8 deletions
This file was deleted.

autoscaler/.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoscaler/.idea/autoscaler.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoscaler/.idea/codeStyles/Project.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoscaler/.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoscaler/.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoscaler/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoscaler/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoscaler/redis-cloud-autoscaler/src/main/java/com/redis/autoscaler/services/RedisCloudDatabaseService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public RedisCloudDatabase getDatabase(String dbId) throws IOException, Interrupt
4747
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
4848

4949
if(response.statusCode() != 200){
50-
throw new RuntimeException("Failed to fetch database info");
50+
throw new RuntimeException(String.format("Failed to fetch database info on %s", uri.toString()));
5151
}
5252

5353
return objectMapper.readValue(response.body(), RedisCloudDatabase.class);
@@ -210,7 +210,7 @@ Task scaleDatabase(String dbId, ScaleRequest request){
210210
}
211211

212212
else {
213-
throw new HttpResponseException(response.statusCode(), String.format("Failed to scale database %s", response.body()));
213+
throw new HttpResponseException(response.statusCode(), String.format("Failed to scale database %s %s", dbId, response.body()));
214214
}
215215
} catch (IOException | InterruptedException e) {
216216
throw new RuntimeException(e);

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ resource "null_resource" "build_app" {
203203
}
204204

205205
provisioner "file" {
206-
source = "./autoscaler/redis-cloud-autoscaler/build/libs/redis-cloud-autoscaler.jar"
206+
source = "./autoscaler/redis-cloud-autoscaler/build/libs/redis-cloud-autoscaler-0.0.2.jar"
207207
destination = "autoscaler.jar"
208208
}
209209

@@ -232,7 +232,7 @@ resource "null_resource" "build_app" {
232232
"echo 'Environment=REDIS_PASSWORD=${rediscloud_subscription_database.autoscale-database.password}' | sudo tee -a /etc/systemd/system/autoscaler.service > /dev/null",
233233
"echo 'Environment=REDIS_CLOUD_API_KEY=${var.redis_cloud_api_key}' | sudo tee -a /etc/systemd/system/autoscaler.service > /dev/null",
234234
"echo 'Environment=REDIS_CLOUD_ACCOUNT_KEY=${var.redis_cloud_account_key}' | sudo tee -a /etc/systemd/system/autoscaler.service > /dev/null",
235-
"echo 'Environment=REDIS_CLOUD_SUBSCRIPTION_ID=${rediscloud_subscription_database.autoscale-database.id}' | sudo tee -a /etc/systemd/system/autoscaler.service > /dev/null",
235+
"echo 'Environment=REDIS_CLOUD_SUBSCRIPTION_ID=${rediscloud_subscription.autoscaling_sub.id}' | sudo tee -a /etc/systemd/system/autoscaler.service > /dev/null",
236236
"echo 'Environment=ALERT_MANAGER_HOST=${google_compute_instance.autoscale-vm-prometheus.network_interface[0].access_config[0].nat_ip}' | sudo tee -a /etc/systemd/system/autoscaler.service > /dev/null",
237237
"echo 'Environment=ALERT_MANAGER_PORT=9093' | sudo tee -a /etc/systemd/system/autoscaler.service > /dev/null",
238238
"echo 'ExecStart=/usr/bin/java -jar /usr/local/bin/autoscaler.jar' | sudo tee -a /etc/systemd/system/autoscaler.service > /dev/null",

quickstart/.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
REDIS_HOST_AND_PORT=
2+
REDIS_PASSWORD=
3+
REDIS_CLOUD_API_KEY=
4+
REDIS_CLOUD_ACCOUNT_KEY=
5+
REDIS_CLOUD_SUBSCRIPTION_ID=
6+
ALERT_MANAGER_HOST=
7+
ALERT_MANAGER_PORT=

quickstart/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
services:
2+
autoscaler:
3+
ghcr.io/redis-field-engineering/redis-cloud-autoscaler
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
global:
2+
resolve_timeout: 1m
3+
route:
4+
receiver: webhook-receiver
5+
repeat_interval: 1m
6+
receivers:
7+
- name: webhook-receiver
8+
webhook_configs:
9+
- url: 'http://autoscaler:8080/alerts'

0 commit comments

Comments
 (0)