Skip to content

Commit

Permalink
Merge branch 'master' into statsd_and_multi_imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jertel authored Apr 25, 2021
2 parents cef5e2b + 92f84f7 commit 93309ae
Show file tree
Hide file tree
Showing 55 changed files with 2,259 additions and 1,644 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PLEASE READ: The majority of topics are better suited for the Discussion forum. You can access this area by clicking The Discussions link above. Please search the discussions area first, for keywords that could be associated with the problem you are experiencing. If you do not see an existing discussion, please open a new discussion and include sufficient details for someone in the community to help you.

If you are confident you have discovered a legitimate issue, attach logs and reproduction steps to this issue. Failure to provide sufficient information will likely cause this issue to go stale and eventually be deleted.
28 changes: 28 additions & 0 deletions .github/workflows/master_build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: master_build_test

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Build and run tests
run: make test-docker
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: upload_python_package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
19 changes: 19 additions & 0 deletions .github/workflows/upload_chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: upload_chart

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Helm push chart
env:
HELM_REPO_ACCESS_TOKEN: ${{ secrets.HELM_REPO_ACCESS_TOKEN }}
run: |
wget https://get.helm.sh/helm-v3.2.1-linux-amd64.tar.gz
tar xf helm-v3.2.1-linux-amd64.tar.gz
linux-amd64/helm plugin install https://github.com/chartmuseum/helm-push
linux-amd64/helm push chart/elastalert2 https://charts.banzaicloud.io/gh/Codesim-LLC
27 changes: 0 additions & 27 deletions .secrets.baseline

This file was deleted.

42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM python:alpine as builder

LABEL description="Elastalert 2 suitable for Kubernetes and Helm"
LABEL maintainer="Jason Ertel (jertel at codesim.com)"

RUN apk --update upgrade && \
apk add git && \
rm -rf /var/cache/apk/*

RUN mkdir -p /opt/elastalert && \
git clone https://github.com/jertel/elastalert2 /tmp/elastalert && \
cd /tmp/elastalert && \
pip install setuptools wheel && \
python setup.py sdist bdist_wheel

FROM python:alpine

COPY --from=builder /tmp/elastalert/dist/*.tar.gz /tmp/

RUN apk --update upgrade && \
apk add gcc libffi-dev musl-dev python3-dev openssl-dev tzdata libmagic cargo && \
pip install /tmp/*.tar.gz && \
apk del gcc libffi-dev musl-dev python3-dev openssl-dev cargo && \
rm -rf /var/cache/apk/*

RUN mkdir -p /opt/elastalert && \
echo "#!/bin/sh" >> /opt/elastalert/run.sh && \
echo "set -e" >> /opt/elastalert/run.sh && \
echo "elastalert-create-index --config /opt/config/elastalert_config.yaml" >> /opt/elastalert/run.sh && \
echo "elastalert --config /opt/config/elastalert_config.yaml \"\$@\"" >> /opt/elastalert/run.sh && \
chmod +x /opt/elastalert/run.sh

ENV TZ "UTC"

WORKDIR /opt/elastalert
ENTRYPOINT ["/opt/elastalert/run.sh"]
6 changes: 4 additions & 2 deletions Dockerfile-test
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM ubuntu:latest

RUN apt-get update && apt-get upgrade -y
RUN apt-get -y install build-essential python3.6 python3.6-dev python3-pip libssl-dev git
RUN apt update && apt upgrade -y
RUN apt install software-properties-common -y
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt -y install build-essential python3.9 python3.9-dev python3-pip libssl-dev git

WORKDIR /home/elastalert

Expand Down
Loading

0 comments on commit 93309ae

Please sign in to comment.