Compare commits
2 Commits
d61cc8627b
...
2ace4c1c00
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ace4c1c00 | ||
|
|
0105c98ce5 |
28
.github/workflows/docker.yaml
vendored
28
.github/workflows/docker.yaml
vendored
@@ -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,29 @@ 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 - nomad-scale
|
||||||
|
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 }}
|
||||||
|
|||||||
5
ceph-rbd-backup/Dockerfile
Normal file
5
ceph-rbd-backup/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM quay.io/ceph/ceph:v20.2
|
||||||
|
|
||||||
|
COPY script.sh /script.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/bash", "/script.sh"]
|
||||||
10
ceph-rbd-backup/README.md
Normal file
10
ceph-rbd-backup/README.md
Normal 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
21
ceph-rbd-backup/script.sh
Normal 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 ${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};
|
||||||
Reference in New Issue
Block a user