Skip to content

Commit c403462

Browse files
authored
chore: remove platform as param for update_track (IN-3157) (#362)
# Remove platform parameter and add node_version parameter This PR makes the following changes: - Removes the `platform` parameter from track update commands and jobs - only removes passing it through so we don't break workflows while deprecating this param - rely on native architecture for platform instead of the flag - Adds `node_version` parameter to database track commands and jobs - Updates the `extra_build_args` to use the node version parameter - Adds `pre_release_steps` parameter to the release job - Updates Docker images in the Node 20 executor: - Changes `circleci/redis:6.2-alpine` to `cimg/redis:6.2` - Changes `circleci/mongo:4.4.1` to `mongo:4.4.1` - Simplifies Docker buildx creation by removing platform specification and using `--bootstrap` flag ## Related PRs - dependency of voiceflow/canvas-export#254 - dependency of voiceflow/database-cli#993
1 parent 2670c32 commit c403462

File tree

7 files changed

+20
-19
lines changed

7 files changed

+20
-19
lines changed

src/commands/track/update_database_track.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ parameters:
1818
description: Name of the Dockerfile to build
1919
type: string
2020
default: Dockerfile
21-
extra_build_args:
22-
description: Arguments to pass while building the docker image
23-
type: string
24-
default: ""
2521
enable_load:
2622
description: Load image into local docker
2723
type: boolean
@@ -98,12 +94,15 @@ parameters:
9894
description: checks if the track exists
9995
type: boolean
10096
default: true
97+
node_version:
98+
description: Node version
99+
type: string
101100
steps:
102101
- update_track:
103102
image_repo: "<< parameters.image_repo >>"
104103
component: "<< parameters.component >>"
105104
dockerfile: "<< parameters.dockerfile >>"
106-
extra_build_args: << parameters.extra_build_args >>
105+
extra_build_args: "NODE_VERSION=<< parameters.node_version >>"
107106
enable_cache_to: "<< parameters.enable_cache_to >>"
108107
build_context: "<< parameters.build_context >>"
109108
checkout: "<< parameters.checkout >>"
@@ -120,7 +119,6 @@ steps:
120119
kms_key: "<< parameters.kms_key >>"
121120
inject_aws_credentials: "<< parameters.inject_aws_credentials >>"
122121
local_registry_container_image: "<< parameters.local_registry_container_image >>"
123-
platform: "<< parameters.platform >>"
124122
enable_dlc: "<< parameters.enable_dlc >>"
125123
enable_load: "<< parameters.enable_load >>"
126124
builder_name: "<< parameters.builder_name >>"

src/commands/track/update_track.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ parameters:
1313
extra_build_args:
1414
description: Arguments to pass while building the docker image
1515
type: string
16-
default: ''
16+
default: ""
1717
enable_cache_to:
1818
description: use --cache-to flag to push cache artifact to remote registry
1919
type: boolean
2020
default: false
2121
build_context:
2222
description: Path to the context for the docker build
2323
type: string
24-
default: '.'
24+
default: "."
2525
checkout:
2626
description: Determines if a checkout will be executed or not
2727
type: boolean
@@ -153,7 +153,6 @@ steps:
153153
DOCKERFILE: "<< parameters.dockerfile >>"
154154
INJECT_AWS_CREDENTIALS: "<< parameters.inject_aws_credentials >>"
155155
ENABLE_LOAD: "<< parameters.enable_load >>"
156-
PLATFORM: "<< parameters.platform >>"
157156
BUILDER_NAME: "<< parameters.builder_name >>"
158157
UPDATE_TRACK_FILE: << parameters.update_track_file >>
159158
ENABLE_PUSH: "<< parameters.enable_push >>"

src/executors/node/code-test-executor-node-20.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ docker: # run the steps with Docker
1717
aws_secret_access_key: $AWS_SECRET_ACCESS_KEY
1818
- image: postgres:14.3-alpine # PostgresDB service container
1919
environment:
20-
POSTGRES_HOST_AUTH_METHOD: trust # This is needed to ensure that the PG instance can be accessed locally without explicitly creating credentials
20+
POSTGRES_HOST_AUTH_METHOD: trust # This is needed to ensure that the PG instance can be accessed locally without explicitly creating credentials
2121
- image: localstack/localstack:0.12.2 # Localstack to emulate AWS DynamoDB and S3 services
2222
environment:
2323
- EDGE_PORT=8000
2424
- SERVICES=s3,dynamodb
2525
- DEFAULT_REGION=us-east-1
2626
- DEBUG=1
27-
- image: circleci/redis:6.2-alpine # Redis service container
28-
- image: circleci/mongo:4.4.1 # MongoDB service container
27+
- image: cimg/redis:6.2 # Redis service container
28+
- image: mongo:4.4.1 # MongoDB service container

src/jobs/release/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ parameters:
3636
description: The SSH key with write permissions to the repository
3737
type: string
3838
default: ""
39+
pre_release_steps:
40+
description: Steps to run before executing the release command
41+
type: steps
42+
default: []
3943
steps:
4044
- add_ssh_keys:
4145
fingerprints:
@@ -48,6 +52,7 @@ steps:
4852
yarn_lock_restore_cache_directory: << parameters.working_directory >>
4953
- attach_workspace:
5054
at: << parameters.working_directory >>
55+
- steps: << parameters.pre_release_steps >>
5156
- when:
5257
condition: << parameters.prerelease_version >>
5358
steps:

src/jobs/track/update_database_track.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ parameters:
2121
description: Platform to build the image for
2222
type: string
2323
default: linux/amd64
24+
node_version:
25+
description: Node version
26+
type: string
2427
steps:
2528
- update_database_track:
2629
component: "<< parameters.component >>"
2730
image_repo: "<< parameters.image_repo >>"
2831
semantic_version: "<< parameters.semantic_version >>"
29-
platform: "<< parameters.platform >>"
3032
image_tag: "<< parameters.image_tag >>"
33+
node_version: "<< parameters.node_version >>"

src/jobs/track/update_track.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ steps:
128128
kms_key: "<< parameters.kms_key >>"
129129
inject_aws_credentials: "<< parameters.inject_aws_credentials >>"
130130
local_registry_container_image: "<< parameters.local_registry_container_image >>"
131-
platform: "<< parameters.platform >>"
132131
enable_dlc: "<< parameters.enable_dlc >>"
133132
enable_load: "<< parameters.enable_load >>"
134133
builder_name: "<< parameters.builder_name >>"

src/scripts/track/update_track.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ echo "BUCKET: ${BUCKET?}"
1313
echo "LOCAL_REGISTRY: ${LOCAL_REGISTRY?}"
1414
echo "DOCKERFILE: ${DOCKERFILE?}"
1515
echo "INJECT_AWS_CREDENTIALS: ${INJECT_AWS_CREDENTIALS?}"
16-
echo "PLATFORM: ${PLATFORM?}"
1716
echo "BUILDER_NAME: ${BUILDER_NAME-}"
1817
echo "EXTRA_BUILD_ARGS: ${EXTRA_BUILD_ARGS[*]}"
1918
echo "ENABLE_CACHE_TO: ${ENABLE_CACHE_TO:=0}"
@@ -110,9 +109,8 @@ if [[ $IMAGE_EXISTS == "false" || "$CIRCLE_BRANCH" == "master" || "$CIRCLE_BRANC
110109
echo "BUILDER_NAME: ${BUILDER_NAME:=buildy-${BRANCH_NAME-}}"
111110

112111
BUILDER_ARGS=(--name "${BUILDER_NAME-}")
113-
docker buildx create --use --platform="$PLATFORM" \
112+
docker buildx create --use --bootstrap \
114113
"${BUILDER_ARGS[@]}"
115-
docker buildx inspect --bootstrap
116114

117115
OUTPUT_ARGS=()
118116
if ((ENABLE_PUSH)); then
@@ -162,7 +160,7 @@ if [[ $IMAGE_EXISTS == "false" || "$CIRCLE_BRANCH" == "master" || "$CIRCLE_BRANC
162160
--label "com.datadoghq.tags.git.repository_url=${CIRCLE_REPOSITORY_URL}"
163161
)
164162

165-
echo "BUILD_ARGS: ${BUILD_ARGS[*]} $PLATFORM"
163+
echo "BUILD_ARGS: ${BUILD_ARGS[*]}"
166164
docker buildx build \
167165
"${LEGACY_BUILD_ARGS[@]}" \
168166
"${DD_TAGS_ARG[@]}" \
@@ -173,7 +171,6 @@ if [[ $IMAGE_EXISTS == "false" || "$CIRCLE_BRANCH" == "master" || "$CIRCLE_BRANC
173171
"${BUILD_ARGS[@]}" \
174172
"${OUTPUT_ARGS[@]}" \
175173
"${DATADOG_LABELS[@]}" \
176-
--platform "$PLATFORM" \
177174
-f "$BUILD_CONTEXT/$DOCKERFILE" \
178175
"${TAGS[@]}" \
179176
"$BUILD_CONTEXT"

0 commit comments

Comments
 (0)