Skip to content

Commit

Permalink
232-ingest-process-monitoring-seems-to-be-not-working (#301)
Browse files Browse the repository at this point in the history
This makes the scraper work with the new log file format. It also
accounts for promql being an architecture specific binary that must be
installed on the import platofrm (it is installed in the container image
but not necessarily when running the import as a script). This exercise
reinforces the need to migrate the metrics into the code somehow,
although that won't be a trivial exercise.
  • Loading branch information
randytpierce authored Jan 25, 2024
2 parents 72466b8 + b7a1f03 commit 960f8d2
Show file tree
Hide file tree
Showing 6 changed files with 374 additions and 328 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
Expand All @@ -53,7 +53,6 @@ jobs:
- name: Code Coverage Report
uses: irongut/[email protected]
with:
header: Test Coverage Report
filename: coverage.xml
badge: true
fail_below_min: false
Expand All @@ -78,7 +77,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Generate image metadata
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
id: meta
with:
images: |
Expand Down Expand Up @@ -124,7 +123,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Generate image metadata
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
id: meta
with:
images: |
Expand Down Expand Up @@ -160,6 +159,7 @@ jobs:
runs-on: ubuntu-latest
needs: build-ingest
steps:
- uses: actions/checkout@v4 # Supply git info to upload-serif
- name: Extract SHORT_SHA
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV"
- name: Scan image with Trivy
Expand All @@ -177,13 +177,14 @@ jobs:
TRIVY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Trivy scan results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-ingest-results.sarif"
scan-import:
runs-on: ubuntu-latest
needs: build-import
steps:
- uses: actions/checkout@v4 # Supply git info to upload-serif
- name: Extract SHORT_SHA
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV"
- name: Scan image with Trivy
Expand All @@ -201,6 +202,6 @@ jobs:
TRIVY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Trivy scan results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-import-results.sarif"
9 changes: 7 additions & 2 deletions docker/import/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ RUN apt-get update && apt-get upgrade -y && \

WORKDIR /app

# Install promql
ARG PROMQL_VERSION=v0.3.0
RUN echo "$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)" && \
curl -L https://github.com/nalbury/promql-cli/releases/download/${PROMQL_VERSION}/promql-${PROMQL_VERSION}-linux-$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/).tar.gz | tar xz --directory /usr/local/bin

# Install the couchbase tools
ENV CB_VERSION=7.2.2
ARG CB_VERSION=7.2.2
RUN curl -L https://packages.couchbase.com/releases/${CB_VERSION}/couchbase-server-tools_${CB_VERSION}-linux_$(uname -m).tar.gz | tar xz --directory /usr/local

# Copy the scripts and metadata dirs so the import script can run
Expand All @@ -44,4 +49,4 @@ COPY ./mats_metadata_and_indexes /app/mats_metadata_and_indexes

USER ${USERNAME}

ENTRYPOINT ["bash", "./scripts/VXingest_utilities/run-import.sh"]
ENTRYPOINT ["bash", "./scripts/VXingest_utilities/run-import.sh"]
Loading

0 comments on commit 960f8d2

Please sign in to comment.