From 462ade02e2bcecf997c047af9b1ef2fcca8d9061 Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Thu, 8 Jun 2023 23:33:10 +0200 Subject: [PATCH 1/3] Build: Resto is incompatible with cohttp-lwt.5.1.0 It leaks file descriptor on streaming RPC --- .gitlab-ci.yml | 2 +- manifest/main.ml | 4 +++- opam/octez-smart-rollup-node.opam | 2 +- opam/tezos-rpc-http-client-unix.opam | 2 +- opam/tezos-rpc-http-server.opam | 1 + opam/tezt-performance-regression.opam | 2 +- opam/tezt-tezos.opam | 2 +- opam/virtual/octez-deps.opam | 2 +- scripts/version.sh | 3 +-- src/lib_rpc_http/dune | 1 + 10 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e05ccdd1056..39c69027e539 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,7 @@ variables: # /!\ CI_REGISTRY is overriden to use a private Docker registry mirror in AWS ECR # in GitLab namespaces `nomadic-labs` and `tezos` ## This value MUST be the same as `opam_repository_tag` in `scripts/version.sh` - build_deps_image_version: e3722c130dcd78c999602d215758399cc0f43d4a + build_deps_image_version: a84a8c4fe73f0bd8e085c7ac74feda5203504f4e build_deps_image_name: "${CI_REGISTRY}/tezos/opam-repository" GIT_STRATEGY: fetch GIT_DEPTH: "1" diff --git a/manifest/main.ml b/manifest/main.ml index ea9f2fd447eb..a9d1ea3b99be 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -101,7 +101,8 @@ let caqti_dynload = external_lib "caqti-dynload" V.True let cmdliner = external_lib "cmdliner" V.(at_least "1.1.0") -let cohttp_lwt_unix = external_lib "cohttp-lwt-unix" V.(at_least "4.0.0") +let cohttp_lwt_unix = + external_lib "cohttp-lwt-unix" V.(at_least "4.0.0" && different_from "5.1.0") let compiler_libs_common = external_lib "compiler-libs.common" V.True ~opam:"" @@ -3228,6 +3229,7 @@ let octez_rpc_http_server = [ octez_base |> open_ ~m:"TzPervasives"; octez_stdlib_unix |> open_; + cohttp_lwt_unix; resto_cohttp_server; resto_acl; octez_rpc; diff --git a/opam/octez-smart-rollup-node.opam b/opam/octez-smart-rollup-node.opam index a16d7d72c2b3..13849691cfe6 100644 --- a/opam/octez-smart-rollup-node.opam +++ b/opam/octez-smart-rollup-node.opam @@ -13,7 +13,7 @@ depends: [ "tezos-base" "tezos-stdlib-unix" "tezos-crypto" - "cohttp-lwt-unix" { >= "4.0.0" } + "cohttp-lwt-unix" { >= "4.0.0" & != "5.1.0" } "octez-node-config" "prometheus-app" { >= "1.2" } "octez-injector" diff --git a/opam/tezos-rpc-http-client-unix.opam b/opam/tezos-rpc-http-client-unix.opam index f70597e9e8aa..29b2b02cf854 100644 --- a/opam/tezos-rpc-http-client-unix.opam +++ b/opam/tezos-rpc-http-client-unix.opam @@ -12,7 +12,7 @@ depends: [ "ocaml" { >= "4.14" } "tezos-stdlib-unix" "tezos-base" - "cohttp-lwt-unix" { >= "4.0.0" } + "cohttp-lwt-unix" { >= "4.0.0" & != "5.1.0" } "resto-cohttp-client" { >= "1.0" } "tezos-rpc" "tezos-rpc-http-client" diff --git a/opam/tezos-rpc-http-server.opam b/opam/tezos-rpc-http-server.opam index d7e34f70990f..f63103ccb646 100644 --- a/opam/tezos-rpc-http-server.opam +++ b/opam/tezos-rpc-http-server.opam @@ -12,6 +12,7 @@ depends: [ "ocaml" { >= "4.14" } "tezos-base" "tezos-stdlib-unix" + "cohttp-lwt-unix" { >= "4.0.0" & != "5.1.0" } "resto-cohttp-server" { >= "1.0" } "resto-acl" { >= "1.0" } "tezos-rpc" diff --git a/opam/tezt-performance-regression.opam b/opam/tezt-performance-regression.opam index 0493321d688b..fece3068ccf5 100644 --- a/opam/tezt-performance-regression.opam +++ b/opam/tezt-performance-regression.opam @@ -12,7 +12,7 @@ depends: [ "ocaml" { >= "4.14" } "tezt" { >= "3.1.0" } "uri" { >= "3.1.0" } - "cohttp-lwt-unix" { >= "4.0.0" } + "cohttp-lwt-unix" { >= "4.0.0" & != "5.1.0" } ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/tezt-tezos.opam b/opam/tezt-tezos.opam index 3f6fe07f7384..c3c22ce30208 100644 --- a/opam/tezt-tezos.opam +++ b/opam/tezt-tezos.opam @@ -16,7 +16,7 @@ depends: [ "hex" { >= "1.3.0" } "tezos-crypto-dal" "tezos-base" - "cohttp-lwt-unix" { >= "4.0.0" } + "cohttp-lwt-unix" { >= "4.0.0" & != "5.1.0" } ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/virtual/octez-deps.opam b/opam/virtual/octez-deps.opam index d823b50f978b..ac541bf50934 100644 --- a/opam/virtual/octez-deps.opam +++ b/opam/virtual/octez-deps.opam @@ -24,7 +24,7 @@ depends: [ "caqti-lwt" "class_group_vdf" { >= "0.0.4" } "cmdliner" { >= "1.1.0" } - "cohttp-lwt-unix" { >= "4.0.0" } + "cohttp-lwt-unix" { >= "4.0.0" & != "5.1.0" } "conf-libev" "conf-rust" "ctypes" { >= "0.18.0" } diff --git a/scripts/version.sh b/scripts/version.sh index 24dcbe9a116b..35e885ad0951 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -25,8 +25,7 @@ export full_opam_repository_tag=0e89b5b0195c6f2597c95251896e1ef8b199c1d2 ## opam_repository is an additional, tezos-specific opam repository. ## This value MUST be the same as `build_deps_image_version` in `.gitlab-ci.yml` export opam_repository_url=https://gitlab.com/tezos/opam-repository -export opam_repository_tag="${OPAM_REPOSITORY_TAG:-e3722c130dcd78c999602d215758399cc0f43d4a}" - +export opam_repository_tag="${OPAM_REPOSITORY_TAG:-a84a8c4fe73f0bd8e085c7ac74feda5203504f4e}" export opam_repository_git="$opam_repository_url.git" export opam_repository="$opam_repository_git"\#"$opam_repository_tag" diff --git a/src/lib_rpc_http/dune b/src/lib_rpc_http/dune index e65dccf04097..1db6a874a13c 100644 --- a/src/lib_rpc_http/dune +++ b/src/lib_rpc_http/dune @@ -54,6 +54,7 @@ (libraries tezos-base tezos-stdlib-unix + cohttp-lwt-unix resto-cohttp-server resto-acl tezos-rpc -- GitLab From 8bd52bf902d9b2be08599166abcec5a24604216f Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Sun, 11 Jun 2023 17:33:30 +0200 Subject: [PATCH 2/3] Doc: Alpine uses python 3.10.12 bugfix release --- .gitlab-ci.yml | 2 +- docs/developer/install-python-debian-ubuntu.sh | 10 +++++----- docs/developer/python_environment.rst | 16 ++++++++-------- scripts/version.sh | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39c69027e539..671f25109b02 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,7 @@ variables: # /!\ CI_REGISTRY is overriden to use a private Docker registry mirror in AWS ECR # in GitLab namespaces `nomadic-labs` and `tezos` ## This value MUST be the same as `opam_repository_tag` in `scripts/version.sh` - build_deps_image_version: a84a8c4fe73f0bd8e085c7ac74feda5203504f4e + build_deps_image_version: 209f861254276cab87c0a38f9d1451ff8f82c68a build_deps_image_name: "${CI_REGISTRY}/tezos/opam-repository" GIT_STRATEGY: fetch GIT_DEPTH: "1" diff --git a/docs/developer/install-python-debian-ubuntu.sh b/docs/developer/install-python-debian-ubuntu.sh index 47f029379b45..636aeda6c248 100755 --- a/docs/developer/install-python-debian-ubuntu.sh +++ b/docs/developer/install-python-debian-ubuntu.sh @@ -67,20 +67,20 @@ pyenv --version [ "$PYENV_VIRTUALENV_INIT" = "1" ] ## -## Install python 3.10.11 through pyenv +## Install python 3.10.12 through pyenv ## ## References: ## - https://github.com/pyenv/pyenv#usage # [install python through pyenv] -pyenv install 3.10.11 -pyenv global 3.10.11 +pyenv install 3.10.12 +pyenv global 3.10.12 # [print python version] -python --version # should output 3.10.11 +python --version # should output 3.10.12 # [verify python version] -[ "$(python --version)" = "Python 3.10.11" ] +[ "$(python --version)" = "Python 3.10.12" ] ## ## Install poetry diff --git a/docs/developer/python_environment.rst b/docs/developer/python_environment.rst index 1831771dd89e..996b37e5b46c 100644 --- a/docs/developer/python_environment.rst +++ b/docs/developer/python_environment.rst @@ -12,7 +12,7 @@ Installation Prerequisites: -- ``python 3.10.11``. It is recommended to use `pyenv +- ``python 3.10.12``. It is recommended to use `pyenv `_ to manage the python versions. If you want to use ``pyenv``: @@ -21,11 +21,11 @@ Prerequisites: has been executed first during the shell session, by adding this line to an environment script sourced automatically. - * You can use then ``pyenv install 3.10.11`` followed by: + * You can use then ``pyenv install 3.10.12`` followed by: - + ``pyenv local 3.10.11`` to use ``python 3.10.11`` only in the current directory (and its subdirectories, unless redefined) - + ``pyenv global 3.10.11`` to set the python version to ``3.10.11`` globally - + ``pyenv shell 3.10.11`` to use ``python 3.10.11`` only in the current shell + + ``pyenv local 3.10.12`` to use ``python 3.10.12`` only in the current directory (and its subdirectories, unless redefined) + + ``pyenv global 3.10.12`` to set the python version to ``3.10.12`` globally + + ``pyenv shell 3.10.12`` to use ``python 3.10.12`` only in the current shell - `poetry 1.2.2 `_ to manage the python dependencies and run the tests in a sandboxed python environment. Follow the `installation instructions `__. @@ -39,8 +39,8 @@ A typical installation of the above prerequisites (including their own prerequis # 1. install pyenv # 2. restart shell, to ensure "pyenv init -" has been evaluated # 3. then install python using pyenv: - pyenv install 3.10.11 - pyenv global 3.10.11 + pyenv install 3.10.12 + pyenv global 3.10.12 # 4. install poetry # 5. restart shell, to activate the poetry setup # 6. then install dependencies for Octez using poetry: @@ -88,7 +88,7 @@ executing ``pyenv``: :start-after: [print pyenv version] :end-before: [verify pyenv installation] -Now we can use ``pyenv`` to install Python 3.10.11 and set it as the +Now we can use ``pyenv`` to install Python 3.10.12 and set it as the default version to use: .. literalinclude:: install-python-debian-ubuntu.sh diff --git a/scripts/version.sh b/scripts/version.sh index 35e885ad0951..14b0783d243d 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -25,7 +25,7 @@ export full_opam_repository_tag=0e89b5b0195c6f2597c95251896e1ef8b199c1d2 ## opam_repository is an additional, tezos-specific opam repository. ## This value MUST be the same as `build_deps_image_version` in `.gitlab-ci.yml` export opam_repository_url=https://gitlab.com/tezos/opam-repository -export opam_repository_tag="${OPAM_REPOSITORY_TAG:-a84a8c4fe73f0bd8e085c7ac74feda5203504f4e}" +export opam_repository_tag="${OPAM_REPOSITORY_TAG:-209f861254276cab87c0a38f9d1451ff8f82c68a}" export opam_repository_git="$opam_repository_url.git" export opam_repository="$opam_repository_git"\#"$opam_repository_tag" -- GitLab From b2b6c4419f072efd772453d7bf428bbf50e12fcb Mon Sep 17 00:00:00 2001 From: Arvid Jakobsson Date: Mon, 12 Jun 2023 11:28:51 +0200 Subject: [PATCH 3/3] CI: Doc tests can be made manual with MR label [ci--no-docs] --- .gitlab/ci/jobs/doc/linkcheck.yml | 2 ++ .gitlab/ci/jobs/doc/tests.yml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.gitlab/ci/jobs/doc/linkcheck.yml b/.gitlab/ci/jobs/doc/linkcheck.yml index 02ffc163c210..8cd8091fbc0b 100644 --- a/.gitlab/ci/jobs/doc/linkcheck.yml +++ b/.gitlab/ci/jobs/doc/linkcheck.yml @@ -5,6 +5,8 @@ documentation:linkcheck: stage: doc needs: [] rules: + - if: '$CI_MERGE_REQUEST_LABELS =~ /(?:^|[,])ci--no-docs(?:$|[,])/' + when: manual - if: '$CI_PIPELINE_SOURCE == "schedule" && $TZ_SCHEDULE_KIND == "EXTENDED_TESTS"' when: always - if: '$CI_MERGE_REQUEST_ID' diff --git a/.gitlab/ci/jobs/doc/tests.yml b/.gitlab/ci/jobs/doc/tests.yml index 75d41824b847..f011f72d0bd8 100644 --- a/.gitlab/ci/jobs/doc/tests.yml +++ b/.gitlab/ci/jobs/doc/tests.yml @@ -2,6 +2,9 @@ stage: doc needs: [] rules: + - if: '$CI_MERGE_REQUEST_LABELS =~ /(?:^|[,])ci--no-docs(?:$|[,])/' + when: manual + allow_failure: true - if: '$CI_PIPELINE_SOURCE == "schedule" && $TZ_SCHEDULE_KIND == "EXTENDED_TESTS"' when: always - if: '$CI_MERGE_REQUEST_ID' -- GitLab