-
Notifications
You must be signed in to change notification settings - Fork 0
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
Upgrade fl4heath and made appropriate changes #110
Changes from 5 commits
b4cd434
a1d4a43
bb11590
1eab8c6
df64e1c
b08a0d5
ebece2f
5960dac
4643388
7ceb98b
21f98d7
5a44e62
6a6c4ae
c9c1f39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,11 +26,11 @@ jobs: | |
virtualenvs-in-project: true | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.9' | ||
python-version: '3.10' | ||
cache: 'poetry' | ||
- run: | | ||
python3 -m pip install --upgrade pip && python3 -m pip install poetry | ||
poetry env use '3.9' | ||
poetry env use '3.10' | ||
source .venv/bin/activate | ||
poetry install --with docs,test | ||
cd docs && rm -rf source/reference/api/_autosummary && make html | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,11 +31,11 @@ jobs: | |
virtualenvs-in-project: true | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.9' | ||
python-version: '3.10' | ||
cache: 'poetry' | ||
- run: | | ||
python3 -m pip install --upgrade pip && python3 -m pip install poetry | ||
poetry env use '3.9' | ||
poetry env use '3.10' | ||
source $(poetry env info --path)/bin/activate | ||
poetry install --with docs,test | ||
cd docs && rm -rf source/reference/api/_autosummary && make html | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ jobs: | |
virtualenvs-in-project: true | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.9' | ||
python-version: '3.10' | ||
- name: Setup redis | ||
uses: supercharge/[email protected] | ||
with: | ||
|
@@ -55,7 +55,7 @@ jobs: | |
mongodb-version: 7.0.8 | ||
- name: Install dependencies and check code | ||
run: | | ||
poetry env use '3.9' | ||
poetry env use '3.10' | ||
source .venv/bin/activate | ||
poetry install --with docs,test | ||
coverage run -m pytest florist/tests/integration && coverage xml && coverage report -m | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
virtualenvs-in-project: true | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.9' | ||
python-version: '3.10' | ||
- name: Build package | ||
run: poetry build | ||
- name: Publish package | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,14 +34,14 @@ jobs: | |
virtualenvs-in-project: true | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.9' | ||
python-version: '3.10' | ||
cache: 'poetry' | ||
- name: Setup yarn | ||
uses: mskelton/setup-yarn@v3 | ||
- name: Install dependencies and check code | ||
run: | | ||
yarn | ||
poetry env use '3.9' | ||
poetry env use '3.10' | ||
source .venv/bin/activate | ||
poetry install --with test --all-extras | ||
pre-commit run --all-files | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,10 +44,10 @@ jobs: | |
virtualenvs-in-project: true | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.9' | ||
python-version: '3.10' | ||
- name: Install python dependencies and check code | ||
run: | | ||
poetry env use '3.9' | ||
poetry env use '3.10' | ||
source .venv/bin/activate | ||
poetry install --with docs,test | ||
coverage run -m pytest florist/tests/unit && coverage xml && coverage report -m | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,12 @@ | |
import flwr as fl | ||
from fl4health.clients.basic_client import BasicClient | ||
from fl4health.server.base_server import FlServer | ||
from flwr.common.logger import DEFAULT_FORMATTER | ||
from flwr.server import ServerConfig | ||
|
||
|
||
DEFAULT_FORMATTER = logging.Formatter("%(levelname)s %(name)s %(asctime)s | %(filename)s:%(lineno)d | %(message)s") | ||
|
||
|
||
def redirect_logging_from_console_to_file(log_file_path: str) -> None: | ||
""" | ||
Redirect loggers outputting to console to specified file. | ||
|
@@ -60,7 +62,6 @@ def start_server( | |
config=ServerConfig(num_rounds=n_server_rounds), | ||
) | ||
server.shutdown() | ||
server.metrics_reporter.dump() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are dumping on every call to report I figured we can remove these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess, yes... I put it there just in case, it doesn't hurt, but I guess it's better to remove if it's not really necessary :) |
||
|
||
|
||
def start_client(client: BasicClient, server_address: str, client_log_file_name: str) -> None: | ||
|
@@ -79,7 +80,6 @@ def start_client(client: BasicClient, server_address: str, client_log_file_name: | |
sys.stderr = log_file | ||
fl.client.start_numpy_client(server_address=server_address, client=client) | ||
client.shutdown() | ||
client.metrics_reporter.dump() | ||
|
||
|
||
def launch_server( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess flwr removed the DEFAULT_FORMATTER they were exporting previously.
Here there reference it in the documentation so I just sourced it from there: https://flower.ai/docs/framework/how-to-configure-logging.html