Remove legacy build args
This commit is contained in:
@@ -1,12 +1,5 @@
|
|||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
ARG TASK_TYPE
|
|
||||||
ARG GPU_TYPE
|
|
||||||
ARG FRAMEWORK
|
|
||||||
|
|
||||||
ENV TASK_TYPE=${TASK_TYPE}
|
|
||||||
ENV GPU_TYPE=${GPU_TYPE}
|
|
||||||
ENV FRAMEWORK=${FRAMEWORK}
|
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -7,7 +7,7 @@ It satisfies the runtime contract from the parent README:
|
|||||||
- Root-level `Dockerfile`
|
- Root-level `Dockerfile`
|
||||||
- Listens on port `8080`
|
- Listens on port `8080`
|
||||||
- Exposes `GET /health`
|
- Exposes `GET /health`
|
||||||
- Reads `TASK_TYPE`, `GPU_TYPE`, `FRAMEWORK`, and `EXTERNAL_SERVICE_TOKEN`
|
- Reads `EXTERNAL_SERVICE_TOKEN`
|
||||||
- Handles `SIGTERM` for graceful shutdown
|
- Handles `SIGTERM` for graceful shutdown
|
||||||
|
|
||||||
## Local Run
|
## Local Run
|
||||||
@@ -21,11 +21,7 @@ curl http://localhost:8080/
|
|||||||
## Build Locally
|
## Build Locally
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build \
|
docker build -t strategy-demo:v1.0.0 .
|
||||||
--build-arg TASK_TYPE=validation \
|
|
||||||
--build-arg GPU_TYPE=amd64 \
|
|
||||||
--build-arg FRAMEWORK=pytorch \
|
|
||||||
-t strategy-demo:v1.0.0 .
|
|
||||||
|
|
||||||
docker run --rm -p 8080:8080 strategy-demo:v1.0.0
|
docker run --rm -p 8080:8080 strategy-demo:v1.0.0
|
||||||
```
|
```
|
||||||
@@ -38,9 +34,6 @@ Push this directory to Gitea and keep the `v1.0.0` tag. Then create a strategy w
|
|||||||
{
|
{
|
||||||
"name": "strategy-demo",
|
"name": "strategy-demo",
|
||||||
"repo_url": "https://<your-gitea-host>/<user>/strategy-demo",
|
"repo_url": "https://<your-gitea-host>/<user>/strategy-demo",
|
||||||
"tag": "v1.0.0",
|
"tag": "v1.0.0"
|
||||||
"task_type": "validation",
|
|
||||||
"gpu_type": "amd64",
|
|
||||||
"framework": "pytorch"
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
3
main.py
3
main.py
@@ -12,9 +12,6 @@ shutdown_requested = False
|
|||||||
def _config() -> dict:
|
def _config() -> dict:
|
||||||
token = os.getenv("EXTERNAL_SERVICE_TOKEN", "")
|
token = os.getenv("EXTERNAL_SERVICE_TOKEN", "")
|
||||||
return {
|
return {
|
||||||
"task_type": os.getenv("TASK_TYPE", ""),
|
|
||||||
"gpu_type": os.getenv("GPU_TYPE", ""),
|
|
||||||
"framework": os.getenv("FRAMEWORK", ""),
|
|
||||||
"external_service_token_present": bool(token),
|
"external_service_token_present": bool(token),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user