Open Geoffmoss77 opened 5 days ago
we manually pulled the image with : docker pull public.ecr.aws/sam/build-python3.11:latest-arm64
Hi @Geoffmoss77 Thanks for reporting and closing.. Glad you got it resolved. I'm unclear though, if there is a remaining defect.. you should not have needed to manually pull the image. Or was it a transient problem, do you think?
Hi Bob
Thanks for the reply, we are not sure. It just hangs, we've left it for hours, We are using cloud 9 instances for building.
I know you should not add 2 issues together, but we found the only way to deploy from cloud9 is using these commands, we tried multiple instances using AWS Linux, and switched to Ubuntu with the following.
sudo pip install virtualenv sudo apt remove python3-blinker sudo pip install aws-sam-cli --force cd amazon-transcribe-live-call-analytics/ ./publish.sh lca-ubt-249 lca-ubt-prfx-249 eu-west-2
After multiple failed builds we finally found that we were getting a 403 on https://s3.eu-west-2.amazonaws.com/lca-deploy-eu-west-2/lca-2309/0.9.2/lca-ai-stack/0.9.2/template.yaml
We stripped the Bot section from the code to bypass the stuck image pull, and we put Docker in debug mode but still did not get any errors :(
Thanks again for any assistance.
Thanks Geoff.. I'll try it again from scratch myself with a brand new EC2 instance. Will report back.
Not able to reproduce it, unfortunately (or fortunately) @Geoffmoss77 Here are my notes::
# developer tools & python/pip
sudo yum groupinstall "Development Tools"
sudo yum install python3
sudo yum install python3-pip
pip3 install virtualenv
# docker
sudo yum install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo usermod -a -G docker ssm-user
Log out and back in to apply docker changes
# sam cli
wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
unzip aws-sam-cli-linux-x86_64.zip -d ./sam-cli
sudo ./sam-cli/install
# node 18
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 18
AWS CLI credentials
aws configure
Clone LCA repo
git clone https://github.com/aws-samples/amazon-transcribe-live-call-analytics.git
cd amazon-transcribe-live-call-analytics/
./publish.sh bobs-test-lca-build testlca us-east-1
It all ran fine.. final output
Validating template: https://s3.us-east-1.amazonaws.com/bobs-test-lca-build-us-east-1/testlca/lca-main.yaml
OUTPUTS
Template URL: https://s3.us-east-1.amazonaws.com/bobs-test-lca-build-us-east-1/testlca/lca-main.yaml
CF Launch URL: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?templateURL=https://s3.us-east-1.amazonaws.com/bobs-test-lca-build-us-east-1/testlca/lca-main.yaml&stackName=LCA
CLI Deploy: aws cloudformation deploy --region us-east-1 --template-file /tmp/lca/lca-main.yaml --capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack-name LCA --parameter-overrides AdminEmail=jdoe@example.com CallAudioSource=Demo Asterisk PBX Server demoSoftphoneAllowedCidr=CIDRBLOCK siprecAllowedCidrList="" S3BucketName=""
Done
I claimed victory too soon.. Although the publish script did not hang, it appears it also failed to create the template for the nested AISTACK.. Digging..
I've started another Cloud 9 instance, let us know when you want me to test again :)
Also thanks
Different symptom and different root cause though..
PACKAGING lca-ai-stack
~/amazon-transcribe-live-call-analytics/lca-ai-stack/deployment ~/amazon-transcribe-live-call-analytics
make: bash: No such file or directory
make: *** [Makefile:39: out] Error 127
echo '[INFO] uploading sagemaker-summary-stack.yaml to s3://bobs-test-lca-build-us-east-1/testlca/0.9.2/lca-ai-stack/0.9.2/sagemaker-summary-stack.yaml'
When running make
in lca-ai-stack it's not finding the bash
command..
Tracked it down to this line in the Makefile.. which works on my AL2 Cloud9 build machine, but on the new AL 2023 instance it is effectively messing up the PATH. I'll continue digging.
It looks like the newer version of gnu make
does not like the "
characters in this line
I modified it from
export PATH := "$(VIRTUALENV_BUILD_BIN_DIR):$(VIRTUALENV_DEV_BIN_DIR):$(PATH)"
to
export PATH := $(VIRTUALENV_BUILD_BIN_DIR):$(VIRTUALENV_DEV_BIN_DIR):$(PATH)
which resolved the issue.. Now the publish script ran completely, this time correctly building the AISTACK template and artifacts as well.. No issues with sam containers.
I have a stack deploying currently to verify the build was all good, and i can see it's already deploying the nested AISTACK.. so we definately got past the point where you had been having the problem.
Here's the extract from the publish log for the sam part..
Starting Build use cache
Starting Build inside a container
Below nested stacks(s) specify non-local URL(s), which are unsupported:
- SageMakerTranscriptSummaryStack
- BedrockPreviewBoto3Stack
Skipping building resources inside these nested stacks.
Cache is invalid, running build and copying resources for following layers (TranscriptEnrichmentPythonLayer)
Building layer 'TranscriptEnrichmentPythonLayer'
WARNING: Layer 'TranscriptEnrichmentPythonLayer' has BuildArchitecture x86_64, which is not listed in CompatibleArchitectures
Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image......
Mounting /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_layers/transcript_enrichment_layer as /tmp/samcli/source:ro,delegated, inside runtime container
Running PythonPipBuilder:ResolveDependencies
Running PythonPipBuilder:CopySource
Cache is invalid, running build and copying resources for following functions (FetchTranscript)
Cache is invalid, running build and copying resources for following functions (LambdaCodeBuildStartBuild)
Building codeuri: /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/start_codebuild runtime: python3.11 architecture: x86_64 functions: LambdaCodeBuildStartBuild
Building codeuri: /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/fetch_transcript runtime: python3.11 architecture: x86_64 functions: FetchTranscript
Cache is invalid, running build and copying resources for following functions (LLMAnthropicSummaryLambda)
Cache is invalid, running build and copying resources for following functions (AsyncAgentAssistOrchestrator)
Building codeuri: /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/async_agent_assist_orchestrator runtime: python3.11 architecture: x86_64 functions: AsyncAgentAssistOrchestrator
Building codeuri: /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/llm_anthropic_summary_lambda runtime: python3.11 architecture: x86_64 functions: LLMAnthropicSummaryLambda
Cache is invalid, running build and copying resources for following functions (AsyncTranscriptSummaryOrchestrator)
Building codeuri: /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/async_transcript_summary_orchestrator runtime: python3.11 architecture: x86_64 functions: AsyncTranscriptSummaryOrchestrator
Cache is invalid, running build and copying resources for following functions (BedrockSummaryLambda)
Building codeuri: /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/bedrock_summary_lambda runtime: python3.11 architecture: x86_64 functions: BedrockSummaryLambda
Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image......
Mounting /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/start_codebuild as /tmp/samcli/source:ro,delegated, inside runtime container
Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image......
Mounting /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/fetch_transcript as /tmp/samcli/source:ro,delegated, inside runtime container
Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image......
Mounting /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/async_agent_assist_orchestrator as /tmp/samcli/source:ro,delegated, inside runtime container
Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image......
Mounting /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/llm_anthropic_summary_lambda as /tmp/samcli/source:ro,delegated, inside runtime container
Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image......
Mounting /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/bedrock_summary_lambda as /tmp/samcli/source:ro,delegated, inside runtime container
Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image......
Mounting /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/async_transcript_summary_orchestrator as /tmp/samcli/source:ro,delegated, inside runtime container
Running PythonPipBuilder:ResolveDependencies
requirements.txt file not found. Continuing the build without dependencies.
Running PythonPipBuilder:CopySource
requirements.txt file not found. Continuing the build without dependencies.
Running PythonPipBuilder:CopySource
Cache is invalid, running build and copying resources for following functions (CallEventProcessorFunction)
Building codeuri: /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/call_event_processor runtime: python3.11 architecture: arm64 functions: CallEventProcessorFunction
Running PythonPipBuilder:ResolveDependencies
requirements.txt file not found. Continuing the build without dependencies.
Running PythonPipBuilder:CopySource
Running PythonPipBuilder:ResolveDependencies
Fetching public.ecr.aws/sam/build-python3.11:latest-arm64 Docker container image.......................................... Running PythonPipBuilder:CopySource
.................................................................. Running PythonPipBuilder:CopySource
... Running PythonPipBuilder:CopySource
................................................................................................................................................................................................................................................................................................................................................................................................................
Mounting /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/call_event_processor as /tmp/samcli/source:ro,delegated, inside runtime container
Running PythonPipBuilder:ResolveDependencies
Running PythonPipBuilder:CopySource
Build Succeeded
Built Artifacts : .aws-sam/build
Built Template : .aws-sam/build/template.yaml
I will log two separate issues.. (1) Make fails to find bash (with new version of gnu make (4.3) #190 (2) Publish script fails to detect make failure in lca-ai-stack during build.. #191
For now, can you try again, @Geoffmoss77 ?
Try doing it exactly as i did it above, but edit the file lca-ai-stack/Makefile
line 130 first, exactly as shown above.
Make sure you provision your instance with at least 100Gb storage - in case the hanging issue is related to insufficient space.. (I have a feeling we encountered something like that before)
I just pushed PR #192 to develop to address the incidental issues logged above (#190 and #191)
@Geoffmoss77 Feel free to checkout develop
branch from the repo to do your build test..
Thank you Bob will deploy and report, Thanks again
Hi Bob I ran : ./publish.sh lca-ubt-249-bobtest lca-ubt-prfx-249-bobtest eu-west-2 from a fresh pull
Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image................................................................................................................................................................................................................................................................................................................
Mounting /home/ec2-user/environment/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_layers/transcript_enrichment_layer as /tmp/samcli/source:ro,delegated, inside runtime container
Error: Container does not exist. Cannot get logs for this container
Traceback:
File "click/core.py", line 1078, in main
File "click/core.py", line 1688, in invoke
File "click/core.py", line 1434, in invoke
File "click/core.py", line 783, in invoke
File "samcli/cli/cli_config_file.py", line 347, in wrapper
File "click/decorators.py", line 92, in new_func
File "click/core.py", line 783, in invoke
File "samcli/lib/telemetry/metric.py", line 185, in wrapped
File "samcli/lib/telemetry/metric.py", line 150, in wrapped
File "samcli/lib/utils/version_checker.py", line 43, in wrapped
File "samcli/cli/main.py", line 95, in wrapper
File "samcli/commands/build/command.py", line 175, in cli
File "samcli/commands/build/command.py", line 264, in do_cli
File "samcli/commands/build/build_context.py", line 284, in run
File "samcli/lib/build/app_builder.py", line 225, in build
File "samcli/lib/build/build_strategy.py", line 413, in build
File "samcli/lib/build/build_strategy.py", line 82, in build
File "samcli/lib/build/build_strategy.py", line 416, in _build_layers
File "samcli/lib/build/build_strategy.py", line 435, in _run_builds_async
File "samcli/lib/utils/async_utils.py", line 137, in run_async
File "samcli/lib/utils/async_utils.py", line 96, in run_given_tasks_async
File "asyncio/base_events.py", line 653, in run_until_complete
File "samcli/lib/utils/async_utils.py", line 62, in _run_given_tasks_async
File "concurrent/futures/thread.py", line 58, in run
File "samcli/lib/build/build_strategy.py", line 443, in build_single_layer_definition
File "samcli/lib/build/build_strategy.py", line 608, in build_single_layer_definition
File "samcli/lib/build/build_strategy.py", line 358, in build_single_layer_definition
File "samcli/lib/build/build_strategy.py", line 239, in build_single_layer_definition
File "samcli/lib/build/app_builder.py", line 566, in _build_layer
File "samcli/lib/build/app_builder.py", line 958, in _build_function_on_container
File "samcli/local/docker/container.py", line 460, in wait_for_logs
An unexpected error was encountered while executing "sam build".
Search for an existing issue:
https://github.com/aws/aws-sam-cli/issues?q=is%3Aissue+is%3Aopen+Bug%3A%20sam%20build%20-%20RuntimeError
Or create a bug report:
https://github.com/aws/aws-sam-cli/issues/new?template=Bug_report.md&title=Bug%3A%20sam%20build%20-%20RuntimeError
make: *** [Makefile:292: out/template-packaged-lca-ubt-249-bobtest-eu-west-2-lca-ubt-prfx-249-bobtest_0.9.2_lca-ai-stack-0.9.2.yaml] Error 1
Do I need to add another dependency?
Hi Geoff, Can you reproduce my successful build by replicating everything exactly as I had noted? In theory that should work, and then we can establish that as a baseline, to figure out what's different in the one that fails. Eg instance size, storage, versions, different region, etc.
On Sep 25, 2024 8:53 AM, Geoffrey Rowland @.***> wrote:
Hi Bob I ran : ./publish.sh lca-ubt-249-bobtest lca-ubt-prfx-249-bobtest eu-west-2 from a fresh pull
`Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image................................................................................................................................................................................................................................................................................................................ Mounting /home/ec2-user/environment/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_layers/transcript_enrichment_layer as /tmp/samcli/source:ro,delegated, inside runtime container
Error: Container does not exist. Cannot get logs for this container Traceback: File "click/core.py", line 1078, in main File "click/core.py", line 1688, in invoke File "click/core.py", line 1434, in invoke File "click/core.py", line 783, in invoke File "samcli/cli/cli_config_file.py", line 347, in wrapper File "click/decorators.py", line 92, in new_func File "click/core.py", line 783, in invoke File "samcli/lib/telemetry/metric.py", line 185, in wrapped File "samcli/lib/telemetry/metric.py", line 150, in wrapped File "samcli/lib/utils/version_checker.py", line 43, in wrapped File "samcli/cli/main.py", line 95, in wrapper File "samcli/commands/build/command.py", line 175, in cli File "samcli/commands/build/command.py", line 264, in do_cli File "samcli/commands/build/build_context.py", line 284, in run File "samcli/lib/build/app_builder.py", line 225, in build File "samcli/lib/build/build_strategy.py", line 413, in build File "samcli/lib/build/build_strategy.py", line 82, in build File "samcli/lib/build/build_strategy.py", line 416, in _build_layers File "samcli/lib/build/build_strategy.py", line 435, in _run_builds_async File "samcli/lib/utils/async_utils.py", line 137, in run_async File "samcli/lib/utils/async_utils.py", line 96, in run_given_tasks_async File "asyncio/base_events.py", line 653, in run_until_complete File "samcli/lib/utils/async_utils.py", line 62, in _run_given_tasks_async File "concurrent/futures/thread.py", line 58, in run File "samcli/lib/build/build_strategy.py", line 443, in build_single_layer_definition File "samcli/lib/build/build_strategy.py", line 608, in build_single_layer_definition File "samcli/lib/build/build_strategy.py", line 358, in build_single_layer_definition File "samcli/lib/build/build_strategy.py", line 239, in build_single_layer_definition File "samcli/lib/build/app_builder.py", line 566, in _build_layer File "samcli/lib/build/app_builder.py", line 958, in _build_function_on_container File "samcli/local/docker/container.py", line 460, in wait_for_logs
An unexpected error was encountered while executing "sam build". Search for an existing issue: https://github.com/aws/aws-sam-cli/issues?q=is%3Aissue+is%3Aopen+Bug%3A%20sam%20build%20-%20RuntimeError Or create a bug report: https://github.com/aws/aws-sam-cli/issues/new?template=Bug_report.md&title=Bug%3A%20sam%20build%20-%20RuntimeError make: *** [Makefile:292: out/template-packaged-lca-ubt-249-bobtest-eu-west-2-lca-ubt-prfx-249-bobtest_0.9.2_lca-ai-stack-0.9.2.yaml] Error 1 `
Do I need to add another dependency?
— Reply to this email directly, view it on GitHubhttps://github.com/aws-samples/amazon-transcribe-live-call-analytics/issues/189#issuecomment-2374004051, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACTSFHRBH6LIOO4XBWVQE23ZYKW5BAVCNFSM6AAAAABOWPKTX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZUGAYDIMBVGE. You are receiving this because you commented.Message ID: @.***>
Hi Bob Seems to have got stuck at
will give it a few could this be a docker version issue?
This is what I have:
OS: Amazon Linux 2023 Instance type: t2.large Storage: 100Gb Default VPC
commands run:
sudo -i yum groupinstall "Development Tools" -y yum install python3 -y yum install python3-pip -y pip3 install virtualenv yum install npm yum install docker -y systemctl enable docker systemctl start docker <-- not sure why but the script could not see docker could even though it was running sudo usermod -a -G docker ec2-user sudo usermod -a -G docker ssm-user <-- this user not found git clone https://github.com/aws-samples/amazon-transcribe-live-call-analytics.git imported AWS creds from login screen cd /home/ec2-user/amazon-transcribe-live-call-analytics/ ./publish.sh bob-test-eu-west-2 bob-test-deploy eu-west-2
will try US now
On a corporate network and can't access US servers
I wish I could explain this.. Any more luck @Geoffmoss77 ? I'll try one more time myself, repeating the experiment I posted above, previously successful, and see what happens.. @kishd - you have also experienced same/similar issues - please post if you make any breakthrough on root cause. Tx.
So... I thought I'd record a screen video of me setting up a new EC2, exactly as I did a couple of days ago, and prove beyond doubt that it works... Well.. this time it didn't.. i followed my own script exactly - and this time it's hung Mounting /home/ssm-user/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/call_event_processor as /tmp/samcli/source:ro,delegated, inside runtime container
- same as you!
But - at least now I have reproduced the issue.. and am more motivated than ever to help you get to the bottom of it! It's the weekend now, but @kishd and I will dig deep next week - there has got to be a solution!
Hope you have a great weekend!
Describe the bug docker build of Fetching public.ecr.aws/sam/build-python3.11:latest-arm64 Docker container image................................................................................................................................................................................................................................................................................................................................................................................................................................... Mounting /home/ec2-user/environment/aws/amazon-transcribe-live-call-analytics/lca-ai-stack/source/lambda_functions/call_event_processor as /tmp/samcli/source:ro,delegated, inside runtime container
stuck for hours
To Reproduce Steps to reproduce the behavior:
Expected behavior build job for link to AWS and template file
Screenshots
Additional context Add any other context about the problem here.