-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local dev setup with vscode & some tiny fixes (#128)
* some tiny fixes * add local dev setup
- Loading branch information
Showing
8 changed files
with
127 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,4 @@ docs/_build/* | |
cover/* | ||
MANIFEST | ||
|
||
.vscode | ||
venv | ||
|
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,24 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Docker: Python - Flask", | ||
"type": "docker", | ||
"request": "launch", | ||
"preLaunchTask": "docker-run: debug", | ||
"python": { | ||
"pathMappings": [ | ||
{ | ||
"localRoot": "${workspaceFolder}", | ||
"remoteRoot": "/src/openeo_grass_gis_driver" | ||
} | ||
], | ||
"projectType": "flask" | ||
}, | ||
"dockerServerReadyAction": { | ||
"action": "openExternally", | ||
"pattern": "Running on (https?://\\S+|[0-9]+)", | ||
"uriFormat": "%s://localhost:%s/api/v1.0/collections" | ||
} | ||
} | ||
] | ||
} |
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,48 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "docker-build", | ||
"label": "docker-build", | ||
"platform": "python", | ||
"dockerBuild": { | ||
"tag": "openeograssgisdriver:latest", | ||
"dockerfile": "${workspaceFolder}/docker/dev/Dockerfile", | ||
"context": "${workspaceFolder}" | ||
// "pull": true | ||
} | ||
}, | ||
{ | ||
"type": "docker-run", | ||
"label": "docker-run: debug", | ||
"dependsOn": [ | ||
"docker-build" | ||
], | ||
"python": { | ||
"args": [ | ||
"run", | ||
"--no-debugger", | ||
// "--no-reload", | ||
"--host", | ||
"0.0.0.0", | ||
"--port", | ||
"5000" | ||
], | ||
"module": "flask" | ||
// "file": "dev.py" | ||
}, | ||
"dockerRun": { | ||
"remove": true, | ||
// network host is needed when connecting to a local actinia | ||
// while not using docker-compose network | ||
"network": "host", | ||
"volumes": [{ | ||
"localPath": "${workspaceFolder}", | ||
"containerPath": "/src/openeo_grass_gis_driver", | ||
"permissions": "rw" | ||
}] | ||
}, | ||
|
||
} | ||
] | ||
} |
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,23 @@ | ||
FROM mundialis/openeo-grassgis-driver:latest as base | ||
|
||
# Keeps Python from generating .pyc files in the container | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
# Turns off buffering for easier container logging | ||
ENV PYTHONUNBUFFERED=1 | ||
ENV FLASK_APP=openeo_grass_gis_driver.main | ||
ENV FLASK_ENV=development | ||
ENV FLASK_DEBUG=1 | ||
ENV DEFAULT_CONFIG_PATH=/src/openeo_grass_gis_driver/config | ||
|
||
RUN apk add make git | ||
|
||
RUN pip3 uninstall openeo-grass-gis-driver -y | ||
|
||
COPY . /src/openeo_grass_gis_driver/ | ||
COPY config/sample.ini /src/openeo_grass_gis_driver/config/config.ini | ||
|
||
WORKDIR /src/openeo_grass_gis_driver/ | ||
RUN pip3 install -e . | ||
|
||
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug | ||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "openeo_grass_gis_driver.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
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