-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
codebuild
: Arrays are not preserved between commands
#26694
Comments
codebuild
: codebuild
: Arrays are not being preserved between commands
codebuild
: Arrays are not being preserved between commandscodebuild
: Arrays are not preserved between commands
What makes you think this is an issue with CDK, can you identify a misconfigured option in the synthesized template? |
Hey Peter, not sure if this is an issue with CDK. I thought it would make sense since ARM support was just recently added. Let me know where else I can report the issue. It takes some time to figure out that such a basic thing is not working, so I'm just trying to create awareness and potentially help others not to run into it. Feel free to close if the issue is not with CDK. |
Yeah I don't see any explicit issues with the template. If you're able to test this same setup in the console to verify that it's not an issue with the service not fixing this particular case of the issue, that would be very helpful. Else, I can see what else I can do |
Sorry, but I don't have the time for further investigation now. I also don't feel particularly excited about fixing AWS services for them. For anyone running into the same issue, just use multi-line commands. E.g.: from aws_cdk import aws_codebuild as codebuild
# ...
example_codebuild_project = codebuild.Project(
self,
"EFSPackageInstallerProject",
project_name="EFSPackageInstallerProject",
description="Installs Python packages on EFS for use in model serving Lambda",
build_spec=codebuild.BuildSpec.from_object(
{
"version": "0.2",
"phases": {
"build": {
"commands": [
"""echo "Using an example array";
my_array=("first" "second" "third" "fourth");
for item in "${my_array[@]}"; do
echo "$item";
done""",
]
}
},
}
),
environment=codebuild.BuildEnvironment(
build_image=codebuild.LinuxArmBuildImage.from_docker_registry(
f"public.ecr.aws/sam/build-python3.9:latest-arm64"
),
compute_type=codebuild.ComputeType.SMALL,
privileged=True,
),
) |
Yeah to put it simply - if it is using the correct image after you deploy, then this is almost certainly a service issue, which unfortunately I can't help much with. I submitted a ticket internally for this (P96948151), will provide an update when one becomes available |
@BastiQ the service team let me know that arrays are not supported in buildspec command yet - From the team:
|
|
Good to know, thanks for the update! Maybe something worth adding to the docs somewhere. |
I'll forward this feedback onto them 🙂 |
Describe the bug
When using
LinuxArmBuildImage
with the docker image,public.ecr.aws/sam/build-python3.9:latest-arm64
and buildspec version 0.2, I run into the issue that arrays are not being preserved between commands.According to the docs this should only happen with buildspec version 0.1 and be resolved in version 0.2.
The weird thing is, that other variables are preserved, and array variables can be looped over if the command is in the same line (see examples below).
This, btw. doesn't happen if I use
LinuxBuildImage
withpublic.ecr.aws/sam/build-python3.9:latest
(no arm image).I assume this is a bug, as arm support has just recently (v2.88.0, #26121, f522796) been added.
Expected Behavior
Current Behavior
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.90.0 (build 8c535e4)
Framework Version
No response
Node.js Version
v16.16.0
OS
MacOS
Language
Python
Language Version
3.9
Other information
No response
The text was updated successfully, but these errors were encountered: