Skip to content

Commit

Permalink
Enhance shell provisioner in Packer configuration: add debug informat…
Browse files Browse the repository at this point in the history
…ion and improve installation commands
  • Loading branch information
Your Name committed May 9, 2025
1 parent 279030a commit 7e7b867
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,30 @@ build {

provisioner "shell" {
inline = [
"ls -la /tmp", # Debug: List contents of tmp directory
"pip3 install -r /tmp/requirements.txt -t /var/task",
"pip3 install /tmp -t /var/task", # Install the package itself
"cp /tmp/app.py /var/task/", # Copy the entry point file
"ls -la /var/task" # Debug: List contents of task directory
"echo '=== Debug: Listing directory contents ==='",
"ls -la /tmp",
"echo '=== Debug: Python version ==='",
"python3 --version",
"echo '=== Debug: Pip version ==='",
"pip3 --version",

"echo '=== Installing requirements.txt dependencies ==='",
"pip3 install --no-cache-dir -r /tmp/requirements.txt -t /var/task -v",

"echo '=== Installing pydantic explicitly ==='",
"pip3 install --no-cache-dir 'pydantic~=2.6' -t /var/task -v",

"echo '=== Installing package in development mode ==='",
"pip3 install --no-cache-dir -e /tmp -t /var/task -v",

"echo '=== Copying app.py to task root ==='",
"cp /tmp/app.py /var/task/",

"echo '=== Listing installed Python packages ==='",
"pip3 list",

"echo '=== Verifying task directory contents ==='",
"ls -la /var/task"
]
}

Expand Down

0 comments on commit 7e7b867

Please sign in to comment.