This repository was archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
This repository was archived by the owner on Feb 15, 2022. It is now read-only.
spk service create should allow for arguments to be passed into the az acr build process #1006
Copy link
Copy link
Closed
microsoft/bedrock-cli
#16Labels
effort - Lindicates item should be broken upindicates item should be broken upenhancementNew feature or requestNew feature or requestgreat for pairingx-projectMapped to external projectsMapped to external projects
Milestone
Description
As a: developer
I want: to be able to pass arguments into the container build process.
Describe the solution you'd like:
Building of the Dockerfile assumes there are no inputs into the build process. One possible example would be to add a variable group and script the inputs to generate the build are string.
An example of doing such is as follows:
- script: |-
set -e
export BUILD_REPO_NAME=$(echo $(Build.Repository.Name)-jmsgumbo-svc | tr '[:upper:]' '[:lower:]')
echo "Image Name: $BUILD_REPO_NAME"
cd ./
echo "az acr build -r $(ACR_NAME) --image $BUILD_REPO_NAME:$(echo $(Build.SourceBranchName) | tr / - | tr . -)-$(Build.BuildNumber) ."
az acr build -r $(ACR_NAME) --image $BUILD_REPO_NAME:$(echo $(Build.SourceBranchName) | tr / - | tr . -)-$(Build.BuildNumber) .
displayName: ACR Build and Publish
To:
- script: |-
set -e
export BUILD_REPO_NAME=$(echo $(Build.Repository.Name)- | tr '[:upper:]' '[:lower:]')
echo "Image Name: $BUILD_REPO_NAME"
cd ./
export DOCKER_BUILD_FILE=$(if [ -z "$SERVICE_DOCKERFILE_PATH" ]; then echo "DockerFile"; else echo "$SERVICE_DOCKERFILE_PATH"; fi)
if [ ! -z "$SERVICE_NAME_BASE" ]; then
arg_str=""
for v in project_path version_suffix test_logger skip_tests docker_entrypoint framework_release framework_build; do
arg_str=""
for v in project_path version_suffix test_logger skip_tests docker_entrypoint framework_release framework_build; do
valueKey=$(echo "service_""$v" | tr '[:lower:]' '[:upper:]')
arg_str="$arg_str --build-arg $v=\"${!valueKey}\""
done
fi
echo "az acr build -r $(ACR_NAME) --file $DOCKER_BUILD_FILE $arg_str --image $BUILD_REPO_NAME:$(Build.SourceBranchName)-$(Build.BuildNumber) ."
az acr build -r $(ACR_NAME) --file $DOCKER_BUILD_FILE $arg_str --image $BUILD_REPO_NAME:$(Build.SourceBranchName)-$(Build.BuildNumber) .
displayName: ACR Build and Publish
Acceptance Criteria:
- Design documentation on implementation
- A flag to add a variable-group and a list of variables to be used as build args during
spk service create - Enforcing variable name cases:
- https://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html:
-
uppercase letters, digits, and the '_' (underscore)
- Create a warning for variable format
- Command to create a new variable-group in azure devops with given variables and values (some of which will be secrets).
- does
spk variable-group createdo what we need already?- We may be deprecating that command. For now we'll link documentation and guidance on how to manually create variable groups though the az cli or UI.
- does
- reference documentation on bedrock repository during walkthrough components
- updated smoke tests with build arguments
Does this require updates to documentation?:
Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
effort - Lindicates item should be broken upindicates item should be broken upenhancementNew feature or requestNew feature or requestgreat for pairingx-projectMapped to external projectsMapped to external projects