Skip to content
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

Mrunge f38 #77

Open
wants to merge 30 commits into
base: fedora38_x86_64
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f47b7e6
add README
Feb 11, 2019
5ad9214
travis-ci.sh: Print an error if TRAVIS_BRANCH, DOCKER_PASSWORD, or DO…
octo Sep 1, 2020
498f328
checks/check-built-plugins.sh: Improve check output.
octo Sep 14, 2020
a5b9d38
checks/check-built-plugins.sh: Remove left-over echo debugging.
octo Sep 14, 2020
2de5969
Create docker-image.yml
mrunge Sep 16, 2021
3b13ddc
Enable basic container image building.
mrunge Sep 16, 2021
5753bcd
[gha] Add no-op jobs for each set of actions
elfiesmelfie Sep 17, 2021
ba81149
[githubactions] Add a periodic jobs for contaienr builds
elfiesmelfie Sep 14, 2021
a53f8ba
Merge pull request #17 from elfiesmelfie/gha/build_containers
mrunge Sep 21, 2021
13f6c4c
[githubactions] Add a job for PRs to container branches (#19)
elfiesmelfie Sep 21, 2021
0cd3c0a
Build Fedora 34 instead of rawhide for now (#24)
mrunge Sep 28, 2021
8a806ef
[githubactions] Add a merge job to build and publish containers (#20)
elfiesmelfie Sep 28, 2021
7ddb5c4
Update weekly-jobs.yml
mrunge Sep 28, 2021
26a876b
Add CentOS 8 weekly job (#26)
mrunge Sep 30, 2021
686cce8
[PR jobs] Update incorrect command (#34)
elfiesmelfie Sep 30, 2021
44066f3
[gha][periodic] Remove other triggers from schedulled jobs (#23)
elfiesmelfie Sep 30, 2021
e5d343f
[weekly-jobs] Add Fedora 34 to weekly build (#37)
elfiesmelfie Sep 30, 2021
a0a1a27
[gha][weekly] Add bionic_amd64 to the weekly container builds
elfiesmelfie Oct 6, 2021
e4b1c92
[gha][weekly] Add focal_amd64 to the weekly container builds
elfiesmelfie Nov 8, 2021
58e255c
[gha] Update triggers for on-merge action
elfiesmelfie Feb 14, 2022
aad1d37
[ci][pr-jobs] Add valgrind opts
elfiesmelfie Feb 21, 2022
a30322b
Merge pull request #66 from elfiesmelfie/add_valgrind_opts
elfiesmelfie Feb 21, 2022
6df3239
[gha][PR] Update the PR tests to split tests (#44)
elfiesmelfie Apr 28, 2022
bfce637
Add newer fedora builds including rawhide
mrunge Jun 8, 2022
c82d54a
[gha] Add el9_x86_64 container to weekly builds
elfiesmelfie Jun 9, 2022
379f4a7
[f24] Stop building fedora 24 daily
elfiesmelfie Jun 9, 2022
bf7860a
Update releases for CI testing
mrunge Apr 23, 2023
b840013
Remove conflicting java package
mrunge Apr 24, 2023
3008da1
Merge branch 'main' into mrunge_f38
mrunge Apr 24, 2023
d80d489
Change to f38 instead of rawhide
mrunge Apr 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/daily-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Daily container builds

on:
schedule:
- cron: '0 0 * * *'

jobs:
build:

runs-on: ubuntu-latest

strategy:
# Don't stop other in-progress jobs when one fails
fail-fast: false

matrix:
branch:
- sid_amd64
- fedora38_x86_64
- fedora_rawhide_x86_64

env:
SLUG: "collectd/ci:${{ matrix.branch }}"

steps:
- uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}
- name: Build container
run:
docker build --pull -t "${SLUG}" .
- run: docker inspect "${SLUG}"
- run: docker history "${SLUG}"
- name: Log into the container registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push "${SLUG}"
33 changes: 33 additions & 0 deletions .github/workflows/merge-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Merge jobs

on:
pull_request:
types: [closed]
branches-ignore:
- main
# topic branches (e.g. fix/something)
- '**/**'

jobs:
build_and_publish_container:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v2
- name: Get branch name
run: |
export BRANCH="$(${{ github.ref }} | rev | cut -d '/' -f1 | rev )
- run:
export SLUG="collectd/ci:${BRANCH}"
- name: Build container
run:
docker build --pull -t "${SLUG}" .
- run: docker inspect "${SLUG}"
- run: docker history "${SLUG}"
- run: docker images
- name: Log into the container registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push "${SLUG}"
36 changes: 36 additions & 0 deletions .github/workflows/pr-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PR jobs

on:
pull_request:
branches-ignore:
- main

jobs:
# Build and test container for each PR submitted to that branch
build_and_test_container:

runs-on: ubuntu-latest
env:
SLUG: "collectd/ci:test"
VALGRIND_OPTS: "--errors-for-leak-kinds=definite"
steps:
- uses: actions/checkout@v2
- name: Build container
run: docker build -t "${SLUG}" .
- run: docker inspect "${SLUG}"
- name: Check out the latest verison of collectd
uses: actions/checkout@v2
with:
repository: collectd/collectd
ref: main
path: ${{ github.workspace }}/collectd
- name: Create the test container
run: |
docker run -itd --name collectd-pr-test -v "${GITHUB_WORKSPACE}/collectd:/collectd" -w /collectd "${SLUG}"
- name: Make sure collectd builds on the container
run: |
docker exec -w /collectd collectd-pr-test bash -c './build.sh && ./configure && make'
- name: Run collectd unit tests
continue-on-error: true
run: |
docker exec -w /collectd collectd-pr-test make check
53 changes: 53 additions & 0 deletions .github/workflows/weekly-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Weekly container builds

on:
schedule:
- cron: '0 0 * * 0'

jobs:
build:

runs-on: ubuntu-latest

strategy:
# Don't stop other in-progress jobs when one fails
fail-fast: false
matrix:
branch:
# Debian
# Debian 11
- bullseye_amd64
# Debian 10
- buster_amd64
# Ubuntu
# Ubuntu 20.04
- focal_amd64
# Ubuntu 18.04
- bionic_amd64
# Ubuntu 16.04
- xenial_amd64
# Ubuntu 14.04
- trusty_amd64
# Fedora
- fedora36_x86_64
# CentOS
- el9_x86_64

env:
SLUG: "collectd/ci:${{ matrix.branch }}"

steps:
- uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}
- name: Build container
run:
docker build --pull -t "${SLUG}" .
- run: docker inspect "${SLUG}"
- run: docker history "${SLUG}"
- name: Log into the container registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push "${SLUG}"
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:rawhide
FROM fedora:38

ADD redhat.sh /redhat.sh
COPY /checks/*.sh /checks/
Expand All @@ -13,8 +13,6 @@ ENV EXTRA_PACKAGES="\
intel-cmt-cat-devel \
iproute-devel \
iptables-devel \
java-latest-openjdk-devel \
jpackage-utils \
libatasmart-devel \
libcap-devel \
libcurl-devel \
Expand Down Expand Up @@ -49,15 +47,13 @@ ENV EXTRA_PACKAGES="\
riemann-c-client-devel \
rrdtool-devel \
varnish-libs-devel \
xen-devel \
xfsprogs-devel \
yajl-devel \
"

ENV SUPPORTED_PLUGIN_LIST="\
libcollectdclient \
aggregation \
amqp \
apache \
apcups \
ascent \
Expand Down Expand Up @@ -100,7 +96,6 @@ ENV SUPPORTED_PLUGIN_LIST="\
iptables \
ipvs \
irq \
java \
load \
log_logstash \
logfile \
Expand Down Expand Up @@ -190,7 +185,6 @@ ENV SUPPORTED_PLUGIN_LIST="\
write_riemann \
write_sensu \
write_tsdb \
xencpu \
zfs_arc \
zookeeper \
"
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Helper images for building collectd
===================================

Here is a collection of manifests used to build the Docker images hosted at:
<https://cloud.docker.com/u/collectd/repository/docker/collectd/ci/tags>

There is one branch per distribution/architecture pair which collectd is tested
against. Common bits are stored in the master branch, and merged into the
distro branches when needed.

Each Dockerfile contains a list of package names (mostly support libraries) to
install, and a list of plugins collectd *master* is expected to build based on
them. We want to stick to the official repositories, and only install packages
found there, to ensure collectd releases integrate smoothly in these
distributions.

Travis-CI takes care of building these images and pushing them to
cloud.docker.com. NB: Debian/sid and Fedora/rawhide built are triggered once
per day (as these distributions change constantly). You'll find the build logs
there: <https://travis-ci.org/collectd/ci-docker/builds>

The goal is to have the resulting images fit in the collectd project's CI, but
they are free to use for any other case. Only patches related to the CI will be
considered, though.

Here's an example of how you could build collectd in an Ubuntu/Xenial
environment:
```
git clone https://github.com/collectd/collectd
docker run -it --rm -v $PWD/collectd:/collectd -w /collectd collectd/ci:xenial_amd64
./build.sh && ./configure && make && make check
```
58 changes: 32 additions & 26 deletions checks/check-built-plugins.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
#!/bin/sh -e
#!/bin/bash

echo "### Checking whether all known working plugins on this platform have been built ###"
STATUS=0
for i in ${SUPPORTED_PLUGIN_LIST}; do
echo "$i plugin:"
if test -f "src/$i.c"; then
if test -f ."libs/${i}.so"; then
ldd ".libs/${i}.so" || STATUS=1
else
ldd "src/.libs/${i}.so" || STATUS=1
fi
else
echo "... doesn't exist in this version"
fi
set -e

declare -A want
for p in ${SUPPORTED_PLUGIN_LIST}; do
want["${p}"]=1
done

echo "### Looking for any plugins previously unsupported on this platform ###"
for i in .libs/*.so src/libs/*.so; do
plugin="$(basename $i)"
[ "${plugin}" = '*.so' ] && continue
FOUND=0
for j in ${SUPPORTED_PLUGIN_LIST}; do
[ "x${plugin}" = "x${j}.so" ] && FOUND=1
done
if [ $FOUND -eq 0 ]; then
echo "found this new plugin: ${plugin}"
ldd "${i}"
declare -A got
for f in .libs/*.so; do
p="$(basename "${f}" .so)"

if [[ -v want["${p}"] ]]; then
unset want["${p}"]
continue
fi

got["${p}"]=1
done

exit $STATUS
if [[ ${#got[@]} > 0 ]]; then
echo "## The following EXTRA plugins were built:"
echo ""
for p in "${!got[@]}"; do
echo " * ${p}"
done | sort
echo ""
fi

if [[ ${#want[@]} > 0 ]]; then
echo "## The following expected plugins are MISSING:"
echo ""
for p in "${!want[@]}"; do
echo " * ${p}"
done | sort
exit 1
fi
23 changes: 10 additions & 13 deletions travis-ci.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#!/bin/sh -e
#!/bin/bash

if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
set -ex

if [[ "${TRAVIS_PULL_REQUEST}" != "false" ]]; then
echo "Not building docker images out of Pull Requests"
exit 0
fi

if [ ! -z "${TRAVIS_BRANCH}" ]; then
SLUG="collectd/ci:${TRAVIS_BRANCH}"
docker build --pull -t "${SLUG}" .
docker inspect "${SLUG}"
docker history "${SLUG}"
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_LOGIN}" --password-stdin
docker push "${SLUG}"
else
echo 'no $TRAVIS_BRANCH defined, exiting'
exit 1
fi
declare -r SLUG="collectd/ci:${TRAVIS_BRANCH:?}"
docker build --pull -t "${SLUG}" .
docker inspect "${SLUG}"
docker history "${SLUG}"
echo "${DOCKER_PASSWORD:?}" | docker login --username "${DOCKER_LOGIN:?}" --password-stdin
docker push "${SLUG}"