feat: support x-machines placement constraints in compose files (#90)

This commit is contained in:
Evgenii Orlov
2025-07-10 16:46:29 +10:00
committed by GitHub
parent 492a0af2b2
commit 31cd4c77e9
22 changed files with 472 additions and 39 deletions
+1 -1
View File
@@ -4,8 +4,8 @@ import (
"context"
"fmt"
systemd "github.com/coreos/go-systemd/daemon"
"log/slog"
"github.com/psviderski/uncloud/internal/machine"
"log/slog"
)
type Daemon struct {
+1 -1
View File
@@ -2,10 +2,10 @@ package proxy
import (
"fmt"
"github.com/psviderski/uncloud/internal/machine/api/pb"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/encoding/protowire"
"google.golang.org/protobuf/proto"
"github.com/psviderski/uncloud/internal/machine/api/pb"
)
// One2ManyResponder converts upstream responses into messages from upstreams, so that multiple
+5 -5
View File
@@ -5,17 +5,17 @@ import (
"context"
"errors"
"fmt"
"github.com/psviderski/uncloud/internal/corrosion"
"github.com/psviderski/uncloud/internal/machine/api/pb"
"github.com/psviderski/uncloud/internal/machine/network"
"github.com/psviderski/uncloud/internal/machine/store"
"github.com/psviderski/uncloud/internal/secret"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
"log/slog"
"net/netip"
"time"
"github.com/psviderski/uncloud/internal/corrosion"
"github.com/psviderski/uncloud/internal/machine/api/pb"
"github.com/psviderski/uncloud/internal/machine/network"
"github.com/psviderski/uncloud/internal/machine/store"
"github.com/psviderski/uncloud/internal/secret"
)
type Cluster struct {
+1 -1
View File
@@ -4,10 +4,10 @@ import (
"bytes"
"fmt"
"github.com/BurntSushi/toml"
"github.com/psviderski/uncloud/internal/fs"
"net/netip"
"os"
"path/filepath"
"github.com/psviderski/uncloud/internal/fs"
)
const (
+1 -1
View File
@@ -3,13 +3,13 @@ package tunnel
import (
"context"
"fmt"
"github.com/psviderski/uncloud/internal/secret"
"golang.zx2c4.com/wireguard/conn"
"golang.zx2c4.com/wireguard/device"
"golang.zx2c4.com/wireguard/tun/netstack"
"net"
"net/netip"
"time"
"github.com/psviderski/uncloud/internal/secret"
)
const (
+1 -1
View File
@@ -2,10 +2,10 @@ package network
import (
"fmt"
"github.com/psviderski/uncloud/internal/secret"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"net/netip"
"time"
"github.com/psviderski/uncloud/internal/secret"
)
const (
+1 -1
View File
@@ -6,6 +6,7 @@ import (
"context"
"errors"
"fmt"
"github.com/psviderski/uncloud/internal/secret"
"github.com/vishvananda/netlink"
"go4.org/netipx"
"golang.org/x/sys/unix"
@@ -17,7 +18,6 @@ import (
"slices"
"sync"
"time"
"github.com/psviderski/uncloud/internal/secret"
)
type WireGuardNetwork struct {
+1 -1
View File
@@ -3,10 +3,10 @@ package machine
import (
"encoding/json"
"fmt"
"github.com/psviderski/uncloud/internal/machine/network"
"os"
"path/filepath"
"sync"
"github.com/psviderski/uncloud/internal/machine/network"
)
const (
+2 -2
View File
@@ -5,10 +5,10 @@ import (
_ "embed"
"errors"
"fmt"
"google.golang.org/protobuf/encoding/protojson"
"log/slog"
"github.com/psviderski/uncloud/internal/corrosion"
"github.com/psviderski/uncloud/internal/machine/api/pb"
"google.golang.org/protobuf/encoding/protojson"
"log/slog"
)
var (
+1 -1
View File
@@ -4,9 +4,9 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"github.com/psviderski/uncloud/internal/secret"
"net/netip"
"strings"
"github.com/psviderski/uncloud/internal/secret"
)
const (