pip install error in building the container runtime when installing devstack

Bug #1978246 reported by Hiroo Kitamura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr-kubernetes
Fix Released
Undecided
Unassigned

Bug Description

When I tried to install Tacker by devstack with kubernetes as VIM(Virtualized Infrastructure Manager), an error occurred in pip install when building the container runtime with the installation of kuryr-kubernetes.
Therefore, after taking temporary fixes based on the error content, the installation was successful.
Details are given below, so could you check these.

- devstack installation procedure
https://docs.openstack.org/tacker/latest/install/kubernetes_vim_installation.html

- Environment specifications
OS: Ubuntu 20.04.4 LTS
CPU: 4CPU
Memory: 16GB
Storage: 50GB

- local.conf (excerpt of the part related to kuryr-kubernetes)
https://opendev.org/openstack/tacker/src/branch/master/devstack/local.conf.kubernetes
```
# Enable kuryr-kubernetes, docker, octavia
KUBERNETES_VIM=True
enable_plugin kuryr-kubernetes https://opendev.org/openstack/kuryr-kubernetes master
enable_plugin octavia https://opendev.org/openstack/octavia master
enable_plugin devstack-plugin-container https://opendev.org/openstack/devstack-plugin-container master
#KURYR_K8S_CLUSTER_IP_RANGE="10.0.0.0/24"
enable_service kubernetes-master
enable_service kuryr-kubernetes
enable_service kuryr-daemon
```

- Error contents
```
Step 12/17 : RUN pip3 --no-cache-dir install -U pip && python3 -m pip --no-cache-dir install -c $UPPER_CONSTRAINTS_FILE /opt/kuryr-kubernetes && cp /opt/kuryr-kubernetes/cni_ds_init /usr/bin/cni_ds_init && mkdir -p /etc/kuryr-cni && cp /opt/kuryr-kubernetes/etc/cni/net.d/* /etc/kuryr-cni && dnf -y history undo last && dnf clean all && rm -rf /opt/kuryr-kubernetes && mkdir ${OSLO_LOCK_PATH}
...snip...
Collecting setuptools
  Downloading setuptools-62.3.2-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 18.2 MB/s eta 0:00:00
...snip...
  Attempting uninstall: setuptools
    Found existing installation: setuptools 57.4.0
ERROR: Cannot uninstall setuptools 57.4.0, RECORD file not found. Hint: The package was installed by rpm.
The command '/bin/sh -c pip3 --no-cache-dir install -U pip && python3 -m pip --no-cache-dir install -c $UPPER_CONSTRAINTS_FILE /opt/kuryr-kubernetes && cp /opt/kuryr-kubernetes/cni_ds_init /usr/bin/cni_ds_init && mkdir -p /etc/kuryr-cni && cp /opt/kuryr-kubernetes/etc/cni/net.d/* /etc/kuryr-cni && dnf -y history undo last && dnf clean all && rm -rf /opt/kuryr-kubernetes && mkdir ${OSLO_LOCK_PATH}' returned a non-zero code: 1
++ /opt/stack/kuryr-kubernetes/devstack/lib/kuryr_kubernetes:container_runtime:33 : die 33 'Error when running docker command'
++ functions-common:die:264 : local exitcode=1
[Call Trace]
./stack.sh:1403:run_phase
/opt/stack/devstack/functions-common:1881:run_plugins
/opt/stack/devstack/functions-common:1848:source
/opt/stack/kuryr-kubernetes/devstack/plugin.sh:92:build_kuryr_container_image
/opt/stack/kuryr-kubernetes/devstack/lib/kuryr_kubernetes:326:container_runtime
/opt/stack/kuryr-kubernetes/devstack/lib/kuryr_kubernetes:33:die
[ERROR] /opt/stack/kuryr-kubernetes/devstack/lib/kuryr_kubernetes:33 Error when running docker command
Error on exit
```

- Temporary fixes
In cni.Dockerfil used to build the container runtime, it seemed that setuptools failed to install via pip, so I removed the conflicting rpm package before that.
```
$ git diff
diff --git a/cni.Dockerfile b/cni.Dockerfile
index 32729da4..60a3d58b 100644
--- a/cni.Dockerfile
+++ b/cni.Dockerfile
@@ -18,6 +18,8 @@ RUN dnf upgrade -y && dnf install -y epel-release $RDO_REPO \

 COPY . /opt/kuryr-kubernetes

+RUN dnf remove -y python-setuptools
+
 RUN pip3 --no-cache-dir install -U pip \
     && python3 -m pip --no-cache-dir install -c $UPPER_CONSTRAINTS_FILE /opt/kuryr-kubernetes \
     && cp /opt/kuryr-kubernetes/cni_ds_init /usr/bin/cni_ds_init \
```

Revision history for this message
Michal Dulko (michal-dulko-f) wrote :
Revision history for this message
Hiroo Kitamura (h-kitamura) wrote :

Thank you for the information.
The 845125-patch has already been merged, so by applying the 845143-patch to the master branch, I was able to confirm that the devstack installaion was successful.

Changed in kuryr-kubernetes:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.