Skip to content

Commit

Permalink
Upgrade docker SDK client version (#16593)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
Previously the upgrade of requests package caused a compatibility issue with the docker SDK client. A workaround was introduced in the playbook to force install a lower version requests package.

After the issue was fixed in the docker SDK client side, the workaround code can be removed.

How did you do it?
This change removed the workaround code and upgraded the docker client to version 7.1.0.

How did you verify/test it?
Tested add/remove topo using the testbed-cli.sh
  • Loading branch information
wangxin authored Jan 22, 2025
1 parent aac9677 commit 3d850a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ansible/roles/vm_set/tasks/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
environment: "{{ proxy_env | default({}) }}"
ignore_errors: yes
- name: Install python packages
pip: name=docker version=6.1.0 state=forcereinstall executable={{ pip_executable }}
pip: name=docker version=7.1.0 state=forcereinstall executable={{ pip_executable }}
become: yes
environment: "{{ proxy_env | default({}) }}"
when: pip_executable=="pip3"
17 changes: 4 additions & 13 deletions ansible/roles/vm_set/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,10 @@
- include_tasks: docker.yml
when: package_installation|bool

- name: Update python3 packages
block:
# Workaround for '"Error connecting: Error while fetching server API version: Not supported URL scheme http+docker'
# See https://github.com/docker/docker-py/issues/3256
- name: Remove old requests package >=2.32.0
pip: name=requests state=absent executable={{ pip_executable }}
become: yes
environment: "{{ proxy_env | default({}) }}"
ignore_errors: yes
- name: Install requests package <2.32.0
pip: name=requests version=2.31.0 state=present executable={{ pip_executable }}
become: yes
environment: "{{ proxy_env | default({}) }}"
- name: Install requests package
pip: name=requests version=2.32.3 state=present executable={{ pip_executable }}
become: yes
environment: "{{ proxy_env | default({}) }}"
when: pip_executable=="pip3"

- name: Ensure {{ ansible_user }} in docker,sudo group
Expand Down

0 comments on commit 3d850a7

Please sign in to comment.