Commit Graph
514 Commits
Author SHA1 Message Date
Pasha Sviderski 2f159157cc feat(version): replace --version with 'version' command to print build information for uc and uncloudd 2026-05-21 15:14:08 +10:00
Pasha Sviderski 28c88e4e10 feat(version): collect build-time metadata for uncloud binaries in version pkg 2026-05-21 15:14:08 +10:00
Pasha Sviderski 7f7d091429 chore: make the reset machine prompt a bit clearer 2026-05-21 15:14:08 +10:00
Aaron EcholsandGitHub 424263bdd4 feat: allow to customise WireGuard listen port with --wg-port for machine init/add (#366) 2026-05-19 16:55:55 +10:00
c95136eae6 BREAKING CHANGE: resolve gRPC API proxy targets (machines) on server instead of client, needs upgrade to v0.20 (#247)
Co-authored-by: Pasha Sviderski <me@psviderski.name>
2026-05-19 15:22:50 +10:00
Pasha Sviderski 5ecd09aa2b fix: return non-exit code when uc commands cancelled by not confirming prompt (fixes #354) 2026-05-05 10:41:53 +10:00
Miek GiebenandGitHub dd68079005 feat: add shell completion for ucind CLI (#344)
For feature parity with uc. Only _really_ usefull for ucind cluster rm,
but still useful, and not many lines of code.

Signed-off-by: Miek Gieben <miek@miek.nl>
2026-05-04 13:42:23 +10:00
Miek GiebenandGitHub d23f1bdc00 refactor: manually modernize Go (#349)
Signed-off-by: Miek Gieben <miek@miek.nl>
2026-05-04 13:20:48 +10:00
Miek GiebenandGitHub 4a12217e65 feat: add uc CLI argument completion for machines, services, volumes (#309)
* Allow for argument completion

This shows for a single command on how to complete service names in the
cluster: `uc inspect <TAB>` will complete using ListServices

See: #307

Signed-off-by: Miek Gieben <miek@miek.nl>

* All cluster interactions can be completed

Signed-off-by: Miek Gieben <miek@miek.nl>

* Machines -m flag completion

Signed-off-by: Miek Gieben <miek@miek.nl>

* Add completion for "ctx use"

Signed-off-by: Miek Gieben <miek@miek.nl>

* Complete from compose file too

Signed-off-by: Miek Gieben <miek@miek.nl>

* Allow for argument completion

This shows for a single command on how to complete service names in the
cluster: `uc inspect <TAB>` will complete using ListServices

See: #307

Signed-off-by: Miek Gieben <miek@miek.nl>

* All cluster interactions can be completed

Signed-off-by: Miek Gieben <miek@miek.nl>

* Machines -m flag completion

Signed-off-by: Miek Gieben <miek@miek.nl>

* Add completion for "ctx use"

Signed-off-by: Miek Gieben <miek@miek.nl>

* Complete from compose file too

Signed-off-by: Miek Gieben <miek@miek.nl>

* Move to better place

Signed-off-by: Miek Gieben <miek@miek.nl>

* Adjust imports

Signed-off-by: Miek Gieben <miek@miek.nl>

* prefix match for context too

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
2026-04-29 12:18:05 +10:00
Pasha Sviderski 3310b478a1 chore: do not log too noisy 'Sent log stream heartbeat.' log line for machine logs 2026-04-24 14:22:25 +10:00
Pasha Sviderski 8384d4162c lint 2026-04-24 13:24:17 +10:00
Pasha Sviderski fe829efbf5 refactor: embed install.sh script in uc CLI to not curl | sh and version together with CLI 2026-04-24 11:37:12 +10:00
Pasha Sviderski 45cf87a0cb feat(caddy): order local machine upstreams first in generated Caddyfile 2026-04-23 19:42:33 +10:00
Pasha Sviderski 50057c42e0 fix: machine logs timestamp parsing and streaming for systemd <v255 2026-04-23 17:31:31 +10:00
Pasha Sviderski 7b554cd703 chore: style the machine reset prompt in red and fix the padding for [y/N] 2026-04-22 19:00:38 +10:00
Miek GiebenandGitHub 6fb68c22c5 fix: correctly wait for journalctl processes to not leave zombies when streaming machine logs (#325)
* fix: call cmd.Wait()

Even though the context is cancelled we still need to call cmd.Wait()
after a cmd.Start() to clean up the child (reap) process. Not doing so
results in a zombie journalctl.

I have manually tested this, as I'm still not sure how to e2e test for
this in a simple manner.

Before:

```
root@uncloud2:~# ps aux|grep jou
root         313  0.0  1.2  42272 23352 ?        S<s  Apr20   0:10 /usr/lib/systemd/systemd-journald
root       15751  0.0  0.0      0     0 pts/0    Z+   07:02   0:00 [journalctl] <defunct>
root       15754  0.0  0.0      0     0 pts/0    Z+   07:02   0:00 [journalctl] <defunct>
```

After:

```
root         313  0.0  1.2  42272 23592 ?        S<s  Apr20   0:10 /usr/lib/systemd/systemd-journald
```

* follow() doesnt need wait

We can keep the wait function more contraint, as follow does not need it

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
2026-04-22 19:00:15 +10:00
Pasha Sviderski b1897ce719 fix(nightly): inject correct semver 0.<next-minor>.0-nightly-abc1234 for nightly builds 2026-04-22 15:41:55 +10:00
Pasha Sviderski 47199c36ce fix: containerd socket detection and unregistry startup on machine reboot 2026-04-22 15:31:18 +10:00
Pasha Sviderski 56a54ab3fd feat(logs): include hook information in log entry formatting 2026-04-22 13:55:42 +10:00
Pasha Sviderski 5b5cd44d68 refactor(logs): encapsulate printing errors in PrintEntry 2026-04-22 11:32:23 +10:00
Pasha Sviderski 19c13f6cd2 refactor: move internal logs pkg from cmd to internal/cli 2026-04-22 11:27:30 +10:00
Miek GiebenandGitHub 7e1b91c372 feat: ucind: implement cluster list command (#316)
* ucind: implement cluster list

I keep forgetting my ucind clusters, that add the missing list command:
```
% ./ucind cluster list
NAME    MACHINES
miek1   machine-1
```

Just the name would have been enough, but to actually make use of the
tui table a machines list is handy as well.
(There isn't much bubbletea in ucind, but I thought lets start now).

Signed-off-by: Miek Gieben <miek@miek.nl>

* Filter directly when listing

Filter on ucind managed while listing clusters

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
2026-04-21 19:43:04 +10:00
Miek GiebenandGitHub f44ada06b9 feat(logs): 'uc machine logs' to view logs from systemd services on machines (#283)
* logging: client side

Create internal/logs and put abstracted way service and machine logging in there
This adds the bits to do machine logging of the services.

See #273 and discussion in #158

Signed-off-by: Miek Gieben <miek@miek.nl>

* go mod tidy

Signed-off-by: Miek Gieben <miek@miek.nl>

* fix typo

Signed-off-by: Miek Gieben <miek@miek.nl>

* Hook it up further

Signed-off-by: Miek Gieben <miek@miek.nl>

* Check unit validity server side

Signed-off-by: Miek Gieben <miek@miek.nl>

* Make cli-docs

Signed-off-by: Miek Gieben <miek@miek.nl>

* Add newline to logs

Signed-off-by: Miek Gieben <miek@miek.nl>

* docs

Signed-off-by: Miek Gieben <miek@miek.nl>

* Polish a bit

Signed-off-by: Miek Gieben <miek@miek.nl>

* comment fix

Signed-off-by: Miek Gieben <miek@miek.nl>

* There is no groupid

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
2026-04-21 17:27:39 +10:00
Pasha Sviderski 84990ad692 refactor(rtt): use proto Duration, add tests 2026-04-20 11:36:44 +10:00
Justin BradfordandGitHub 8d023f5c53 feat(rtt): 'machine rtt' command to show round-trip time between macines usign using gossip data (#226)
* Add corrosion admin client function to get RTT to other machines in the cluster

* Add `uc machine rtt` showing all pair-wise RTT stats from corrosion

* Add long description to machine rtt command

* Include machine peer RTTs in InspectMachine instead of adding new gRPC API for it

* Add nil check on InspectMachine's Rtt field to protect from a potential edge case

* Generate docs for machine rtt command

* Handle m.Message being nil when a node is down or unavailble

* Update cli-docs

* Use tui Table instead of tabwriter

* Change reported RTT to the median rather than mean. Still calculate include stddev, as it might be a useful indication of network jitter.

* Show RTT to peers in `wg show` output

* Update cli docs
2026-04-20 08:01:20 +10:00
Pasha Sviderski fdbffbf020 fix: close stale ControlMaster ssh connection for machine init/add 2026-04-16 17:28:05 +10:00
Pasha Sviderski f8234916cb fix: another attempt to fix flaky e2e tests: bump dind and get rid of incomplete cgroups fix, pre-allocate ucind machine port, allow ucind container retarts 2026-04-15 20:40:24 +10:00
Pasha Sviderski 208a561003 chore: trigger container sync on ActionHealthStatusRunning Docker event as well 2026-04-15 17:34:24 +10:00
Pasha Sviderski 6e9acefbe6 fix: Caddy config regeneration due to non-deterministic container serialisation (fixes #111) 2026-04-15 16:49:01 +10:00
Miek GiebenandGitHub e8111a419f feat: auto-accept only new SSH host keys using "-o StrictHostKeyChecking: accept-new" (#303)
* feat: add "StrictHostKeyChecking no" to ssh

Disable host key checking to prevent interaction with ssh.

Fixes: #297

Signed-off-by: Miek Gieben <miek@miek.nl>

* use accept-new instead of no

Signed-off-by: Miek Gieben <miek@miek.nl>

* fix tests

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix tests here as well

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
2026-04-14 18:00:59 +10:00
Miek GiebenandGitHub dd989a281e feat: check automatically if uc can connect via Unix socket when running on cluster machine (#296)
* Check autom if we can connect via Unix socket

When there is no config, but a unix socket does exist, connect via the
unix socket. Prohibit saving the config if this is the case.

Fixes: #148

Use the new CutPrefix to shorten some code.

Signed-off-by: Miek Gieben <miek@miek.nl>

* remove error checking; it can not be hit

Signed-off-by: Miek Gieben <miek@miek.nl>

* Extra error text when logged in locally

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
2026-04-13 16:37:48 +10:00
Pasha Sviderski b3b33a82ba chore(e2e): increase ucind cluster init timeouts, decrease max backoff delay for TCP connection to retry faster 2026-04-09 14:39:12 +10:00
Pasha Sviderski ab644f6a47 fix: race on warned flag in versioncheck pkg, make consistent use of client/server terms 2026-04-08 20:42:27 +10:00
Pasha Sviderski 883f184e37 lint 2026-04-08 19:53:26 +10:00
897f30fd36 feat: add client/server version check mechanism to gRPC calls (#260)
* Add version check mechanism to gRPC calls

* Use semver not semver/v3

* Give dev builds a special "infinite" version number (999.0.0-dev)

* Handle no metadata on grpc call correctly for version check

* Move versioncheck package to root pkg/ from pkg/api/ since it is shared by both pkg/api/ and pkg/client/

* Only show "no daemon version" warning once

* Append version headers to metadata, not overwrite...

* Unit tests on versioncheck logic

* Move SetHeader to the ServerStream in ServerStreamInterceptor

* Go modernizer nits: interface{} -> any

* Use more conventional gRPC header names for version/min-versions

* Add TODO notes on checkDaemonVersionInResponse and related code that can be removed eventually after transition to version checking client/daemons

* Use testify for testing assertions

* Add explanatory comments on MinCLIVersion and MinDaemonVersion

---------

Co-authored-by: Pasha Sviderski <me@psviderski.name>
2026-04-08 19:52:42 +10:00
Pasha Sviderski 943fea0515 refactor: simplify journal logs following, fix corrosion unit name 2026-04-08 19:38:02 +10:00
Pasha Sviderski e96cce88c1 fix(pre-deploy): exclude hook containers from caddy and dns controllers 2026-04-08 19:16:42 +10:00
Pasha Sviderski fe813302b7 refactor: event ID generation for images, machines, and volumes to align with plan formatting 2026-04-08 19:16:42 +10:00
Pasha Sviderski 0da9df17a4 feat(pre-deploy): correct progress events for pre-deploy hooks, make other container events more aligned with plan 2026-04-08 19:16:42 +10:00
Pasha Sviderski 0e820f9c52 feat(pre-deploy): add support for x-pre_deploy extension in Compose + e2e test 2026-04-08 19:16:42 +10:00
Pasha Sviderski 772b31b57f feat(pre-deploy): implement pre-deploy hook operations for deployment 2026-04-08 19:16:42 +10:00
Pasha Sviderski 1c8b77054a feat(pre-deploy): add support for pre-deploy hook containers in service management, sync *all* containers to store 2026-04-08 19:16:28 +10:00
Miek GiebenandGitHub cef047221c feat(machine-logs): add server side of journal logs (#282)
* Add server side of journal logs

This add the server side and grpc methods to get a journal logs from a
machine. It repurposes ServiceLogEntry for these logs to keep the
changes somewhat to a minimum. And it lets us re-use the merging of the
various logs. In the protobufs ContainerLog has been renamed to just Log
and LogEntry, as these are now also used for journal logs.

It does api.LogOptions in more places to reduce the various logOpts that
were used.

It does not yet plumb it through to the uc client, that needs a follow
up pr. Following logs is also not yet implemented.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix test too

Signed-off-by: Miek Gieben <miek@miek.nl>

* remove entire comment

Signed-off-by: Miek Gieben <miek@miek.nl>

* Implement the follow option, untested mind you

Signed-off-by: Miek Gieben <miek@miek.nl>

* update debug line

Signed-off-by: Miek Gieben <miek@miek.nl>

* internal/jounal: First batch of PR comments

Signed-off-by: Miek Gieben <miek@miek.nl>

* internal/journal: code review comments

Signed-off-by: Miek Gieben <miek@miek.nl>

* Manually apply suggestion

Signed-off-by: Miek Gieben <miek@miek.nl>

* apply comment manually

Signed-off-by: Miek Gieben <miek@miek.nl>

* internal/journal: add unit test

Signed-off-by: Miek Gieben <miek@miek.nl>

* Use testify

Signed-off-by: Miek Gieben <miek@miek.nl>

* -amFix scanner.Err checking

Signed-off-by: Miek Gieben <miek@miek.nl>

* Implement code review comments

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
2026-04-08 18:51:52 +10:00
Pasha Sviderski e22cdf0b18 refactor: NewTable for consistent CLI table rendering, style images for ls,ps 2026-03-30 14:08:50 +10:00
Pasha Sviderski 06c2bc55f2 feat: make connection method using system 'ssh' the default (add ssh+go:// fallback) 2026-03-27 20:27:36 +10:00
Pasha Sviderski ada9bec2d4 refactor: remove docker dependency for Pid container property 2026-03-24 18:29:45 +10:00
98439b7743 feat: support PID namespace mode in Compose (#276)
This adds `pid: host` compose key support.

Modelled after #238.

See: #237

Signed-off-by: Miek Gieben <miek@miek.nl>
Co-authored-by: Pasha Sviderski <me@psviderski.name>
2026-03-24 16:18:53 +10:00
Miek GiebenandGitHub 2ab58d24d4 chore: modernize the codebase using go 1.26 (#278)
This runs:

```
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./...
```

over the codebase, as this is using go 1.26, it can also use the new
new() functionallity so AsPtr and boolPtr is are needed anymore.

Signed-off-by: Miek Gieben <miek@miek.nl>
2026-03-21 21:16:09 +10:00
Pasha Sviderski 3f95583dd4 fix: plan formatting for service scaling (update verb), fix image and replicas diff 2026-03-19 15:29:21 +10:00
Pasha Sviderski b4b1232375 refactor: format deployment plan for caddy (uc caddy deploy) 2026-03-19 14:22:01 +10:00