Skip to content

Commit 7e7b867

Browse files
author
Your Name
committed
Enhance shell provisioner in Packer configuration: add debug information and improve installation commands
1 parent 279030a commit 7e7b867

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

packer.pkr.hcl

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,30 @@ build {
4040

4141
provisioner "shell" {
4242
inline = [
43-
"ls -la /tmp", # Debug: List contents of tmp directory
44-
"pip3 install -r /tmp/requirements.txt -t /var/task",
45-
"pip3 install /tmp -t /var/task", # Install the package itself
46-
"cp /tmp/app.py /var/task/", # Copy the entry point file
47-
"ls -la /var/task" # Debug: List contents of task directory
43+
"echo '=== Debug: Listing directory contents ==='",
44+
"ls -la /tmp",
45+
"echo '=== Debug: Python version ==='",
46+
"python3 --version",
47+
"echo '=== Debug: Pip version ==='",
48+
"pip3 --version",
49+
50+
"echo '=== Installing requirements.txt dependencies ==='",
51+
"pip3 install --no-cache-dir -r /tmp/requirements.txt -t /var/task -v",
52+
53+
"echo '=== Installing pydantic explicitly ==='",
54+
"pip3 install --no-cache-dir 'pydantic~=2.6' -t /var/task -v",
55+
56+
"echo '=== Installing package in development mode ==='",
57+
"pip3 install --no-cache-dir -e /tmp -t /var/task -v",
58+
59+
"echo '=== Copying app.py to task root ==='",
60+
"cp /tmp/app.py /var/task/",
61+
62+
"echo '=== Listing installed Python packages ==='",
63+
"pip3 list",
64+
65+
"echo '=== Verifying task directory contents ==='",
66+
"ls -la /var/task"
4867
]
4968
}
5069

0 commit comments

Comments
 (0)