Skip to content

Add azure-prebuild script #1351

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add azure-prebuild script #1351

wants to merge 1 commit into from

Conversation

lrafeei
Copy link
Contributor

@lrafeei lrafeei commented Apr 11, 2025

This script will enable Azure App Services to install New Relic before the app executes without having to override the startup script.

Copy link

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 5 0 0 0.47s
✅ MARKDOWN markdownlint 7 0 0 0 1.09s
✅ MARKDOWN markdown-link-check 7 0 0 17.84s
✅ PYTHON ruff 893 0 0 0 0.54s
✅ PYTHON ruff-format 893 0 0 0 0.33s
✅ YAML prettier 11 0 0 0 1.19s
✅ YAML v8r 11 0 0 4.88s
✅ YAML yamllint 11 0 0 0.55s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.07%. Comparing base (687d47c) to head (d58b04f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1351   +/-   ##
=======================================
  Coverage   81.07%   81.07%           
=======================================
  Files         204      204           
  Lines       22822    22822           
  Branches     3618     3618           
=======================================
  Hits        18502    18502           
  Misses       3120     3120           
  Partials     1200     1200           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lrafeei lrafeei marked this pull request as ready for review April 11, 2025 19:50
@lrafeei lrafeei requested a review from a team as a code owner April 11, 2025 19:50
Comment on lines +10 to +30
# Retrieve files to use in startup script:
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/newrelic_k8s_operator.py > newrelic_k8s_operator.py
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/requirements-vendor.txt > requirements-vendor.txt
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/requirements-builder.txt > requirements-builder.txt

cd /home/

pip install -r requirements-builder.txt

export NEW_RELIC_EXTENSIONS=false
export WRAPT_DISABLE_EXTENSIONS=true

pip install newrelic --target=./workspace/newrelic

mkdir -p ./workspace/vendor
pip install --target=./workspace/vendor -r requirements-vendor.txt

cp ./workspace/* /home/
cp /home/workspace/newrelic/newrelic/bootstrap/sitecustomize.py /home/sitecustomize.py

cd /home/site/wwwroot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Retrieve files to use in startup script:
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/newrelic_k8s_operator.py > newrelic_k8s_operator.py
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/requirements-vendor.txt > requirements-vendor.txt
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/requirements-builder.txt > requirements-builder.txt
cd /home/
pip install -r requirements-builder.txt
export NEW_RELIC_EXTENSIONS=false
export WRAPT_DISABLE_EXTENSIONS=true
pip install newrelic --target=./workspace/newrelic
mkdir -p ./workspace/vendor
pip install --target=./workspace/vendor -r requirements-vendor.txt
cp ./workspace/* /home/
cp /home/workspace/newrelic/newrelic/bootstrap/sitecustomize.py /home/sitecustomize.py
cd /home/site/wwwroot
# Retrieve files to use in startup script:
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/newrelic_k8s_operator.py > newrelic_k8s_operator.py
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/requirements-vendor.txt > requirements-vendor.txt
mkdir -p /home/.newrelic
cd /home/.newrelic
pip install 'setuptools>=40.8.0' wheel
export NEW_RELIC_EXTENSIONS=false
export WRAPT_DISABLE_EXTENSIONS=true
pip install newrelic --target=./newrelic
mkdir -p ./vendor
pip install --target=./vendor -r requirements-vendor.txt
cp /home/.newrelic/newrelic/bootstrap/sitecustomize.py /home/.newrelic/sitecustomize.py
cd /home/site/wwwroot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants