Is there any way to get logs from Garden Exec?
# 🌱|help-and-getting-started
a
I have a script running through a Garden Exec in a workflow. The step's
{steps.step.log}
just outputs "Step command includes global options that will be ignored...". Nothing else in the steps object has any of the logs I'd expect from my script. Is there any way to save or bubble stdout that happens within the Garden Exec, or do I need to just save to file from the script in question? Thanks!
q
Hi @aloof-gpu-13406 if there's nothing sensitive in your exec workflow are you able to paste a repoducible example here?
a
workflows.garden.yaml
Copy code
kind: Workflow
steps:
  - name: hideslogs
    script: |
      garden exec --interactive=false whereIWantScriptToExectute "runscript.sh"
runscript.sh
(Python script using
@click
.echo to stdout) Whether I define it as a script or a command step, stdout ranges from (1) graph resolution logs then nothing from my actual script to (2) no logs at all. When I pipe the stdout, same thing. I could change the script to log to file, but then I'd need to do some file mounting to get that log file out, and it feels like there should be a way to just bubble stdout up through the garden exec Note: Since my original question, I was able to test - running the garden exec command from the command line seemed to show the logs in stdout that we expected, so the cause of this issue is with the Garden workflow, not the garden exec command
I might have actually figured out a way to pipe them out that should work, but runs into a type casting error from the cryptography package that garden core uses... Will dump an error log for that later
(when using
garden exec --interactive=false whereIWantScriptToExectute logs.log<(runscript.sh)
)
Running a kubectl exec in the script step of the workflow instead of garden exec results in seeing the logs.
@quaint-dress-831 is there any more info I can provide? I have a workaround (kubectl) but would love to start tracking the issue with garden exec/garden workflow combo suppressing logs
q
Hi @aloof-gpu-13406 I'm on vacation from today until the 20th (I believe near you if you are from Bellevue as your username suggests)! I'm pinging @ancient-diamond-80011 in the interim
a
Sorry to bother you in that case! Hope you enjoy the visit and time off! Thank you plenty! (And yes, Bellevue!)
a
sorry for the delay! 🙇‍♂️ pinging @glamorous-caravan-26619, this could be more under your area of expertise
a
Thanks!
I created an issue on GitHub to help track this. Dump of the info from this thread. https://github.com/garden-io/garden/issues/3536
a
thank you! 💚
g
Thanks @aloof-gpu-13406 will take a look
Hey @aloof-gpu-13406, thanks for creating the github issue, it does look like a bug, I'll leave it with the core team from here and follow along on the issue.
a
Thank you!
4 Views