Skip to content

Commit

Permalink
Merge branch 'master' into KU-1744/batching
Browse files Browse the repository at this point in the history
  • Loading branch information
marco6 committed Oct 7, 2024
2 parents bd5b970 + 72d769f commit ba4887f
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 6 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/k8s-snap-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Integration Test K8s-snap

on:
push:
branches: ["master"]
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build K8-dqlite
runs-on: ubuntu-20.04

steps:
- name: Checking out repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install tox
run: pip install tox
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Download latest k8s-snap
run: |
sudo snap download k8s --channel=latest/edge --basename k8s
- name: Install lxd
run: |
sudo snap refresh lxd --channel 5.21/stable
sudo lxd init --auto
sudo usermod --append --groups lxd $USER
sg lxd -c 'lxc version'
- name: Build k8s-dqlite
run: |
make static
- name: Unpack Snap
run: |
sudo unsquashfs -d snap-unpack-dir k8s.snap
- name: Replace k8s-dqlite binary
run: |
sudo cp ./bin/static/k8s-dqlite snap-unpack-dir/bin/k8s-dqlite
sudo chmod o+r snap-unpack-dir/bin/k8s-dqlite
- name: Repack Snap
run: |
sudo mksquashfs snap-unpack-dir k8s-updated.snap -noappend -comp lzo -no-fragments
- name: Running
env:
TEST_SNAP: ${{ github.workspace }}/k8s-updated.snap
TEST_SUBSTRATE: lxd
TEST_LXD_IMAGE: ubuntu:22.04
TEST_INSPECTION_REPORTS_DIR: ${{ github.workspace }}/inspection-reports
run: |
git clone https://github.com/canonical/k8s-snap.git
cd k8s-snap/tests/integration && sg lxd -c 'tox -e integration'
- name: Prepare inspection reports
if: failure()
run: |
tar -czvf inspection-reports.tar.gz -C ${{ github.workspace }} inspection-reports
- name: Upload inspection report artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: inspection-reports
path: ${{ github.workspace }}/inspection-reports.tar.gz
10 changes: 4 additions & 6 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@ and connect to the Dqlite database.

Follow the guide for MicroK8s steps 1-5 while changing the snap name to `k8s`.

Step 5:
Stop k8s-dqlite included in the snap:
5. Stop k8s-dqlite included in the snap:

```bash
```
sudo snap stop k8s.k8s-dqlite --disable
```

Step 6:
This step is different as it uses a different path for the storage directory and the listen address:
6. This step is different as it uses a different path for the storage directory and the listen address:

```bash
```
cd k8s-dqlite
make static
sudo ./bin/static/k8s-dqlite \
Expand Down

0 comments on commit ba4887f

Please sign in to comment.