cncf / cnf-testbed

ARCHIVED: 🧪🛏️Cloud-native Network Function (CNF) Testbed --> See LFN Cloud Native Telecom Initiative https://wiki.lfnetworking.org/pages/viewpage.action?pageId=113213592
https://wiki.lfnetworking.org/pages/viewpage.action?pageId=113213592
Apache License 2.0
164 stars 51 forks source link

optimization debian package manager tweaks #339

Closed Rajpratik71 closed 4 years ago

Rajpratik71 commented 4 years ago

By default, Ubuntu or Debian based "apt" or "apt-get" system installs recommended but not suggested packages .

By passing "--no-install-recommends" option, the user lets apt-get know not to consider recommended packages as a dependency to install.

This results in smaller downloads and installation of packages .

Refer to blog at Ubuntu Blog .

Signed-off-by: Pratik Raj rajpratik71@gmail.com

Rajpratik71 commented 4 years ago

I like the idea behind this PR, but I can also see that it will require other changes in the code to work.

Example: https://github.com/cncf/cnf-testbed/blob/f04bfc8bb6c1fe9a7eda4071fb5efd81e8ca3139/examples/network_functions/vppcontainer/Dockerfile#L11

This will fail when curl is installed without the recommended packages:

Step 4/7 : RUN curl https://packagecloud.io/install/repositories/fdio/release/script.deb.sh | bash
 ---> Running in 5e5f7438a1a8 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current 
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 
curl: (77) error setting certificate verify locations: 
  CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs

The fix here seems quite simple, as installing ca-certificates fixes the curl issue. I am however worried that there are additional caveats for some of the modifications, which will require a bit more testing before being merged.

I will continue looking into this as soon as I sort out another set of changes I have staged

To fix the error added "ca-certificates" and also added "apt-utils" because without this apt-get take more time while configuring packages , every time new package is installed . It is also suggested in log.

Rajpratik71 commented 4 years ago

done some cleanup in automated way like removed "-y" flag , rearranged etc . If other left remains , their duplicity doesn't affect anything in any way.