#spacelift (2023-08)

2023-08-01

johncblandii avatar
johncblandii

settings.depends_on is the atmos stack dependency. This does not work for creating spacelift dependencies.

What’s the official way to create dependencies in spacelift?

https://atmos.tools/cli/commands/describe/dependents/#description

atmos describe dependents | atmos

This command produces a list of Atmos components in Atmos stacks that depend on the provided Atmos component.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

settings.spacelift.depends_on

atmos describe dependents | atmos

This command produces a list of Atmos components in Atmos stacks that depend on the provided Atmos component.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

(we need to consolidate it with settings.depends_on since settings.depends_on was added recently and Spacelift modules/components were not updated to use it)

johncblandii avatar
johncblandii

which one is going to win the battle? both?

if we moved to the spacelift version, will the atmos dependency cli runs still work?

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

settings.depends_on will be used, but for this all Spacelift odules and components will have to be updated

johncblandii avatar
johncblandii

right. any timeline on that or is that not a planned update yet?

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

not a high priority for us. Please use both for now. settings.depends_on for the CLI, and settings.spacelift.depends_on for Spacelift, and add TODO to the code so you’ll update it later

johncblandii avatar
johncblandii

ouch

johncblandii avatar
johncblandii

wait…i could use anchors to not duplicate so might not be too bad

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

note that settings.depends_on is used only in this command (which was added not too long ago) https://atmos.tools/cli/commands/describe/dependents, and nowhere else

atmos describe dependents | atmos

This command produces a list of Atmos components in Atmos stacks that depend on the provided Atmos component.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

since it was added not to long ago, all other things were not updated to use settings.depends_on

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

Spacelift has been using settings.spacelift.depends_on for years

johncblandii avatar
johncblandii

yeah, i did a full audit of depends_on and consolidated on settings.depends_on after upgrading Atmos.

I saw the page you linked and compared to https://atmos.tools/integrations/spacelift/#stack-configuration which does not mention depends_on so I thought the above link was the right way for spacelift

Spacelift Integration | atmos

Atmos natively supports Spacelift. This is accomplished using

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

if you are using it just for spacelift, use the old way

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

cc @matt @Dan Miller (Cloud Posse) if @johncblandii is using the GHA to detect affected stacks, he should probably define both, no?

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

it’s not related to atmos describe affected, it’s related to atmos describe dependents

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

but we need to update our spacelift components to use the new way of describing dependencies to make everything consistent (b/c stacks deps are not only related to Spacelift stacks, and the command atmos describe dependents uses it to describe the dependencies using the CLI)

johncblandii avatar
johncblandii

is there ever a case where settings.depends_on would differ from settings.spacelift.depends_on?

johncblandii avatar
johncblandii

documentation on atmos.tools would be helpful too; specifically https://atmos.tools/integrations/spacelift/#stack-configuration

Spacelift Integration | atmos

Atmos natively supports Spacelift. This is accomplished using

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

they have diff formats. The old one settings.spacelift.depends_on (which our Spacelift components are using) is a list

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

settings.depends_on is a map to support deep-merging and inheritance, and make the config DRY

johncblandii avatar
johncblandii

yuppers. we stopped using 1: blah and started doing this for ease of overrides:

      settings:
        depends_on:
          cluster:
            component: platform-ecs-cluster
          ecs-tasks-mirror:
            component: ecs-tasks-mirror
          vpc:
            component: vpc

2023-08-02

2023-08-08

2023-08-23

Matt Gowie avatar
Matt Gowie

Hey folks – with the spacelift-automation module / component, is there new functionality since 0.49.5 that will cancel stacked “trigger-policy” runs? As in it will do something similar to the below screenshot where if many runs are triggered due to dependencies, only the last will actually be planned?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I know we definitely take advantage of it

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Is that not desired?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Cc @matt

Matt Gowie avatar
Matt Gowie

I’m interested in avoiding having to manually cancel the stacked runs to not bog down the Spacelift runs with clean plans. That’s what I’m getting at. Just wondering if there was ever an enhancement that made it in that helped avoid that. Haha I should probably just look at the release notes. I’ll dig into them sometime this week.

Matt Calhoun avatar
Matt Calhoun

This should be a simple policy update…you can do something like the following…

cancel[run.id] {
	run := input.in_progress[_]
	run.type == "PROPOSED"
	run.state == "QUEUED"
	run.branch == input.pull_request.head.branch
}
3

2023-08-24

    keyboard_arrow_up