]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
deploy: create dockerfile to fast k8s compilation in rhel platform
authorfrancisco garcia <francisco.garcia@baculasystems.com>
Tue, 11 Jun 2024 11:19:31 +0000 (11:19 +0000)
committerEric Bollengier <eric@baculasystems.com>
Wed, 4 Dec 2024 08:14:25 +0000 (09:14 +0100)
bacula/src/plugins/fd/kubernetes-backend/docker/Dockerfile
bacula/src/plugins/fd/kubernetes-backend/docker/README
bacula/src/plugins/fd/kubernetes-backend/docker/docker-entrypoint.sh
bacula/src/plugins/fd/kubernetes-backend/requirements.txt

index f1b540f390e3066c1e874e410a0069fc1f49d063..d37c89e8f3b31aa4cf18068a5f0c062252251007 100644 (file)
@@ -19,7 +19,7 @@ ENTRYPOINT ["/docker-entrypoint.sh"]
     # Add Makefile rule:
         # async:
            #   rsync -av -i ../bacula/src/ build/src/
-    # Change directory to: /mnt/regress/
+    # Change bacula directory in config file to: /mnt/regress/
     # Execute:
     #    make async && -C build/src/plugins/fd install-kubernetes && make -C build/src/plugins/fd/kubernetes-backend clean && make -C build/src/plugins/fd/kubernetes-backend install-kubernetes
     # Binary in: ~/regress/bin/k8s_backend
\ No newline at end of file
index 968d80408e850a82c7b302f898c3792d7a31dbce..8bb09f24983c36ba08203efe6a1111b008a80985 100644 (file)
@@ -1,15 +1,23 @@
 # Target
 
+## Ubuntu/Debian
+
 This docker image is to compile k8s plugin independent of ubuntu/debian platform. I had problems with libc library, so to isolate this problem, we create this docker image.
 
 If you want change this version, modify the image tag and dockerfile FROM.
 
+For example: `FROM debian:bullseye` to `FROM ubuntu:jammy`
+
 **Note:** The difference between Ubuntu and Debian in this compilation is that `rm` binary is allocated in other place:
  - Ubuntu: `/usr/bin/rm`
  - Debian: `/bin/rm`
 
 So, the Makefile will be modified to avoid errors.
 
+## RHEL (Rocky 9)
+
+This docker image is to compile k8s plugin independent of RHEL platforms.
+
 # Create the Docker image
 
 We need copy the requirements to docker context folder. For this reason, we do:
@@ -17,10 +25,18 @@ We need copy the requirements to docker context folder. For this reason, we do:
 cp -a ../requirements.txt .
 ```
 
+```bash
+docker build -t k8s_compilation:bullseye .
+```
+
 ```bash
 docker build -t k8s_compilation:jammy .
 ```
 
+```bash
+docker build -t k8s_compilation:rocky9 -f Dockerfile-rpm .
+```
+
 # Pre-Run docker container
 
 To compile in docker container, we need modify the `regress config file` to adapt.
@@ -60,19 +76,31 @@ async:
 ```
 
 # Run docker container
-In root project (bacula-bee folder), execute:
+In root project (bacula-bee folder), execute (Depend on platform):
+
+```bash
+docker run --rm -it -v $(pwd):/mnt k8s_compilation:bullseye /bin/bash
+```
 
 ```bash
 docker run --rm -it -v $(pwd):/mnt k8s_compilation:jammy /bin/bash
 ```
 
+```bash
+docker run --rm -it -v $(pwd):/mnt k8s_compilation:rocky9 /bin/bash
+```
+
 # Compile k8s plugin
 
 Execute:
 ```bash
 make async
+
+./k8s_compile
 ```
 
+This `./k8s_compile` binary will do:
+
 ```bash
 make -C build/src/plugins/fd install-kubernetes
 ```
@@ -85,10 +113,6 @@ make -C build/src/plugins/fd/kubernetes-backend clean
 make -C build/src/plugins/fd/kubernetes-backend install-kubernetes
 ```
 
-Or in one command:
-```bash
-make async; make -C build/src/plugins/fd install-kubernetes; make -C build/src/plugins/fd/kubernetes-backend clean; make -C build/src/plugins/fd/kubernetes-backend install-kubernetes
-```
 
 # Get the k8s_backend binary
 
index dfad74981d7d799005fd678d31908bc1e54043d3..31578fe980f9713a733a0c3e78b301f289d97195 100755 (executable)
@@ -4,6 +4,18 @@ TMP_DIR="/mnt/regress/tmp"
 
 if [ ! -d "$TMP_DIR" ]; then
     make setup
+    cat <<EOF >/mnt/regress/k8s_compile
+#!/bin/bash
+make async
+printf "\n%s\n" "Make async done."
+make -C build/src/plugins/fd install-kubernetes
+printf "\n%s\n" "Compiled k8s fd."
+make -C build/src/plugins/fd/kubernetes-backend clean
+printf "\n%s\n" "Cleaned k8s binary."
+make -C build/src/plugins/fd/kubernetes-backend install-kubernetes
+printf "\n%s\n" "Compiled k8s binary."
+EOF
+chmod +x /mnt/regress/k8s_compile
 else
     echo "The directory /mnt/regress/tmp already exists. So, we do not make setup"
 fi
index dbfa9803399a06c1697fa29f2f9364f0c1d26b71..a29e84963df70ad8e9662222e39928447658fa03 100644 (file)
@@ -6,7 +6,7 @@
 # Author: Radoslaw Korzeniewski
 #
 
-pyyaml == 6.0
-kubernetes <= 26.1.0
-urllib3 == 1.26.16
-requests == 2.27.1
+pyyaml == 6.0.1
+kubernetes == 30.1.0
+urllib3 == 2.2.1
+requests == 2.32.3