-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fw 2.9.0 migration #16
base: 2.9.0_base
Are you sure you want to change the base?
Changes from 11 commits
afc08c8
a352583
b2720ac
00d7f82
f97dcde
d550d91
68ea0f9
53cf1a5
495d5ec
eb2b982
c6d3e03
e0adedb
245fbcc
8757561
2112e70
95fb088
f934df3
6559448
891054c
9a27131
f2a4319
d235826
b775438
141bd6e
f3fc092
7dcdc6b
06a382a
da97c30
279ca89
3473c31
4ae2fa5
82ef1fb
2af9dc0
0447628
1a944ef
dac7b19
d4c500b
e2a47fd
6f3978d
fc3e0a7
85c2059
b2b8525
3a7a86c
71f9916
a8b62c7
80730bd
be8094b
bdb737e
6c7b5e4
deed439
603cfd9
7738a07
a4de602
0961faf
ddf3e77
ed6cf65
b66348d
f77e979
daa5aa8
45802d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,8 @@ my_rules | |
*~ | ||
/rules/ | ||
mod/ | ||
comparisonFile | ||
comparisonFile2 | ||
examples/ex/* | ||
examples/ex1/* | ||
comparisonFile* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
FROM python:3-slim-buster as builder | ||
|
||
LABEL description="ElastAlert 2 Official Image" | ||
LABEL maintainer="Jason Ertel" | ||
|
||
COPY . /tmp/elastalert | ||
|
||
RUN mkdir -p /opt/elastalert && \ | ||
cd /tmp/elastalert && \ | ||
pip install setuptools wheel && \ | ||
python setup.py sdist bdist_wheel | ||
|
||
FROM python:3-slim-buster | ||
|
||
ARG GID=1000 | ||
ARG UID=1000 | ||
ARG USERNAME=elastalert | ||
|
||
COPY --from=builder /tmp/elastalert/dist/*.tar.gz /tmp/ | ||
|
||
RUN apt update && apt -y upgrade && \ | ||
apt -y install jq curl gcc libffi-dev && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip install /tmp/*.tar.gz && \ | ||
rm -rf /tmp/* && \ | ||
apt -y remove gcc libffi-dev && \ | ||
apt -y autoremove && \ | ||
mkdir -p /opt/elastalert && \ | ||
echo "#!/bin/sh" >> /opt/elastalert/run.sh && \ | ||
echo "set -e" >> /opt/elastalert/run.sh && \ | ||
echo "elastalert-create-index --config /opt/elastalert/config.yaml" \ | ||
>> /opt/elastalert/run.sh && \ | ||
echo "elastalert --config /opt/elastalert/config.yaml \"\$@\"" \ | ||
>> /opt/elastalert/run.sh && \ | ||
chmod +x /opt/elastalert/run.sh && \ | ||
groupadd -g ${GID} ${USERNAME} && \ | ||
useradd -u ${UID} -g ${GID} -M -b /opt -s /sbin/nologin \ | ||
-c "ElastAlert 2 User" ${USERNAME} | ||
|
||
USER ${USERNAME} | ||
ENV TZ "UTC" | ||
FROM python:3.9-alpine as build | ||
|
||
ENV ELASTALERT_HOME /opt/elastalert | ||
ADD . /opt/elastalert/ | ||
|
||
WORKDIR /opt | ||
|
||
RUN apk add --update --no-cache jq curl gcc openssl-dev libffi-dev ca-certificates musl-dev | ||
RUN pip install "setuptools==65.5.0" "elasticsearch==6.3.1" | ||
|
||
WORKDIR "${ELASTALERT_HOME}" | ||
|
||
RUN pip install -r requirements.txt | ||
RUN python setup.py install | ||
|
||
RUN pip show elastalert2 | ||
|
||
RUN echo "coming here..." | ||
RUN ls /usr/local/lib/ | ||
RUN ls /usr/lib/ | ||
RUN ls /lib/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these ls statement are required ? |
||
|
||
FROM gcr.io/distroless/python3:debug as runtime | ||
|
||
COPY --from=build /opt/elastalert /opt/elastalert | ||
COPY --from=build /usr/local/bin/elastalert* /usr/local/bin/ | ||
|
||
COPY --from=build /opt/elastalert /opt/elastalert | ||
COPY --from=build /usr/local/lib/python3.9 /usr/local/lib/python3.9 | ||
COPY --from=build /usr/local/bin/elastalert* /usr/local/bin/ | ||
COPY --from=build /usr/local/lib/libpython3.9.so.1.0 /usr/local/lib/ | ||
COPY --from=build /lib/libc.musl-x86_64.so.1 /lib/ | ||
|
||
#COPY --from=build /data/elastalert /data/elastalert | ||
|
||
ENV PYTHONPATH=/usr/local/lib/python3.9/site-packages | ||
ENV PATH=/usr/local/lib:/usr/lib:$PATH | ||
|
||
RUN ls /usr/local/bin/ | ||
RUN python --version | ||
|
||
WORKDIR /opt/elastalert | ||
ENTRYPOINT ["/opt/elastalert/run.sh"] | ||
|
||
COPY commands.sh /opt/elastalert/commands.sh | ||
RUN ["chmod", "+x", "/opt/elastalert/commands.sh"] | ||
ENTRYPOINT ["sh","/opt/elastalert/commands.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
echo "creating elastalert indices" | ||
python -m elastalert.create_index --config /data/elastalert/config.yaml --verbose | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. --verbose should be removed from elastalert-create-index ? |
||
echo "Starting elastalert" | ||
python -m elastalert.elastalert --config /data/elastalert/config.yaml --verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this print statement?