diff --git a/pkg/cmd/drtprod/configs/drt_test.yaml b/pkg/cmd/drtprod/configs/drt_test.yaml index 7ba2bbeb65d4..0f79e8437e4b 100644 --- a/pkg/cmd/drtprod/configs/drt_test.yaml +++ b/pkg/cmd/drtprod/configs/drt_test.yaml @@ -1,47 +1,95 @@ # Yaml to create a test-cluster. Please make sure that you change the cluster names to avoid conflicts. environment: - ROACHPROD_GCE_DEFAULT_PROJECT: cockroach-ephemeral + ROACHPROD_GCE_DEFAULT_SERVICE_ACCOUNT: 622274581499-compute@developer.gserviceaccount.com + ROACHPROD_DNS: drt.crdb.io + ROACHPROD_GCE_DNS_DOMAIN: drt.crdb.io + ROACHPROD_GCE_DNS_ZONE: drt + ROACHPROD_GCE_DEFAULT_PROJECT: cockroach-drt CLUSTER: drt-test WORKLOAD_CLUSTER: workload-test + CLUSTER_NODES: 3 + WORKLOAD_NODES: 1 targets: + # crdb cluster specs - target_name: $CLUSTER steps: - - command: create - args: - - $CLUSTER - flags: - clouds: gce - nodes: 1 - username: drt - gce-machine-type: n2-standard-2 - gce-use-spot: true - on_rollback: - - command: destroy + - command: create args: - $CLUSTER - - command: stage - args: - - $CLUSTER - - cockroach - - command: start - args: - - $CLUSTER + flags: + clouds: gce + gce-managed: true + gce-enable-multiple-stores: true + gce-zones: "us-central1-a" + nodes: $CLUSTER_NODES + gce-machine-type: n2-standard-2 + username: drt + on_rollback: + - command: destroy + args: + - $CLUSTER + - command: sync + flags: + clouds: gce + - command: stage + args: + - $CLUSTER + - cockroach + - script: "pkg/cmd/drtprod/scripts/setup_datadog_cluster" + - command: start + args: + - $CLUSTER + - "--binary" + - "./cockroach" + flags: + # add flag to set provisioned throughput on each store according to their cloud provider limits + enable-fluent-sink: true + restart: false + sql-port: 26257 + - command: run + args: + - $CLUSTER + - -- + - "sudo systemctl unmask cron.service ; sudo systemctl enable cron.service ; echo \"crontab -l ; echo '@reboot sleep 100 && ~/cockroach.sh' | crontab -\" > t.sh ; sh t.sh ; rm t.sh" + # workload cluster specs - target_name: $WORKLOAD_CLUSTER steps: - - command: create - args: - - $WORKLOAD_CLUSTER - flags: - nodes: 1 - username: workload - on_rollback: - - command: destroy + - command: create + args: + - $WORKLOAD_CLUSTER + flags: + clouds: gce + gce-zones: "us-central1-a" + nodes: $WORKLOAD_NODES + gce-machine-type: n2-standard-2 + os-volume-size: 100 + username: workload + on_rollback: + - command: destroy + args: + - $WORKLOAD_CLUSTER + - command: sync + flags: + clouds: gce + - command: stage + args: + - $WORKLOAD_CLUSTER + - cockroach + - command: stage + args: + - $WORKLOAD_CLUSTER + - workload + - script: "pkg/cmd/drtprod/scripts/setup_datadog_workload" - target_name: post_tasks dependent_targets: - $CLUSTER - $WORKLOAD_CLUSTER steps: + - script: rm + args: + - -rf + - certs-$CLUSTER - command: get args: - $CLUSTER:1 @@ -59,3 +107,33 @@ targets: - chmod - 600 - './certs/*' + - command: put + args: + - $WORKLOAD_CLUSTER + - artifacts/roachprod + - roachprod + - command: put + args: + - $WORKLOAD_CLUSTER + - artifacts/roachtest + - roachtest-operations + - script: "pkg/cmd/drtprod/scripts/tpcc_init.sh" + args: + - cct_tpcc_1k # suffix added to script name tpcc_init_cct_tpcc_400k.sh + - true # determines whether to execute the script immediately on workload node + flags: + warehouses: 1000 + db: cct_tpcc + - script: "pkg/cmd/drtprod/scripts/generate_tpcc_run.sh" + args: + - cct_tpcc_1k # suffix added to script name tpcc_run_400k.sh + - false # determines whether to execute the script immediately on workload node + flags: + db: cct_tpcc + warehouses: 1000 + max-rate: 100 + workers: 50 + conns: 100 + duration: 12h + ramp: 10m + wait: 0 diff --git a/pkg/cmd/drtprod/scripts/generate_tpcc_run.sh b/pkg/cmd/drtprod/scripts/generate_tpcc_run.sh index 29bc5bd54866..d1290035d80a 100755 --- a/pkg/cmd/drtprod/scripts/generate_tpcc_run.sh +++ b/pkg/cmd/drtprod/scripts/generate_tpcc_run.sh @@ -39,6 +39,8 @@ if [ -z "${WORKLOAD_NODES}" ]; then exit 1 fi +absolute_path=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "realpath ./cockroach") +pwd=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "dirname ${absolute_path}") # Prepare PGURLS PGURLS=$(roachprod pgurl $CLUSTER | sed s/\'//g) @@ -72,5 +74,7 @@ EOF roachprod ssh $WORKLOAD_CLUSTER:$NODE -- "chmod +x tpcc_run_${suffix}.sh" if [ "$execute_script" = "true" ]; then roachprod run "${WORKLOAD_CLUSTER}":1 -- "sudo systemd-run --unit tpcc_run_${suffix} --same-dir --uid \$(id -u) --gid \$(id -g) bash ${pwd}/tpcc_run_${suffix}.sh" + else + echo "Run --> roachprod run "${WORKLOAD_CLUSTER}":1 -- \"sudo systemd-run --unit tpcc_run_${suffix} --same-dir --uid \\\$(id -u) --gid \\\$(id -g) bash ${pwd}/tpcc_run_${suffix}.sh\"" fi done diff --git a/pkg/cmd/drtprod/scripts/generate_tpch_run.sh b/pkg/cmd/drtprod/scripts/generate_tpch_run.sh index 1a13a0e52c21..fcda1437ba6c 100755 --- a/pkg/cmd/drtprod/scripts/generate_tpch_run.sh +++ b/pkg/cmd/drtprod/scripts/generate_tpch_run.sh @@ -25,7 +25,7 @@ if [ -z "${WORKLOAD_CLUSTER}" ]; then exit 1 fi -absolute_path=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "realpath ./tpch_run_${suffix}.sh") +absolute_path=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "realpath ./cockroach") pwd=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "dirname ${absolute_path}") PGURLS=$(roachprod pgurl "${CLUSTER}":1) diff --git a/pkg/cmd/drtprod/scripts/tpcc_init.sh b/pkg/cmd/drtprod/scripts/tpcc_init.sh index 55b0d4821ce7..8641336113c6 100755 --- a/pkg/cmd/drtprod/scripts/tpcc_init.sh +++ b/pkg/cmd/drtprod/scripts/tpcc_init.sh @@ -36,7 +36,7 @@ if [ -z "${WORKLOAD_CLUSTER}" ]; then exit 1 fi -absolute_path=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "realpath ./tpcc_init_${suffix}.sh") +absolute_path=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "realpath ./cockroach") pwd=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "dirname ${absolute_path}") PGURLS=$(roachprod pgurl "${CLUSTER}":1) @@ -50,4 +50,6 @@ roachprod ssh "${WORKLOAD_CLUSTER}":1 -- "chmod +x tpcc_init_${suffix}.sh" if [ "$execute_script" = "true" ]; then roachprod run "${WORKLOAD_CLUSTER}":1 -- "sudo systemd-run --unit tpcc_init_${suffix} --same-dir --uid \$(id -u) --gid \$(id -g) bash ${pwd}/tpcc_init_${suffix}.sh" +else + echo "Run --> roachprod run "${WORKLOAD_CLUSTER}":1 -- \"sudo systemd-run --unit tpcc_init_${suffix} --same-dir --uid \\\$(id -u) --gid \\\$(id -g) bash ${pwd}/tpch_init_${suffix}.sh\"" fi diff --git a/pkg/cmd/drtprod/scripts/tpch_init.sh b/pkg/cmd/drtprod/scripts/tpch_init.sh index 5aa89fd40996..00ba2fb07afd 100755 --- a/pkg/cmd/drtprod/scripts/tpch_init.sh +++ b/pkg/cmd/drtprod/scripts/tpch_init.sh @@ -36,7 +36,7 @@ if [ -z "${WORKLOAD_CLUSTER}" ]; then exit 1 fi -absolute_path=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "realpath ./tpch_init_${suffix}.sh") +absolute_path=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "realpath ./cockroach") pwd=$(roachprod run "${WORKLOAD_CLUSTER}":1 -- "dirname ${absolute_path}") PGURLS=$(roachprod pgurl "${CLUSTER}":1)