Skip to content
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

Initial dockerized dev environment prototype. #162

Merged
merged 4 commits into from
Jun 1, 2021
Merged

Conversation

zsistla
Copy link
Contributor

@zsistla zsistla commented May 7, 2021

This is a prototype of a dockerized development environment that would allow contributors to both develop and test (using unit tests AND integration tests) without having to set up a specific environment on their own system. Integration tests send actual data to the New Relic backend and therefore requires a license key (Sign up at https://newrelic.com/signup for a free account.).

Currently docker-compose spins up mysql and redis databases in separate containers.

Two environment variables to note:
NEWRELIC_LICENSE_KEY is required to run the integration tests and should be set to your NR license key.
If your collector isn’t the default (collector.newrelic.com), set the NEWRELIC_COLLECTOR_HOST to the appropriate value.

PHP_VER can also be set, but hasn’t been tested beyond 8.0.

Set all environment variables prior to running the development environment.

To start the dev environment type make dev-start. This will create a set of docker containers.
A prompt will open and you’ll be able to compile and run all make commands right away with no additional setup (for example: make -j4 all or make -j4 valgrind or make -j4 run_tests).

After compiling the agent, the integration tests can be run using the integration_runner.
To run all integration tests, from the prompt, run: ./bin/integration_runner -agent ./agent/.libs/newrelic.so
To run redis only: ./bin/integration_runner -agent ./agent/.libs/newrelic.so -pattern tests/integration/redis/*

To end the session type exit. You can run make dev-stop to stop the docker-compose containers.

files/Dockerfile Outdated Show resolved Hide resolved
NEWRELIC_COLLECTOR_HOST : ${NEWRELIC_COLLECTOR_HOST:-collector.newrelic.com}
NEWRELIC_LICENSE_KEY: ${NEWRELIC_LICENSE_KEY}
volumes:
# - ./:/usr/src/myapp
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete?

files/Dockerfile Outdated
Comment on lines 17 to 19
# The sql tests produce partition/filtered but tests can't currently be updated
# to reflect that since the sql database on CI doesn't have those values.
# RUN docker-php-ext-install pdo pdo_mysql
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
# The sql tests produce partition/filtered but tests can't currently be updated
# to reflect that since the sql database on CI doesn't have those values.
# RUN docker-php-ext-install pdo pdo_mysql
# The explain plan in the sql tests contain partition/filtered properties
# but the tests can't currently be updated to reflect that since the sql
# database on our CI doesn't include those values.
# RUN docker-php-ext-install pdo pdo_mysql

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, thanks.

Copy link
Contributor

@kneitinger kneitinger left a comment

Choose a reason for hiding this comment

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

Awesome job Amber!

@zsistla zsistla merged commit 53692fe into newrelic:dev Jun 1, 2021
Fahmy-Mohammed pushed a commit that referenced this pull request Aug 3, 2021
* Initial dockerized dev environment prototype.

* Added `docs/dev_environment.md` readme and a few more `Makefile` options.
zsistla added a commit to zsistla/docs-website that referenced this pull request Aug 23, 2021
---
subject: PHP agent
releaseDate: '2021-08-23'
version: 9.18.1.303
downloadLink: 'https://download.newrelic.com/php_agent/archive/9.18.1.303'
---

## New Relic PHP Agent v9.18.1 ##

### New Features ###
* [Added](newrelic/newrelic-php-agent#162) a docker development environment. It's now possible for contributors to both develop and test (unit tests and integration tests) without setting up a specific environment on their own system. Please see our [documentation](https://github.com/newrelic/newrelic-php-agent/blob/main/docs/dev_environment.md) for more information.
* [Route caching in `Laravel 7.x` is now supported!](newrelic/newrelic-php-agent#174). Transaction naming now works with routes cached via `php artisan route:cache`. @stockalexander, thanks for your contribution!
* `Redis::mget` and `Redis::mset` [functions are now supported](newrelic/newrelic-php-agent#156). @b-viguier, thanks for your contribution!

### Bug Fixes ###
* [Fixed](newrelic/newrelic-php-agent#161) instances where a memory leak was occurring with our `curl multi` instrumentation.
* [Fixed](newrelic/newrelic-php-agent#176) an issue where a supportability metric used to track an edge case was causing a segfault.
* [Fixed](newrelic/newrelic-php-agent#87) an issue where PHP versions with an unknown API version were incorrectly handled during Debian package install.
* [Fixed](newrelic/newrelic-php-agent#164) instances where `parent.transportDuration` values are `0` for transactions between two PHP applications instrumented through distributed tracing. @b-viguier, thanks for your contribution!
* [Fixed](newrelic/newrelic-php-agent#158) an issue where the `newrelic.ini` configuration file was incorrectly installed. @b-viguier, thanks for your contribution!

### Support Statement ###
* New Relic recommends that you upgrade the agent regularly and at a minimum every 3 months. As of this release, the oldest supported version is [8.6.0](/docs/release-notes/agent-release-notes/php-release-notes/php-agent-860238/).
zuluecho9 pushed a commit to zsistla/docs-website that referenced this pull request Aug 23, 2021
---
subject: PHP agent
releaseDate: '2021-08-23'
version: 9.18.1.303
downloadLink: 'https://download.newrelic.com/php_agent/archive/9.18.1.303'
---

## New Relic PHP Agent v9.18.1 ##

### New Features ###
* [Added](newrelic/newrelic-php-agent#162) a docker development environment. It's now possible for contributors to both develop and test (unit tests and integration tests) without setting up a specific environment on their own system. Please see our [documentation](https://github.com/newrelic/newrelic-php-agent/blob/main/docs/dev_environment.md) for more information.
* [Route caching in `Laravel 7.x` is now supported!](newrelic/newrelic-php-agent#174). Transaction naming now works with routes cached via `php artisan route:cache`. @stockalexander, thanks for your contribution!
* `Redis::mget` and `Redis::mset` [functions are now supported](newrelic/newrelic-php-agent#156). @b-viguier, thanks for your contribution!

### Bug Fixes ###
* [Fixed](newrelic/newrelic-php-agent#161) instances where a memory leak was occurring with our `curl multi` instrumentation.
* [Fixed](newrelic/newrelic-php-agent#176) an issue where a supportability metric used to track an edge case was causing a segfault.
* [Fixed](newrelic/newrelic-php-agent#87) an issue where PHP versions with an unknown API version were incorrectly handled during Debian package install.
* [Fixed](newrelic/newrelic-php-agent#164) instances where `parent.transportDuration` values are `0` for transactions between two PHP applications instrumented through distributed tracing. @b-viguier, thanks for your contribution!
* [Fixed](newrelic/newrelic-php-agent#158) an issue where the `newrelic.ini` configuration file was incorrectly installed. @b-viguier, thanks for your contribution!

### Support Statement ###
* New Relic recommends that you upgrade the agent regularly and at a minimum every 3 months. As of this release, the oldest supported version is [8.6.0](/docs/release-notes/agent-release-notes/php-release-notes/php-agent-860238/).
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.

None yet

3 participants