Skip to content

[new release] nbd, nbd-unix and nbd-tool (6.0.0)#22107

Merged
kit-ty-kate merged 2 commits into
ocaml:masterfrom
psafont:release-nbd-6.0.0
Sep 16, 2022
Merged

[new release] nbd, nbd-unix and nbd-tool (6.0.0)#22107
kit-ty-kate merged 2 commits into
ocaml:masterfrom
psafont:release-nbd-6.0.0

Conversation

@psafont
Copy link
Copy Markdown
Contributor

@psafont psafont commented Sep 14, 2022

Network Block Device (NBD) protocol implementation

CHANGES:
  • Use Stdlib's Result type
  • BREAKING: Avoid unerasable optional arguments in init_tls_get_ctx
  • Update for cmdliner 1.1.0 compatibility
  • Update for cstruct 6.1.0 compatibility
  • ci: fix doc upload and coverage reporting

Comment thread packages/nbd-unix/nbd-unix.6.0.0/opam
Comment thread packages/nbd/nbd.6.0.0/opam
@kit-ty-kate
Copy link
Copy Markdown
Member

nbd-tool also does not compile in all cases:

#=== ERROR while compiling nbd-tool.6.0.0 =====================================#
# context              2.2.0~alpha~dev | linux/x86_64 | ocaml-base-compiler.4.08.1 | pinned(https://github.com/xapi-project/nbd/releases/download/6.0.0/nbd-6.0.0.tbz)
# path                 ~/.opam/4.08/.opam-switch/build/nbd-tool.6.0.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p nbd-tool -j 31
# exit-code            1
# env-file             ~/.opam/log/nbd-tool-7-e2b313.env
# output-file          ~/.opam/log/nbd-tool-7-e2b313.out
### output ###
# (cd _build/default && /home/opam/.opam/4.08/bin/ocamlc.opt -w -40 -g -bin-annot -I cli/.main.eobjs/byte -I /home/opam/.opam/4.08/lib/angstrom -I /home/opam/.opam/4.08/lib/base/caml -I /home/opam/.opam/4.08/lib/bigarray-compat -I /home/opam/.opam/4.08/lib/bigstringaf -I /home/opam/.opam/4.08/lib/cmdliner -I /home/opam/.opam/4.08/lib/cstruct -I /home/opam/.opam/4.08/lib/cstruct-lwt -I /home/opam/.opam/4.08/lib/fmt -I /home/opam/.opam/4.08/lib/io-page -I /home/opam/.opam/4.08/lib/io-page/unix -I /home/opam/.opam/4.08/lib/logs -I /home/opam/.opam/4.08/lib/lwt -I /home/opam/.opam/4.08/lib/lwt/unix -I /home/opam/.opam/4.08/lib/lwt_log -I /home/opam/.opam/4.08/lib/lwt_log/core -I /home/opam/.opam/4.08/lib/lwt_ssl -I /home/opam/.opam/4.08/lib/mirage-block -I /home/opam/.opam/4.08/lib/mirage-block-unix -I /home/opam/.opam/4.08/lib/nbd -I /home/opam/.opam/4.08/lib/nbd-unix -I /home/opam/.opam/4.08/lib/ocaml/threads -I /home/opam/.opam/4.08/lib/ocplib-endian -I /home/opam/.opam/4.08/lib/ocplib-endian/bigstring -I /home/opam/.opam/4.08/lib/parsexp -I /home/opam/.opam/4.08/lib/ppx_sexp_conv/runtime-lib -I /home/opam/.opam/4.08/lib/rresult -I /home/opam/.opam/4.08/lib/sexplib -I /home/opam/.opam/4.08/lib/sexplib0 -I /home/opam/.opam/4.08/lib/ssl -I /home/opam/.opam/4.08/lib/stringext -I /home/opam/.opam/4.08/lib/uri -no-alias-deps -open Dune__exe -o cli/.main.eobjs/byte/dune__exe__Main.cmo -c -impl cli/main.ml)
# File "cli/main.ml", line 75, characters 23-37:
# 75 |         | Result.Error `Unimplemented ->
#                             ^^^^^^^^^^^^^^
# Error: This pattern matches values of type [? `Unimplemented ]
#        but a pattern was expected which matches values of type Block.error
#        The second variant type does not allow tag(s) `Unimplemented

@mseri
Copy link
Copy Markdown
Member

mseri commented Sep 15, 2022

nbd-tool is failing with


#=== ERROR while compiling nbd-tool.6.0.0 =====================================#
# context              2.2.0~alpha~dev | linux/x86_64 | ocaml-variants.5.0.0+trunk | pinned(https://github.com/xapi-project/nbd/releases/download/6.0.0/nbd-6.0.0.tbz)
# path                 ~/.opam/5.0/.opam-switch/build/nbd-tool.6.0.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p nbd-tool -j 31
# exit-code            1
# env-file             ~/.opam/log/nbd-tool-7-3f68ce.env
# output-file          ~/.opam/log/nbd-tool-7-3f68ce.out
### output ###
# (cd _build/default && /home/opam/.opam/5.0/bin/ocamlc.opt -w -40 -g -bin-annot -I cli/.main.eobjs/byte -I /home/opam/.opam/5.0/lib/angstrom -I /home/opam/.opam/5.0/lib/base/caml -I /home/opam/.opam/5.0/lib/bigarray-compat -I /home/opam/.opam/5.0/lib/bigstringaf -I /home/opam/.opam/5.0/lib/bytes -I /home/opam/.opam/5.0/lib/cmdliner -I /home/opam/.opam/5.0/lib/cstruct -I /home/opam/.opam/5.0/lib/cstruct-lwt -I /home/opam/.opam/5.0/lib/fmt -I /home/opam/.opam/5.0/lib/io-page -I /home/opam/.opam/5.0/lib/io-page/unix -I /home/opam/.opam/5.0/lib/logs -I /home/opam/.opam/5.0/lib/lwt -I /home/opam/.opam/5.0/lib/lwt/unix -I /home/opam/.opam/5.0/lib/lwt_log -I /home/opam/.opam/5.0/lib/lwt_log/core -I /home/opam/.opam/5.0/lib/lwt_ssl -I /home/opam/.opam/5.0/lib/mirage-block -I /home/opam/.opam/5.0/lib/mirage-block-unix -I /home/opam/.opam/5.0/lib/nbd -I /home/opam/.opam/5.0/lib/nbd-unix -I /home/opam/.opam/5.0/lib/ocaml/threads -I /home/opam/.opam/5.0/lib/ocaml/unix -I /home/opam/.opam/5.0/lib/ocplib-endian -I /home/opam/.opam/5.0/lib/ocplib-endian/bigstring -I /home/opam/.opam/5.0/lib/parsexp -I /home/opam/.opam/5.0/lib/ppx_sexp_conv/runtime-lib -I /home/opam/.opam/5.0/lib/rresult -I /home/opam/.opam/5.0/lib/sexplib -I /home/opam/.opam/5.0/lib/sexplib0 -I /home/opam/.opam/5.0/lib/ssl -I /home/opam/.opam/5.0/lib/stringext -I /home/opam/.opam/5.0/lib/uri -no-alias-deps -open Dune__exe -o cli/.main.eobjs/byte/dune__exe__Main.cmo -c -impl cli/main.ml)
# File "cli/main.ml", line 75, characters 23-37:
# 75 |         | Result.Error `Unimplemented ->
#                             ^^^^^^^^^^^^^^
# Error: This pattern matches values of type [? `Unimplemented ]
#        but a pattern was expected which matches values of type Block.error
#        The second variant type is private,
#        it may not allow the tag(s) `Unimplemented

@psafont
Copy link
Copy Markdown
Contributor Author

psafont commented Sep 15, 2022

Seems to be due to the type being private, it used to come from Mirage_device: https://docs.mirage.io/mirage-device/Mirage_device/index.html#type-error

Comment thread packages/nbd-tool/nbd-tool.6.0.0/opam
Comment thread packages/nbd-tool/nbd-tool.6.0.0/opam
Comment thread packages/nbd-tool/nbd-tool.6.0.0/opam Outdated
CHANGES:

