-
-
Notifications
You must be signed in to change notification settings - Fork 3
Fixes for SR2024 image #212
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
Open
WillB97
wants to merge
15
commits into
main
Choose a base branch
from
wbb/sr2024-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d4cdd15
Execute the subprocess in the same python as astprocd
WillB97 5bc499f
Correct wifi channel
WillB97 eb553df
Fix python 3.11 support
WillB97 dde4f99
Fix requirements
WillB97 74121a7
Support getting custom version info from /etc/srobo-release
WillB97 f48a753
Tweak CI
WillB97 bd06324
Mostly fix types
WillB97 c32e036
Bump Astoria version fro release
WillB97 7f54025
Update poetry lock
WillB97 e0c047d
Skip building docs in Python 3.11
WillB97 5a6feed
Remove disallow_any_explicit constraint
WillB97 1189ed6
Update CI version release
WillB97 10cb05b
Make log files sync to disk
WillB97 fdda23f
Merge pull request #213 from srobo/wbb/sync-logs
WillB97 0007031
Bump version to 0.11.3
WillB97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,4 +4,4 @@ | |
| "__version__", | ||
| ] | ||
|
|
||
| __version__ = "0.11.1" | ||
| __version__ = "0.11.3" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,9 @@ | |
|
|
||
| import asyncio | ||
| import logging | ||
| import sys | ||
| from datetime import datetime, timedelta | ||
| from os import environ | ||
| from os import environ, fsync | ||
| from signal import SIGKILL, SIGTERM | ||
| from string import Template | ||
| from typing import IO, Callable, Dict, Optional | ||
|
|
@@ -110,7 +111,7 @@ async def run_process(self) -> None: | |
| ) | ||
| self._process_end_event.clear() | ||
| self._process = await asyncio.create_subprocess_exec( | ||
| "python3", | ||
| sys.executable, | ||
| "-u", | ||
| self._entrypoint, | ||
| stdin=asyncio.subprocess.DEVNULL, | ||
|
|
@@ -207,6 +208,7 @@ def log( | |
| ) -> None: | ||
| fh.write(data) | ||
| fh.flush() | ||
| fsync(fh.fileno()) | ||
|
Member
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. Thank you for adding this, we had too many issues with logs not being synced to disk. |
||
| self._log_helper.send( | ||
| pid=pid, | ||
| priority=log_line_idx, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
| Match, | ||
| Optional, | ||
| TypeVar, | ||
| Union, | ||
| ) | ||
| from uuid import UUID | ||
|
|
||
|
|
@@ -25,7 +26,7 @@ | |
|
|
||
| LOGGER = logging.getLogger(__name__) | ||
|
|
||
| Handler = Callable[[Match[str], str], Coroutine[Any, Any, None]] # type: ignore | ||
| Handler = Callable[[Match[str], str], Coroutine[Any, Any, None]] | ||
| RequestT = TypeVar("RequestT", bound=ManagerRequest) | ||
|
|
||
|
|
||
|
|
@@ -230,12 +231,14 @@ async def wait_dependencies(self) -> None: | |
| if len(self._dependencies) > 0: | ||
| LOGGER.debug("Waiting for " + ", ".join(self._dependencies)) | ||
|
|
||
| tasks = [asyncio.gather( | ||
| *(event.wait() for event in self._dependency_events.values()), | ||
| )] | ||
| tasks: List[Union[asyncio.Future[Any], asyncio.Task[Any]]] = [ | ||
|
Member
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. Question: Should this |
||
| asyncio.gather( | ||
| *(event.wait() for event in self._dependency_events.values()), | ||
| ), | ||
| ] | ||
|
|
||
| if self._no_dependency_event is not None: | ||
| tasks.append(self._no_dependency_event.wait()) # type: ignore | ||
| tasks.append(asyncio.create_task(self._no_dependency_event.wait())) | ||
|
|
||
| await asyncio.wait( | ||
| tasks, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is a very neat way of handling this.