Skip to content

Commit

Permalink
Backports (stable-5.0) (#14400)
Browse files Browse the repository at this point in the history
- Switch to dqlite 1.17 LTS and go-dqlite v2.0.0 LTS
- Backports
- Use go mod version of Go for building
  • Loading branch information
tomponline authored Nov 5, 2024
2 parents 6869198 + 03ee688 commit 4175911
Show file tree
Hide file tree
Showing 29 changed files with 95 additions and 539 deletions.
43 changes: 13 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
path: ${{ steps.ShellCheck.outputs.sarif }}
if: github.event_name == 'pull_request'

- name: Install Go (1.22)
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version-file: 'go.mod'

- name: Install dependencies
run: |
Expand Down Expand Up @@ -177,22 +177,8 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ["1.22.x"]
suite: ["cluster", "standalone"]
backend: ["dir", "btrfs", "lvm", "zfs", "ceph", "random"]
include:
- go: "1.22.x"
suite: cluster
backend: dir
- go: "1.22.x"
suite: standalone
backend: dir
- go: stable
suite: cluster
backend: dir
- go: stable
suite: standalone
backend: dir

steps:
- name: Performance tuning
Expand Down Expand Up @@ -237,13 +223,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Go (${{ matrix.go }})
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
go-version-file: 'go.mod'

- name: Check compatibility with min Go version (${{ matrix.go }})
if: matrix.go == '1.22.x'
- name: Check compatibility with min Go version
run: |
set -eux
GOMIN="$(sed -n 's/^GOMIN=\([0-9.]\+\)$/\1/p' Makefile)"
Expand All @@ -267,7 +252,7 @@ jobs:
libacl1-dev \
libcap-dev \
libdbus-1-dev \
libdqlite-dev \
libdqlite1.17-dev \
liblxc-dev \
libseccomp-dev \
libselinux-dev \
Expand Down Expand Up @@ -380,7 +365,7 @@ jobs:
sudo microceph.ceph status
sudo rm -f /snap/bin/rbd
- name: "Run system tests (${{ matrix.go }}, ${{ matrix.suite }}, ${{ matrix.backend }})"
- name: "Run system tests (${{ matrix.suite }}, ${{ matrix.backend }})"
run: |
set -eux
chmod +x ~
Expand All @@ -393,8 +378,6 @@ jobs:
strategy:
fail-fast: false
matrix:
go:
- 1.22.x
os:
- ubuntu-latest
- macos-latest
Expand All @@ -405,10 +388,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go (${{ matrix.go }})
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
go-version-file: 'go.mod'

- name: Create build directory
run: |
Expand Down Expand Up @@ -475,10 +458,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Go (1.22)
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version-file: 'go.mod'

- name: Install dependencies
run: |
Expand Down Expand Up @@ -544,10 +527,10 @@ jobs:
ssh-keyscan git.launchpad.net >> ~/.ssh/known_hosts
ssh-keygen -qlF git.launchpad.net | grep -xF 'git.launchpad.net RSA SHA256:UNOzlP66WpDuEo34Wgs8mewypV0UzqHLsIFoqwe8dYo'
- name: Install Go (${{ matrix.go }})
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version-file: 'go.mod'

- name: Trigger Launchpad snap build
env:
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ GOPATH ?= $(shell go env GOPATH)
CGO_LDFLAGS_ALLOW ?= (-Wl,-wrap,pthread_create)|(-Wl,-z,now)
SPHINXENV=doc/.sphinx/venv/bin/activate
GOMIN=1.22.7
DQLITE_BRANCH=lts-1.17.x

ifneq "$(wildcard vendor)" ""
DQLITE_PATH=$(CURDIR)/vendor/dqlite
Expand Down Expand Up @@ -57,8 +58,10 @@ lxd-migrate:
deps:
# dqlite (+raft)
@if [ ! -e "$(DQLITE_PATH)" ]; then \
git clone --depth=1 "https://github.com/canonical/dqlite" "$(DQLITE_PATH)"; \
echo "Retrieving dqlite from ${DQLITE_BRANCH} branch"; \
git clone --depth=1 --branch "${DQLITE_BRANCH}" "https://github.com/canonical/dqlite" "$(DQLITE_PATH)"; \
elif [ -e "$(DQLITE_PATH)/.git" ]; then \
echo "Updating existing dqlite branch"; \
cd "$(DQLITE_PATH)"; git pull; \
fi

Expand Down Expand Up @@ -191,7 +194,7 @@ dist: doc
(cd $(TMP)/lxd-$(VERSION) ; go mod vendor)

# Download the dqlite library
git clone --depth=1 https://github.com/canonical/dqlite $(TMP)/lxd-$(VERSION)/vendor/dqlite
git clone --depth=1 --branch "${DQLITE_BRANCH}" https://github.com/canonical/dqlite $(TMP)/lxd-$(VERSION)/vendor/dqlite
(cd $(TMP)/lxd-$(VERSION)/vendor/dqlite ; git show-ref HEAD | cut -d' ' -f1 > .gitref)

# Copy doc output
Expand Down
4 changes: 2 additions & 2 deletions doc/howto/cluster_form.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ See {ref}`clustering-members` for more information.

You can form the LXD cluster interactively by providing configuration information during the initialization process or by using preseed files that contain the full configuration.

To quickly and automatically set up a basic LXD cluster, you can use MicroCloud.
Note, however, that this project is still in an early phase.
To quickly and automatically set up a basic LXD cluster, you can use {ref}`MicroCloud <use-microcloud>`.

## Configure the cluster interactively

Expand Down Expand Up @@ -397,6 +396,7 @@ opyQ1VRpAg2sV2C4W8irbNqeUsTeZZxhLqp4vNOXXBBrSqUCdPu1JXADV0kavg1l
````
`````

(use-microcloud)=
## Use MicroCloud

```{youtube} https://www.youtube.com/watch?v=iWZYUU8lX5A
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/Rican7/retry v0.3.1
github.com/armon/go-proxyproto v0.1.0
github.com/canonical/candid v1.12.3
github.com/canonical/go-dqlite v1.22.0
github.com/canonical/go-dqlite/v2 v2.0.0
github.com/checkpoint-restore/go-criu/v6 v6.3.0
github.com/digitalocean/go-qemu v0.0.0-20230711162256-2e3d0186973e
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e
Expand All @@ -35,10 +35,10 @@ require (
github.com/mdlayher/netx v0.0.0-20230430222610-7e21880baee8
github.com/mdlayher/vsock v1.2.1
github.com/miekg/dns v1.1.62
github.com/minio/minio-go/v7 v7.0.78
github.com/minio/minio-go/v7 v7.0.80
github.com/mitchellh/mapstructure v1.5.0
github.com/olekukonko/tablewriter v0.0.5
github.com/osrg/gobgp/v3 v3.30.0
github.com/osrg/gobgp/v3 v3.31.0
github.com/pkg/sftp v1.13.7
github.com/pkg/xattr v0.4.10
github.com/robfig/cron/v3 v3.0.1
Expand All @@ -57,7 +57,7 @@ require (
gopkg.in/juju/environschema.v1 v1.0.1
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637
gopkg.in/yaml.v2 v2.4.0
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6
k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078
)

require (
Expand All @@ -68,7 +68,7 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/eapache/channels v1.1.0 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/go-macaroon-bakery/macaroonpb v1.0.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/renameio v1.0.1 // indirect
Expand Down Expand Up @@ -126,7 +126,7 @@ require (
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/tools v0.26.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/grpc v1.67.1 // indirect
gopkg.in/errgo.v1 v1.0.1 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
Expand Down
Loading

0 comments on commit 4175911

Please sign in to comment.