Compare commits

...

5 Commits

Author SHA1 Message Date
Lol3rrr
505e5c4cdb Add docker image for uploading a file to gcp
All checks were successful
Build Docker Image / nomad-scale (push) Successful in 11s
Build Docker Image / ceph-rbd-backup (push) Successful in 26s
Build Docker Image / gcp-backup-upload (push) Successful in 5m2s
2026-10-03 14:25:27 +02:00
Lol3rrr
04d56ca7a5 Fix zstd command
All checks were successful
Build Docker Image / nomad-scale (push) Successful in 10s
Build Docker Image / ceph-rbd-backup (push) Successful in 7s
2026-10-03 00:23:14 +02:00
Lol3rrr
b40ce21e9d Install zstd in the docker image
All checks were successful
Build Docker Image / nomad-scale (push) Successful in 20s
Build Docker Image / ceph-rbd-backup (push) Successful in 1m0s
2026-10-03 00:17:43 +02:00
Lol3rrr
2ace4c1c00 Add workflow to build image
All checks were successful
Build Docker Image / nomad-scale (push) Successful in 11s
Build Docker Image / ceph-rbd-backup (push) Successful in 2m29s
2026-10-02 23:35:34 +02:00
Lol3rrr
0105c98ce5 Add docker image for ceph-rbd backups 2026-10-02 23:34:52 +02:00
7 changed files with 121 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ permissions:
packages: write packages: write
jobs: jobs:
docker: nomad-scale:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -34,3 +34,55 @@ jobs:
tags: | tags: |
gitea.lol3r.com/leon/nomad-scale:latest gitea.lol3r.com/leon/nomad-scale:latest
gitea.lol3r.com/leon/nomad-scale:${{ gitea.sha }} gitea.lol3r.com/leon/nomad-scale:${{ gitea.sha }}
ceph-rbd-backup:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: gitea.lol3r.com
username: leon
password: ${{ secrets.DOCKER_PAT }}
- name: Build and push - ceph-rbd-backup
uses: docker/build-push-action@v6
with:
context: ./ceph-rbd-backup
file: ./ceph-rbd-backup/Dockerfile
push: true
tags: |
gitea.lol3r.com/leon/ceph-rbd-backup:latest
gitea.lol3r.com/leon/ceph-rbd-backup:${{ gitea.sha }}
gcp-backup-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: gitea.lol3r.com
username: leon
password: ${{ secrets.DOCKER_PAT }}
- name: Build and push - gcp-backup-upload
uses: docker/build-push-action@v6
with:
context: ./gcp-backup-upload
file: ./gcp-backup-upload/Dockerfile
push: true
tags: |
gitea.lol3r.com/leon/gcp-backup-upload:latest
gitea.lol3r.com/leon/gcp-backup-upload:${{ gitea.sha }}

View File

@@ -0,0 +1,11 @@
FROM quay.io/ceph/ceph:v20.2
RUN dnf clean all \
&& rm -rf /var/cache/dnf \
&& dnf install -y zstd \
&& dnf clean all \
&& rm -rf /var/cache/dnf
COPY script.sh /script.sh
ENTRYPOINT ["/bin/bash", "/script.sh"]

10
ceph-rbd-backup/README.md Normal file
View File

@@ -0,0 +1,10 @@
# Ceph-RBD-backup
## Environment Variables
| Name | Default | Description |
|---|---|---|
| CEPH_USERNAME | - | TODO |
| RBD_POOL | - | TODO |
| RBD_IMAGE_ID | - | TODO |
| SNAPSHOT_ID | - | TODO |
| OUTPUT_FILE | - | TODO |

21
ceph-rbd-backup/script.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
CEPH_USERNAME="${CEPH_USERNAME:-}"
RBD_POOL="${RBD_POOL:-}"
RBD_IMAGE_ID="${RBD_IMAGE_ID:-}"
SNAPSHOT_ID="${SNAPSHOT_ID:-}"
OUTPUT_FILE="${OUTPUT_FILE:-}"
# Create the snapshot
rbd --name ${CEPH_USERNAME} snap create ${RBD_POOL}/${RBD_IMAGE_ID}@${SNAPSHOT_ID};
# Export the snapshot to a file
rbd --name ${CEPH_USERNAME} export --export-format 2 ${RBD_POOL}/${RBD_IMAGE_ID}@${SNAPSHOT_ID} - | zstd -T1 -3 -o ${OUTPUT_FILE};
touch ${OUTPUT_FILE}.done;
ls -al ${OUTPUT_FILE};
# Remove the snapshot again
rbd --name ${CEPH_USERNAME} snap rm ${RBD_POOL}/${RBD_IMAGE_ID}@${SNAPSHOT_ID};

View File

@@ -0,0 +1,5 @@
FROM google/cloud-sdk:587.0.0
COPY script.sh /script.sh
ENTRYPOINT ["/bin/bash", "/script.sh"]

View File

@@ -0,0 +1,9 @@
# GCP-Backup-Upload
## Environment Variables
| Name | Default | Description |
|---|---|---|
| FILE_TO_TRIGGER | - | TODO |
| FILE_TO_BACKUP | - | TODO |
| BUCKET_URL | - | TODO |
| GCLOUD_KEY_FILE | - | TODO |

View File

@@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail
until [ -f ${FILE_TO_TRIGGER} ]
do
sleep 5
done
gcloud auth activate-service-account --key-file ${GCLOUD_KEY_FILE};
gcloud storage cp ${FILE_TO_BACKUP} ${BUCKET_URL}/;