-
Notifications
You must be signed in to change notification settings - Fork 42
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 #1182 from breatheco-de/development
Development
- Loading branch information
Showing
49 changed files
with
1,311 additions
and
736 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Change Tracking Marker | ||
|
||
on: | ||
push: {} | ||
|
||
|
||
jobs: | ||
|
||
newrelic-prod: | ||
runs-on: ubuntu-latest | ||
name: New Relic | ||
if: >- | ||
github.repository == 'breatheco-de/apiv2' && | ||
github.event_name == 'push' && | ||
github.ref == 'refs/heads/master' | ||
steps: | ||
|
||
# This step builds a var with the release tag value to use later | ||
- name: Set Release Version from Tag | ||
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | ||
|
||
# This step creates a new Change Tracking Marker | ||
- name: New Relic Application Deployment Marker | ||
uses: newrelic/[email protected] | ||
with: | ||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }} | ||
guid: ${{ secrets.NEW_RELIC_DEPLOYMENT_ENTITY_GUID }} | ||
version: "${{ env.RELEASE_VERSION }}" | ||
user: "${{ github.actor }}" | ||
|
||
newrelic-dev: | ||
runs-on: ubuntu-latest | ||
name: New Relic | ||
if: >- | ||
github.repository == 'breatheco-de/apiv2' && | ||
github.event_name == 'push' && | ||
github.ref == 'refs/heads/development' | ||
steps: | ||
|
||
# This step builds a var with the release tag value to use later | ||
- name: Set Release Version from Tag | ||
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | ||
|
||
# This step creates a new Change Tracking Marker | ||
- name: New Relic Application Deployment Marker | ||
uses: newrelic/[email protected] | ||
with: | ||
apiKey: ${{ secrets.NEW_RELIC_API_KEY_DEV }} | ||
guid: ${{ secrets.NEW_RELIC_DEPLOYMENT_ENTITY_GUID_DEV }} | ||
version: "${{ env.RELEASE_VERSION }}" | ||
user: "${{ github.actor }}" |
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,59 @@ | ||
FROM newrelic/infrastructure:latest as infrastructure | ||
|
||
FROM heroku/heroku:22 | ||
|
||
COPY --from=infrastructure /usr/bin/newrelic-infra /usr/bin/newrelic-infra | ||
COPY --from=infrastructure /usr/bin/newrelic-infra-ctl /usr/bin/newrelic-infra-ctl | ||
COPY --from=infrastructure /usr/bin/newrelic-infra-service /usr/bin/newrelic-infra-service | ||
COPY --from=infrastructure /newrelic /newrelic | ||
|
||
ENV NEW_RELIC_LICENSE_KEY $NEW_RELIC_LICENSE_KEY | ||
|
||
RUN apt update -y \ | ||
&& apt install -y -qq software-properties-common curl \ | ||
&& add-apt-repository -y ppa:deadsnakes/ppa \ | ||
&& apt update -y -qq \ | ||
&& apt upgrade -y -qq \ | ||
&& apt install -y -qq --no-install-recommends software-properties-common curl libcap2-bin \ | ||
python3.11 python3.11-dev pip libpq-dev libboost-all-dev kmod sudo \ | ||
&& apt clean -y -qq \ | ||
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/* /tmp/* | ||
|
||
RUN python3.11 -m pip install pipenv && \ | ||
python3.11 -m pip cache purge && \ | ||
rm -rf $HOME/.cache/pipenv /tmp/* | ||
|
||
RUN useradd -ms /bin/bash 4geeks | ||
|
||
RUN mkdir /var/run/newrelic-infra | ||
RUN mkdir /var/db | ||
RUN mkdir /var/db/newrelic-infra | ||
RUN mkdir /var/db/newrelic-infra/data | ||
RUN chown -R 4geeks:4geeks /var/run/newrelic-infra | ||
RUN chown -R 4geeks:4geeks /var/db/newrelic-infra | ||
RUN chown -R 4geeks:4geeks /var/db/newrelic-infra/data | ||
|
||
RUN touch /etc/newrelic-infra.yml | ||
RUN chown 4geeks:4geeks /etc/newrelic-infra.yml | ||
|
||
USER 4geeks | ||
ENV NRIA_MODE="UNPRIVILEGED" | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
|
||
ENV NEW_RELIC_APP_NAME ${NEW_RELIC_APP_NAME} | ||
ENV NEW_RELIC_LICENSE_KEY ${NEW_RELIC_LICENSE_KEY} | ||
ENV NEW_RELIC_LOG ${NEW_RELIC_LOG} | ||
ENV NEW_RELIC_API_KEY ${NEW_RELIC_API_KEY} | ||
ENV NEW_RELIC_ACCOUNT_ID ${NEW_RELIC_ACCOUNT_ID} | ||
ENV NRIA_LICENSE_KEY ${NEW_RELIC_LICENSE_KEY} | ||
|
||
RUN echo $NEW_RELIC_LICENSE_KEY | ||
RUN echo ${NEW_RELIC_LICENSE_KEY} | ||
|
||
RUN pipenv install --system --deploy --ignore-pipfile && \ | ||
python3.11 -m pip cache purge && \ | ||
rm -rf $HOME/.cache/pipenv /tmp/* | ||
|
||
# RUN newrelic-infra |
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,51 @@ | ||
FROM newrelic/infrastructure:latest | ||
|
||
RUN echo "license_key: $NEW_RELIC_LICENSE_KEY" | tee -a /etc/newrelic-infra.yml | ||
|
||
RUN apk upgrade && \ | ||
apk add --no-cache curl gnupg python3 python3-dev py3-pip libpq boost-dev postgresql-dev libcap py3-pip py3-numpy py3-scipy \ | ||
musl-dev linux-headers gcc g++ cmake build-base cython libstdc++ gfortran wget freetype-dev libpng-dev openblas-dev \ | ||
git bash jemalloc-dev autoconf zlib-dev flex bison py3-numpy py3-scipy libffi-dev openssl-dev apache-arrow && \ | ||
python3 -m ensurepip && \ | ||
rm -r /usr/lib/python*/ensurepip && \ | ||
pip3 install --upgrade pip setuptools pipenv && \ | ||
adduser -D 4geeks && \ | ||
mkdir -p /app | ||
|
||
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h | ||
|
||
ARG ARROW_VERSION=14.0.1 | ||
ARG ARROW_SHA1=2ede75769e12df972f0acdfddd53ab15d11e0ac2 | ||
ARG ARROW_BUILD_TYPE=release | ||
|
||
ENV ARROW_HOME=/usr/local \ | ||
PARQUET_HOME=/usr/local | ||
|
||
RUN mkdir /mnt/arrow \ | ||
&& cd /mnt/arrow \ | ||
&& curl -L -o apache-arrow-${ARROW_VERSION}.tar.gz \ | ||
https://github.com/apache/arrow/archive/refs/tags/apache-arrow-${ARROW_VERSION}.tar.gz \ | ||
&& tar -xzvf apache-arrow-${ARROW_VERSION}.tar.gz \ | ||
&& cd arrow-apache-arrow-${ARROW_VERSION} \ | ||
&& ls | ||
|
||
USER 4geeks | ||
ENV NRIA_MODE="UNPRIVILEGED" | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN python3 --version | ||
RUN python3.11 --version | ||
|
||
RUN pipenv install --system --deploy --ignore-pipfile && \ | ||
pip3 cache purge && \ | ||
rm -rf $HOME/.cache/pipenv /tmp/* | ||
|
||
|
||
RUN newrelic-infra | ||
|
||
|
||
RUN newrelic profile configure --accountId $NEW_RELIC_ACCOUNT_ID --apiKey $NEW_RELIC_API_KEY && \ | ||
/usr/bin/newrelic install -n logs-integration | ||
# |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,3 +123,4 @@ redis = {extras = ["hiredis"], version = "*"} | |
brotli = "*" | ||
circuitbreaker = "*" | ||
kombu = "*" | ||
zstandard = "*" |
Oops, something went wrong.