Skip to content

feature: Allow ordering service deployments #2935

@vittoriom94

Description

@vittoriom94

Hello,
when I try to use the attribute "depends_on" in the manifest of a service, I get the error "container dependency does not exist" when I try to generate the cloudformation stack.

The app I generated with copilot has a nginx service that I want to start after its backend services in the copilot generated pipeline.

The structure of the "copilot" folder is:
image

My nginx manifest has the following configuration:

name: nginx
type: Load Balanced Web Service

http:
  path: '/'

image:
  build
  build: nginx/Dockerfile
  port: 80
  depends_on:
    sport: START

cpu: 256  
memory: 512   
count: 1       
exec: true 

environments:
  test:
    variables:
      DEFAULT_URL: "default.test.cnn.local"
      ECONOMY_URL: "economy.test.cnn.local"
      ENTERTAINMENT_URL: "entertainment.test.cnn.local"
      LEISURE_URL: "leisure.test.cnn.local"
      LIFESTYLE_URL: "lifestyle.test.cnn.local"
      SCIENCE_URL: "science.test.cnn.local"
      SPORT_URL: "sport.test.cnn.local"

And this is the beginning of the sport service manifest:

# Your service name will be used in naming your resources like log groups, ECS services, etc.
name: sport
type: Backend Service

I tried the command to generate the cloudformation stack and the error is:

copilot svc package -n nginx
Only found one environment, defaulting to: test
✘ generate stack template: convert the container dependency for service nginx: container dependency does not exist

When I try to deploy the service through the pipeline, the error is the same:

[Container] 2021/10/13 15:46:22 Running command for env in $pl_envs; do
for svc in $svcs; do
./copilot-linux svc package -n $svc -e $env --output-dir './infrastructure' --tag $tag;
done;
for job in $jobs; do
./copilot-linux job package -n $job -e $env --output-dir './infrastructure' --tag $tag;
done;
done;
923 ✘ generate stack template: convert the container dependency for service nginx: container dependency does not exist

And the outcome is an empty nginx stack.yml and params.json:

[Container] 2021/10/13 15:46:30 Running command ls -lah ./infrastructure
total 168K
drwxr-xr-x 2 root root 4.0K Oct 13 15:46 .
drwxr-xr-x 9 root root 4.0K Oct 13 15:46 ..
-rw-r--r-- 1 root root 540 Oct 13 15:46 climate-test.params.json
-rw-r--r-- 1 root root 15K Oct 13 15:46 climate-test.stack.yml
-rw-r--r-- 1 root root 540 Oct 13 15:46 default-test.params.json
-rw-r--r-- 1 root root 15K Oct 13 15:46 default-test.stack.yml
-rw-r--r-- 1 root root 540 Oct 13 15:46 economy-test.params.json
-rw-r--r-- 1 root root 15K Oct 13 15:46 economy-test.stack.yml
-rw-r--r-- 1 root root 558 Oct 13 15:46 entertainment-test.params.json
-rw-r--r-- 1 root root 15K Oct 13 15:46 entertainment-test.stack.yml
-rw-r--r-- 1 root root 540 Oct 13 15:46 leisure-test.params.json
-rw-r--r-- 1 root root 15K Oct 13 15:46 leisure-test.stack.yml
-rw-r--r-- 1 root root 546 Oct 13 15:46 lifestyle-test.params.json
-rw-r--r-- 1 root root 15K Oct 13 15:46 lifestyle-test.stack.yml
-rw-r--r-- 1 root root 0 Oct 13 15:46 nginx-test.params.json
-rw-r--r-- 1 root root 0 Oct 13 15:46 nginx-test.stack.yml
-rw-r--r-- 1 root root 540 Oct 13 15:46 science-test.params.json
-rw-r--r-- 1 root root 15K Oct 13 15:46 science-test.stack.yml
-rw-r--r-- 1 root root 534 Oct 13 15:46 sport-test.params.json
-rw-r--r-- 1 root root 15K Oct 13 15:46 sport-test.stack.yml

Am I missing some configuration parameter or do I need to inject the service name in some other way to the manifest?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pipelineIssues about pipelines to release applications.type/featureIssues that are new feature requests.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions