Merge ~ubuntu-docker-images/ubuntu-docker-images/+git/cassandra:4.0-20.04-update-version into ~ubuntu-docker-images/ubuntu-docker-images/+git/cassandra:4.0-20.04

Proposed by Athos Ribeiro
Status: Merged
Merge reported by: Athos Ribeiro
Merged at revision: 3138bd2987b4e72cfb38855c797a8fe85a1e2acd
Proposed branch: ~ubuntu-docker-images/ubuntu-docker-images/+git/cassandra:4.0-20.04-update-version
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/cassandra:4.0-20.04
Diff against target: 65 lines (+6/-6)
3 files modified
HACKING.md (+1/-1)
README.md (+4/-4)
data/cassandra.yaml (+1/-1)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior Approve
Ubuntu Docker Images Pending
Review via email: mp+406330@code.launchpad.net

Description of the change

Update version to 4.0.0

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks, this is OK.

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

On Wed, Jul 28, 2021 at 10:30:13PM -0000, Sergio Durigan Junior wrote:
> Review: Approve
>
> Thanks, this is OK.
>
> Diff comments:
>
> > diff --git a/README.md b/README.md
> > index acd0e0b..2e4388e 100644
> > --- a/README.md
> > +++ b/README.md
> > @@ -19,7 +19,7 @@ _Tags in italics are not available in ubuntu/cassandra but are shown here for co
> >
> > | Channel Tag | | | Currently | Architectures |
> > |---|---|---|---|---|
> > -| **`4.0-rc1-20.04_beta`**    | | | Cassandra 4.0-rc1 on Ubuntu 20.04 | `amd64`, `arm64`, `ppc64el`, `s390x` |
>
> I've just noticed that the template code didn't cope well with the "-rc1" suffix. This happens because we're splitting the version string using:
>
> '.'.join(version.split(".")[:2])
>
> We will also have to remove anything after minor version number in this case. Something to add to our TODO list.

Or could it be splitting on the first '-' when it should instead split
on the last one?

Also, there are python modules for version number manipulation, that
might be worth moving to in preference to manually splitting on "." -
for example, packaging.version.parse[1] is useful if you're dealing with
*only* upstream version numbers. For debian version numbers,
debian.debian_support has a NativeVersion module that is worth looking
at. For ubuntu version numbers, I'd point to versioning.py in
git-ubuntu, which wraps debian.debian_support with additional ubuntu
specific logic.

1: https://newbedev.com/how-do-i-compare-version-numbers-in-python

> > +| **`4.0-20.04_beta`**    | | | Cassandra 4.0.0 on Ubuntu 20.04 | `amd64`, `arm64`, `ppc64el`, `s390x` |
> > | _`track_risk`_ |
> >
> > Channel tag shows the most stable channel for that track ordered `stable`, `candidate`, `beta`, `edge`. More risky channels are always implicitly available. So if `beta` is listed, you can also pull `edge`. If `candidate` is listed, you can pull `beta` and `edge`. When `stable` is listed, all four are available. Images are guaranteed to progress through the sequence `edge`, `beta`, `candidate` before `stable`.
>
>
> --
> https://code.launchpad.net/~canonical-server/ubuntu-docker-images/+git/cassandra/+merge/406330
> Your team Ubuntu Docker Images is requested to review the proposed merge of ~canonical-server/ubuntu-docker-images/+git/cassandra:4.0-20.04-update-version into ~canonical-server/ubuntu-docker-images/+git/cassandra:4.0-20.04.

Revision history for this message
Jason C. McDonald (codemouse92) wrote :

This happened to come through my inbox, and I had to mention, you can also compare Ubuntu-style version numbers using the `apt_pkg` Python module, which is installed even on minimal Ubuntu images as a dependency of several things (including unattended-upgrades). Here's an example out of some code I'm working on:

```
import apt_pkg
def at_least_version(value: str, target: str) -> bool:
    if value is None:
        return False
    compared = apt_pkg.version_compare(value, target)
    return (compared >= 0)
```

Not sure whether that will come in handy, but I thought I'd throw it out there in case it is.

Cheers!

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the comments, Bryce and Jason.

I'm not sure if we want to depend on external Python libraries in order to do the parsing (as much as I agree that this would help!) because we're running this code in the context of a template parser (called RenderDown), so we'd like to keep things as simple as possible.

I don't think that we'll have to deal with exotic version strings too often, so I think it should be enough to improve the one-liner we have and make it a bit smarter when dealing with suffixes.

BTW, I've opened https://bugs.launchpad.net/ubuntu-docker-images/+bug/1938350 in order to track this.

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks for the review, and for filing the bug, Sergio!

Thanks for the comments, Jason, Bryce :)

Revision history for this message
Bryce Harrington (bryce) wrote :

On Thu, Jul 29, 2021 at 03:17:35AM -0000, Sergio Durigan Junior wrote:
> Thanks for the comments, Bryce and Jason.
>
> I'm not sure if we want to depend on external Python libraries in order to do the parsing (as much as I agree that this would help!) because we're running this code in the context of a template parser (called RenderDown), so we'd like to keep things as simple as possible.
>
> I don't think that we'll have to deal with exotic version strings too often, so I think it should be enough to improve the one-liner we have and make it a bit smarter when dealing with suffixes.
>

