Open obayesshelton opened 2 years ago
@BethanyZhou , please help to look into it.
Hi @obayesshelton ,
Could you check your command or script whether terminates on your local environment? Seems like your script is under python interactive mode. For non-terminating case, we will look forward to user's next input or Ctrl-C.
Hi @BethanyZhou
When using Powershell via terminal on my Apple laptop the output is as followed and it does terminate fine
PS /Users/oliver/Projects/byobeta> Invoke-AzContainerInstanceCommand -ContainerGroupName byob-feature-product-engine -ContainerName byob-feature-product-engine-one -ResourceGroupName DevApplication -Command "npm run script_eod_daily_equity_prices"
> byobeta@1.0.0 script_eod_daily_equity_prices
> python -c 'from etl.tasks import *; process_eod_daily_equity_prices()'
Getting Price for:BGFD.LSE
https://eodhistoricaldata.com/api/eod/BGFD.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:BDEV.LSE
https://eodhistoricaldata.com/api/eod/BDEV.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:BWY.LSE
https://eodhistoricaldata.com/api/eod/BWY.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:VTY.LSE
https://eodhistoricaldata.com/api/eod/VTY.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:GNS.LSE
https://eodhistoricaldata.com/api/eod/GNS.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:AV.LSE
https://eodhistoricaldata.com/api/eod/AV.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:DGE.LSE
https://eodhistoricaldata.com/api/eod/DGE.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:BDEV.LSE
https://eodhistoricaldata.com/api/eod/BDEV.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:HLMA.LSE
https://eodhistoricaldata.com/api/eod/HLMA.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:HNE.LSE
https://eodhistoricaldata.com/api/eod/HNE.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:LGEN.LSE
https://eodhistoricaldata.com/api/eod/LGEN.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:BRWM.LSE
https://eodhistoricaldata.com/api/eod/BRWM.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:SCP.LSE
https://eodhistoricaldata.com/api/eod/SCP.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:OXT.LSE
https://eodhistoricaldata.com/api/eod/OXT.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
ETLException, OXT.LSE , Cannot find EOD Price for:OXT.LSE
Getting Price for:OXIG.LSE
https://eodhistoricaldata.com/api/eod/OXIG.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:PSN.LSE
https://eodhistoricaldata.com/api/eod/PSN.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:UTG.LSE
https://eodhistoricaldata.com/api/eod/UTG.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:PRU.LSE
https://eodhistoricaldata.com/api/eod/PRU.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:LIO.LSE
https://eodhistoricaldata.com/api/eod/LIO.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:SSE.LSE
https://eodhistoricaldata.com/api/eod/SSE.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:SRP.LSE
https://eodhistoricaldata.com/api/eod/SRP.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:MGNS.LSE
https://eodhistoricaldata.com/api/eod/MGNS.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Getting Price for:LLOY.LSE
https://eodhistoricaldata.com/api/eod/LLOY.LSE?from=2022-01-18&to=2022-01-19&period=d&api_token=6156d42b6df943.72036216&fmt=json
Equity - Daily Prices Saved: 22/23 :-1:
Equity - Daily Prices Not Found: 1 :-1:
Equity - Missing Daily Prices: OXT.LSE
:white_check_mark: Background task: Process EOD Daily Equity Prices For Products V2
PS /Users/oliver/Projects/byobeta>
Is there some sort of response we could return via the script for Invoke-AzContainerInstanceCommand
to end?
At the moment I have to stop the Runbook job daily which isn't the end of the world but it is not clean.
Thank you @obayesshelton for your information.
At the moment I have to stop the Runbook job daily which isn't the end of the world but it is not clean.
Is there some sort of response we could return via the script for Invoke-AzContainerInstanceCommand to end?
Invoke-AzContainerInstanceCommand -ContainerGroupName byob-feature-product-engine -ContainerName byob-feature-product-engine-one -ResourceGroupName DevApplication -Command "npm run script_eod_daily_equity_prices -Debug"
Hey @BethanyZhou as per the other ticket. This doesn't work.
The script finishes and completes as I can see things in the database etc but PowerShell doesn't know it has completed.
Adjust it to feature request because it requires additional implementation. We will check how API of PowerShell can handle it.
Same issue; the runbook with Invoke script appears in the test pane as running forever
@obayesshelton @jucabot how about adding exit() at the end of python command like "python -c 'from etl.tasks import *; process_eod_daily_equity_prices();exit()'"?
Please let me know if it works. If not, I guess I have to find an expert in runbook for help.
Seeing the same issue in PowerShell7 runbooks using Az.ContainerInstance v3.1.0
Here's a test runbook that stays Running forever in a sleep
-ing debian:bullseye container:
Write-Output "Connecting to Azure with MSI..."
Connect-AzAccount -Identity -ErrorAction Stop | Format-Table
$resourceGroupName = Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName
$acg = Get-AzContainerGroup -Name $containerGroupName -ResourceGroupName $resourceGroupName
Invoke-AzContainerInstanceCommand `
-ResourceGroupName $acg.ResourceGroupName `
-ContainerGroupName $acg.Name `
-ContainerName $acg.Container[0].Name `
-Command '/bin/echo "hello"'
@BethanyZhou didn't fix the issue. It also seems now things are running twice.
Not going to lie but this is the worse feature in the entire Azure library.
@obayesshelton , @baldwicc, @jucabot , To clear the environment, did you meet this issue on Azure Automation Runbooks 7.1?
On both @BethanyZhou
Description
Hi,
I am running
RunBook Version 7.1
and the latest ContainerInstance modules. The script runs fine and I can see the commands being executed on the container instance. However the script never stops. My script is as followed:Is seems as though the
Invoke-AzContainerInstanceCommand
isn't returning a success code or something for the script to know it has finished.Issue script & Debug output
Environment data
Module versions
Error output