Skip to main content

Deployments 2.0 - Сhangelog

Take a look at the release notes to better understand the motivation behind these changes, or at the guide to learn about some possible real-world workflows.

Concepts

ConceptsBeforeAfter
VersionExistedRemoved (replaced with slots)
SlotDid not existIntroduced (unique identifier for configs)
Production aliasExistedDeprecated (use tags)
TagDid not existIntroduced (user-defined labels for deployments)
ReferenceExistedExists, but the format has changed

Format changes

ValueBeforeAfter
VersionMust be a numberDeprecated
SlotDid not existA string of up to six lower case alphanumeric characters, dashes allowed
TagDid not existA string of lowercase alphanumeric characters, dashes allowed
Reference<name>@v<version>[<org>/]<name>(@<slot>|:<tag>)
Canonical URLhttps://<org>.squids.live/<name>/v/v<version>/graphqlhttps://<org>.squids.live/<name>@<slot>/api/graphql
Production URLhttps://<org>.squids.live/<name>/graphqlDeprecated. See also backwards compatibility.
Tag URLDid not existhttps://<org>.squids.live/<name>:<tag>/api/graphql

Manifest changes

FieldBeforeAfter
namePresentPresent
versionPresentDeprecated (mapped to slot)
slotAbsentNew field (unique identifier)
tagAbsentNew field (user-defined label)

CLI changes

Changes to CLI behavior are rather extensive:

  • New flags --name/-n, --tag/-t, --slot/-s, --reference/-r have been added to nearly all commands.
    • For sqd deploy they now can override their corresponding manifest fields. Heterogenous overrides also work: -t in CLI overrides slot: in manifest, and -s overrides tag:.
    • For other commands (sqd logs, sqd restart etc) they allow for flexible specification of deployment.
  • New commands sqd tags add and sqd tags remove have been added.
  • The sqd prod command has been removed.

Here's what the new commands look like for some common tasks:

ActionBeforeAfter
Deploying prod versionsqd deploy . && sqd prod my-squid@v1sqd deploy . --add-tag prod
Promoting to prodsqd prod my-squid@v1sqd tags add prod -n my-squid -s v1
Marking a deployment as a "dev" versionWas not possiblesqd tags add dev -n my-squid -s v1
Updating the "dev" versionWas not possiblesqd deploy . -t dev
Fetching logssqd logs my-squid@v1sqd logs -n my-squid -s v1

Cheatsheet

Add tag testtag to the deployment of my-squid running in slot v1

sqd tags add testtag -n my-squid -s v1

(Re)deploy the squid and immediately assign the tag testtag to the deployment

sqd deploy . --add-tag testtag
  • The squid will be redeployed if one of the tag:, slot: or version: fields are defined in the manifest and the Cloud already has a deployment that matches the reference.
  • If the fields are undefined or there's no matching squid in the Cloud, a new deployment will be created in a new slot.
  • Tag testtag will be assigned to the slot of the (possibly new) deployment.

Update the deployment tagged dev

sqd deploy . --tag dev
  • If there's a deployment tagged dev, it will be updated.
  • Otherwise, the command will exit with an error.

Read logs of the deployment of my-squid tagged prod

sqd logs -n my-squid -t prod

Backwards compatibility

Here are the measures we've taken to make the migration smoother:

  • Existing deployments lose their versions; instead, they are assigned to the corresponding v<version> slots. New deployments that specify version: in the manifest will be assigned to the v<version> slot, too. Hence, for the time being the lines
    version: 42
    and
    slot: v42
    in the manifest file are equivalent.
  • Tag prod has a special meaning for the duration of the transition period: deployments that have it are made available via old-style production URLs.
  • Tag prod is assigned to all existing deployments with production aliases.
  • You can, for the time being, add an old-style production URL to any deployment - just assign the prod tag to it.