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

Merge main #874

Merged
merged 19 commits into from
Jul 31, 2023
Merged
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
50 changes: 0 additions & 50 deletions .github/actions/setup-python-matrix/action.yml

This file was deleted.

22 changes: 18 additions & 4 deletions .github/containers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
freetds-common \
freetds-dev \
gcc \
gfortran \
git \
libbz2-dev \
libcurl4-openssl-dev \
Expand All @@ -43,6 +44,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
make \
odbc-postgresql \
openssl \
pkg-config \
python2-dev \
python3-dev \
python3-pip \
Expand All @@ -55,10 +57,22 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*

# Build librdkafka from source
ARG LIBRDKAFKA_VERSION=2.1.1
RUN cd /tmp && \
wget https://github.com/confluentinc/librdkafka/archive/refs/tags/v${LIBRDKAFKA_VERSION}.zip -O ./librdkafka.zip && \
unzip ./librdkafka.zip && \
rm ./librdkafka.zip && \
cd ./librdkafka-${LIBRDKAFKA_VERSION} && \
./configure && \
make all install && \
cd /tmp && \
rm -rf ./librdkafka-${LIBRDKAFKA_VERSION}

# Setup ODBC config
RUN sed -i 's/Driver=psqlodbca.so/Driver=\/usr\/lib\/x86_64-linux-gnu\/odbc\/psqlodbca.so/g' /etc/odbcinst.ini && \
sed -i 's/Driver=psqlodbcw.so/Driver=\/usr\/lib\/x86_64-linux-gnu\/odbc\/psqlodbcw.so/g' /etc/odbcinst.ini && \
sed -i 's/Setup=libodbcpsqlS.so/Setup=\/usr\/lib\/x86_64-linux-gnu\/odbc\/libodbcpsqlS.so/g' /etc/odbcinst.ini
RUN sed -i 's|Driver=psqlodbca.so|Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so|g' /etc/odbcinst.ini && \
sed -i 's|Driver=psqlodbcw.so|Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so|g' /etc/odbcinst.ini && \
sed -i 's|Setup=libodbcpsqlS.so|Setup=/usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so|g' /etc/odbcinst.ini

# Set the locale
RUN locale-gen --no-purge en_US.UTF-8
Expand All @@ -79,7 +93,7 @@ RUN echo 'eval "$(pyenv init -)"' >>$HOME/.bashrc && \
pyenv update

# Install Python
ARG PYTHON_VERSIONS="3.10 3.9 3.8 3.7 3.11 2.7 pypy2.7-7.3.11 pypy3.7"
ARG PYTHON_VERSIONS="3.10 3.9 3.8 3.7 3.11 2.7 pypy2.7-7.3.12 pypy3.8-7.3.11"
COPY --chown=1000:1000 --chmod=+x ./install-python.sh /tmp/install-python.sh
COPY ./requirements.txt /requirements.txt
RUN /tmp/install-python.sh && \
Expand Down
6 changes: 5 additions & 1 deletion .github/containers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ default: test
.PHONY: build
build:
@# Perform a shortened build for testing
@docker build --build-arg='PYTHON_VERSIONS=3.10 2.7' $(MAKEFILE_DIR) -t ghcr.io/newrelic/newrelic-python-agent-ci:local
@docker build $(MAKEFILE_DIR) \
-t ghcr.io/newrelic/newrelic-python-agent-ci:local \
--build-arg='PYTHON_VERSIONS=3.10 2.7'

.PHONY: test
test: build
Expand All @@ -38,7 +40,9 @@ run: build
@docker run --rm -it \
--mount type=bind,source="$(REPO_ROOT)",target=/home/github/python-agent \
--workdir=/home/github/python-agent \
--add-host=host.docker.internal:host-gateway \
-e NEW_RELIC_HOST="${NEW_RELIC_HOST}" \
-e NEW_RELIC_LICENSE_KEY="${NEW_RELIC_LICENSE_KEY}" \
-e NEW_RELIC_DEVELOPER_MODE="${NEW_RELIC_DEVELOPER_MODE}" \
-e GITHUB_ACTIONS="true" \
ghcr.io/newrelic/newrelic-python-agent-ci:local /bin/bash
7 changes: 2 additions & 5 deletions .github/containers/install-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

SCRIPT_DIR=$(dirname "$0")
PIP_REQUIREMENTS=$(cat /requirements.txt)
set -eo pipefail

main() {
# Coerce space separated string to array
Expand Down Expand Up @@ -50,7 +47,7 @@ main() {
pyenv global ${PYENV_VERSIONS[@]}

# Install dependencies for main python installation
pyenv exec pip install --upgrade $PIP_REQUIREMENTS
pyenv exec pip install --upgrade -r /requirements.txt
}

main
Loading
Loading