Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove devscripts expect the checkbashisms script, and remove lsb-release from rocker/r-ver #511

Merged
merged 5 commits into from
Nov 9, 2022

Conversation

eitsupi
Copy link
Member

@eitsupi eitsupi commented Jul 23, 2022

Close #510

ToDo

@eitsupi
Copy link
Member Author

eitsupi commented Jul 23, 2022

Unfortunately, the image built from 4a1df66 does not appear to have reduced image size (rocker/r-ver:devel 856MB to 856MB) 🤔

@eitsupi
Copy link
Member Author

eitsupi commented Jul 23, 2022

Perhaps we need to rethink the minimum package requirements: python3 will be installed even if devscripts is not installed (listed below).

apt-get install -y --no-install-recommends \
bash-completion \
ca-certificates \
file \
fonts-texgyre \
g++ \
gfortran \
gsfonts \
libblas-dev \
libbz2-* \
libcurl4 \
libicu* \
liblapack-dev \
libpcre2* \
libjpeg-turbo* \
libpangocairo-* \
libpng16* \
"libreadline${READLINE_VERSION}" \
libtiff* \
liblzma* \
make \
unzip \
zip \
zlib1g

@cboettig
Copy link
Member

yeah, I'm still relatively skeptical that there are major savings to be had here, especially that will persist after a user also adds commonly used packages etc, at least while remaining based on Ubuntu. @gaborcsardi's Alpine based https://github.com/r-hub/r-minimal is probably a better option for environments where saving 10s of MB is critical.

@benz0li
Copy link
Contributor

benz0li commented Jul 24, 2022

@eitsupi The problematic line is

apt-get -y install locales lsb-release

ℹ️ lsb-release depends on python3.

@benz0li
Copy link
Contributor

benz0li commented Jul 24, 2022

yeah, I'm still relatively skeptical that there are major savings to be had here

@cboettig It's not only about reducing image size, but also reducing the number of [unneeded] packages.

Installing devscripts on bare ubuntu:focal results in 104 newly installed packages.

@benz0li
Copy link
Contributor

benz0li commented Jul 24, 2022

You could use UBUNTU_VERSION=$(. /etc/os-release && echo $UBUNTU_CODENAME) at

UBUNTU_VERSION=$(lsb_release -sc)

instead of [installing and] using lsb_release.

@cboettig
Copy link
Member

Thanks @benz0li , 💯 with you on trimming unnecessary dependencies. The lsb_release is a good example.

Having unneeded packages increases image size and maybe makes a bigger surface area of dependencies that could break later, as well as potential security issues. Though for the latter two issues I think relying on the official ubuntu LTS repo sources is probably a better way to avoid either security or dependency issues than us hand-rolling dependencies. I like both of the above work-arounds because it looks like they will still be based on the official repo sources, where we benefit from the dependency management and security patching of the Debian and Canonical maintainers.

@eitsupi
Copy link
Member Author

eitsupi commented Nov 2, 2022

I've been writing shell scripts as Dev Container Features for these days and I've learned how good the method of loading os-release scripts is.
https://github.com/rocker-org/devcontainer-features/blob/cbee3bfdce891012e88ae87c0da2c925a6a11301/src/r-apt/install.sh#L34
https://github.com/rocker-org/devcontainer-features/blob/cbee3bfdce891012e88ae87c0da2c925a6a11301/src/r-apt/install.sh#L123-L129
Definitely a good thing to bring this here.

@eitsupi eitsupi added this to the R 4.2.3 milestone Nov 2, 2022
@eitsupi eitsupi added the enhancement New feature or request label Nov 6, 2022
@eitsupi
Copy link
Member Author

eitsupi commented Nov 6, 2022

The size of rocker/r-ver:devel was reduced from 836MB (bfe2d71) -> 808MB (c5a1e36) by deleting lsb-release.
However, lsb-release is a dependency of RStudio Server, so it seems that rocker/rstudio needs to be lsb-release installed.

And, Python 3 continues to be installed. I do not know where this came from.

Edit: I was mistaken. The following apt packages have been removed. Thanks @benz0li !

distro-info-data	0.52ubuntu0.2
libmpdec3	2.5.1-2build2
libpython3-stdlib	3.10.6-1~22.04
libpython3.10-stdlib	3.10.6-1~22.04.1
libsqlite3-0	3.37.2-2
lsb-release	11.1.0ubuntu4
python3-minimal	3.10.6-1~22.04
python3.10	3.10.6-1~22.04.1

@eitsupi eitsupi requested a review from cboettig November 6, 2022 10:37
@eitsupi eitsupi marked this pull request as ready for review November 6, 2022 10:37
@eitsupi eitsupi changed the title Remove devscripts expect the checkbashisms script Remove devscripts expect the checkbashisms script, and remove lsb-release from rocker/r-ver Nov 6, 2022
@eitsupi eitsupi merged commit d188172 into rocker-org:master Nov 9, 2022
@eitsupi eitsupi deleted the purge-devscripts branch November 9, 2022 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove devscripts installation from install R scripts to reduce container size
3 participants