commit b6c250540a961bf46f9dcaa71f3370dde9f4219b Author: Sofiane Gerhardt Date: Mon Dec 2 10:45:59 2024 +0100 Add GitHub Actions workflow for building and pushing Docker container diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..567e7e6 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,48 @@ +name: Build and Push container +run-name: Build and Push container + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +env: + IMAGE: git.kvant.cloud/phoenix/metricbeat-hpc + VERSION: ${{ github.ref_name }} + +jobs: + build_besu: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to gitea registry + uses: docker/login-action@v3 + with: + registry: git.kvant.cloud + username: ${{ vars.PHOENIX_PACKAGE_WRITER_USERNAME }} + password: ${{ secrets.PHOENIX_PACKAGE_WRITER_TOKEN }} + + - name: Update Dockerfile FROM version + run: sed -i "s|^FROM .\+|FROM docker.elastic.co/beats/metricbeat-oss:${{ env.VERSION }}|" Dockerfile + + - name: Build and push to gitea registry + uses: docker/build-push-action@v6 + with: + platforms: linux/s390x + push: true + context: . + build-args: | + VERSION=${{ env.VERSION }} + image: ${{ env.IMAGE }} + cache-from: | + type=registry,ref=${{ env.IMAGE }}:${{ env.VERSION }} + type=registry,ref=${{ env.IMAGE }}:latest + cache-to: type=inline + tags: | + ${{ env.IMAGE }}:${{ env.VERSION }} + ${{ env.IMAGE }}:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b74bc76 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM docker.elastic.co/beats/metricbeat-oss:latest + +COPY metricbeat.yml /usr/share/metricbeat/metricbeat.yml diff --git a/metricbeat.yml b/metricbeat.yml new file mode 100644 index 0000000..b9a1eff --- /dev/null +++ b/metricbeat.yml @@ -0,0 +1,61 @@ +metricbeat.autodiscover: + providers: + - type: docker + hints.enabled: true + +metricbeat.modules: +- module: docker + metricsets: + - container + - cpu + - diskio + - healthcheck + - info + - image + - memory + - network + hosts: ["unix:///var/run/docker.sock"] + period: 30s + enabled: True +- module: system + metricsets: + - cpu # CPU usage + - load # CPU load averages + - memory # Memory usage + - network # Network IO + - process # Per process metrics + - process_summary # Process summary + - uptime # System Uptime + - socket_summary # Socket summary + - core # Per CPU core usage + - diskio # Disk IO + - filesystem # File system usage for each mountpoint + - fsstat # File system summary metrics + enabled: true + period: 30s + processes: ['.*'] + cpu.metrics: ["percentages"] + core.metrics: ["percentages"] + +processors: + - add_cloud_metadata: ~ + - add_docker_metadata: ~ + - add_id: ~ + +output.elasticsearch: + hosts: '${ES_HOSTS}' + username: '${ES_USERNAME}' + password: '${ES_PASSWORD}' + ssl.verification_mode: "none" + index: '${ES_INDEX}' + +setup.template.name: '${ES_TEMPLATE_NAME}' +setup.template.pattern: '${ES_TEMPLATE_PATTERN}' +setup.template.settings: + index.number_of_shards: 1 + index.number_of_replicas: 1 +setup.template.overwrite: false + +setup.ilm.enabled: false +setup.ilm.check_exists: false +setup.dashboards.enabled: false