Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 93cf7891d3 | |||
| c55bdcbf28 | |||
| 011642a708 | |||
| 27b923b5e9 | |||
| 698cb404cf |
@@ -0,0 +1,6 @@
|
|||||||
|
/dist
|
||||||
|
/vendor
|
||||||
|
/.idea
|
||||||
|
/.github
|
||||||
|
/.git
|
||||||
|
/webapp/frontend/node_modules
|
||||||
@@ -156,7 +156,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||||
asset_path: /buildd/scrutiny-collector-metrics-linux-arm-6
|
asset_path: /build/scrutiny-collector-metrics-linux-arm-6
|
||||||
asset_name: scrutiny-collector-metrics-linux-arm-6
|
asset_name: scrutiny-collector-metrics-linux-arm-6
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||||
asset_path: /buildd/scrutiny-collector-metrics-linux-arm-7
|
asset_path: /build/scrutiny-collector-metrics-linux-arm-7
|
||||||
asset_name: scrutiny-collector-metrics-linux-arm-7
|
asset_name: scrutiny-collector-metrics-linux-arm-7
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
|||||||
+5
-7
@@ -31,15 +31,13 @@ EXPOSE 8080
|
|||||||
WORKDIR /scrutiny
|
WORKDIR /scrutiny
|
||||||
ENV PATH="/scrutiny/bin:${PATH}"
|
ENV PATH="/scrutiny/bin:${PATH}"
|
||||||
|
|
||||||
ADD https://github.com/dshearer/jobber/releases/download/v1.4.4/jobber_1.4.4-1_amd64.deb /tmp/
|
RUN apt-get update && apt-get install -y cron smartmontools=7.0-0ubuntu1~ubuntu18.04.1 ca-certificates curl && update-ca-certificates
|
||||||
RUN apt install /tmp/jobber_1.4.4-1_amd64.deb
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y smartmontools=7.0-0ubuntu1~ubuntu18.04.1 ca-certificates curl && update-ca-certificates
|
|
||||||
|
|
||||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-amd64.tar.gz /tmp/
|
ADD https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-amd64.tar.gz /tmp/
|
||||||
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C /
|
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C /
|
||||||
COPY /rootfs /
|
COPY /rootfs /
|
||||||
|
|
||||||
|
COPY /rootfs/etc/cron.d/scrutiny /etc/cron.d/scrutiny
|
||||||
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny /scrutiny/bin/
|
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny /scrutiny/bin/
|
||||||
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-selftest /scrutiny/bin/
|
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-selftest /scrutiny/bin/
|
||||||
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-metrics /scrutiny/bin/
|
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-metrics /scrutiny/bin/
|
||||||
@@ -47,11 +45,11 @@ COPY --from=frontendbuild /scrutiny/dist /scrutiny/web
|
|||||||
RUN chmod +x /scrutiny/bin/scrutiny && \
|
RUN chmod +x /scrutiny/bin/scrutiny && \
|
||||||
chmod +x /scrutiny/bin/scrutiny-collector-selftest && \
|
chmod +x /scrutiny/bin/scrutiny-collector-selftest && \
|
||||||
chmod +x /scrutiny/bin/scrutiny-collector-metrics && \
|
chmod +x /scrutiny/bin/scrutiny-collector-metrics && \
|
||||||
|
chmod 0644 /etc/cron.d/scrutiny && \
|
||||||
|
rm -f /etc/cron.daily/* && \
|
||||||
mkdir -p /scrutiny/web && \
|
mkdir -p /scrutiny/web && \
|
||||||
mkdir -p /scrutiny/config && \
|
mkdir -p /scrutiny/config && \
|
||||||
mkdir -p /scrutiny/jobber && \
|
chmod -R ugo+rwx /scrutiny/config
|
||||||
chmod -R ugo+rwx /scrutiny/config && \
|
|
||||||
chmod -R ugo+rwx /scrutiny/jobber
|
|
||||||
|
|
||||||
|
|
||||||
CMD ["/init"]
|
CMD ["/init"]
|
||||||
|
|||||||
@@ -11,20 +11,18 @@ RUN go mod vendor && \
|
|||||||
|
|
||||||
########
|
########
|
||||||
FROM ubuntu:bionic as runtime
|
FROM ubuntu:bionic as runtime
|
||||||
EXPOSE 8080
|
|
||||||
WORKDIR /scrutiny
|
WORKDIR /scrutiny
|
||||||
ENV PATH="/scrutiny/bin:${PATH}"
|
ENV PATH="/scrutiny/bin:${PATH}"
|
||||||
|
|
||||||
ADD https://github.com/dshearer/jobber/releases/download/v1.4.4/jobber_1.4.4-1_amd64.deb /tmp/
|
RUN apt-get update && apt-get install -y cron smartmontools=7.0-0ubuntu1~ubuntu18.04.1 ca-certificates && update-ca-certificates
|
||||||
RUN apt install /tmp/jobber_1.4.4-1_amd64.deb
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y smartmontools=7.0-0ubuntu1~ubuntu18.04.1 ca-certificates && update-ca-certificates
|
|
||||||
|
|
||||||
COPY /rootfs/scrutiny /scrutiny
|
|
||||||
|
|
||||||
|
COPY /docker/entrypoint-collector.sh /entrypoint-collector.sh
|
||||||
|
COPY /rootfs/etc/cron.d/scrutiny /etc/cron.d/scrutiny
|
||||||
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-selftest /scrutiny/bin/
|
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-selftest /scrutiny/bin/
|
||||||
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-metrics /scrutiny/bin/
|
COPY --from=backendbuild /go/src/github.com/analogj/scrutiny/scrutiny-collector-metrics /scrutiny/bin/
|
||||||
RUN chmod +x /scrutiny/bin/scrutiny-collector-selftest && \
|
RUN chmod +x /scrutiny/bin/scrutiny-collector-selftest && \
|
||||||
chmod +x /scrutiny/bin/scrutiny-collector-metrics
|
chmod +x /scrutiny/bin/scrutiny-collector-metrics && \
|
||||||
|
chmod 0644 /etc/cron.d/scrutiny && \
|
||||||
|
rm -f /etc/cron.daily/apt /etc/cron.daily/dpkg /etc/cron.daily/passwd
|
||||||
|
|
||||||
CMD ["/usr/lib/x86_64-linux-gnu/jobberrunner", "/scrutiny/jobber/jobber.yaml"]
|
CMD ["/entrypoint-collector.sh"]
|
||||||
|
|||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
# Cron runs in its own isolated environment (usually using only /etc/environment )
|
||||||
|
# So when the container starts up, we will do a dump of the runtime environment into a .env file that we
|
||||||
|
# will then source into the crontab file (/etc/cron.d/scrutiny.sh)
|
||||||
|
|
||||||
|
printenv | sed 's/^\(.*\)$/export \1/g' > /env.sh
|
||||||
|
|
||||||
|
# now that we have the env start cron in the foreground
|
||||||
|
echo "starting cron"
|
||||||
|
cron -f
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
if [ -n "${TZ}" ]
|
||||||
|
then
|
||||||
|
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime
|
||||||
|
echo "${TZ}" > /etc/timezone
|
||||||
|
fi
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
MAILTO=""
|
||||||
|
# Example of job definition:
|
||||||
|
# .---------------- minute (0 - 59)
|
||||||
|
# | .------------- hour (0 - 23)
|
||||||
|
# | | .---------- day of month (1 - 31)
|
||||||
|
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
|
||||||
|
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
|
||||||
|
# | | | | |
|
||||||
|
# * * * * * user-name command to be executed
|
||||||
|
|
||||||
|
# correctly route collector logs (STDOUT & STDERR) to Cron foreground (collectable by Docker STDOUT)
|
||||||
|
# cron schedule to run daily at midnight: '0 0 * * *'
|
||||||
|
# System environmental variables are stripped by cron, source our dump of the docker environmental variables before each command (/env.sh)
|
||||||
|
0 0 * * * root . /env.sh; /scrutiny/bin/scrutiny-collector-metrics run >/proc/1/fd/1 2>/proc/1/fd/2
|
||||||
|
# An empty line is required at the end of this file for a valid cron file.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/execlineb -S0
|
#!/usr/bin/execlineb -S0
|
||||||
|
|
||||||
echo "jobber/cron exiting"
|
echo "cron exiting"
|
||||||
s6-svscanctl -t /var/run/s6/services
|
s6-svscanctl -t /var/run/s6/services
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
# Cron runs in its own isolated environment (usually using only /etc/environment )
|
||||||
|
# So when the container starts up, we will do a dump of the runtime environment into a .env file that we
|
||||||
|
# will then source into the crontab file (/etc/cron.d/scrutiny.sh)
|
||||||
|
|
||||||
|
printenv | sed 's/^\(.*\)$/export \1/g' > /env.sh
|
||||||
|
|
||||||
|
echo "starting cron"
|
||||||
|
cron -f
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
|
||||||
|
|
||||||
echo "starting jobber/cron"
|
|
||||||
|
|
||||||
su -c "/usr/lib/x86_64-linux-gnu/jobberrunner /scrutiny/jobber/jobber.yaml" root
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
version: 1.4
|
|
||||||
|
|
||||||
prefs:
|
|
||||||
logPath: /scrutiny/jobber/log.log
|
|
||||||
runLog:
|
|
||||||
type: file
|
|
||||||
path: /scrutiny/jobber/runlog
|
|
||||||
maxFileLen: 100m
|
|
||||||
maxHistories: 2
|
|
||||||
|
|
||||||
resultSinks:
|
|
||||||
- &filesystemSink
|
|
||||||
type: filesystem
|
|
||||||
path: /scrutiny/jobber
|
|
||||||
data:
|
|
||||||
- stdout
|
|
||||||
- stderr
|
|
||||||
maxAgeDays: 10
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
MetricsJob:
|
|
||||||
cmd: /scrutiny/bin/scrutiny-collector-metrics run
|
|
||||||
# run daily at midnight.
|
|
||||||
time: '0 0 0 * * *'
|
|
||||||
onError: Backoff
|
|
||||||
notifyOnSuccess:
|
|
||||||
- *filesystemSink
|
|
||||||
notifyOnFailure:
|
|
||||||
- *filesystemSink
|
|
||||||
|
|
||||||
@@ -2,4 +2,4 @@ package version
|
|||||||
|
|
||||||
// VERSION is the app-global version string, which will be replaced with a
|
// VERSION is the app-global version string, which will be replaced with a
|
||||||
// new value during packaging
|
// new value during packaging
|
||||||
const VERSION = "0.3.4"
|
const VERSION = "0.3.5"
|
||||||
|
|||||||
Reference in New Issue
Block a user