]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Allow quick bootstrap script to use custom images 68801/head
authorAfreen Misbah <afreen@ibm.com>
Mon, 20 Apr 2026 14:51:47 +0000 (20:21 +0530)
committerAfreen Misbah <afreen@ibm.com>
Fri, 8 May 2026 09:55:06 +0000 (15:25 +0530)
- if no image provided default image will be used
- the -i flag was added but its not working. so this commit fixes that.
- exporting the CEPHADM_IMAGE in cpeh_cluster.yaml so that bootstrap script can utilize that
- passing image in cephadm shell

Signed-off-by: Afreen Misbah <afreen@ibm.com>
src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh
src/pybind/mgr/dashboard/ci/cephadm/ceph_cluster.yml
src/pybind/mgr/dashboard/ci/cephadm/quick-bootstrap.sh

index 89332210bf35f6275851d9ab226272d12cc637de..5ffb9fe7ef1921ce0f08a57dd6569973aa822c9b 100755 (executable)
@@ -5,7 +5,7 @@ set -x
 export PATH=/root/bin:$PATH
 mkdir /root/bin
 
-export CEPHADM_IMAGE='quay.ceph.io/ceph-ci/ceph:main'
+export CEPHADM_IMAGE="${CEPHADM_IMAGE:-quay.ceph.io/ceph-ci/ceph:main}"
 
 CEPHADM="/root/bin/cephadm"
 CEPHADM_SRC="/mnt/{{ ceph_dev_folder }}/src/cephadm/cephadm"
@@ -28,9 +28,15 @@ bootstrap_extra_options='--allow-fqdn-hostname --dashboard-password-noupdate'
 # {% if expanded_cluster is not defined %}
 #   bootstrap_extra_options+=" ${bootstrap_extra_options_not_expanded}"
 # {% endif %}
+
+shell_image=''
+
 quick_install_options=''
 {% if quick_install is defined %}
-  quick_install_options="--image localhost:5000/ceph"
+  export CEPHADM_IMAGE="${CEPHADM_IMAGE:-quay.ceph.io/ceph-ci/ceph:main}"
+  quick_install_options="--image localhost:5000/ceph" 
+  shell_image="--image localhost:5000/ceph"
+
 {% endif %}
 
 if [[ ${NODES} -lt 2 ]]; then
@@ -49,8 +55,13 @@ fi
 
 $CEPHADM ${quick_install_options} bootstrap --mon-ip $mon_ip --initial-dashboard-password {{ admin_password }} ${bootstrap_extra_options}
 
-fsid=$(cat /etc/ceph/ceph.conf | grep fsid | awk '{ print $3}')
-cephadm_shell="$CEPHADM shell --fsid ${fsid} -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring"
+fsid=$(awk '/fsid/ {print $3}' /etc/ceph/ceph.conf)
+cephadm_shell="$CEPHADM ${shell_image} shell --fsid ${fsid} -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring"
+
+{% if quick_install is defined %}
+  ${cephadm_shell} ceph config set global container_image localhost:5000/ceph
+{% endif %}
+
 
 for number in $(seq 1 $((NODES - 1))); do
   LAST_OCTET=$((NODE_IP_OFFSET + $number))
index 17ebe38968c7ce3bd70a59d636945e57a1b446b3..2b2ffafe5f0f3b65c24d0ea7825d6efa939def1c 100755 (executable)
@@ -47,6 +47,9 @@ parameters:
  {% if quick_install is defined %}
  - /root/load-podman-image.sh
  {% endif %}
+ {% if custom_image is defined %}
+ - export CEPHADM_IMAGE={{custom_image}}
+ {% endif %}
  - sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config
  - setenforce 0
  {% if number == 0 %}
index 853ceae346b508e8be4e25839d391c119f82a6d6..1cd532a8263d8c65076a3cad922c2888f15f8944 100755 (executable)
@@ -49,6 +49,8 @@ for arg in "$@"; do
       ;;
     -i=*|--ceph-image=*)
       CEPHADM_IMAGE="${arg#*=}"
+      echo "Using custom Ceph image: $CEPHADM_IMAGE"
+      extra_args+=" -P custom_image=${CEPHADM_IMAGE}"
       ;;
     -h|--help)
       show_help
@@ -62,19 +64,18 @@ for arg in "$@"; do
   esac
 done
 
-image_name=$(echo "$CEPHADM_IMAGE")
-
+image_name="${CEPHADM_IMAGE:-quay.ceph.io/ceph-ci/ceph:main}"
 extra_args+=" -P nodes=${NODES}"
 
 if [[ ${use_cached_image} == false ]]; then
     printf "Pulling the image: %s\n" "$image_name"
-    podman pull "${image_name}"
+    podman pull "$image_name"
 fi
 
 rm -f ceph_image.tar
 
 printf "Saving the image: %s\n" "$image_name"
-podman save -o ceph_image.tar "${image_name}"
+podman save -o ceph_image.tar "$image_name"
 
 # build cephadm binary if it does not exist
 printf "\nChecking for cephadm binary...\n"