Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-3013

Quay OMR installer find the wrong directory when installation remotely

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • omr-v1.0.0
    • omr-v1.0.0
    • OMR
    • 0

      Description:

      When install OMR remotely, the Ansible script tied to search wrong directory for redis tar package when customize quay root. 

      Build: 

      podman cp $(podman create --authfile authfile --rm brew.registry.redhat.io/rh-osbs/openshift-openshift-mirror-registry-rhel8:v1.0-3):/openshift-mirror-registry.tar.gz .

       

      Test environment:

      Azure VM1 :  whuvm1

      Azure VM2 :  whuvm2

       

      # ./openshift-mirror-registry install --initPassword=12345678 --quayHostname=whuvm2.com:8443 --sslCert=./ssl.crt --sslKey=./ssl.key --quayRoot=/home/quay --targetHostname=whuvm2.com --sslCheckSkip=true --ssh-key ~/.ssh/id_rsa -v
         __   __
        /  \ /  \     ______   _    _     __   __   __
       / /\ / /\ \   /  __  \ | |  | |   /  \  \ \ / /
      / /  / /  \ \  | |  | | | |  | |  / /\ \  \   /
      \ \  \ \  / /  | |__| | | |__| | / ____ \  | |
       \ \/ \ \/ /   \_  ___/  \____/ /_/    \_\ |_|
        \__/ \__/      \ \__
                        \___\ by Red Hat
       Build, Store, and Distribute your Containers
          
      INFO[2021-12-30 05:43:01] Install has begun                            
      DEBU[2021-12-30 05:43:01] Ansible Execution Environment Image: quay.io/quay/openshift-mirror-registry-ee:latest 
      DEBU[2021-12-30 05:43:01] Redis Image: registry.access.redhat.com/ubi8/pause:latest 
      DEBU[2021-12-30 05:43:01] Quay Image: registry.redhat.io/quay/quay-rhel8:v3.6.1 
      DEBU[2021-12-30 05:43:01] Redis Image: registry.redhat.io/rhel8/redis-6:1-25 
      DEBU[2021-12-30 05:43:01] Postgres Image: registry.redhat.io/rhel8/postgresql-10:1-161 
      INFO[2021-12-30 05:43:01] Found execution environment at /home/azureuser/execution-environment.tar 
      INFO[2021-12-30 05:43:01] Loading execution environment from execution-environment.tar 
      DEBU[2021-12-30 05:43:01] Importing execution enviornment with command: /bin/bash -c sudo /usr/bin/podman image import \
                          --change 'ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' \
                          --change 'ENV HOME=/home/runner' \
                          --change 'ENV container=oci' \
                          --change 'ENTRYPOINT=["entrypoint"]' \
                          --change 'WORKDIR=/runner' \
                          --change 'EXPOSE=6379' \
                          --change 'VOLUME=/runner' \
                          --change 'CMD ["ansible-runner", "run", "/runner"]' \
                          - quay.io/quay/openshift-mirror-registry-ee:latest < /home/azureuser/execution-environment.tar 
      Getting image source signatures
      Copying blob b2387d188d3e [--------------------------------------] 0.0b / 0.0b
      Copying config d83a46dbce done  
      Writing manifest to image destination
      Storing signatures
      sha256:d83a46dbce05147f1a6e67965c600abe0b6e465732d784d5d6228e19dde6a5d6
      INFO[2021-12-30 05:43:05] Loading SSL certificate file ./ssl.crt       
      INFO[2021-12-30 05:43:05] Loading SSL key file ./ssl.key               
      INFO[2021-12-30 05:43:05] Attempting to set SELinux rules on ./ssl.crt 
      INFO[2021-12-30 05:43:05] Attempting to set SELinux rules on ./ssl.key 
      INFO[2021-12-30 05:43:05] Found SSH key at /root/.ssh/id_rsa           
      INFO[2021-12-30 05:43:05] Attempting to set SELinux rules on /root/.ssh/id_rsa 
      INFO[2021-12-30 05:43:05] Found image archive at /home/azureuser/image-archive.tar 
      INFO[2021-12-30 05:43:05] Attempting to set SELinux rules on image archive 
      INFO[2021-12-30 05:43:05] Running install playbook. This may take some time. To see playbook output run the installer with -v (verbose) flag. 
      DEBU[2021-12-30 05:43:05] Running command: sudo podman run --rm --interactive --tty --workdir /runner/project --net host -v /home/azureuser/image-archive.tar:/runner/image-archive.tar -v /home/azureuser/ssl.crt:/runner/certs/quay.cert:Z -v /home/azureuser/ssl.key:/runner/certs/quay.key:Z -v /root/.ssh/id_rsa:/runner/env/ssh_key -e RUNNER_OMIT_EVENTS=False -e RUNNER_ONLY_FAILED_EVENTS=False -e ANSIBLE_HOST_KEY_CHECKING=False -e ANSIBLE_CONFIG=/runner/project/ansible.cfg --quiet --name ansible_runner_instance quay.io/quay/openshift-mirror-registry-ee ansible-playbook -i root@whuvm2.com, --private-key /runner/env/ssh_key -e "init_password=12345678 quay_image=registry.redhat.io/quay/quay-rhel8:v3.6.1 redis_image=registry.redhat.io/rhel8/redis-6:1-25 postgres_image=registry.redhat.io/rhel8/postgresql-10:1-161 quay_hostname=whuvm2.com:8443 local_install=false quay_root=/home/quay" install_mirror_appliance.yml   
      PLAY [Install Mirror Appliance] ***********************************************************************************************
      TASK [Gathering Facts] ********************************************************************************************************
      ok: [root@whuvm2.com]
      TASK [mirror_appliance : Install Dependencies] ********************************************************************************
      included: /runner/project/roles/mirror_appliance/tasks/install-deps.yaml for root@whuvm2.com
      TASK [mirror_appliance : Add IP address of all hosts to all hosts] ************************************************************
      changed: [root@whuvm2.com]
      TASK [mirror_appliance : Set SELinux Rules] ***********************************************************************************
      included: /runner/project/roles/mirror_appliance/tasks/set-selinux-rules.yaml for root@whuvm2.com
      TASK [mirror_appliance : Set container_manage_cgroup flag on and keep it persistent across reboots] ***************************
      skipping: [root@whuvm2.com]
      TASK [mirror_appliance : Create Podman Pod] ***********************************************************************************
      included: /runner/project/roles/mirror_appliance/tasks/create-podman-pod.yaml for root@whuvm2.com
      TASK [mirror_appliance : Starting Pod with ports 80 and 443 exposed] **********************************************************
      changed: [root@whuvm2.com]
      TASK [mirror_appliance : Autodetect Image Archive] ****************************************************************************
      included: /runner/project/roles/mirror_appliance/tasks/autodetect-image-archive.yaml for root@whuvm2.com
      TASK [mirror_appliance : Checking for Image Archive] **************************************************************************
      ok: [root@whuvm2.com -> localhost]
      TASK [mirror_appliance : Create install directory for image-archive.tar dest] *************************************************
      changed: [root@whuvm2.com]
      TASK [mirror_appliance : Copy Images if /runner/image-archive.tar exists] *****************************************************
      changed: [root@whuvm2.com]
      TASK [mirror_appliance : Unpack Images if /runner/image-archive.tar exists] ***************************************************
      changed: [root@whuvm2.com]
      TASK [mirror_appliance : Loading Redis if redis.tar exists] *******************************************************************
      fatal: [root@whuvm2.com]: FAILED! => {"changed": true, "cmd": "podman image import --change 'ENV PATH=/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --change 'ENV container=oci'  --change 'ENV STI_SCRIPTS_URL=image:///usr/libexec/s2i' --change 'ENV STI_SCRIPTS_PATH=/usr/libexec/s2i' --change 'ENV APP_ROOT=/opt/app-root' --change 'ENV HOME=/var/lib/redis' --change 'ENV PLATFORM=el8' --change 'ENV REDIS_VERSION=6' --change 'ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/redis' --change 'ENV REDIS_PREFIX=/usr' --change 'ENTRYPOINT=[\"container-entrypoint\"]' --change 'USER=1001' --change 'WORKDIR=/opt/app-root/src' --change 'EXPOSE=6379' --change 'VOLUME=/var/lib/redis/data' --change 'CMD [\"run-redis\"]' - registry.redhat.io/rhel8/redis-6:1-25 < /etc/quay-install/redis.tar", "delta": "0:00:00.004853", "end": "2021-12-30 05:45:17.148509", "msg": "non-zero return code", "rc": 1, "start": "2021-12-30 05:45:17.143656", "stderr": "/bin/sh: /etc/quay-install/redis.tar: No such file or directory", "stderr_lines": ["/bin/sh: /etc/quay-install/redis.tar: No such file or directory"], "stdout": "", "stdout_lines": []}
      PLAY RECAP ********************************************************************************************************************
      root@whuvm2.com            : ok=11   changed=5    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0   
      ERRO[2021-12-30 05:45:17] An error occurred: exit status 2        
       
      

      In test command,  specify the 

      --quayRoot=/home/quay

      But Ansible script tried to find redis.tar in  "/etc/quay-install/"

      The redis.tar was saved in "/home/quay" on whuvm2

       

      [root@whuvm2 quay]# pwd
      /home/quay
      
      [root@whuvm2 quay]# ll
      total 4459304
      -rw-r--r--. 1 root root 2283161600 Dec 30 05:45 image-archive.tar
      -rw-r--r--. 1 root root    3474432 Dec 23 18:11 pause.tar
      -rw-r--r--. 1 root root  612423680 Dec 23 18:13 postgres.tar
      -rw-r--r--. 1 root root 1217648640 Dec 23 18:12 quay.tar
      -rw-r--r--. 1 root root  449607680 Dec 23 18:13 redis.tar
      

            doconnor@redhat.com Dave O'Connor
            rhwhu Weihua Hu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: