Skip to content

Commit

Permalink
chore: add base image for canary-checker
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Jul 14, 2024
1 parent 97b44b9 commit 2853a04
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 3 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
permissions:
contents: read

jobs:
semantic-release:
permissions:
contents: write # for codfish/semantic-release-action to create release tags
Expand Down Expand Up @@ -37,7 +36,7 @@ jobs:
- name: Set up Docker Buildx #must be executed before a step that contains platforms
uses: docker/setup-buildx-action@v2

- name: Publish minimal image to registry
- name: Publish base image to registry
uses: elgohr/Publish-Docker-Github-Action@eb53b3ec07136a6ebaed78d8135806da64f7c7e2 # v5
with:
name: flanksource/base-image
Expand All @@ -47,3 +46,22 @@ jobs:
dockerfile: Dockerfile
tags: 'latest,v${{ env.RELEASE_VERSION }}'
platforms: linux/amd64,linux/arm64

- name: Publish canary-checker base image to registry
uses: elgohr/Publish-Docker-Github-Action@eb53b3ec07136a6ebaed78d8135806da64f7c7e2 # v5
with:
name: flanksource/base-image-canary-checker
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
snapshot: true
dockerfile: Dockerfile.canary-checker
tags: 'latest,v${{ env.RELEASE_VERSION }}'
platforms: linux/amd64,linux/arm64

- name: Update base image tag in canary-checker
run: |
sed -i "s|flanksource/base-image:[^ ]*|flanksource/base-image:v${{ env.RELEASE_VERSION }}|g" Dockerfile.canary-checker
git config --global user.name 'flankbot' && git config --global user.email 'flankbot@users.noreply.github.com'
git add Dockerfile.canary-checker
git commit -m "[skip ci] bump canary-checker base image to v${{ env.RELEASE_VERSION }}
git push
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ RUN apt-get update && apt-get upgrade -y && \
rm -Rf /var/lib/apt/lists/* && \
apt-get clean

# stern, jq, yq
RUN curl -sLS https://get.arkade.dev | sh && \
arkade get kubectl stern jq yq --path /usr/bin && \
chmod +x /usr/bin/kubectl /usr/bin/stern /usr/bin/jq /usr/bin/yq

# Azure CLI
RUN mkdir -p /etc/apt/keyrings && \
curl -sLS https://packages.microsoft.com/keys/microsoft.asc | \
gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null && \
Expand All @@ -27,7 +29,7 @@ RUN mkdir -p /etc/apt/keyrings && \
apt-get install -y azure-cli && \
apt-get clean

# Install AWS CLI
# AWS CLI
RUN AWSCLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" && \
if [ "${TARGETARCH}" = "arm64" ]; then \
AWSCLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip"; \
Expand All @@ -36,6 +38,7 @@ RUN AWSCLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" && \
unzip -q awscliv2.zip && ./aws/install -i /aws -b /usr/bin/ && \
rm awscliv2.zip

# GCP CLI
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \
apt-get update -y && \
Expand Down
69 changes: 69 additions & 0 deletions Dockerfile.canary-checker
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
FROM --platform=${BUILDPLATFORM:-linux/amd64} flanksource/base-image:v0.2.0
ARG TARGETARCH

WORKDIR /app

ARG TARGETARCH

RUN apt-get update && \
apt-get install -y python3 python3-pip zip --no-install-recommends && \
rm -Rf /var/lib/apt/lists/* && \
rm -Rf /usr/share/doc && rm -Rf /usr/share/man && \
apt-get clean

RUN pip3 install pip pyyaml lxml requests robotframework \
robotframework \
robotframework-jsonlibrary \
robotframework-jsonschemalibrary \
robotframework-requests \
robotframework-restlibrary \
robotframework-seleniumlibrary \
robotframework-excellib \
robotframework-crypto \
robotframework-databaselibrary \
psycopg2-binary \
PyMySQL

# Restic
ENV RESTIC_VERSION=0.15.2
RUN curl -L https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_${TARGETARCH}.bz2 -o restic.bz2 && \
bunzip2 /app/restic.bz2 && \
chmod +x /app/restic && \
mv /app/restic /usr/local/bin/ && \
rm -rf /app/restic.bz2

# Mergestat
# Unsupported in arm64 as of yet
RUN curl -L https://github.com/flanksource/askgit/releases/download/v0.61.0-flanksource.1/mergestat-linux-amd64.tar.gz -o mergestat.tar.gz && \
tar zxf mergestat.tar.gz -C /usr/local/bin/ && \
rm mergestat.tar.gz

# K6
ENV K6_VERSION=v0.47.0
RUN curl -L https://github.com/grafana/k6/releases/download/${K6_VERSION}/k6-${K6_VERSION}-linux-${TARGETARCH}.tar.gz -o k6.tar.gz && \
tar xvf k6.tar.gz && \
mv k6-${K6_VERSION}-linux-${TARGETARCH}/k6 /usr/local/bin/k6 && \
rm k6.tar.gz

# Benthos: high performance and resilient stream processor
RUN curl -Lsf https://sh.benthos.dev | bash -s -- 4.22.0

# dsq: commandline tool for running SQL queries against JSON, CSV, Excel, Parquet, and more
RUN curl -L https://github.com/multiprocessio/dsq/releases/download/v0.23.0/dsq-linux-x64-v0.23.0.zip -o dsq.zip && \
unzip -q dsq.zip && \
mv dsq /usr/local/bin/dsq && \
rm dsq.zip

ENV SDKMAN_DIR="/usr/lib/sdkman"

ENV JAVA_VERSION=21.0.2-tem
ENV JMETER_VERSION=5.6
ENV JMETER_HOME=${SDKMAN_DIR}/candidates/jmeter/${JMETER_VERSION}
ENV JAVA_HOME=${SDKMAN_DIR}/candidates/java/${JAVA_VERSION}
ENV PATH="$PATH:$SDKMAN_DIR/bin:$JAVA_HOME/bin:$JMETER_HOME/bin"
SHELL [ "bash", "-c" ]
RUN curl -s "https://get.sdkman.io?rcupdate=false" | bash && \
. $SDKMAN_DIR/bin/sdkman-init.sh && \
sdk install java ${JAVA_VERSION} ${JAVA_HOME} && \
sdk install jmeter ${JMETER_VERSION} ${JMETER_HOME} && \
sdk flush tmp

0 comments on commit 2853a04

Please sign in to comment.