-
Notifications
You must be signed in to change notification settings - Fork 383
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
baseImages: Updating base image versions #1285
Conversation
Great work @garethtdavies 👍 Regarding your questions:
|
| Go | 1.12.7 | armv7hf, aarch64, amd64, i386, armv6 | | ||
| Dotnet | 2.2-sdk | armv7hf, aarch64, amd64 | | ||
| Node.js | v13.1.0 | armv6, armv7hf, aarch64, amd64, i386 | | ||
| Python | v2.7.17 | armv5e, armv6, armv7hf, aarch64, amd64, i386 | |
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 wonder if it's also worth having a separate Python3 language tag, bearing in mind the upcoming EOL of Python2 ? https://pythonclock.org/
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.
There's also part of the page which says "latest
points to the latest Python 2 version, which currently is 2.7.17" and I guess that means there's currently no way to automatically get the latest Python 3 version?
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 missed this one. I'd have thought using 3
would do it but that doesn't seem to work as expected:
docker run -it balenalib/raspberrypi4-64-alpine-python:3-3.11-run bash
bash-5.0# python --version
Python 3.6.9
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.
Maybe that's the default package available i.e via I don't think that is correct and I don't know why it would default to that version when 3.8 is available https://github.com/balena-io-library/base-images/tree/master/balena-base-images/python/raspberrypi4-64/alpine/3.11apt-get install python3
?
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.
Created balena-io-library/base-images#606 to track this inconsistency
Thanks for this explanation @nghiant2710 . I've tested this quite a bit now, but I am still a bit confused about Raspbian and how to document it. I understand those device types with device type
I guess I'm expecting these to work, but they, of course, do not:
So, I'm not sure how we should document this for Raspbian. Basically, if you want to use Raspbian, use the base image |
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.
small nits, otherwise lgtm
In case it helps to clear up any confusion (at least from the Raspbian side, if not from the Balena side 😉 ) - the Raspbian images available from https://www.raspberrypi.org/downloads/raspbian/ support all models of the Raspberry Pi (Pi1, Pi Zero, Pi2, Pi3, Pi4) with a single image (which is presumably why there's no I dunno how closely Balena's |
@garethtdavies, you're right, only Another thing is |
5293470
to
6a36c5a
Compare
Thanks all for the discussion, that's much clearer to me now 😄 At the root of this is simply what we should include in the docs with reference to Raspbian. To that end, I've added a note to the docs about Raspbian. @nghiant2710 can you review this note https://github.com/balena-io/docs/pull/1285/files#diff-aa7d2966be46f689a147702028e9ac59R129 or have any other suggestions about any other missing information or where this should be included? I've also updated this file for the latest contracts, and I have done a general cleanup, but I'll follow up with additional PRs for auto-generating these docs. |
6a36c5a
to
a93037c
Compare
74fe36e
to
ba494ee
Compare
If no variant is specified, the image defaults to `run` | ||
- <yyyymmdd> the last optional field on tags is the date tag. This is useful for production deployments as these base images are non-moving tags, so no packages in these will update ever. | ||
- `<lang_ver>` is the version of the language stack, for example, Node.js 10.10, it can also be substituted for `latest`. | ||
- `<distro_ver>` is the version of the Linux distro, for example in the case of Debian, there are 4 valid versions, namely `sid`, `jessie`, `buster` and `stretch`. |
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.
Should this mention that latest
can also be used for the <distro_ver>
tags?
- `<lang_stack>` is the programming language pack, currently we support Node.js, Python, OpenJDK and Go. This field is optional and if left out, no language pack will be installed, so you will just have the distribution. | ||
- `<hw>` is either architecture or device type and is **mandatory**. If using Dockerfile.templates, you can replace this with `%%BALENA_MACHINE_NAME%%` or `%%BALENA_ARCH%%`. For a list of available device names and architectures, see the [Device types](/reference/base-images/devicetypes/). | ||
- `<distro>` is the Linux distribution. Currently there are 4 distributions, namely Debian, Alpine, Ubuntu and Fedora. This field is optional and will default to Debian if left out. | ||
- `<lang_stack>` is the programming language pack, currently we support Node.js, Python, OpenJDK and Go. This field is optional, and if left out, no language pack will be installed, so you will just have the distribution. |
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.
So I guess if you specify a <lang_ver>
but not a <lang_stack>
, the lang_ver will just be ignored?
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.
It won't be ignored and it'd probably just mean the image doesn't exist (unless it happened to coincide with an available tag) - but either way, it's unlikely to be what you want. For example, you can see the raspberrypi3-alpine
tags here https://hub.docker.com/r/balenalib/raspberrypi3-alpine/tags so if you specified a <lang_ver> tag of 10.8 (e.g. node) then there simply isn't a corresponding image.
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.
Cool, I was just checking what the edge-case behaviour was 🙂
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.
Hmmm, that's curious - https://hub.docker.com/layers/balenalib/raspberrypi3-alpine/latest/images/sha256-054582a87ef96ba2243334500bb580246dba066967e9f6ad0c3bee655fde281d says "LABEL io.balena.device-type=raspberry-pi2" ??
Currently balenalib supports the following OS distributions and Language stacks, if you would like to see others added, create an issue on the [balena base images repo](https://github.com/balena-io-library/base-images/issues). | ||
Currently, balenalib supports the following OS distributions and Language stacks, if you would like to see others added, create an issue on the [balena base images repo]({{ $links.githubLibrary }}/base-images/issues). | ||
|
||
| Distribution | Default | Supported Architectures | |
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.
Presumably in both this table and the next, the "Default" column is the version you'd get if you used the latest
tag for the <distro_ver>
or <lang_ver>
fields?
Is it worth mentioning that explicitly? (e.g. by changing the "Default" column-header to "Default (latest)" ? ) 🤷♂️
Hmmm, in the "Multiple Distributions:" and "Multiple language stacks:" lists earlier on in the page, I wonder if it'd be worth highlighting the versions corresponding to the "latest" tag by e.g. displaying them in bold? Like:
- `<distro>` : omitted, so it defaults to Debian. | ||
- `<lang>` : node - the Node.js runtime and npm will be installed | ||
- `<lang_ver>` : 10.10 - This gives us node.js version 10.10.x whatever is the latest patch version provided on balenalib | ||
- `<distro_ver>` : omitted, so it defaults to `stretch` | ||
- `<lang_ver>` : 10.18 - This gives us Node.js version 10.18.x whatever is the latest patch version provided on balenalib |
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.
The "Multiple language stacks:" list further up the page lists "Node.js 10.18.0" but here you're using a <lang_ver>
of 10.18
. Does that imply that balenalib/raspberrypi3-node:10.18
, balenalib/raspberrypi3-node:10.18.0
and balenalib/raspberrypi3-node:10
are all equally valid base-image names? Or is there some other logic at work?
Possibly worthy of more explanation? 🤷♂️
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.
Yes. You can confirm this via docker pull balenalib/raspberrypi3-node:10.18
(and other tags) and inspecting the output of docker images
which shows they are all the same image (for this specific example). As I noted earlier I think a few more examples would go a long way for this sort of information.
➜ ~ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
balenalib/raspberrypi3-node 10 3bf113fa9176 15 hours ago 231MB
balenalib/raspberrypi3-node 10.18 3bf113fa9176 15 hours ago 231MB
balenalib/raspberrypi3-node 10.18.0 3bf113fa9176 15 hours ago 231MB
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.
Hmmm, I wonder if this might explain the behaviour you discovered at #1285 (comment) where balenalib/raspberrypi4-64-alpine-python:3-3.11-run
points to an image containing Python 3.6.9 (whereas you'd expect it to contain Python 3.8.0) ...
Perhaps when python:3.6.9
got added, it also added the python:3.6
and python:3
tags, inadvertently "overwriting" the python:3
tag which was previously pointing to python:3.8.0
?
That's just a guess though, and only @nghiant2710 will know for sure.
| Distribution | Default | Supported Architectures | | ||
| ------------ | ---------------------------- | -------------------------------------------- | | ||
| Debian | Debian GNU/Linux 10 (buster) | armv5e, armv6, armv7hf, aarch64, amd64, i386 | | ||
| Alpine | Alpine Linux v3.10 | armv6, armv7hf, aarch64, amd64, i386 | |
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.
Hmmm, I've just noticed that this table says that the Default version of Alpine is v3.10, and by comparing Digests on https://hub.docker.com/r/balenalib/raspberrypi3-alpine/tags you can also confirm that the latest
and 3.10
tags point to the same image, and yet Alpine 3.11 is mentioned in the "Multiple Distributions:" list on this page, and there's a 3.11
tag on DockerHub? 😕
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.
Maybe that's explained by balena-io/contracts@84035e0#r36690619 but that's a bit of a random stab in the dark 😉
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.
Yeah looks like a mistake as mentioned in that linked contract above. In general though latest
doesn't necessarily mean "latest" 😕https://medium.com/@mccode/the-misunderstood-docker-tag-latest-af3babfd6375 In this case though it looks like it should have been tagged latest.
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.
That's interesting, but I've no idea how and/or if Docker tags relate to the base-image tags used by Balena 😉
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'm not sure I understand that comment. The tags on Docker Hub are the base-image tags.
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.
The medium.com article you've linked to mentions tags like marc/test:latest
and it seems like the latest
tag there is automatically added by Docker. I was assuming that that's actually unrelated to the latest
tag embedded within a Balena image-name like balenalib/raspberrypi3-alpine-python:latest-3.7
? 🤷♂️ 🤷♂️
ba494ee
to
7d4ab52
Compare
Squashed and rebased. I'm keen to get this in, in its current state, as the current docs are outdated and this fixes that. I'll take some of the unresolved suggestions to a follow-up PR as I'll likely need to tweak the layout to generate this doc from the contracts anyway. |
Apologies if my comments / questions have delayed this PR, but hopefully they were more of a help than a hindrance. |
Oh no @lurch they have been super helpful and have helped clarify a lot of things. I didn't just want to merge this in under the assumption everything was resolved r.e. discussions above, so the note to acknowledge that. We can carry on the discussion but I don't want to delay getting at least the updated version information in 👍 |
Change-type: patch Signed-off-by: Gareth Davies <[email protected]>
7d4ab52
to
bb21ec1
Compare
@nghiant2710 I've manually updated the base image page for updated version information and to get a better sense of how it works before trying to pull this information in dynamically from the contracts.
I wrote a simple script to parse the
version
field for each variant from here for Node.js for example https://github.com/balena-io/contracts/blob/master/contracts/sw.stack/node/contract.json. A couple of questions as result:sw.os
https://github.com/balena-io/contracts/tree/master/contracts/sw.os. Is there support for Raspbian?Change-type: patch
Signed-off-by: Gareth Davies [email protected]