-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding restart upon error capability * Finalize restart capability * Bump version * Change test settings to restart on error * Fix json schema dir * Bump version
- Loading branch information
Showing
29 changed files
with
340 additions
and
104 deletions.
There are no files selected for viewing
This file contains 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
Empty file.
This file contains 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 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import http.server | ||
import logging | ||
import pathlib as pl | ||
import socketserver | ||
import threading | ||
|
||
logging.basicConfig( | ||
level=logging.INFO, format="[%(filename)s:%(lineno)d] %(message)s" | ||
) | ||
logger = logging.getLogger(__name__) | ||
|
||
HTTP_PORT = 8888 | ||
|
||
|
||
def main(): | ||
http_dir_path = pl.Path(__file__).parent | ||
|
||
class HTTPHandler(http.server.SimpleHTTPRequestHandler): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__( | ||
*args, **kwargs, directory=http_dir_path.resolve() | ||
) | ||
|
||
try: | ||
logger.info( | ||
f"Starting http server at port {HTTP_PORT} and serving path {http_dir_path}" | ||
) | ||
with socketserver.TCPServer(("", HTTP_PORT), HTTPHandler) as httpd: | ||
httpd_thread = threading.Thread(target=httpd.serve_forever) | ||
httpd_thread.start() | ||
httpd.serve_forever() | ||
except Exception as err: # pylint: disable=broad-except | ||
logger.error(f"{err} . Stopping %s", exc_info=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
cd /docker/http | ||
python server.py & | ||
|
||
cd ${HOME} | ||
source ./venv/bin/activate | ||
python3 /docker/main.py |
Oops, something went wrong.