HaoWang9909 commented on issue #5525:
URL: https://github.com/apache/openwhisk/issues/5525#issuecomment-2564984302

   ## Issue Resolved
   
   The issue has been resolved successfully. The problem was related to how the 
invoker image was specified and deployed across multiple machines. Here’s the 
detailed explanation:
   
   ## Root Cause
   
   The problem occurred because:
   1. Deployment Across Multiple Machines: I have a setup with two machines – 
one for the controller and one for the invoker. During the deployment process, 
there was a mismatch in how the invoker image was configured and deployed.
   2. Temporary Ansible Configuration Change: At some point, I modified the 
ansible/roles/invoker/tasks/deploy.yml file to force the invoker to use the 
nightly tag from the Docker registry:
   ```
   image: "{{ docker_registry }}openwhisk/invoker:nightly"
   ```
   This change caused the deployment process to always pull the nightly image 
from the registry, ignoring any locally built or customized images.
   
   ## Solution
   
   To resolve the issue, I followed these steps:
   1. Reverted the Ansible Configuration:
   I updated the ansible/roles/invoker/tasks/deploy.yml file to use the correct 
dynamic image configuration:
   ```
   image: "{{ docker_registry }}{{ docker.image.prefix }}/invoker:{{ 'cov' if 
(coverage_enabled) else docker.image.tag }}"
   ```
   This ensures that the invoker deployment respects the tag specified in the 
docker.image.tag variable.
   
   2. Built the Invoker Image Locally:
   On the machine where the invoker image was being built (controller machine), 
I ran:
   ```
   ./gradlew :core:invoker:clean :core:invoker:distDocker
   ```
   3. Transferred the Image to the Invoker Machine:
   - I exported the built image as invoker.tar:
   - docker save -o invoker.tar whisk/invoker:latest
   - Then transferred it to the invoker machine:
   ```
   scp invoker.tar user@invoker-machine:~
   ```
   4. Loaded the Image on the Invoker Machine:
   On the invoker machine, I loaded the image:
   ```
   docker load -i ~/invoker.tar
   ```
   5. Redeployed OpenWhisk:
   Finally, I redeployed OpenWhisk to ensure the correct image was used:
   ```
   cd ansible
   sudo ansible-playbook -i environments/local openwhisk.yml
   ```
   ## Outcome
   
   After completing the above steps:
   1. The invoker is now using the correct image.
   2. My code changes are reflected in the invoker logs, confirming that the 
updated image is being used.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to