Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0.24.0 #241

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.docker
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PROJECT_ROOT := $(dir $(abspath $(lastword ${MAKEFILE_LIST})))
PROJECT_VERSION := $(shell make --no-print-directory -C ${PROJECT_ROOT} -f Makefile.package info-version)

UBUNTU_NAME := ubuntu
UBUNTU_VERSIONS := 18.04 20.04 22.04
UBUNTU_VERSIONS := 20.04 22.04

DOCKER := DOCKER_BUILDKIT=1 docker
DOCKER_IMAGE_NAME := cloe/cloe-engine
Expand Down
1 change: 0 additions & 1 deletion Makefile.setup
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ install-python-deps::
"conan<2.0.0" \
libtmux \
toml \
rich \
pipx \
;

Expand Down
6 changes: 6 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,11 @@ installed with the help of Conan):
- Source: https://github.com/oatpp/oatpp
- Conan-Package: oatpp

- Open-Simulation-Interface
- License: MPL2
- License-Source: https://github.com/OpenSimulationInterface/open-simulation-interface/blob/master/LICENSE
- Source: https://github.com/OpenSimulationInterface/open-simulation-interface
- Conan-Package: open-simulation-interface

Additional third-party content that is used for the web user-interface
is listed in the `ui/LICENSE-3RD-PARTY.txt` file.
5 changes: 4 additions & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ make install
## Usage

```
cloe-launch [-v] config [--edit] [--write]

cloe-launch [-v] clean CONANFILE

cloe-launch [-v] prepare CONANFILE [CONAN_INSTALL_ARGS]

cloe-launch [-v] activate [-c] CONANFILE [CONAN_INSTALL_ARGS]

cloe-launch -v activate -c tests/conanfile.py -o cloe-engine:server=True

cloe-launch [-v] deploy [-c] [-f] [-r] [-D PATH] CONANFILE [CONAN_INSTALL_ARGS]
cloe-launch [-v] deploy [-D PATH] CONANFILE [CONAN_INSTALL_ARGS]

cloe-launch [-v] exec [-c] [-e VAR] [-E] [-d] CONANFILE [CONAN_INSTALL_ARGS] -- [ENGINE_ARGS]

Expand Down
26 changes: 9 additions & 17 deletions cli/cloe_launch/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from typing import Type

from cloe_launch import Configuration, procutils, binutils
from cloe_launch.procutils import Environment, transient_system
from cloe_launch.procutils import Environment


class PluginSetup:
Expand Down Expand Up @@ -351,33 +351,25 @@ def _prepare_virtualenv(self, with_json: bool = False) -> None:
for arg in self.conan_args:
conan_cmd.append(arg)
conan_cmd.append(self.profile_path)

command_str = " ".join(conan_cmd)
logging.debug(f"Exec: {command_str}")
result = transient_system(
conan_cmd,
capture_output=self.capture_output,
transient_title=f"Exec: {command_str}",
transient_indent="| ",
)

if result.return_code == 0:
logging.debug(f"Exec: {' '.join(conan_cmd)}")
result = subprocess.run(conan_cmd, check=False, capture_output=self.capture_output)
if result.returncode == 0:
# Short-circuit out if everything is fine.
return

logging.error("Error: cannot install virtualenv configuration!")
logging.error("Command:")
logging.error(f" {' '.join(conan_cmd)}")
logging.error("")
logging.error("Error Output:")
logging.error("Output:")

columns, _rows = os.get_terminal_size(0)
for line in result.stderr_lines:
stderr_lines = result.stderr.decode().splitlines()
for line in stderr_lines:
logging.error(
"\n".join(
textwrap.wrap(
line,
columns,
80,
initial_indent=" ",
subsequent_indent=" ",
break_long_words=False,
Expand Down Expand Up @@ -425,7 +417,7 @@ def _prepare_virtualenv(self, with_json: bool = False) -> None:
" ",
],
}
for error in result.stderr_lines:
for error in stderr_lines:
for regex, response in known_errors.items():
if re.match(regex, error):
logging.error("")
Expand Down
114 changes: 2 additions & 112 deletions cli/cloe_launch/procutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,15 @@
# SPDX-License-Identifier: Apache-2.0

import logging
import subprocess
import shlex
import os
import re
import select
import shlex
import subprocess
import textwrap

from collections import OrderedDict
from pathlib import Path
from typing import Dict, List, Optional, Mapping, Union

from rich.console import Console
from rich.style import Style
from rich.live import Live
from rich.text import Text


class Environment:
"""This class stores a set of environment variables for runtimes.
Expand Down Expand Up @@ -339,106 +332,3 @@ def system(
if must_succeed:
raise ChildProcessError()
return result


class TransientResult:
command: List[str]
env: Optional[Dict[str, str]]
merged_output: List[str]
stdout_lines: List[str]
stderr_lines: List[str]
return_code: int

def __init__(self, command: List[str], env: Optional[Dict[str, str]]):
self.command = command
self.env = env

def _readlines_noblock(fd):
lines = []
while True:
line = fd.readline()
if line == '':
break
lines.append(line)
return lines


def transient_system(
command: List[str],
environment: Optional[Dict[str, str]] = None,
capture_output: bool = True,
transient_title: Optional[str] = None,
transient_lines: int = 10,
transient_indent: str = "",
) -> TransientResult:
"""Run a command with transient output, clearing the output when the command is finished."""
result = TransientResult(command, environment)

result.merged_output = []
result.stdout_lines = []
result.stderr_lines = []
console = Console(highlight=False, markup=False)
with Live(console=console, refresh_per_second=10, transient=True) as live:
last_lines: List[str] = [transient_title] if transient_title else []
if capture_output:
live.update(Text("\n".join(last_lines), style="dim"))

def update_output(line):
if capture_output:
if len(last_lines) >= transient_lines:
# Remove the oldest line
last_lines.pop(1 if transient_title else 0)
last_lines.append(
transient_indent
+ textwrap.shorten(
line.strip(),
width=(live.console.width - len(transient_indent)),
placeholder="...",
)
)

# Clear previous lines and print the last 10 lines
live.update(Text("\n".join(last_lines), style="dim"))
else:
live.console.print(line, style="dim", end='')

with subprocess.Popen(
command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
env=environment,
bufsize=1,
) as process:
assert process.stdout is not None
assert process.stderr is not None

poll = select.poll()
poll.register(process.stdout, select.POLLIN | select.POLLHUP)
poll.register(process.stderr, select.POLLIN | select.POLLHUP)
os.set_blocking(process.stdout.fileno(), False)
os.set_blocking(process.stderr.fileno(), False)
alive = 2

events = poll.poll()
while alive > 0 and len(events) > 0:
for fd, event in events:
if event & select.POLLIN:
if fd == process.stdout.fileno():
lines = _readlines_noblock(process.stdout)
result.stdout_lines.extend(lines)
if fd == process.stderr.fileno():
lines = _readlines_noblock(process.stderr)
result.stderr_lines.extend(lines)
result.merged_output.extend(lines)
for line in lines:
update_output(line)
if event & select.POLLHUP:
poll.unregister(fd)
alive = alive - 1
if alive > 0:
events = poll.poll()

result.return_code = process.wait()

return result
3 changes: 1 addition & 2 deletions cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[project]
name = "cloe-launch"
version = "0.23.0"
version = "0.24.0"
description = "Launch cloe-engine with Conan profiles."
license = { text = "Apache-2.0" }
authors = [
Expand All @@ -17,7 +17,6 @@ requires-python = ">=3.7"
dependencies = [
"toml >= 0.10",
"click >= 7.0",
"rich >= 13.0",
]

[project.scripts]
Expand Down
40 changes: 39 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,45 @@

Note that the most recent release is at the *top* of the document.

0.24.0 (2024-05-06)
-------------------

This is the seventh public minor release of the Cloe packages.
Read all about the changes :doc:`here <news/release-0.24.0>`.

Please note that there is a breaking change in the interface of the
``cloe-launch`` tool, which *will* affect every single use of the tool.

**CLI:**

- cli: Fix help text for deploy command `[4c193c1a] <https://github.com/eclipse/cloe/commit/4c193c1a186335daf83f5e434f133cc7487409d0>`_
- cli: Add missing copyright headers `[02101bac] <https://github.com/eclipse/cloe/commit/02101baca32fef9412942969a52823a3f822977c>`_
- cli: Replace os.path with pathlib method `[857eec68] <https://github.com/eclipse/cloe/commit/857eec683b46ddeaeac00835bdcbc07b2b54c89f>`_
- cli: Add config subcommand `[871eb2f1] <https://github.com/eclipse/cloe/commit/871eb2f1b6b27fc33e880af6b842c886dc7af7a5>`_
- cli: Unpin click and toml versions `[4c36d5bf] <https://github.com/eclipse/cloe/commit/4c36d5bf8a8e5af318c15d9a79862626e0f10d4a>`_
- cli: Show conan command being executed in verbose mode `[f7f2aee5] <https://github.com/eclipse/cloe/commit/f7f2aee5475d1f569dfb8676f00ec5f06b09ff89>`_
- cli: Fix cloe-launch prepare not showing output. `[98ec84e4] <https://github.com/eclipse/cloe/commit/98ec84e4eb203fd97863045861c16713fce2a2f4>`_
- cli: Prevent . from being added to CLOE_PLUGIN_PATH `[d914acda] <https://github.com/eclipse/cloe/commit/d914acdabf95d4303c83505c1fcd5c95f0c63548>`_
- cli: Add --ignore-plugin-setups option `[093bd23a] <https://github.com/eclipse/cloe/commit/093bd23ab4f4b2e17ffbaa16379046752d48eee7>`_
- cli: Provide help for common errors `[7c8c71f9] <https://github.com/eclipse/cloe/commit/7c8c71f9d39d007c47f438489e9cddc3d8d164b2>`_
- cli: Update default build policy from outdated to cascade `[8438361d] <https://github.com/eclipse/cloe/commit/8438361d5c128cf321b7c281e7adda3790f11aee>`_
- cli: Fix rpath list being modified `[a7f44169] <https://github.com/eclipse/cloe/commit/a7f441690879a6805a38424a9e20ceca3eb56278>`_
- cli: Fix allow_interspersed_args not inherited anymore `[74097b72] <https://github.com/eclipse/cloe/commit/74097b724f4cd5b4913035d3da4dbe220a942bde>`_
- cli: Fix broken Makefile failing to install . `[bfe9b834] <https://github.com/eclipse/cloe/commit/bfe9b834113b693548e33d548a8f1099f1b49255>`_
- cli: Fix conanfile.py referring to missing setup.py `[32b2bba2] <https://github.com/eclipse/cloe/commit/32b2bba25b48d128d23baa36f06ef13623f8484c>`_
- cli: Fix usage error in README `[6c85cc56] <https://github.com/eclipse/cloe/commit/6c85cc56eb7ddaa19b90fdf0e853ac8e1974c116>`_
- cli: Improve cloe-launch command help messages `[a4093b83] <https://github.com/eclipse/cloe/commit/a4093b830c927a5592b68958d7e340533891ff51>`_
- cli: Simplify conan argument passing `[0b4052f7] <https://github.com/eclipse/cloe/commit/0b4052f718d100230df62f170a5de66d13ad9573>`_
- cli: Refactor cloe_utils into binutils and procutils `[ab0250e9] <https://github.com/eclipse/cloe/commit/ab0250e93f85510c7520fd05e6eebb6d1c1004e5>`_
- cli: Improve error handling of patch_rpath `[479e6188] <https://github.com/eclipse/cloe/commit/479e6188af9e3c37166767964e9213624ee8023f>`_
- cli: Disable pylint logging-fstring-interpolation `[d8a0c645] <https://github.com/eclipse/cloe/commit/d8a0c64575bc99e4dc283e22349b5907bcd995b7>`_
- cli: Fail when patchelf does not exist `[9d746eb2] <https://github.com/eclipse/cloe/commit/9d746eb239064d38b3771f3e6e1a453db49ea326>`_
- cli: Add deploy command `[1984ca41] <https://github.com/eclipse/cloe/commit/1984ca4118a0b66cdfbe3d3f14e75d151a8858b3>`_

**Plugins:**

- frustum_culling: Add frustum culling as a cloe plugin `[9f921ec2] <https://github.com/eclipse/cloe/commit/9f921ec2aa757536e01b143fb763a141180b6b95>`_

0.23.0 (2024-04-23)
-------------------

Expand All @@ -70,7 +109,6 @@

The following is a *selection* of interesting commits.


**Engine:**

- engine: Provide better error messages for missing plugins `[9dd06d0a] <https://github.com/eclipse/cloe/commit/9dd06d0addb30bcbf70e713a80c81f6a6ea40530>`_
Expand Down Expand Up @@ -246,7 +284,7 @@
- all: Bump required C++ standard from 14 to 17 `[fe678bca] <https://github.com/eclipse/cloe/commit/fe678bca4d50cea7b42a044caa07bbf1a487d434>`_
- all: Remove constraints on Boost version from cppnetlib `[2fabcaa9] <https://github.com/eclipse/cloe/commit/2fabcaa98ab7e7e4299355c561fd523d083b957f>`_
- ci: Improve performance of Github CI jobs `[b13c7182] <https://github.com/eclipse/cloe/commit/b13c7182fc427ee913e15b9bb6b5d7f57a1b2354>`_ ci: Remove ubuntu-18.04 from Github workflows `[47cec675] <https://github.com/eclipse/cloe/commit/47cec6755752ec62fe2e18f6b080d459c5a046b1>`_
- tests: Don't fail when *.so glob doesn't match anything `[88a92dca] <https://github.com/eclipse/cloe/commit/88a92dca75c47714ce5c7c2feea966ab49ea21fd>`_

Check warning on line 287 in docs/changelog.rst

View workflow job for this annotation

GitHub Actions / sphinx

Inline emphasis start-string without end-string.
- tests: Depend on cloe-launch-profile >= 0.20 `[c6aaea2b] <https://github.com/eclipse/cloe/commit/c6aaea2bb731d64414e77552b5cdad26e541dc73>`_
- tests: Replace testname arg quotes with single quotes `[637f44cf] <https://github.com/eclipse/cloe/commit/637f44cfc5fdd001bb6b20a16665dd0234579e02>`_
- tooling: Add cloe-normal Conan profile `[1893b91f] <https://github.com/eclipse/cloe/commit/1893b91fe230632fb426791dd1a334791323b355>`_
Expand Down
6 changes: 3 additions & 3 deletions docs/contributing/creating-a-new-release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Places in the documentation which require attention at every release have
a ``TODO(release)`` comment which explains what needs to be done.
Search for those with your editor!

- Ensure ``NOTICE.md`` is up-to-date.

This includes the documentation for the following steps:

1. Generate the plugin documentation
Expand All @@ -102,8 +104,6 @@ For now we are releasing all parts of Cloe in lock-step, even though they
are separate packages sometimes.

1. Update cloe-launch version in ``cli/pyproject.yaml``.
Run ``dephell`` afterwards to update ``cli/setup.py``, or if you are confident
only the version has changed, do it yourself.

2. Update smoketest conanfiles requires to ``cloe-launch-profile``, if necessary.
It's ok for them to depend on older versions, if they are still compatible.
Expand Down Expand Up @@ -149,7 +149,7 @@ Replace ``X.Y.Z`` with the corresponding values.

Then, push the tag to Github::

git push vX.Y.Z
git push origin vX.Y.Z

G. Trigger Read-the-Docs
------------------------
Expand Down
23 changes: 21 additions & 2 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,32 @@ News
:hidden:
:maxdepth: 1

news/release-0.24.0
news/release-0.23.0
news/release-0.22.0
news/release-0.21.0
news/release-0.20.0
news/release-0.19.0


:doc:`Version 0.24.0 Release <news/release-0.24.0>`
---------------------------------------------------

This is a small release that contains two changes:

Firstly, the ``cloe-launch`` interface is significantly improved and simplified:

- Launch profiles are no longer "managed"; instead use Conan recipes directly.
- Arguments to Conan can be passed as-is after specifying the Conan recipe.
- Common Conan errors are summarized for the user.
- New command ``config`` lets you manage the launcher configuration.
- New command ``deploy`` lets you create a binary deployment of a Conan recipe.

Secondly, this release includes the new ``frustum_culling`` plugin.

Read more about these changes and more :doc:`here <news/release-0.24.0>`.


:doc:`Version 0.23.0 Release <news/release-0.23.0>`
---------------------------------------------------

Expand All @@ -44,8 +64,7 @@ to use.
The old `Array` schema, which was for `std::vector`, has been renamed to
`Vector`, and its header moved to `fable/schema/vector.hpp`.

Read all about these and the other many changes :doc:`here
<news/release-0.23.0>`.
Read all about these and the other many changes :doc:`here <news/release-0.23.0>`.

:doc:`Version 0.22.0 Release <news/release-0.22.0>`
---------------------------------------------------
Expand Down
Loading
Loading