File tree Expand file tree Collapse file tree 3 files changed +54
-1
lines changed Expand file tree Collapse file tree 3 files changed +54
-1
lines changed Original file line number Diff line number Diff line change 1+ # Use an official Python runtime as a parent image
2+ FROM python:3.11-slim
3+
4+ # Set the working directory in the container
5+ WORKDIR /pdl
6+
7+ # Copy the current directory contents into the container at /app
8+ COPY . /pdl
9+
10+ # Install any needed dependencies specified in requirements.txt
11+ RUN pip install .
12+ RUN pip install '.[all]'
13+
14+
15+ # Run app.py when the container launches
16+ ENTRYPOINT ["pdl-local"]
Original file line number Diff line number Diff line change 1+ import os
2+ import subprocess
3+ import sys
4+
5+ WATSONX_APIKEY = "WATSONX_APIKEY=" + os .environ ["WATSONX_APIKEY" ]
6+ WATSONX_URL = "WATSONX_URL=" + os .environ ["WATSONX_URL" ]
7+ WATSONX_PROJECT_ID = "WATSONX_PROJECT_ID=" + os .environ ["WATSONX_PROJECT_ID" ]
8+ LOCAL_DIR = os .getcwd () + ":/local"
9+
10+
11+ def main ():
12+ subprocess .run (
13+ [
14+ "docker" ,
15+ "run" ,
16+ "-v" ,
17+ LOCAL_DIR ,
18+ "-w" ,
19+ "/local" ,
20+ "-e" ,
21+ WATSONX_APIKEY ,
22+ "-e" ,
23+ WATSONX_URL ,
24+ "-e" ,
25+ WATSONX_PROJECT_ID ,
26+ "--rm" ,
27+ "-it" ,
28+ "pdl-runner" ,
29+ * sys .argv [1 :],
30+ ],
31+ check = True ,
32+ )
33+
34+
35+ if __name__ == "__main__" :
36+ main ()
Original file line number Diff line number Diff line change @@ -60,4 +60,5 @@ Repository = "https://github.com/IBM/prompt-declaration-language"
6060Issues = " https://github.com/IBM/prompt-declaration-language/issues"
6161
6262[project .scripts ]
63- pdl = " pdl.pdl:main"
63+ pdl-local = " pdl.pdl:main"
64+ pdl = " pdl.pdl_runner:main"
You can’t perform that action at this time.
0 commit comments