]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm/box: fix remove image tar error and cleanups
authorPere Diaz Bou <pdiazbou@redhat.com>
Thu, 27 Jan 2022 17:29:16 +0000 (18:29 +0100)
committerErnesto Puerta <epuertat@redhat.com>
Wed, 9 Feb 2022 19:48:52 +0000 (20:48 +0100)
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
(cherry picked from commit 71c493528eb17f4280b50df67bfd437e054cb6aa)

src/cephadm/box/Dockerfile
src/cephadm/box/box.py

index 7b1afd8952f9d9ac01c984a6ac8960cf57325c9e..d3bd9c28a88e440f898b49daa9d5ea1d580f3944 100644 (file)
@@ -2,6 +2,11 @@
 FROM centos:8 as centos-systemd
 ENV container docker
 ENV CEPHADM_PATH=/usr/local/sbin/cephadm
+
+# Centos met EOL and the content of the CentOS 8 repos has been moved to vault.centos.org
+RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
+RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
+
 RUN dnf -y install chrony firewalld lvm2 \
   openssh-server openssh-clients python3 \
   yum-utils sudo which && dnf clean all
@@ -23,7 +28,5 @@ EXPOSE 22
 
 FROM centos-systemd-docker
 WORKDIR /root
-# VOLUME /var/run/docker.sock
-COPY start /usr/local/bin
 
 CMD [ "/usr/sbin/init" ]
index 96acc8b3777938e597bcf897b26d70bf0be50b67..da41e2a7675182a02de625e69c586a55c11e2970 100755 (executable)
@@ -14,8 +14,18 @@ from util import (Config, Target, ensure_inside_container,
 CEPH_IMAGE = 'quay.ceph.io/ceph-ci/ceph:master'
 BOX_IMAGE = 'cephadm-box:latest'
 
+# NOTE: this image tar is a trickeroo so cephadm won't pull the image everytime
+# we deploy a cluster. Keep in mind that you'll be responsible of pulling the
+# image yourself with `box cluster setup`
+CEPH_IMAGE_TAR = 'docker/ceph/image/quay.ceph.image.tar'
+
+def remove_ceph_image_tar():
+    if os.path.exists(CEPH_IMAGE_TAR):
+        os.remove(CEPH_IMAGE_TAR)
+
 def cleanup_box() -> None:
     osd.cleanup()
+    remove_ceph_image_tar()
 
 def image_exists(image_name: str):
     # extract_tag
@@ -39,10 +49,10 @@ def get_ceph_image():
     run_shell_command(f'docker build -t {CEPH_IMAGE} docker/ceph')
     if not os.path.exists('docker/ceph/image'):
         os.mkdir('docker/ceph/image')
-    image_tar = 'docker/ceph/image/quay.ceph.image.tar'
-    if not os.path.exists(image_tar):
-        os.remove(image_tar)
-    run_shell_command(f'docker save {CEPH_IMAGE} -o {image_tar}')
+
+    remove_ceph_image_tar()
+
+    run_shell_command(f'docker save {CEPH_IMAGE} -o {CEPH_IMAGE_TAR}')
     print('Ceph image added')
 
 def get_box_image():
@@ -92,10 +102,6 @@ class Cluster(Target):
 
         extra_args = []
 
-        shared_ceph_folder = os.environ.get('SHARED_CEPH_FOLDER')
-        if shared_ceph_folder:
-            extra_args.extend(['--shared_ceph_folder', shared_ceph_folder])
-
         extra_args.append('--skip-pull')
 
         # cephadm prints in warning, let's redirect it to the output so shell_command doesn't