* Use Stdlib's Result type
* BREAKING: Avoid unerasable optional arguments in init_tls_get_ctx
* Update for cmdliner 1.1.0 compatibility
* Update for cstruct 6.1.0 compatibility
* ci: fix doc upload and coverage reporting
"nbd" {=version}
"odoc" {with-doc}
"ssl"
"alcotest-lwt" {with-test}
Copy link
Copy Markdown
Contributor Author

@psafont psafont Sep 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed now because tests aren't defined in a package, fixing for next version: xapi-project/nbd#163

@kit-ty-kate
Copy link
Copy Markdown
Member

The tests of nbd-tool fail on Alpine and macOS:

#=== ERROR while compiling nbd-tool.6.0.0 =====================================#
# context              2.2.0~alpha~dev | linux/x86_64 | ocaml-base-compiler.4.14.0 | pinned(https://github.com/xapi-project/nbd/releases/download/6.0.0/nbd-6.0.0.tbz)
# path                 ~/.opam/4.14/.opam-switch/build/nbd-tool.6.0.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p nbd-tool -j 31 @runtest
# exit-code            1
# env-file             ~/.opam/log/nbd-tool-7-c2ddc3.env
# output-file          ~/.opam/log/nbd-tool-7-c2ddc3.out
### output ###
# (cd _build/default/lib_test && ./mux_test.exe)
# Testing `Sync Nbd library test suite'.
# This run has ID `7D55QFD2'.
# 
#   [OK]          Mux tests          0   Basic test of the rpc function.
#   [OK]          Mux tests          1   Test queuing of rpc calls in the mux.
#   [OK]          Mux tests          2   Test RPC functions work when responses...
#   [OK]          Mux tests          3   Check the mux does not have a memory l...
#   [OK]          Mux tests          4   Check that exceptions raised are handl...
# 
# Full test results in `~/.opam/4.14/.opam-switch/build/nbd-tool.6.0.0/_build/default/lib_test/_build/_tests/Sync Nbd library test suite'.
# Test Successful in 0.311s. 5 tests run.
# (cd _build/default/lib_test && ./suite.exe)
# Testing `Lwt Nbd library test suite'.
# This run has ID `IK25W55H'.
# 
#   [OK]          Nbd client-server connection tests          0   test_connect_...
#   [OK]          Nbd client-server connection tests          1   test_list_exp...
#   [OK]          Nbd client-server connection tests          2   test_read_write.
#   [OK]          Nbd protocol tests                          0   Perform a neg...
#   [OK]          Nbd protocol tests                          1   Perform a neg...
#   [OK]          Nbd protocol tests                          2   Client connec...
#   [OK]          Nbd protocol tests                          3   Client connec...
#   [OK]          Nbd protocol tests                          4   Check that if...
#   [OK]          Nbd protocol tests                          5   Check that th...
#   [OK]          Nbd protocol tests                          6   Server denies...
#   [OK]          Nbd protocol tests                          7   Client connec...
#   [OK]          Nbd protocol tests                          8   Client reques...
#   [OK]          Nbd protocol tests                          9   Client reques...
#   [OK]          Nbd protocol tests                         10   List exports ...
#   [OK]          Nbd protocol tests                         11   Serve a read-...
#   [OK]          Nbd protocol tests                         12   Serve a read-...
# 
# Full test results in `~/.opam/4.14/.opam-switch/build/nbd-tool.6.0.0/_build/default/lib_test/_build/_tests/Lwt Nbd library test suite'.
# Test Successful in 0.030s. 16 tests run.
# File "cli_test/dune", line 6, characters 0-196:
#  6 | (rule
#  7 |  (alias runtest)
#  8 |  (package nbd-tool)
#  9 |  (deps
# 10 |   (:suite suite.exe)
# 11 |   (:cli ../cli/main.exe)
# 12 |   ./test-qemu.sh
# 13 |   ./test-nbd-client.sh
# 14 |   ./random_data.sh)
# 15 |  (action
# 16 |   (run %{suite} --cli %{cli})))
# (cd _build/default/cli_test && ./suite.exe --cli ../cli/main.exe)
# Testing `Nbd CLI interoperability tests'.
# This run has ID `VWQYJSVD'.
# 
#   [OK]          NBD CLI interoperability tests          0   data copying with...
# > [FAIL]        NBD CLI interoperability tests          1   listing exports w...
#   [OK]          Stress tests                            0   Misbehaving clien...
# 
# ┌──────────────────────────────────────────────────────────────────────────────┐
# │ [FAIL]        NBD CLI interoperability tests          1   listing export...  │
# └──────────────────────────────────────────────────────────────────────────────┘
# /usr/sbin/nbd-client
# + CLI=../cli/main.exe
# + mktemp -d
# + SCRATCH=/opam-tmp/build_6ed103_dune/tmp.darP4rGpii
# + EXPORT=/opam-tmp/build_6ed103_dune/tmp.darP4rGpii/test
# + dd 'if=/dev/urandom' 'of=/opam-tmp/build_6ed103_dune/tmp.darP4rGpii/test' 'bs=1M' 'count=40'
# 40+0 records in
# 40+0 records out
# 41943040 bytes (42 MB, 40 MiB) copied, 0.928485 s, 45.2 MB/s
# + SERVER=630
# + sleep 0.1
# + ../cli/main.exe serve --exportname test --no-tls /opam-tmp/build_6ed103_dune/tmp.darP4rGpii/test
# + trap stop_server EXIT
# + nbd-client -l 0.0.0.0
# nbd-client: unrecognized option: l
# BusyBox v1.33.1 () multi-call binary.
# 
# Usage: nbd-client { [-b BLKSIZE] [-N NAME] [-t SEC] [-p] HOST [PORT] | -d } BLOCKDEV
# 
# Connect to HOST and provide network block device on BLOCKDEV
# + stop_server
# + kill -9 630
# ASSERT ./test-nbd-client.sh
# FAIL ./test-nbd-client.sh
# 
#    Expected: `0'
#    Received: `1'
# 
# Raised at Alcotest_engine__Test.check in file "src/alcotest-engine/test.ml", line 196, characters 4-261
# Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 180, characters 17-23
# Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35
# 
# Logs saved to `~/.opam/4.14/.opam-switch/build/nbd-tool.6.0.0/_build/default/cli_test/_build/_tests/Nbd CLI interoperability tests/NBD CLI interoperability tests.001.output'.
#  ──────────────────────────────────────────────────────────────────────────────
# 
# Full test results in `~/.opam/4.14/.opam-switch/build/nbd-tool.6.0.0/_build/default/cli_test/_build/_tests/Nbd CLI interoperability tests'.
# 1 failure! in 53.731s. 3 tests run.
#=== ERROR while compiling nbd-tool.6.0.0 =====================================#
# context              2.1.2 | macos/x86_64 | ocaml.4.14.0 | pinned(https://github.com/xapi-project/nbd/releases/download/6.0.0/nbd-6.0.0.tbz)
# path                 ~/.opam/default/.opam-switch/build/nbd-tool.6.0.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p nbd-tool -j 11 @runtest
# exit-code            1
# env-file             ~/.opam/log/nbd-tool-16234-7b8067.env
# output-file          ~/.opam/log/nbd-tool-16234-7b8067.out
### output ###
# File "cli_test/dune", line 6, characters 0-196:
#  6 | (rule
#  7 |  (alias runtest)
#  8 |  (package nbd-tool)
#  9 |  (deps
# 10 |   (:suite suite.exe)
# 11 |   (:cli ../cli/main.exe)
# 12 |   ./test-qemu.sh
# 13 |   ./test-nbd-client.sh
# 14 |   ./random_data.sh)
# 15 |  (action
# 16 |   (run %{suite} --cli %{cli})))
# (cd _build/default/cli_test && ./suite.exe --cli ../cli/main.exe)
# Testing `Nbd CLI interoperability tests'.
# This run has ID `B2WIMKOT'.
# 
#   [OK]          NBD CLI interoperability tests          0   data copying with...
#   [OK]          NBD CLI interoperability tests          1   listing exports w...
# > [FAIL]        Stress tests                            0   Misbehaving clien...
# 
# ┌──────────────────────────────────────────────────────────────────────────────┐
# │ [FAIL]        Stress tests                            0   Misbehaving cl...  │
# └──────────────────────────────────────────────────────────────────────────────┘
# /usr/bin/nc
# + CLI=../cli/main.exe
# ++ mktemp -d
# + SCRATCH=/var/folders/zf/rk4bsym16fbd0f65qr1wj7n40000z8/T/tmp.wWdCV7hS
# + EXPORT=/var/folders/zf/rk4bsym16fbd0f65qr1wj7n40000z8/T/tmp.wWdCV7hS/test
# + DATA=/var/folders/zf/rk4bsym16fbd0f65qr1wj7n40000z8/T/tmp.wWdCV7hS/data
# + truncate --size=10M /var/folders/zf/rk4bsym16fbd0f65qr1wj7n40000z8/T/tmp.wWdCV7hS/test
# ./random_data.sh: line 15: truncate: command not found
# ASSERT ./random_data.sh
# FAIL ./random_data.sh
# 
#    Expected: `0'
#    Received: `127'
# 
# Raised at Alcotest_engine__Test.check in file "src/alcotest-engine/test.ml", line 196, characters 4-261
# Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 180, characters 17-23
# Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35
# 
# Logs saved to `~/.opam/default/.opam-switch/build/nbd-tool.6.0.0/_build/default/cli_test/_build/_tests/Nbd CLI interoperability tests/Stress tests.000.output'.
#  ──────────────────────────────────────────────────────────────────────────────
# 
# Full test results in `~/.opam/default/.opam-switch/build/nbd-tool.6.0.0/_build/default/cli_test/_build/_tests/Nbd CLI interoperability tests'.
# 1 failure! in 0.028s. 3 tests run.
# (cd _build/default/lib_test && ./mux_test.exe)
# Testing `Sync Nbd library test suite'.
# This run has ID `B982BNXR'.
# 
#   [OK]          Mux tests          0   Basic test of the rpc function.
#   [OK]          Mux tests          1   Test queuing of rpc calls in the mux.
#   [OK]          Mux tests          2   Test RPC functions work when responses...
#   [OK]          Mux tests          3   Check the mux does not have a memory l...
#   [OK]          Mux tests          4   Check that exceptions raised are handl...
# 
# Full test results in `~/.opam/default/.opam-switch/build/nbd-tool.6.0.0/_build/default/lib_test/_build/_tests/Sync Nbd library test suite'.
# Test Successful in 0.088s. 5 tests run.
# (cd _build/default/lib_test && ./suite.exe)
# Testing `Lwt Nbd library test suite'.
# This run has ID `7HEIEEH0'.
# 
#   [OK]          Nbd client-server connection tests          0   test_connect_...
#   [OK]          Nbd client-server connection tests          1   test_list_exp...
#   [OK]          Nbd client-server connection tests          2   test_read_write.
#   [OK]          Nbd protocol tests                          0   Perform a neg...
#   [OK]          Nbd protocol tests                          1   Perform a neg...
#   [OK]          Nbd protocol tests                          2   Client connec...
#   [OK]          Nbd protocol tests                          3   Client connec...
#   [OK]          Nbd protocol tests                          4   Check that if...
#   [OK]          Nbd protocol tests                          5   Check that th...
#   [OK]          Nbd protocol tests                          6   Server denies...
#   [OK]          Nbd protocol tests                          7   Client connec...
#   [OK]          Nbd protocol tests                          8   Client reques...
#   [OK]          Nbd protocol tests                          9   Client reques...
#   [OK]          Nbd protocol tests                         10   List exports ...
#   [OK]          Nbd protocol tests                         11   Serve a read-...
#   [OK]          Nbd protocol tests                         12   Serve a read-...
# 
# Full test results in `~/.opam/default/.opam-switch/build/nbd-tool.6.0.0/_build/default/lib_test/_build/_tests/Lwt Nbd library test suite'.
# Test Successful in 0.014s. 16 tests run.

Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
@psafont
Copy link
Copy Markdown
Contributor Author

psafont commented Sep 16, 2022

I've disabled the tests for those distributions, I don't have bandwith now to set up those systems and debug them

@kit-ty-kate
Copy link
Copy Markdown
Member

Thanks!

@kit-ty-kate kit-ty-kate merged commit 85bb906 into ocaml:master Sep 16, 2022
@psafont psafont deleted the release-nbd-6.0.0 branch September 16, 2022 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants