-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update some deprecated functions, add configurable temp dir for stori…
…ng graph data
- Loading branch information
1 parent
eb0eb8d
commit 4b229cd
Showing
16 changed files
with
102 additions
and
50 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
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 |
---|---|---|
|
@@ -15,4 +15,6 @@ scan*.txt | |
|
||
# temp | ||
.env_local | ||
.env | ||
.env | ||
|
||
.vscode/ |
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 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 |
---|---|---|
|
@@ -2,7 +2,10 @@ | |
name = "routing-graph-packager" | ||
version = "1.0.0b" | ||
description = "Backend to generate packages of routing graphs for FOSS routing engines in a job queue." | ||
authors = ["Nils Nolde <[email protected]>"] | ||
authors = [ | ||
"Nils Nolde <[email protected]>", | ||
"Christian Beiwinkel <[email protected]>", | ||
] | ||
license = "MIT" | ||
packages = [{ include = "routing_packager_app" }] | ||
|
||
|
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ class BaseSettings(_BaseSettings): | |
CORS_ORIGINS: List[str] = ["*"] | ||
|
||
DATA_DIR: Path = BASE_DIR.joinpath("data") | ||
TMP_DATA_DIR: Path = BASE_DIR.joinpath("tmp_data") | ||
VALHALLA_URL: str = "http://localhost" | ||
|
||
ENABLED_PROVIDERS: list[str] = list(CommaSeparatedStrings("osm")) | ||
|
@@ -52,7 +53,7 @@ def get_valhalla_path(self, port: int) -> Path: # pragma: no cover | |
Return the path to the OSM Valhalla instances. | ||
""" | ||
if port in (8002, 8003): | ||
p = self.get_data_dir().joinpath(Providers.OSM.lower(), str(port)) | ||
p = self.get_tmp_data_dir().joinpath(Providers.OSM.lower(), str(port)) | ||
p.mkdir(exist_ok=True, parents=True) | ||
return p | ||
raise ValueError(f"{port} is not a valid port for Valhalla.") | ||
|
@@ -68,6 +69,15 @@ def get_data_dir(self) -> Path: | |
data_dir = Path("/app/data") | ||
|
||
return data_dir | ||
|
||
def get_tmp_data_dir(self) -> Path: | ||
tmp_data_dir = self.TMP_DATA_DIR | ||
# if we're inside a docker container, we need to reference the fixed directory instead | ||
# Watch out for CI, also runs within docker | ||
if os.path.isdir("/app") and not os.getenv("CI", None): # pragma: no cover | ||
tmp_data_dir = Path("/app/tmp_data") | ||
|
||
return tmp_data_dir | ||
|
||
|
||
class ProdSettings(BaseSettings): | ||
|
@@ -87,6 +97,7 @@ class TestSettings(BaseSettings): | |
POSTGRES_PASS: str = "admin" | ||
|
||
DATA_DIR: Path = BASE_DIR.joinpath("tests", "data") | ||
TMP_DATA_DIR: Path = BASE_DIR.joinpath("tests", "tmp_data") | ||
|
||
ADMIN_EMAIL: str = "[email protected]" | ||
ADMIN_PASS: str = "admin" | ||
|
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
Oops, something went wrong.