-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2563 from DataDog/szegedi/profiling-onboarding
PROF-9979: Add host system tests for DD_PROFILING_ENABLED=auto
- Loading branch information
Showing
16 changed files
with
254 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
..._machine/provisions/host-auto-inject-install-script-profiling/auto-inject_host_script.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#Execute script installation for lib-injection packages using install script | ||
- os_type: linux | ||
copy_files: | ||
- name: copy-auto-install-script | ||
local_path: utils/build/virtual_machine/provisions/auto-inject/repositories/autoinstall/execute_install_script.sh | ||
- name: copy-tracer-debug-config | ||
local_path: utils/build/virtual_machine/provisions/auto-inject/tracer_debug/debug_config.yaml | ||
remote-command: | | ||
printf "BOGUS=foo\n" | sudo tee -a /etc/environment | ||
printf "DD_APM_RECEIVER_SOCKET=/opt/datadog/apm/inject/run/apm.socket\nDD_DOGSTATSD_SOCKET=/opt/datadog/apm/inject/run/dsd.socket\nDD_USE_DOGSTATSD=true\n" | sudo tee /var/run/datadog-installer/environment | ||
DD_APM_INSTRUMENTATION_ENABLED=host DD_PROFILING_ENABLED=auto bash execute_install_script.sh | ||
sudo mkdir -p /var/run/datadog-installer | ||
sudo mkdir -p /opt/datadog/apm/inject/run | ||
sudo chmod 777 /opt/datadog/apm/inject/run | ||
sudo cp debug_config.yaml /etc/datadog-agent/inject/debug_config.yaml |
32 changes: 32 additions & 0 deletions
32
.../build/virtual_machine/provisions/host-auto-inject-install-script-profiling/provision.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#Optional: Load the environment variables | ||
init-environment: !include utils/build/virtual_machine/provisions/auto-inject/auto-inject-environment.yml | ||
|
||
#Mandatory: Scripts to extract the installed/tested components (json {component1:version, component2:version}) | ||
tested_components: | ||
install: !include utils/build/virtual_machine/provisions/auto-inject/auto-inject-tested_components.yml | ||
|
||
#Mandatory: Steps to install provision | ||
provision_steps: | ||
- init-config #Very first machine actions, like disable auto updates | ||
- prepare-repos #Configure the reporitories for install auto-injection | ||
- install-agent #Install the agent (allways latest release) | ||
- autoinjection_install_script #Install the auto-injection softaware 'datadog-apm-inject' and 'datadog-apm-library-$DD_LANG' using the agent install script | ||
|
||
init-config: | ||
cache: true | ||
install: !include utils/build/virtual_machine/provisions/auto-inject/auto-inject_init_vm_config.yml | ||
|
||
prepare-repos: | ||
cache: true | ||
install: !include utils/build/virtual_machine/provisions/auto-inject/auto-inject-prepare_repos.yml | ||
|
||
install-agent: | ||
install: | ||
- os_type: linux | ||
remote-command: | | ||
REPO_URL=$DD_agent_repo_url DD_AGENT_DIST_CHANNEL=$DD_agent_dist_channel DD_AGENT_MAJOR_VERSION=$DD_agent_major_version bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)" | ||
autoinjection_install_script: | ||
install: !include utils/build/virtual_machine/provisions/host-auto-inject-install-script-profiling/auto-inject_host_script.yml | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
utils/build/virtual_machine/weblogs/nodejs/provision_test-app-nodejs-profiling.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
lang_variant: | ||
name: node16 | ||
version: 16 | ||
cache: true | ||
install: | ||
- os_type: linux | ||
os_distro: deb | ||
remote-command: curl -sL https://deb.nodesource.com/setup_16.x | sudo bash - && sudo apt-get install -y nodejs | ||
- os_type: linux | ||
os_distro: rpm | ||
remote-command: | | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
nvm install 16.0.0 | ||
nvm use node | ||
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local | ||
weblog: | ||
name: test-app-nodejs-profiling | ||
excluded_os_branches: [amazon_linux2_dotnet6, amazon_linux2023_amd64] | ||
install: | ||
- os_type: linux | ||
copy_files: | ||
- name: copy-service | ||
local_path: utils/build/virtual_machine/weblogs/nodejs/test-app-nodejs-profiling/test-app.service | ||
|
||
- name: copy-run-weblog-script | ||
local_path: utils/build/virtual_machine/weblogs/nodejs/test-app-nodejs-profiling/test-app-nodejs_run.sh | ||
|
||
- name: copy-binary | ||
local_path: lib-injection/build/docker/nodejs/sample-app/index.js | ||
|
||
remote-command: sh test-app-nodejs_run.sh |
13 changes: 13 additions & 0 deletions
13
utils/build/virtual_machine/weblogs/nodejs/test-app-nodejs-profiling/test-app-nodejs_run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
echo "START RUN APP" | ||
|
||
|
||
sudo sed -i "s/18080/5985/g" index.js | ||
sudo cp index.js /home/datadog | ||
sudo cp test-app.service /etc/systemd/system/test-app.service | ||
sudo systemctl daemon-reload | ||
sudo systemctl enable test-app.service | ||
sudo systemctl start test-app.service | ||
sudo systemctl status test-app.service | ||
|
||
echo "RUN DONE" |
21 changes: 21 additions & 0 deletions
21
utils/build/virtual_machine/weblogs/nodejs/test-app-nodejs-profiling/test-app.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[Unit] | ||
Description=Nodejs Weblog App Service | ||
After=syslog.target network.target | ||
|
||
[Service] | ||
SuccessExitStatus=143 | ||
|
||
User=datadog | ||
|
||
Type=simple | ||
|
||
Environment=DD_APM_INSTRUMENTATION_DEBUG=TRUE | ||
Environment=DD_PROFILING_ENABLED=auto | ||
Environment=DD_PROFILING_UPLOAD_PERIOD=10 | ||
Environment=DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD=1500 | ||
WorkingDirectory=/home/datadog | ||
ExecStart=/bin/bash -c 'node index.js' | ||
ExecStop=/bin/kill -15 $MAINPID | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.