From e9c72928f9726e7ba899f265cf697c79e9253110 Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Thu, 16 Nov 2023 11:20:50 -0500 Subject: [PATCH 01/16] Fix clippy 1.74 errors Signed-off-by: Bryan Gurney --- src/engine/strat_engine/backstore/crypt/shared.rs | 2 +- src/engine/strat_engine/thinpool/thinpool.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/strat_engine/backstore/crypt/shared.rs b/src/engine/strat_engine/backstore/crypt/shared.rs index 0ff10103f2..bc79ee158c 100644 --- a/src/engine/strat_engine/backstore/crypt/shared.rs +++ b/src/engine/strat_engine/backstore/crypt/shared.rs @@ -559,8 +559,8 @@ fn tang_dispatch(json: &Value) -> StratisResult { })?; let mut key = keys .iter() + .find(|&obj| obj.get("key_ops") == Some(&Value::Array(vec![Value::from("verify")]))) .cloned() - .find(|obj| obj.get("key_ops") == Some(&Value::Array(vec![Value::from("verify")]))) .ok_or_else(|| { StratisError::Msg("Verification key not found in clevis metadata".to_string()) })?; diff --git a/src/engine/strat_engine/thinpool/thinpool.rs b/src/engine/strat_engine/thinpool/thinpool.rs index 60857dae01..df7f446cb7 100644 --- a/src/engine/strat_engine/thinpool/thinpool.rs +++ b/src/engine/strat_engine/thinpool/thinpool.rs @@ -2603,7 +2603,7 @@ mod tests { let mut file = OpenOptions::new() .create(true) .write(true) - .open(&new_file) + .open(new_file) .unwrap(); let mut bytes_written = Bytes(0); // Write 400 * IEC::Mi From fa9970ba9460c8b0b12cb4df6a21d9faf06be56a Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Mon, 20 Nov 2023 16:41:31 -0500 Subject: [PATCH 02/16] packit.yaml: fix indentation Signed-off-by: Bryan Gurney --- .packit.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index bb3d31e1c4..8762b22293 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -43,15 +43,15 @@ jobs: identifier: cockpit trigger: pull_request notifications: - failure_comment: - message: "Cockpit tests failed for commit {commit_sha}. @martinpitt, @jelly, @mvollmer please check." + failure_comment: + message: "Cockpit tests failed for commit {commit_sha}. @martinpitt, @jelly, @mvollmer please check." targets: - - fedora-development + - fedora-development tf_extra_params: - environments: - - artifacts: - - type: repository-file - id: https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/repo/fedora-$releasever/group_cockpit-main-builds-fedora-$releasever.repo - tmt: - context: - plan: "cockpit" + environments: + - artifacts: + - type: repository-file + id: https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/repo/fedora-$releasever/group_cockpit-main-builds-fedora-$releasever.repo + tmt: + context: + plan: "cockpit" From 165ac34b15ea0eafa2d453db9e92372cdf038ffe Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 20 Nov 2023 18:21:57 -0500 Subject: [PATCH 03/16] support.yml: trigger on packit and tmt changes Signed-off-by: mulhern --- .github/workflows/support.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/support.yml b/.github/workflows/support.yml index f40009bd9d..0a8bb64ae5 100644 --- a/.github/workflows/support.yml +++ b/.github/workflows/support.yml @@ -8,6 +8,9 @@ on: branches: - patch-3.6.0 paths: + - ".packit.yaml" + - "plans/**" + - "tests-fmf/**" - "**/*.yml" - "tests/**" - "!tests/**/README.*" @@ -15,6 +18,9 @@ on: branches: - patch-3.6.0 paths: + - ".packit.yaml" + - "plans/**" + - "tests-fmf/**" - "**/*.yml" - "tests/**" - "!tests/**/README.*" From 69cd5daec2a654c768f355a03f3da02b2035c85b Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 20 Nov 2023 19:07:00 -0500 Subject: [PATCH 04/16] Fix up excludes for tests-fmf Signed-off-by: mulhern --- .github/workflows/fedora.yml | 4 ++-- .github/workflows/main.yml | 4 ++-- .github/workflows/ubuntu.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index c0042703e4..7a7ae9d833 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -13,7 +13,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' pull_request: branches: - patch-3.6.0 @@ -24,7 +24,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' workflow_dispatch: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e7e2ff937..a73d861bf2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' pull_request: branches: - patch-3.6.0 @@ -24,7 +24,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' workflow_dispatch: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 57778d63fd..b3632f1766 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -13,7 +13,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' pull_request: branches: - patch-3.6.0 @@ -24,7 +24,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' workflow_dispatch: From e3a4775059ac87ceb42da3aa5133d4562fae82a1 Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 20 Nov 2023 20:14:06 -0500 Subject: [PATCH 05/16] Re-indent .packit.yaml Signed-off-by: mulhern --- .packit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index 8762b22293..73724cde22 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -53,5 +53,5 @@ jobs: - type: repository-file id: https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/repo/fedora-$releasever/group_cockpit-main-builds-fedora-$releasever.repo tmt: - context: - plan: "cockpit" + context: + plan: "cockpit" From a886e9b3fd882f072e3e31015ae43228f3f29f3d Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Wed, 22 Nov 2023 13:03:06 -0500 Subject: [PATCH 06/16] github actions: update recommended Rust to 1.74.0 Signed-off-by: Bryan Gurney --- .github/workflows/cargo.yml | 2 +- .github/workflows/fedora.yml | 24 ++++++++++++------------ .github/workflows/main.yml | 10 +++++----- .github/workflows/ubuntu.yml | 22 +++++++++++----------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 9682476923..99b2608175 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -51,7 +51,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: components: cargo - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN - name: Check out ci repo run: git clone https://github.com/stratis-storage/ci.git - name: Run comparisons of version specs with available Fedora packages diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index 7a7ae9d833..6e694adc3c 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -40,39 +40,39 @@ jobs: matrix: include: - task: make -f Makefile clippy - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: clippy - task: PROFILEDIR=debug make -f Makefile build - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile build-min - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile build-no-ipc - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile stratis-dumpmetadata - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile docs-ci - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile test - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: >- TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build-min - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build-no-ipc - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: @@ -107,7 +107,7 @@ jobs: matrix: include: - task: RUST_LOG=stratisd=debug make -f Makefile test-loop - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a73d861bf2..4a1730bcec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,10 +40,10 @@ jobs: matrix: include: - task: make -f Makefile fmt-ci - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: rustfmt - task: make -f Makefile check-typos - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: @@ -83,7 +83,7 @@ jobs: TANG_URL=tang RUST_LOG=stratisd=debug make -f Makefile test-clevis-loop - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT runs-on: ubuntu-22.04 @@ -217,7 +217,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: components: cargo - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN - name: Run stratisd-min cli tests run: make test-stratisd-min - name: Run stratis-min cli tests @@ -267,7 +267,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: components: cargo - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN - name: Build stratisd run: PROFILEDIR=debug make -f Makefile build-all - name: Install stratisd diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index b3632f1766..20eacd3b44 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -40,34 +40,34 @@ jobs: matrix: include: - task: make -f Makefile clippy - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: clippy - task: PROFILEDIR=debug make -f Makefile build - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile build-min - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile build-no-ipc - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile stratis-dumpmetadata - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile docs-ci - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile test - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build-min - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build-no-ipc - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: @@ -105,7 +105,7 @@ jobs: matrix: include: - task: RUST_LOG=stratisd=debug make -f Makefile test-loop - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: From 2135c15165776d049edbccc2753751cfea52286a Mon Sep 17 00:00:00 2001 From: mulhern Date: Wed, 15 Nov 2023 19:06:48 -0500 Subject: [PATCH 07/16] Tidy up targets key Signed-off-by: mulhern --- .packit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index 73724cde22..ca8cab1f08 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -42,11 +42,11 @@ jobs: - job: tests identifier: cockpit trigger: pull_request + targets: + - fedora-development notifications: failure_comment: message: "Cockpit tests failed for commit {commit_sha}. @martinpitt, @jelly, @mvollmer please check." - targets: - - fedora-development tf_extra_params: environments: - artifacts: From 28877fd1d0162bd2729f85085f4f957a0df236e0 Mon Sep 17 00:00:00 2001 From: mulhern Date: Wed, 15 Nov 2023 19:08:29 -0500 Subject: [PATCH 08/16] Use fedora-all for our tests Being Rust, stratisd has to release in all the Fedoras. Now that all our releases are in, we can build again, so it is appropriate to test again on all the Fedoras. Signed-off-by: mulhern --- .packit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index ca8cab1f08..cf30df4a2f 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -30,13 +30,13 @@ jobs: - job: copr_build trigger: pull_request targets: - - fedora-rawhide + - fedora-all - job: tests identifier: local trigger: pull_request targets: - - fedora-rawhide + - fedora-all # run Cockpit storage tests, see plans/ with `cockpit == yes` - job: tests From b90e0b0d8858c526f67d393eb29887744c3fc272 Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Mon, 27 Nov 2023 14:29:42 -0500 Subject: [PATCH 09/16] Advance current development environment to Fedora 39 Signed-off-by: Bryan Gurney --- .github/workflows/cargo.yml | 2 +- .github/workflows/fedora.yml | 4 ++-- .github/workflows/main.yml | 12 ++++++------ .github/workflows/support.yml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 99b2608175..2d55b06a7a 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -29,7 +29,7 @@ jobs: checks-with-ci-repo: runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT steps: - uses: actions/checkout@v3 - name: Install dependencies for Fedora diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index 6e694adc3c..99bc34ab7e 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -76,7 +76,7 @@ jobs: components: cargo runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev -v /run/udev:/run/udev -v /usr/lib/udev:/usr/lib/udev steps: - uses: actions/checkout@v3 @@ -111,7 +111,7 @@ jobs: components: cargo runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev -v /run/udev:/run/udev -v /usr/lib/udev:/usr/lib/udev --ipc=host steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a1730bcec..a1dcc9f839 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,7 @@ jobs: components: cargo runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev steps: - uses: actions/checkout@v3 @@ -85,7 +85,7 @@ jobs: make -f Makefile test-clevis-loop toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT runs-on: ubuntu-22.04 container: image: ${{ matrix.image }} @@ -93,7 +93,7 @@ jobs: services: tang: # yamllint disable rule:line-length - image: ghcr.io/stratis-storage/stratisd/tang:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: ghcr.io/stratis-storage/stratisd/tang:39 # CURRENT DEVELOPMENT ENVIRONMENT credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -184,7 +184,7 @@ jobs: stratis-min-cli-checks: runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged --userns=host --ipc=host -v /dev:/dev -v /run/udev:/run/udev -v /usr/lib/udev:/usr/lib/udev -v /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro -v /usr/share/dbus-1:/usr/share/dbus-1 steps: - uses: actions/checkout@v3 @@ -226,7 +226,7 @@ jobs: shell-checks: runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT steps: - uses: actions/checkout@v3 - name: Install dependencies @@ -241,7 +241,7 @@ jobs: python-based-tests: runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/support.yml b/.github/workflows/support.yml index 0a8bb64ae5..19cbcaaa1d 100644 --- a/.github/workflows/support.yml +++ b/.github/workflows/support.yml @@ -55,7 +55,7 @@ jobs: task: make -f Makefile yamllint tmtlint working-directory: . runs-on: ubuntu-22.04 - container: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + container: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT steps: - uses: actions/checkout@v3 - name: Install dependencies From 159f354f2eddc42044633f7723bc4505e8dfa1d5 Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Mon, 27 Nov 2023 15:31:22 -0500 Subject: [PATCH 10/16] Leave tang container as F38 Signed-off-by: Bryan Gurney --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a1dcc9f839..392ae483a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,7 +93,7 @@ jobs: services: tang: # yamllint disable rule:line-length - image: ghcr.io/stratis-storage/stratisd/tang:39 # CURRENT DEVELOPMENT ENVIRONMENT + image: ghcr.io/stratis-storage/stratisd/tang:38 credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} From 5445c7a716fa75c10f72f1d25a0afdfeae842370 Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Mon, 27 Nov 2023 18:53:55 -0500 Subject: [PATCH 11/16] Apply formatting changes from black 23.7.0 Signed-off-by: Bryan Gurney --- tests/client-dbus/tests/udev/_loopback.py | 2 +- tests/client-dbus/tests/udev/_utils.py | 4 ++-- tests/client-dbus/tests/udev/test_predict.py | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/client-dbus/tests/udev/_loopback.py b/tests/client-dbus/tests/udev/_loopback.py index b05c61f686..94e0a27cca 100644 --- a/tests/client-dbus/tests/udev/_loopback.py +++ b/tests/client-dbus/tests/udev/_loopback.py @@ -207,7 +207,7 @@ def destroy_devices(self): Detach loopbacks and remove backing files :return: """ - for (device, backing_file) in self.devices.values(): + for device, backing_file in self.devices.values(): if device is not None: subprocess.check_call([_LOSETUP_BIN, "-d", device]) os.remove(backing_file) diff --git a/tests/client-dbus/tests/udev/_utils.py b/tests/client-dbus/tests/udev/_utils.py index fed1114d59..88a5067f64 100644 --- a/tests/client-dbus/tests/udev/_utils.py +++ b/tests/client-dbus/tests/udev/_utils.py @@ -326,7 +326,7 @@ def __enter__(self): :raises RuntimeError: if setting a key in the keyring through stratisd fails """ - for (key_desc, key_data) in self._key_descs: + for key_desc, key_data in self._key_descs: with NamedTemporaryFile(mode="w") as temp_file: temp_file.write(key_data) temp_file.flush() @@ -349,7 +349,7 @@ def __enter__(self): def __exit__(self, exception_type, exception_value, traceback): try: - for (key_desc, _) in reversed(self._key_descs): + for key_desc, _ in reversed(self._key_descs): (_, return_code, message) = Manager.Methods.UnsetKey( get_object(TOP_OBJECT), {"key_desc": key_desc} ) diff --git a/tests/client-dbus/tests/udev/test_predict.py b/tests/client-dbus/tests/udev/test_predict.py index 347c7577bd..be8227447a 100644 --- a/tests/client-dbus/tests/udev/test_predict.py +++ b/tests/client-dbus/tests/udev/test_predict.py @@ -117,7 +117,11 @@ def _possibly_add_filesystems(pool_object_path, *, fs_specs=None): if not real: raise RuntimeError("Failed to get pool usage before creating filesystems.") - (_, return_code, message,) = Pool.Methods.CreateFilesystems( + ( + _, + return_code, + message, + ) = Pool.Methods.CreateFilesystems( pool_proxy, {"specs": map(lambda x: (x[0], (True, str(x[1].magnitude))), fs_specs)}, ) From bf4dcf8a985eab4a61e660ff6d0652763493d8f2 Mon Sep 17 00:00:00 2001 From: mulhern Date: Tue, 28 Nov 2023 13:00:45 -0500 Subject: [PATCH 12/16] Remove obsolete parameter stratisd never uses it anymore, not since the size of the MDV was increased. Signed-off-by: mulhern --- src/engine/strat_engine/cmd.rs | 12 ++---------- src/engine/strat_engine/liminal/identify.rs | 2 +- src/engine/strat_engine/thinpool/filesystem.rs | 2 +- src/engine/strat_engine/thinpool/mdv.rs | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/engine/strat_engine/cmd.rs b/src/engine/strat_engine/cmd.rs index 764548fb09..594bb7199a 100644 --- a/src/engine/strat_engine/cmd.rs +++ b/src/engine/strat_engine/cmd.rs @@ -233,12 +233,8 @@ fn get_clevis_executable(name: &str) -> StratisResult { } /// Create a filesystem on devnode. If uuid specified, set the UUID of the -/// filesystem on creation. If 'noalign', set the noalign option. -/// NOTE: It used to be desirable to set the noalign option when creating the -/// MDV, because it was very small; since then the size of the MDV has been -/// increased, and it is no longer necessary to pass the noalign option when -/// creating the MDV. -pub fn create_fs(devnode: &Path, uuid: Option, noalign: bool) -> StratisResult<()> { +/// filesystem on creation. +pub fn create_fs(devnode: &Path, uuid: Option) -> StratisResult<()> { let mut command = Command::new(get_executable(MKFS_XFS).as_os_str()); command.arg("-f"); command.arg("-q"); @@ -248,10 +244,6 @@ pub fn create_fs(devnode: &Path, uuid: Option, noalign: bool) -> St command.arg("-m"); command.arg(format!("uuid={uuid}")); } - if noalign { - command.arg("-d"); - command.arg("noalign"); - } execute_cmd(&mut command) } diff --git a/src/engine/strat_engine/liminal/identify.rs b/src/engine/strat_engine/liminal/identify.rs index 938fc8b74b..ca6acb08d9 100644 --- a/src/engine/strat_engine/liminal/identify.rs +++ b/src/engine/strat_engine/liminal/identify.rs @@ -699,7 +699,7 @@ mod tests { } for path in paths { - create_fs(path, None, false).unwrap(); + create_fs(path, None).unwrap(); let device_path = DevicePath::new(path).expect("our test path"); assert_eq!( block_device_apply(&device_path, process_stratis_device) diff --git a/src/engine/strat_engine/thinpool/filesystem.rs b/src/engine/strat_engine/thinpool/filesystem.rs index 8248336c65..a93fd9dab5 100644 --- a/src/engine/strat_engine/thinpool/filesystem.rs +++ b/src/engine/strat_engine/thinpool/filesystem.rs @@ -88,7 +88,7 @@ impl StratFilesystem { let mut thin_dev = ThinDev::new(get_dm(), &dm_name, Some(&dm_uuid), size, thinpool_dev, id)?; - if let Err(err) = create_fs(&thin_dev.devnode(), Some(StratisUuid::Fs(fs_uuid)), false) { + if let Err(err) = create_fs(&thin_dev.devnode(), Some(StratisUuid::Fs(fs_uuid))) { if let Err(err2) = retry_with_index(Fixed::from_millis(100).take(4), |i| { trace!( "Cleanup new thin device after failed create_fs() attempt {}", diff --git a/src/engine/strat_engine/thinpool/mdv.rs b/src/engine/strat_engine/thinpool/mdv.rs index df27253f54..56687f950a 100644 --- a/src/engine/strat_engine/thinpool/mdv.rs +++ b/src/engine/strat_engine/thinpool/mdv.rs @@ -52,7 +52,7 @@ impl MetadataVol { /// Initialize a new Metadata Volume. pub fn initialize(pool_uuid: PoolUuid, dev: LinearDev) -> StratisResult { - create_fs(&dev.devnode(), Some(StratisUuid::Pool(pool_uuid)), false)?; + create_fs(&dev.devnode(), Some(StratisUuid::Pool(pool_uuid)))?; MetadataVol::setup(pool_uuid, dev) } From ac4843bcb51c8e74b33e0550ca15f7ab10d93428 Mon Sep 17 00:00:00 2001 From: mulhern Date: Tue, 28 Nov 2023 13:15:48 -0500 Subject: [PATCH 13/16] Unconditionally add nrext64=0 to inode options Signed-off-by: mulhern --- src/engine/strat_engine/cmd.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/engine/strat_engine/cmd.rs b/src/engine/strat_engine/cmd.rs index 594bb7199a..112f6ebced 100644 --- a/src/engine/strat_engine/cmd.rs +++ b/src/engine/strat_engine/cmd.rs @@ -244,6 +244,15 @@ pub fn create_fs(devnode: &Path, uuid: Option) -> StratisResult<()> command.arg("-m"); command.arg(format!("uuid={uuid}")); } + + // Use smaller size extent counters. Note that the size of the extent + // counters can be increased using an xfs_repair command, although this can + // be a costly operation. If a filesystem is created with the larger size + // extent counters, which is the default for mkfs.xfs >= 6.5.0, then it + // will be unmountable on kernels which do not support the larger size. + command.arg("-i"); + command.arg("nrext64=0"); + execute_cmd(&mut command) } From 9f196dada177b8f43808b9a4a783c54385ba5ce0 Mon Sep 17 00:00:00 2001 From: mulhern Date: Tue, 28 Nov 2023 14:49:15 -0500 Subject: [PATCH 14/16] Check the mkfs.xfs version Signed-off-by: mulhern --- src/engine/strat_engine/cmd.rs | 76 ++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/src/engine/strat_engine/cmd.rs b/src/engine/strat_engine/cmd.rs index 112f6ebced..b4e0167f11 100644 --- a/src/engine/strat_engine/cmd.rs +++ b/src/engine/strat_engine/cmd.rs @@ -232,9 +232,77 @@ fn get_clevis_executable(name: &str) -> StratisResult { } } +// Return the mkfs.xfs version reported by the "-V" option as a string. +fn get_mkfs_xfs_version() -> StratisResult { + let mut command = Command::new(get_executable(MKFS_XFS).as_os_str()) + .arg("-V") + .stdout(Stdio::piped()) + .spawn()?; + command.wait()?; + + let mut output = String::new(); + let is_ok = command.wait()?.code() == Some(0); + command + .stdout + .ok_or_else(|| { + StratisError::Msg("Could not read string value from xfs.mkfs output".to_string()) + })? + .read_to_string(&mut output)?; + + if is_ok { + output + .trim() + .strip_prefix("mkfs.xfs version ") + .ok_or_else(|| { + StratisError::Msg("Could not parse version string from mkfs.xfs output".to_string()) + }) + .map(|v| v.to_string()) + } else { + Err(StratisError::Msg( + "\"mkfs.xfs -V\" returned an error".to_string(), + )) + } +} + /// Create a filesystem on devnode. If uuid specified, set the UUID of the /// filesystem on creation. pub fn create_fs(devnode: &Path, uuid: Option) -> StratisResult<()> { + // If the version can not be obtained, which is unlikely, assume that the + // version of mkfs.xfs is new enough to use the nrext64 option. This will + // become more and more true with time. If the version is not high enough, + // this will be obvious when the command-line invocation fails. + // The check only verifies that the major number is greater than 5, because + // before that time, the larger extent counter size was not used by default, + // so, for earlier versions, it is unnecessary to turn it off explicitly. + // Choose not to use a semantic version package, because there is no Rust + // package availabe that necessarily adheres to the xfsprogs versioning + // scheme. + let use_nrext64_option = match get_mkfs_xfs_version().and_then(|v| { + v.split('.') + .next() + .ok_or_else(|| { + StratisError::Msg( + "Unable to parse major version number from version string".to_string(), + ) + }) + .and_then(|n| { + n.parse::() + .map_err(|_| { + StratisError::Msg( + "Unable to parse major version number from major version string" + .to_string(), + ) + }) + .map(|r| r > 5u64) + }) + }) { + Ok(val) => val, + Err(err) => { + warn!("Unable to read version of mkfs.xfs: {err}; guessing that mkfs.xfs version is high enough to support nrext64 option"); + true + } + }; + let mut command = Command::new(get_executable(MKFS_XFS).as_os_str()); command.arg("-f"); command.arg("-q"); @@ -248,10 +316,12 @@ pub fn create_fs(devnode: &Path, uuid: Option) -> StratisResult<()> // Use smaller size extent counters. Note that the size of the extent // counters can be increased using an xfs_repair command, although this can // be a costly operation. If a filesystem is created with the larger size - // extent counters, which is the default for mkfs.xfs >= 6.5.0, then it + // extent counters, which is the default for mkfs.xfs >= 6.0.0, then it // will be unmountable on kernels which do not support the larger size. - command.arg("-i"); - command.arg("nrext64=0"); + if use_nrext64_option { + command.arg("-i"); + command.arg("nrext64=0"); + } execute_cmd(&mut command) } From eafc887b4c9662ac5df5c329d38e8a08de643843 Mon Sep 17 00:00:00 2001 From: mulhern Date: Wed, 29 Nov 2023 12:12:17 -0500 Subject: [PATCH 15/16] Use semver crate to compare versions Signed-off-by: mulhern --- Cargo.lock | 1 + Cargo.toml | 5 +++++ src/engine/strat_engine/cmd.rs | 36 ++++++++++++++-------------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d3554b3ce1..aa35ccb610 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1305,6 +1305,7 @@ dependencies = [ "rand", "regex", "retry", + "semver", "serde", "serde_derive", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 8bf774527d..d9cb9967a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -175,6 +175,10 @@ version = "1.3.1" default-features = false optional = true +[dependencies.semver] +version = "1.0.0" +optional = true + [dependencies.serde] version = "1.0.185" optional = true @@ -256,6 +260,7 @@ engine = [ "rand", "regex", "retry", + "semver", "serde", "serde_derive", "serde_json", diff --git a/src/engine/strat_engine/cmd.rs b/src/engine/strat_engine/cmd.rs index b4e0167f11..5a5e6241ae 100644 --- a/src/engine/strat_engine/cmd.rs +++ b/src/engine/strat_engine/cmd.rs @@ -25,6 +25,7 @@ use std::{ use either::Either; use libc::c_uint; use libcryptsetup_rs::SafeMemHandle; +use semver::{Version, VersionReq}; use serde_json::Value; use devicemapper::{MetaBlocks, Sectors}; @@ -271,29 +272,22 @@ pub fn create_fs(devnode: &Path, uuid: Option) -> StratisResult<()> // version of mkfs.xfs is new enough to use the nrext64 option. This will // become more and more true with time. If the version is not high enough, // this will be obvious when the command-line invocation fails. - // The check only verifies that the major number is greater than 5, because - // before that time, the larger extent counter size was not used by default, - // so, for earlier versions, it is unnecessary to turn it off explicitly. - // Choose not to use a semantic version package, because there is no Rust - // package availabe that necessarily adheres to the xfsprogs versioning - // scheme. + // The nrext64 option became available in xfsprogs 5.19.0-rc0 and the + // larger extent counter size began to be used by default in xfsprogs + // 6.5.0. This code sets the option when the xfsprogs version is at least + // 6.0.0, i.e., slightly after it was introduced and a deal before it + // became the default. let use_nrext64_option = match get_mkfs_xfs_version().and_then(|v| { - v.split('.') - .next() - .ok_or_else(|| { - StratisError::Msg( - "Unable to parse major version number from version string".to_string(), - ) + v.parse::() + .map_err(|_| { + StratisError::Msg(format!( + "Unable to parse version number from version string {v}" + )) }) - .and_then(|n| { - n.parse::() - .map_err(|_| { - StratisError::Msg( - "Unable to parse major version number from major version string" - .to_string(), - ) - }) - .map(|r| r > 5u64) + .map(|v| { + VersionReq::parse(">=6.0.0") + .expect("req string is valid") + .matches(&v) }) }) { Ok(val) => val, From 4d47bf5f3033cd1aecc9624c33766e299942f794 Mon Sep 17 00:00:00 2001 From: mulhern Date: Wed, 29 Nov 2023 15:48:08 -0500 Subject: [PATCH 16/16] version 3.6.3 Signed-off-by: mulhern --- CHANGES.txt | 23 +++++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 59f5e2d964..26a4c867a5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,26 @@ +stratisd 3.6.3 +============== +Recommended Rust toolchain version: 1.74.0 +Recommended development platform for Python development: Fedora 39 + +- Cherry-picked commits: + * Fix clippy 1.74 errors + * packit.yaml: fix indentation + * support.yml: trigger on packit and tmt changes + * Fix up excludes for tests-fmf + * Re-indent .packit.yaml + * github actions: update recommended Rust to 1.74.0 + * Tidy up targets key + * Use fedora-all for our tests + * Advance current development environment to Fedora 39 + * Leave tang container as F38 + * Apply formatting changes from black 23.7.0 + * Remove obsolete parameter + * Unconditionally add nrext64=0 to inode options + * Check the mkfs.xfs version + * Use semver crate to compare versions + + stratisd 3.6.2 ============== Recommended Rust toolchain version: 1.73.0 diff --git a/Cargo.lock b/Cargo.lock index aa35ccb610..1406bc0aea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1269,7 +1269,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stratisd" -version = "3.6.2" +version = "3.6.3" dependencies = [ "assert_cmd", "assert_matches", diff --git a/Cargo.toml b/Cargo.toml index d9cb9967a7..57ac93887c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stratisd" -version = "3.6.2" +version = "3.6.3" authors = ["Stratis Developers "] edition = "2021" rust-version = "1.71.1" # LOWEST SUPPORTED RUST TOOLCHAIN