Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
[Backport 5.4.5099] release: never use build number in image family (#…
Browse files Browse the repository at this point in the history
…63178)

the executor image and docker mirror image should now follow the
following naming convention:

Image family:
`sourcegraph-executors-[nightly|internal|'']-<MAJOR>-<MINOR>`
Image name:
`sourcegraph-executor-[nightly|internal|'']-<MAJOR>-<MINOR>-<BUILD_NUMBER>`

example:
Image family: `sourcegraph-executors-5-4`
Image name: `sourcegraph-executor-5-4-277666`

## What happens during releases and _not_ releases?
#### Nightly
**`nightly` suffix**
Image family:
`sourcegraph-executors-nightly-<MAJOR>-<MINOR>`
Image name:
`sourcegraph-executor-nightly-<MAJOR>-<MINOR>-<BUILD_NUMBER>`
#### Internal
**`internal` suffix**
Image family:
`sourcegraph-executors-internal-<MAJOR>-<MINOR>`
Image name:
`sourcegraph-executor-internal-<MAJOR>-<MINOR>-<BUILD_NUMBER>`
#### Public / Promote to public

** No suffix **

Image family: `sourcegraph-executors-<MAJOR>-<MINOR>`
Image name:
`sourcegraph-executor-<MAJOR>-<MINOR>-<BUILD_NUMBER>`

>  [!IMPORTANT]
> Should we keep the imagine name stable at
`sourcegraph-executor-<MAJOR>-<MINOR>-<BUILD_NUMBER>`
> and only change the family name? 
>
> **Why?**
>
> The Image family dictates the collection of images and that changes
each major minor and or release phase so there is really no use in
changing the image name too, except at a glance you can see from the
name what image family it belongs to?
## Test plan




## Changelog




 <br> Backport 8bb0ab5 from #63157

Co-authored-by: William Bezuidenhout <[email protected]>
  • Loading branch information
sourcegraph-release-bot and burmudar authored Jun 10, 2024
1 parent 04e2234 commit 3458e82
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 21 deletions.
6 changes: 1 addition & 5 deletions cmd/executor/docker-mirror/_ami.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ GCP_PROJECT="aspect-dev"
"$gcloud" secrets versions access latest --secret=e2e-builder-sa-key --quiet --project="$GCP_PROJECT" >"workdir/builder-sa-key.json"

## Setting up packer
export PKR_VAR_name
PKR_VAR_name="${IMAGE_FAMILY}"
if [ "${RELEASE_INTERNAL:-}" == "true" ]; then
PKR_VAR_name="${PKR_VAR_name}-${BUILDKITE_BUILD_NUMBER}"
fi
export PKR_VAR_name="${IMAGE_FAMILY}-${BUILDKITE_BUILD_NUMBER}"
export PKR_VAR_image_family="${IMAGE_FAMILY}"
export PKR_VAR_tagged_release="${EXECUTOR_IS_TAGGED_RELEASE}"
export PKR_VAR_aws_access_key=${AWS_EXECUTOR_AMI_ACCESS_KEY}
Expand Down
5 changes: 1 addition & 4 deletions cmd/executor/docker-mirror/_ami.push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ export AWS_ACCESS_KEY_ID="${AWS_EXECUTOR_AMI_ACCESS_KEY}"
export AWS_SECRET_ACCESS_KEY="${AWS_EXECUTOR_AMI_SECRET_KEY}"

# Point to GCP boot disk image/AMI built by build.sh script
NAME="${IMAGE_FAMILY}"
if [ "${RELEASE_INTERNAL:-}" == "true" ]; then
NAME="${NAME}-${BUILDKITE_BUILD_NUMBER}"
fi
NAME="${IMAGE_FAMILY}-${BUILDKITE_BUILD_NUMBER}"
GOOGLE_IMAGE_NAME="${NAME}"

# Mark GCP boot disk as released and make it usable outside of Sourcegraph.
Expand Down
6 changes: 1 addition & 5 deletions cmd/executor/vm-image/_ami.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ docker save --output workdir/executor-vm.tar "sourcegraph/executor-vm:$VERSION"
GCP_PROJECT="aspect-dev"
"$gcloud" secrets versions access latest --secret=e2e-builder-sa-key --quiet --project="$GCP_PROJECT" >"workdir/builder-sa-key.json"

export PKR_VAR_name
PKR_VAR_name="${IMAGE_FAMILY}"
if [ "${RELEASE_INTERNAL:-}" == "true" ]; then
PKR_VAR_name="${PKR_VAR_name}-${BUILDKITE_BUILD_NUMBER}"
fi
export PKR_VAR_name="${IMAGE_FAMILY}-${BUILDKITE_BUILD_NUMBER}"
export PKR_VAR_image_family="${IMAGE_FAMILY}"
export PKR_VAR_tagged_release="${EXECUTOR_IS_TAGGED_RELEASE}"
export PKR_VAR_version="${VERSION}"
Expand Down
6 changes: 1 addition & 5 deletions cmd/executor/vm-image/_ami.push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ export AWS_ACCESS_KEY_ID="${AWS_EXECUTOR_AMI_ACCESS_KEY}"
export AWS_SECRET_ACCESS_KEY="${AWS_EXECUTOR_AMI_SECRET_KEY}"

# Point to GCP boot disk image/AMI built by //cmd/executor/vm-image:ami.build
NAME="${IMAGE_FAMILY}"
if [ "${RELEASE_INTERNAL:-}" == "true" ]; then
NAME="${NAME}-${BUILDKITE_BUILD_NUMBER}"
fi

NAME="${IMAGE_FAMILY}-${BUILDKITE_BUILD_NUMBER}"
GOOGLE_IMAGE_NAME="${NAME}"

# Mark GCP boot disk as released and make it usable outside of Sourcegraph.
Expand Down
4 changes: 2 additions & 2 deletions dev/ci/internal/ci/executor_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func executorDockerMirrorImageFamilyForConfig(c Config) string {
if err != nil {
panic("cannot parse version")
}
imageFamily = fmt.Sprintf("sourcegraph-executors-internal-docker-mirror-%d-%d-%d", ver.Major(), ver.Minor(), ver.Patch())
imageFamily = fmt.Sprintf("sourcegraph-executors-internal-docker-mirror-%d-%d", ver.Major(), ver.Minor())
}
return imageFamily
}
Expand All @@ -146,7 +146,7 @@ func executorImageFamilyForConfig(c Config) string {
if err != nil {
panic("cannot parse version")
}
imageFamily = fmt.Sprintf("sourcegraph-executors-internal-%d-%d-%d", ver.Major(), ver.Minor(), ver.Patch())
imageFamily = fmt.Sprintf("sourcegraph-executors-internal-%d-%d", ver.Major(), ver.Minor())
}
return imageFamily
}
Expand Down

0 comments on commit 3458e82

Please sign in to comment.