From 5e4d85a5133f048406de5a72504023e1b2ec4135 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Mon, 4 Mar 2024 21:39:20 +0100 Subject: [PATCH 1/8] build: prepare hotfix release v2.16.7 (2024-03-04) --- antarest/__init__.py | 2 +- docs/CHANGELOG.md | 7 +++++++ setup.py | 2 +- sonar-project.properties | 2 +- webapp/package-lock.json | 4 ++-- webapp/package.json | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/antarest/__init__.py b/antarest/__init__.py index d91081051d..26d5d015d2 100644 --- a/antarest/__init__.py +++ b/antarest/__init__.py @@ -7,7 +7,7 @@ # Standard project metadata -__version__ = "2.16.6" +__version__ = "2.16.7" __author__ = "RTE, Antares Web Team" __date__ = "2024-03-04" # noinspection SpellCheckingInspection diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d93ac70454..2e75ee1611 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,13 @@ Antares Web Changelog ===================== +v2.16.7 (2024-03-04) +-------------------- + +### Bug Fixes + + + v2.16.6 (2024-03-04) -------------------- diff --git a/setup.py b/setup.py index 1446416f8d..c3ec3c3060 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="AntaREST", - version="2.16.6", + version="2.16.7", description="Antares Server", long_description=Path("README.md").read_text(encoding="utf-8"), long_description_content_type="text/markdown", diff --git a/sonar-project.properties b/sonar-project.properties index 643d9b727e..972bef9399 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,5 +6,5 @@ sonar.exclusions=antarest/gui.py,antarest/main.py sonar.python.coverage.reportPaths=coverage.xml sonar.python.version=3.8 sonar.javascript.lcov.reportPaths=webapp/coverage/lcov.info -sonar.projectVersion=2.16.6 +sonar.projectVersion=2.16.7 sonar.coverage.exclusions=antarest/gui.py,antarest/main.py,antarest/singleton_services.py,antarest/worker/archive_worker_service.py,webapp/**/* \ No newline at end of file diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 48e281133d..2c81f56aa3 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -1,12 +1,12 @@ { "name": "antares-web", - "version": "2.16.6", + "version": "2.16.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "antares-web", - "version": "2.16.6", + "version": "2.16.7", "dependencies": { "@emotion/react": "11.11.1", "@emotion/styled": "11.11.0", diff --git a/webapp/package.json b/webapp/package.json index 4ea77417ac..e21bd5dd7e 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -1,6 +1,6 @@ { "name": "antares-web", - "version": "2.16.6", + "version": "2.16.7", "private": true, "type": "module", "scripts": { From 2d58bb64d86d983f89dc1459e4e3c9c927702f90 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Mon, 4 Mar 2024 20:28:42 +0100 Subject: [PATCH 2/8] fix(desktop): add `watcher` configuration to scan studies --- resources/deploy/config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/deploy/config.yaml b/resources/deploy/config.yaml index 3eaaf891b6..6f3fdf595f 100644 --- a/resources/deploy/config.yaml +++ b/resources/deploy/config.yaml @@ -48,5 +48,10 @@ debug: false root_path: "api" +server: + worker_threadpool_size: 12 + services: + - watcher + logging: logfile: ./tmp/antarest.log From bda5069152ce6a9226f08ff432f7836a0a37259d Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Mon, 4 Mar 2024 20:31:26 +0100 Subject: [PATCH 3/8] feat(packaging): update the packaging script to use Antares Solver v8.8.3 --- scripts/package_antares_web.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/package_antares_web.sh b/scripts/package_antares_web.sh index 885ec09ccf..21008c15f8 100755 --- a/scripts/package_antares_web.sh +++ b/scripts/package_antares_web.sh @@ -9,7 +9,7 @@ set -e ANTARES_SOLVER_VERSION="8.8" -ANTARES_SOLVER_FULL_VERSION="8.8.2" +ANTARES_SOLVER_FULL_VERSION="8.8.3" ANTARES_SOLVER_VERSION_INT="880" SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) @@ -30,6 +30,10 @@ LINK="https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/downloa echo "INFO: Preparing the Git Commit ID..." git log -1 HEAD --format=%H > ${RESOURCES_DIR}/commit_id +echo "INFO: Remove the previous build if any..." +# Avoid the accumulation of files from previous builds (in development). +rm -rf ${DIST_DIR} + echo "INFO: Generating the Desktop version of the Web Application..." if [[ "$OSTYPE" == "msys"* ]]; then pushd ${PROJECT_DIR} @@ -49,9 +53,13 @@ popd echo "INFO: Creating destination directory '${ANTARES_SOLVER_DIR}'..." mkdir -p "${ANTARES_SOLVER_DIR}" -echo "INFO: Downloading '$ANTARES_SOLVER_ZIPFILE_NAME' in '$ANTARES_SOLVER_DIR'..." -cd "$ANTARES_SOLVER_DIR" || exit -wget $LINK +if [ -f "$ANTARES_SOLVER_ZIPFILE_NAME" ]; then + echo "INFO: Using existing '$ANTARES_SOLVER_ZIPFILE_NAME' in '$ANTARES_SOLVER_DIR'..." +else + echo "INFO: Downloading '$ANTARES_SOLVER_ZIPFILE_NAME' in '$ANTARES_SOLVER_DIR'..." + cd "$ANTARES_SOLVER_DIR" || exit + wget $LINK +fi echo "INFO: Uncompressing '$ANTARES_SOLVER_ZIPFILE_NAME'..." if [[ "$OSTYPE" == "msys"* ]]; then From bfd276aed3e48a26cb61bb475b23cc1bbedbc715 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Mon, 4 Mar 2024 21:07:11 +0100 Subject: [PATCH 4/8] docs(ssh-client): improve the function documentation --- antarest/launcher/ssh_client.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/antarest/launcher/ssh_client.py b/antarest/launcher/ssh_client.py index 7337a308ac..e52cb0072c 100644 --- a/antarest/launcher/ssh_client.py +++ b/antarest/launcher/ssh_client.py @@ -32,7 +32,7 @@ def execute_command(ssh_config: SSHConfigDTO, args: List[str]) -> Any: command = " ".join(args) try: with ssh_client(ssh_config) as client: # type: ignore - stdin, stdout, stderr = client.exec_command(command, timeout=10) + _, stdout, stderr = client.exec_command(command, timeout=10) output = stdout.read().decode("utf-8").strip() error = stderr.read().decode("utf-8").strip() except ( @@ -77,6 +77,15 @@ def parse_cpu_load(sinfo_output: str) -> float: def calculates_slurm_load(ssh_config: SSHConfigDTO, partition: str) -> Tuple[float, float, int]: """ Returns the used/oad of the SLURM cluster or local machine in percentage and the number of queued jobs. + + Args: + ssh_config: SSH configuration to connect to the SLURM server. + partition: Name of the partition to query, or empty string to query all partitions. + + Returns: + - percentage of used CPUs in the cluster, in range [0, 100] + - percentage of CPU load in the cluster, in range [0, 100] + - number of queued jobs """ partition_arg = f"--partition={partition}" if partition else "" From 8e8df60fe43ba921776bd3c26fcb943119d05a4d Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Mon, 4 Mar 2024 21:11:47 +0100 Subject: [PATCH 5/8] fix(api-launcher-load): correct the launcher load to be in range [0, 100] for local machine --- antarest/launcher/service.py | 3 ++- tests/integration/test_integration.py | 4 ++-- tests/launcher/test_service.py | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/antarest/launcher/service.py b/antarest/launcher/service.py index 4c4ea9aa15..023296188b 100644 --- a/antarest/launcher/service.py +++ b/antarest/launcher/service.py @@ -657,7 +657,8 @@ def get_load(self) -> LauncherLoadDTO: for job in self.job_result_repository.get_running() ) - cluster_load_approx = min(1.0, local_used_cpus / (os.cpu_count() or 1)) + # The cluster load is approximated by the percentage of used CPUs. + cluster_load_approx = min(100.0, 100 * local_used_cpus / (os.cpu_count() or 1)) return LauncherLoadDTO( allocated_cpu_rate=cluster_load_approx, diff --git a/tests/integration/test_integration.py b/tests/integration/test_integration.py index ffa4d4a91d..8065039c92 100644 --- a/tests/integration/test_integration.py +++ b/tests/integration/test_integration.py @@ -299,8 +299,8 @@ def test_main(client: TestClient, admin_access_token: str, study_id: str) -> Non res = client.get("/v1/launcher/load", headers=admin_headers) assert res.status_code == 200, res.json() launcher_load = LauncherLoadDTO.parse_obj(res.json()) - assert launcher_load.allocated_cpu_rate == 1 / (os.cpu_count() or 1) - assert launcher_load.cluster_load_rate == 1 / (os.cpu_count() or 1) + assert launcher_load.allocated_cpu_rate == 100 / (os.cpu_count() or 1) + assert launcher_load.cluster_load_rate == 100 / (os.cpu_count() or 1) assert launcher_load.nb_queued_jobs == 0 assert launcher_load.launcher_status == "SUCCESS" diff --git a/tests/launcher/test_service.py b/tests/launcher/test_service.py index 72f95a782f..9095673070 100644 --- a/tests/launcher/test_service.py +++ b/tests/launcher/test_service.py @@ -937,8 +937,8 @@ def test_save_solver_stats(self, tmp_path: Path) -> None: ), ], { - "allocated_cpu_rate": min(1.0, 8.0 / (os.cpu_count() or 1)), - "cluster_load_rate": min(1.0, 8.0 / (os.cpu_count() or 1)), + "allocated_cpu_rate": min(100.0, 800 / (os.cpu_count() or 1)), + "cluster_load_rate": min(100.0, 800 / (os.cpu_count() or 1)), "nb_queued_jobs": 0, "launcher_status": "SUCCESS", }, From 42550b4a303d21cc101113dfe415bde6aa42589b Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Mon, 4 Mar 2024 21:45:31 +0100 Subject: [PATCH 6/8] docs: update change log --- docs/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 2e75ee1611..e137d6bf1c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,6 +6,7 @@ v2.16.7 (2024-03-04) ### Bug Fixes +* **desktop:** correct configuration and launcher load indicator for Antares Web Desktop [`#1969`](https://github.com/AntaresSimulatorTeam/AntaREST/pull/1969) v2.16.6 (2024-03-04) From dbfc28731b9051d17f10baa5dc6b6549070e0a9c Mon Sep 17 00:00:00 2001 From: Samir Kamal <1954121+skamril@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:56:41 +0100 Subject: [PATCH 7/8] ci: add commitlint GitHub action (#1933) lints Pull Request commits with commitlint (cherry picked from commit 4c60fa20ab6f1a54574bf8a2b899b31f94fad0b1) --- .github/workflows/commitlint.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/commitlint.yml diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000000..8e08ce865c --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,13 @@ +name: Lint Commit Messages +on: [pull_request] + +permissions: + contents: read + pull-requests: read + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: wagoid/commitlint-github-action@v5 From 67125bda26f7692e96ba80a9f80f7f11978fe953 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Wed, 6 Mar 2024 18:23:03 +0100 Subject: [PATCH 8/8] build: prepare hotfix release v2.16.7 (2024-03-05) --- antarest/__init__.py | 2 +- docs/CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/antarest/__init__.py b/antarest/__init__.py index 26d5d015d2..29054100d1 100644 --- a/antarest/__init__.py +++ b/antarest/__init__.py @@ -9,7 +9,7 @@ __version__ = "2.16.7" __author__ = "RTE, Antares Web Team" -__date__ = "2024-03-04" +__date__ = "2024-03-05" # noinspection SpellCheckingInspection __credits__ = "(c) Réseau de Transport de l’Électricité (RTE)" diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e137d6bf1c..fc42446272 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,7 +1,7 @@ Antares Web Changelog ===================== -v2.16.7 (2024-03-04) +v2.16.7 (2024-03-05) -------------------- ### Bug Fixes