Document updated release process (#150)

This commit is contained in:
Anton Schwaighofer 2021-11-03 12:44:02 +00:00 коммит произвёл GitHub
Родитель e89e7d768b
Коммит 67066ebe54
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 33 добавлений и 36 удалений

Просмотреть файл

@ -5,12 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
For each Pull Request, the affected code parts should be briefly described and added here in the "Upcoming" section.
Once a release is prepared, the "Upcoming" section becomes the release changelog, and a new empty "Upcoming" should be
created.
This file has sections for all previous releases, and the next one.
For each Pull Request, the affected code parts should be briefly described and added in the section for the upcoming
release. In the first PR after a release has been made, a section for the upcoming release should be added, by copying
the section headers (Added/Changed/...) and incrementing the package version.
## Upcoming
## 0.1.10
### Added
- ([#142](https://github.com/microsoft/hi-ml/pull/142)) Adding AzureML progress bar and diagnostics for batch loading

Просмотреть файл

@ -93,15 +93,13 @@ When running the tests locally, they can either be run against the source direct
## Creating a New Release
To create a new package release, follow these steps:
* Modify `CHANGELOG.md` as follows:
* Copy the whole section called "Upcoming", including its subsections for "Added/Removed/..." to a new section,
that has the desired package version and the current date as the title. For example, to release package version
`0.12.17` on Oct 10th, that section would be called "0.12.17 (2021-10-21)".
* In the section for the new release, remove any empty subsections if needed.
* Clean up all PR links from the "Upcoming" section, to effectively create an empty template for the next release.
* Create a PR for this change. While creating the PR, add the "no changelog needed" label that exists on the repo.
*Important*: This label needs to be added right when the PR is created, not afterwards - the github workflows will
not pick it up if added afterwards. In the worst case, you can added the label afterwards, and push a whitespace
change to the PR.
* Once the PR with the updated `CHANGELOG.md` is in, create a tag that has the desired version number, plus a "v"
prefix. For example, to create package version 0.12.17, create a tag `v0.12.17`
* Double-check that `CHANGELOG.md` is up-to-date: It should contain a section for the next package version with
subsections Added/Changed/...
* On the repository's github page, click on "Releases", then "Draft a new release"
* In the "Draft a new release" page, click "Choose a tag". In the text box, enter a (new) tag name that has
the desired version number, plus a "v" prefix. For example, to create package version 0.12.17, create a
tag `v0.12.17`. Then choose "+ Create new tag" below the text box.
* Enter a "Release title" that highlights the main feature(s) of this new package version.
* Click "Auto-generate release notes" to pull in the titles of the Pull Requests since the last release.
* Before the auto-generated "What's changed" section, add a few sentences that summarize what's new.
* Click "Publish release"

Просмотреть файл

@ -171,24 +171,20 @@ class AzureMLProgressBar(ProgressBarBase):
self.total_num_batches = total_num_batches
self.stage_start_time = time.time()
def on_train_batch_end(self, trainer: Trainer, pl_module: LightningModule, outputs: Any, batch: Any,
batch_idx: int, dataloader_idx: int) -> None:
super().on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)
def on_train_batch_end(self, *args: Any, **kwargs: Any) -> None:
super().on_train_batch_end(*args, **kwargs)
self.update_progress(batches_processed=self.train_batch_idx)
def on_validation_batch_end(self, trainer: Trainer, pl_module: LightningModule, outputs: Any, batch: Any,
batch_idx: int, dataloader_idx: int) -> None:
super().on_validation_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)
def on_validation_batch_end(self, *args: Any, **kwargs: Any) -> None:
super().on_validation_batch_end(*args, **kwargs)
self.update_progress(batches_processed=self.val_batch_idx)
def on_test_batch_end(self, trainer: Trainer, pl_module: LightningModule, outputs: Any, batch: Any,
batch_idx: int, dataloader_idx: int) -> None:
super().on_test_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)
def on_test_batch_end(self, *args: Any, **kwargs: Any) -> None:
super().on_test_batch_end(*args, **kwargs)
self.update_progress(batches_processed=self.test_batch_idx)
def on_predict_batch_end(self, trainer: Trainer, pl_module: LightningModule, outputs: Any, batch: Any,
batch_idx: int, dataloader_idx: int) -> None:
super().on_predict_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)
def on_predict_batch_end(self, *args: Any, **kwargs: Any) -> None:
super().on_predict_batch_end(*args, **kwargs)
self.update_progress(batches_processed=self.predict_batch_idx)
def update_progress(self, batches_processed: int) -> None:

Просмотреть файл

@ -13,6 +13,7 @@ import pytest
import torch
from _pytest.capture import SysCapture
from _pytest.logging import LogCaptureFixture
from pytorch_lightning import Trainer
from health_ml.utils import AzureMLLogger, AzureMLProgressBar, log_learning_rate, log_on_epoch
@ -253,22 +254,23 @@ def test_progress_bar(capsys: SysCapture) -> None:
return capsys.readouterr().out.splitlines()[-1] # type: ignore
# Messages in training
bar.on_train_epoch_start(None, None) # type: ignore
trainer = Trainer()
bar.on_train_epoch_start(trainer, None) # type: ignore
assert bar.stage == AzureMLProgressBar.PROGRESS_STAGE_TRAIN
assert bar.train_batch_idx == 0
assert bar.val_batch_idx == 0
assert bar.test_batch_idx == 0
assert bar.predict_batch_idx == 0
bar.on_train_batch_end(None, None, None, None, None, None) # type: ignore
bar.on_train_batch_end(None, None, None, None, None) # type: ignore
assert bar.train_batch_idx == 1
latest = latest_message()
assert "Training epoch 12 (step 34)" in latest
assert "1/10 ( 10%) completed" in latest
# When starting the next training epoch, the counters should be reset
bar.on_train_epoch_start(None, None) # type: ignore
bar.on_train_epoch_start(trainer, None) # type: ignore
assert bar.train_batch_idx == 0
# Messages in validation
bar.on_validation_start(None, None) # type: ignore
bar.on_validation_start(trainer, None) # type: ignore
assert bar.stage == AzureMLProgressBar.PROGRESS_STAGE_VAL
assert bar.total_num_batches == 0
assert bar.val_batch_idx == 0
@ -280,7 +282,7 @@ def test_progress_bar(capsys: SysCapture) -> None:
assert "Validation epoch 12: " in latest
assert "1/5 ( 20%) completed" in latest
# Messages in testing
bar.on_test_epoch_start(None, None) # type: ignore
bar.on_test_epoch_start(trainer, None) # type: ignore
assert bar.stage == AzureMLProgressBar.PROGRESS_STAGE_TEST
test_count = 2
for _ in range(test_count):
@ -290,7 +292,7 @@ def test_progress_bar(capsys: SysCapture) -> None:
assert "Testing:" in latest
assert f"{test_count}/20 ( 10%)" in latest
# Messages in prediction
bar.on_predict_epoch_start(None, None) # type: ignore
bar.on_predict_epoch_start(trainer, None) # type: ignore
assert bar.stage == AzureMLProgressBar.PROGRESS_STAGE_PREDICT
predict_count = 3
for _ in range(predict_count):

Просмотреть файл

@ -14,6 +14,6 @@
"extraPaths": [
"hi-ml/testhiml/testhiml/utils/slide_image_loading/src"
]
},
],
}
]
}