My gut suggests it's going to need dealt with more often than expected.
But I'm totally willing to wait for the rule of three to kick in, and
wait until it's come up a few more times before reiterating that it's
worth the effort to use an existing, tested module for this.

> BTW, I've opened https://bugs.launchpad.net/ubuntu-docker-images/+bug/1938350 in order to track this.
> --
> https://code.launchpad.net/~canonical-server/ubuntu-docker-images/+git/cassandra/+merge/406330
> Your team Ubuntu Docker Images is requested to review the proposed merge of ~canonical-server/ubuntu-docker-images/+git/cassandra:4.0-20.04-update-version into ~canonical-server/ubuntu-docker-images/+git/cassandra:4.0-20.04.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/HACKING.md b/HACKING.md
2index f55da34..b7a798a 100644
3--- a/HACKING.md
4+++ b/HACKING.md
5@@ -50,6 +50,6 @@ The repository containing the templates is located at:
6 https://code.launchpad.net/~canonical-server/ubuntu-docker-images/+git/templates
7
8 The specific data for this image's template can be found inside the
9-`data/` directory.
10+`data/` directory, in the image's own repository.
11
12
13diff --git a/README.md b/README.md
14index acd0e0b..2e4388e 100644
15--- a/README.md
16+++ b/README.md
17@@ -5,7 +5,7 @@ Current Cassandra Docker Image from Ubuntu. Receives security updates and rolls
18
19 ## About Cassandra
20
21-Apache Cassandra is a highly-scalable partitioned row store. Rows are organized into tables with a required primary key. [Partitioning](https://cwiki.apache.org/confluence/display/CASSANDRA2/Partitioners) means that Cassandra can distribute your data across multiple machines in an application-transparent matter. Cassandra will automatically repartition as machines are added and removed from the cluster. [Row store](https://cwiki.apache.org/confluence/display/CASSANDRA2/DataModel) means that like relational databases, Cassandra organizes data by rows and columns. The Cassandra Query Language (CQL) is a close relative of SQL. For more information, see the [Apache Cassandra web site](http://cassandra.apache.org/).
22+Apache Cassandra is an open source NoSQL distributed database trusted by thousands of companies for scalability and high availability without compromising performance. Linear scalability and proven fault-tolerance on commodity hardware or cloud infrastructure make it a good platform for mission-critical data.
23
24
25 ## Tags and Architectures
26@@ -19,7 +19,7 @@ _Tags in italics are not available in ubuntu/cassandra but are shown here for co
27
28 | Channel Tag | | | Currently | Architectures |
29 |---|---|---|---|---|
30-| **`4.0-rc1-20.04_beta`**    | | | Cassandra 4.0-rc1 on Ubuntu 20.04 | `amd64`, `arm64`, `ppc64el`, `s390x` |
31+| **`4.0-20.04_beta`**    | | | Cassandra 4.0.0 on Ubuntu 20.04 | `amd64`, `arm64`, `ppc64el`, `s390x` |
32 | _`track_risk`_ |
33
34 Channel tag shows the most stable channel for that track ordered `stable`, `candidate`, `beta`, `edge`. More risky channels are always implicitly available. So if `beta` is listed, you can also pull `edge`. If `candidate` is listed, you can pull `beta` and `edge`. When `stable` is listed, all four are available. Images are guaranteed to progress through the sequence `edge`, `beta`, `candidate` before `stable`.
35@@ -30,7 +30,7 @@ Channel tag shows the most stable channel for that track ordered `stable`, `cand
36 Launch this image locally:
37
38 ```sh
39-docker run -d --name cassandra-container -e TZ=UTC -p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 ubuntu/cassandra:4.0-rc1-20.04_beta
40+docker run -d --name cassandra-container -e TZ=UTC -p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 ubuntu/cassandra:4.0-20.04_beta
41 ```
42 Access your Cassandra server with `cqlsh localhost 9042`.
43
44@@ -68,7 +68,7 @@ docker exec -it cassandra-container /bin/bash
45 Works with any Kubernetes; if you don't have one, we recommend you [install MicroK8s](https://microk8s.io/) and `microk8s.enable dns storage` then `snap alias microk8s.kubectl kubectl`.
46
47 Download
48-[cassandra-deployment.yml](TBD) and set `containers.cassandra.image` in `cassandra-deployment.yml` to your chosen channel tag (e.g. `ubuntu/cassandra:4.0-rc1-20.04_beta`), then:
49+[cassandra-deployment.yml](TBD) and set `containers.cassandra.image` in `cassandra-deployment.yml` to your chosen channel tag (e.g. `ubuntu/cassandra:4.0-20.04_beta`), then:
50
51 ```sh
52 kubectl apply -f cassandra-deployment.yml
53diff --git a/data/cassandra.yaml b/data/cassandra.yaml
54index 92a0d7b..af37289 100644
55--- a/data/cassandra.yaml
56+++ b/data/cassandra.yaml
57@@ -7,7 +7,7 @@ description: >
58 compromising performance. Linear scalability and proven fault-tolerance on
59 commodity hardware or cloud infrastructure make it a good platform for
60 mission-critical data.
61-version: "4.0-rc1"
62+version: "4.0.0"
63 base: Ubuntu 20.04
64 architectures:
65 - amd64

Subscribers

People subscribed via source and target branches

to all changes: