-
Notifications
You must be signed in to change notification settings - Fork 90
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
Use base image for all compiler version #204
Conversation
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
6cf1c14
to
e70e1b4
Compare
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
I don't understand. What is the purpose of those images? |
Same base image, same glic version. We will keep the same image for all builds on CCI, well, not all builds as you can see. Of course, it will require rebuilding a lot packages there, but that's a not a problem. |
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
Using Ubuntu Xenial for all containers means
I think that it would have been nice having RHEL 7 / CentOS supported too, however, the default GCC versions there is GCC 4.8 and we don't build packages for this version anyway... so it should be fine. I support this change 👍 By the way, https://distrowatch.com/table.php?distribution=ubuntu is nice to look thinks up like this 😄 When we already introducing such breaking changes we probably should talk about a few other things. Like what happens when Conan 2.0 gets released will we just pull them into the containers and we potentially breaking people again or should there be specifically Conan 2.0 images? I think we should talk about this now, because we could potentially introduce a naming change right now to not break people with this current change A random idea would be a naming schema like If we use this naming schema now the already existing images could be continued to be used as-is without a change in distro version and glibc version. |
@uilianries Did I understand it correctly that the GCC image won't work for GCC < 6? Why not? |
@Croydon perfect!!!
As you know, we use the Conan version as docker tag. For those new images I thought conanio/-cci, but it's a suggestion. Indeed Conan 2.0 will be a good opportunity for breaking changes, including for docker images if needed. |
libc6-dev \ | ||
gcc \ | ||
libgmp-dev \ | ||
libmpfr-dev \ | ||
libmpc-dev \ | ||
nasm \ | ||
dh-autoreconf \ | ||
libffi-dev \ | ||
libssl-dev \ | ||
pkg-config \ | ||
subversion \ | ||
zlib1g-dev \ | ||
libbz2-dev \ | ||
libsqlite3-dev \ | ||
libreadline-dev \ | ||
xz-utils \ | ||
curl \ | ||
libncurses5-dev \ | ||
libncursesw5-dev \ | ||
liblzma-dev \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the dev
packages and other utils be removed at the end of the docker script?
Keeping only the runtime libraries reduces size and avoids accidental dependencies on system libraries.
I assume keeping only the regular packages will keep everything working?
cci recipes should use the packages provided by cci.
e.g. libgmp
, libmpfr
, libmpc
, nasm
, autoconf
, zlib
, 'libbz2', sqlite3
, ncurses
, flex
, xz-utils
, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of them, yes. We need to filter it, but it's an excellent idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. libc6-dev
should be kept installed, as probably pkg-config
, git
, subversion
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know some packages were installed to build python, libsqlite3-dev for instance, so you are right. I'll comb through the packages and check what can removed. As the images have unit tests, it's possible to see what breaks after removing a system package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What makes this hard is that e.g. libsqlite3-dev
should be removed, but libsqlite3
should be kept installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if you install everything into usr/local
won't it make sense to start "final" image from scratch and just copy this whole directory into the new one? So whatever is needed to build gcc stays in the "build" image?
I have a radical idea: use conan for building these extra packages. So what I am proposing is the following: Create cpython, gcc, ... recipes that: named e.g.
Create a docker recipe that can build and upload the cpython/gcc conan packages.
Create a consumer docker image that will do the ci:
The docker images will probably have a bootstrap problem, because the default python version is too old, but I think this is solvable:
Pros of this approach:
Cons:
|
Not that radical. It's even documented on doc.conan.io. 😂 and we use it for couple years at work. |
Older From my selfish perspective, my current product is supporting RHEL 6 and 7 until their end of maintenance support 2: I understand not wanting to maintain such old versions in conan.io. |
For conan 2 would there be a way to encode the supported glibc and request a no newer than version? The problem I often run into is that builds try to use binary packages built against newer glibc versions than my platform supports. |
@dheater I'm in a similar boat as you -- Ubuntu LTS 8 year maintenance is too short for the 10+ year maintenance of RHEL and SLES used by enterprises. |
I'm going to guess most developers who have to continue supporting these platforms are using Redhat's Devtoolset, which means that in practice they are using new compilers (e.g. gcc 8 on RHEL/CentOS 6 and presently gcc 9 for RHEL/CentOS 7). |
In order to use CentOS as a base, we would need to be able to have their all major version of GCC 4.9+ and Clang 3.9+ Do you see any way to do this? |
@Croydon For gcc there have been developer toolsets: That said, they aren't available immediately upon the release of a new version of the compiler (e.g. no devtoolset-10 yet), and the old ones have been taken off of the repos as they have been EOLed. Currently, only devtoolset 7-9 are available. There are also llvm-toolsets for clang, however, I'm not as familiar with them. The fundamental difference between these toolsets, and just compiling gcc and/or clang yourself on CentOS is that they have a mixed linking model with libstdc++. By default, the devtoolset will dynamically link in symbols that exist in gcc-4.8.5's version of libstdc++, and will statically link in anything from a newer gcc's version, and for the same reason, they always use the old gcc abi (i.e. trying to force the new gcc abi does nothing). The most portable option for C++ is to just statically link against libstdc++/libc++, as there is no real telling what version of the library will be on the host system. Given that, I think probably the best bet would to just build the compilers oneself, probably using a relatively recent devtoolset for the bootstrapping process. |
I'm currently trying to do the same thing at work. Looking at RedHat's spec (and patches) for gcc makes me cry: libstdc++-compat patch is 12 thousands lines long and basically adds a lot of files into a static library. There are actually 2 libraries involved: However |
|
||
FROM base as release | ||
|
||
RUN pip install -U conan conan-package-tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN pip install -U conan conan-package-tools | |
RUN pip install -U conan conan-package-tools | |
liblzma-dev \ | ||
ca-certificates \ | ||
autoconf-archive \ | ||
flex \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you planning to pin the versions of those packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, pinning versions on Ubuntu is useless, as it doesn't keep old versions available for installation. We tried it in the past, but it caused us more problems than security and stability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the attitude 👍 So no issues with reproducibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, you could create a builder/base image (and publish it for example to, say GitHub packages) and then only update compiler / conan.
Superseded by #271 |
Changelog: Feature: Add new Docker images based on Xenial
TODO:
Update README
Add missing Clang versions
Refer to the issue that supports this Pull Request.
If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
I've read the Contributing guide.
I've followed the PEP8 style guides for Python code.
I've followed the Best Practices guides for Dockerfile.