Use LTS microcluster#395
Conversation
|
Test failures appear to be because of the go module transition. Should be fixed when canonical/microcluster#219 is merged. |
f496047 to
fac5eb6
Compare
|
Thanks for the change @masnax will take a look :D |
| // schemaUpdate4 updates all tables referencing `internal_cluster_members` to now reference `core_cluster_members` instead. | ||
| func schemaUpdate4(ctx context.Context, tx *sql.Tx) error { | ||
| stmt := ` | ||
| CREATE TABLE disks2 ( |
There was a problem hiding this comment.
@sabaini It would be good to have a discussion for table names being introduced here.
There was a problem hiding this comment.
FWIW, the tables in MicroCeph have not been renamed, it is only the foreign key reference to the microcluster table that has changed. We ensure that foreign key references are not erased when we changed the table name internally, so no data will be lost.
This had to be retroactively applied to all schema updates in case a very old version of MicroCeph tries to update to the latest version.
microceph/cmd/microcephd/main.go
Outdated
| daemonArgs := microcluster.DaemonArgs{ | ||
| Verbose: c.global.flagLogVerbose, | ||
| Debug: c.global.flagLogDebug, | ||
| Version: "UNKNOWN", // FIXME: Add an explicit version to MicroCeph. |
There was a problem hiding this comment.
@masnax can you please add some comments to describe what versioning is this.
There was a problem hiding this comment.
When using the MicroCeph API, it is useful to determine the current version of MicroCeph so that compatibility can be verified. We have an endpoint at /core/1.0 that provides basic identifying information like the cluster name, address, and project version.
For example, from MicroCloud, we should be able to tell from the API that MicroCeph is installed from a revision belonging to a supported snap track/risk. Like MicroCloud LTS should verify that MicroCeph is also installed as an LTS version.
Microcluster validates that a version must be present, but I wasn't able to find any value in the project that matched this criteria so I put UNKOWN here.
I'll update the commit with the above information as well.
There was a problem hiding this comment.
I've added a comment in-line with the Version field now.
UtkarshBhatthere
left a comment
There was a problem hiding this comment.
Did a round of reviews, have left questions and comments inline.
fd6a044 to
7ac4bc4
Compare
roosterfish
left a comment
There was a problem hiding this comment.
Thanks @masnax, looks good to me from microcluster perspective.
Aside from those changes I am wondering if we should parse the --timeout duration from string instead of requiring specifying it in seconds.
This way if you intend to use a duration of a few hours you don't have to provide this big int which represents the seconds but instead provide only 6h or 1d.
Something like we do in the microcluster example package.
7ac4bc4 to
8d2afd3
Compare
Good idea, this has been applied now. |
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
microcluster no longer exposes the shutdown context, so these async operations can no longer use it. It is not possible to use the request context because it may cancel before the async operation returns, so that just leaves context.Background. In the future, MicroCeph should expose its own shutdown context that it passes to microcluster app.Start. Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Microcluster no longer exposes the shutdown context, so all context handling for the API is shifted to use the request.Context as an explicit argument. Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Version is set to UNKNOWN until an official version number can be chosen. This value cannot be blank. Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
The `internal_cluster_members` table was renamed to `core_cluster_members` to make it clear that this table is expected to be accessed. As such, this adds a schema update that fixes the foreign key reference on all tables. Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
The database is implemented internally, so instead ServerCert is used to signify a nil state. Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
8d2afd3 to
b8bb9ff
Compare
Updates MicroCeph to use the stable release of microcluster at
v2.0.0.For the most part, the changes to the code in MicroCeph are just package imports and changing the definition of
state.Stateto an interface.The actual behavioural changes are these:
state.Contextis no longer exposed, sorequest.Contextfrom the API handler is passed around explicitly to each helper. This should actually result in more precise context handling for MicroCeph.context.Background()is used because the request context may cancel before the goroutine is complete.Adds a schema update to MicroCeph that changes their foreign key references to
core_cluster_members. This table has been renamed frominternal_cluster_membersto make it clear that accessing it is expected behaviour. I also took the liberty of renaming the previous schema update function to use an ordered naming scheme so that it doesn't become ambiguous where an update fits among the others.Join tokens now have expiration dates. By default, MicroCeph will set a 3 hour expiration for join tokens, but this can be configured with the
--timeoutflag added tocluster add.The project version supplied to microcluster has been set to
UNKOWNfor now because microcluster requires a value here.