cold-nightfall-99450
09/06/2023, 1:17 PMecs
(ec2 launch type), vpc
, load balacner
and container registry
.
I have minimum-size fastapi
application (with literally 1 route saying "Hello world")
When I create stack, it is up and running.
When I change source code (say, return "Hello World 1!") and tag correspondingly, i see that:
- new task is created
- old task is inactive
- old task is running, new task is not deployed
Same issue is described here for terraform
https://github.com/hashicorp/terraform/issues/11253
What i've tried:
- in github issue above it is suggested to use dynamic port mapping. turned out not applicable for my stack, since I use awsvpc
- changed max size of ec2 instances from 1 to 2 in autoscale group (weird, i know, just tried)
- changed ec2 instance from t2.micro
to c6i.large
in case there is not enough memory
I see no information in `Events`: when stack returns no error, there are no logs in Events
in AWS console either, i just see inactive task.
Any suggestions what else to look to?
P.S.
I would appreciate if anyone suggest how to at least view logs, since I can only view logs if running application, but not of tasks deployment.billowy-army-68599
cold-nightfall-99450
09/06/2023, 2:02 PMbillowy-army-68599
billowy-army-68599
cold-nightfall-99450
09/06/2023, 2:05 PMbillowy-army-68599
cold-nightfall-99450
09/06/2023, 2:14 PMcold-nightfall-99450
09/06/2023, 2:15 PMbillowy-army-68599
cold-nightfall-99450
09/06/2023, 2:16 PMbillowy-army-68599
cold-nightfall-99450
09/06/2023, 2:18 PMfastapi_image = docker.Image("fastapi-dockerimage",
image_name=app_ecr_repo.repository_url.apply(lambda x: f"{x}:tag2"),
build=docker.DockerBuildArgs(
context="..",
dockerfile="../Dockerfile",
platform="linux/amd64"
),
skip_push=False,
registry=app_registry
)
billowy-army-68599
cold-nightfall-99450
09/06/2023, 3:17 PMbillowy-army-68599
cold-nightfall-99450
09/06/2023, 4:23 PMcold-nightfall-99450
09/06/2023, 7:51 PMec2
instance type to c6i.large
itself didn't trigger instance recreation. it affected autoscaling group
parameters, so when I terminated instance (that still remained t2.micro
), new one was created with type of c6i.large
and all changes were applied.
after that, each time I change code and run pulumi up
, all changes are reflected in tasks as expected without any manual fixes.
i.e. it was really a memory issue, even though my application was as tiny as possible, and one should check instance type when work with autoscale groups 🙃