Skip to content

Commit

Permalink
undid build script changes
Browse files Browse the repository at this point in the history
  • Loading branch information
h4ck3rk3y committed Oct 31, 2023
1 parent bb6310b commit 185561f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/files_artifacts_expander/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source "${script_dirpath}/_constants.env"
BUILD_DIRNAME="build"

DEFAULT_SKIP_DOCKER_IMAGE_BUILDING=false
DEFAULT_ARCHITECTURE_TO_BUILD="$(arch)"
DEFAULT_ARCHITECTURE_TO_BUILD=amd64

MAIN_GO_FILEPATH="${expander_root_dirpath}/main.go"
MAIN_BINARY_OUTPUT_FILENAME="files-artifacts-expander"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ import (
const (
validationInProgressMsg = "Validating Starlark code and downloading container images - execution will begin shortly"

containerDownloadedImagesMsgHeader = "Container images used in this run:"
containerDownloadedImagesMsgFromLocal = "locally cached"
containerDownloadedImagesMsgFromRemote = "remotely downloaded"
containerDownloadedImagesMsgLineFormat = "> %s - %s - %s"
containerDownloadedImagesMsgHeader = "Container images used in this run:"
containerDownloadedImagesMsgFromLocal = "locally cached"
containerDownloadedImagesMsgFromRemote = "remotely downloaded"
containerDownloadedImagesMsgLineFormat = "> %s - %s"

containerImageArchWarningHeaderFormat = "Container images with different architecture than expected(%s):"
containerImageArchitectureMsgLineFormat = "> %s - %s"
linebreak = "\n"

linebreak = "\n"
)

type StartosisValidator struct {
Expand Down Expand Up @@ -221,12 +223,12 @@ func sendContainerImageSummaryInfoMsg(

architecture := validatedImage.GetArchitecture()

if validatedImage.GetArchitecture() != runtime.GOARCH {
imageWithIncorrectArchLine := fmt.Sprintf(containerImageArchitectureMsgLineFormat, image, validatedImage.GetArchitecture())
if architecture != runtime.GOARCH {
imageWithIncorrectArchLine := fmt.Sprintf(containerImageArchitectureMsgLineFormat, image, architecture)
imagesWithIncorrectArchLines = append(imagesWithIncorrectArchLines, imageWithIncorrectArchLine)
}

imageLine := fmt.Sprintf(containerDownloadedImagesMsgLineFormat, image, pulledFromStr, architecture)
imageLine := fmt.Sprintf(containerDownloadedImagesMsgLineFormat, image, pulledFromStr)
imageLines = append(imageLines, imageLine)
}

Expand Down
2 changes: 1 addition & 1 deletion core/server/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ source "${script_dirpath}/_constants.env"
BUILD_DIRNAME="build"

DEFAULT_SKIP_DOCKER_IMAGE_BUILDING=false
DEFAULT_ARCHITECTURE_TO_BUILD="$(arch)"
DEFAULT_ARCHITECTURE_TO_BUILD=amd64

MAIN_DIRNAME="api_container"
MAIN_GO_FILEPATH="${server_root_dirpath}/${MAIN_DIRNAME}/main.go"
Expand Down
2 changes: 1 addition & 1 deletion engine/server/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source "${script_dirpath}/_constants.env"
BUILD_DIRNAME="build"

DEFAULT_SKIP_DOCKER_IMAGE_BUILDING=false
DEFAULT_ARCHITECTURE_TO_BUILD="$(arch)"
DEFAULT_ARCHITECTURE_TO_BUILD=amd64

MAIN_DIRNAME="engine"
MAIN_GO_FILEPATH="${engine_root_dirpath}/${MAIN_DIRNAME}/main.go"
Expand Down
3 changes: 1 addition & 2 deletions scripts/docker-image-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ if "${push_to_registry_container}"; then
buildx_platform_arg='linux/arm64/v8,linux/amd64'
push_flag='--push'
else
arch="$(arch)"
buildx_platform_arg="linux/${arch}"
buildx_platform_arg='linux/amd64' # TODO: infer the local arch if that's reasonable
push_flag='--load'
fi
echo "Building docker image for architecture '${buildx_platform_arg}' with flag '${push_flag}'"
Expand Down

0 comments on commit 185561f

Please sign in to comment.