Skip to content
Open
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
4 changes: 3 additions & 1 deletion terraform/kafka_runner/run-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ def main():
ssh_account=ssh_account,
instance_name=args.instance_name,
jdk_version=args.jdk_version,
jdk_arch=args.jdk_arch
jdk_arch=args.jdk_arch,
JOB_ID=JOB_ID,
enable_cloudwatch=args.enable_cloudwatch
)
else:
logging.info(f"using existing ami: {args.existing_ami}")
Expand Down
1 change: 1 addition & 0 deletions terraform/kafka_runner/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def parse_args():
parser.add_argument("--jdk-arch", action="store", type=str, default="x64",
help="JDK arch to execute."),
parser.add_argument("--nightly", action="store_true", default=False, help="Mark this as a nightly run")
parser.add_argument("--enable-cloudwatch", action="store", type=parse_bool, default=False, help="Enable cloudwatch metrics if true")
parser.add_argument("--new-globals", action="store", type=str, default=None, help="Additional global params to be passed in ducktape")
parser.add_argument("--arm-image", action="store_true", help="load the ARM based image of specified distro")
parser.add_argument("--existing-ami", action="store", type=str, default=None, help="AMI ID to use for the instance, skipping ami creation")
Expand Down
12 changes: 10 additions & 2 deletions vagrant/aws-packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,23 @@
"type": "shell",
"inline": ["while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done"]
},
{
"type": "file",
"source": "../vagrant/cloudwatch-agent-configuration.json",
"destination": "/tmp/cloudwatch-agent-configuration.json"
},
{
"environment_vars": [
"JDK_MAJOR={{ user `jdk_version` }}",
"JDK_ARCH={{ user `jdk_arch` }}"
"JDK_ARCH={{ user `jdk_arch` }}",
"SEMAPHORE_JOB_ID={{ user `JOB_ID` }}",
"ENABLE_CLOUDWATCH={{ user `enable_cloudwatch` }}"
],
"execute_command": "echo 'packer' | {{ .Vars }} sudo -E -S bash '{{ .Path }}'",
"type": "shell",
"scripts": [
"../vagrant/base.sh"
"../vagrant/base.sh",
"../vagrant/cloudwatch-agent-setup.sh"
]
}
]
Expand Down
7 changes: 7 additions & 0 deletions vagrant/cloudwatch-agent-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

set -ex

if [ "${ENABLE_CLOUDWATCH,,}" = "false" ]; then
echo "Cloudwatch is disabled, skipping setup"
exit 0
else
echo "CloudWatch setup enabled, installing amazon-cloudwatch-agent..."
fi

architecture=arm64
arch=$(uname -m)

Expand Down