-
Notifications
You must be signed in to change notification settings - Fork 198
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
DevOps: Fix json query in reading the docker names to filter out fields not starting with aiida #6573
Conversation
There are further errors in the deployment of the docker image, but maybe another PR would be nicer to separate it. It fixes the build-amd64 CI. Compare |
As a quick short term fix you might want to pin to docker/bake-action to v5.5.0 I am just on my way to holiday and will be out for two weeks so don't have time to look into this more. @unkcpz can review this instead perhaps. |
@@ -52,5 +49,7 @@ if [[ -z ${BAKE_METADATA-} ]];then | |||
exit 1 | |||
fi | |||
|
|||
images=$(echo "${BAKE_METADATA}" | jq -c '. as $base |[to_entries[] |{"key": (.key|ascii_upcase|sub("-"; "_"; "g") + "_IMAGE"), "value": [(.value."image.name"|split(",")[0]),.value."containerimage.digest"]|join("@")}] |from_entries') | |||
images=$(echo "${BAKE_METADATA}" | | |||
jq -c 'to_entries | map(select(.key | startswith("aiida"))) | from_entries' | # filters out every key that does not start with aiida |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting approach, although I am honestly quite unhappy about this obscure jq syntax.
Perhaps we should switch to javascript to make this more readable. This was recommended to me here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes agree, understanding this json query was very cumbersome. I would prefer some Python code for this repo, but I guess it results in a similar code you linked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, if you can figure out some Python one-liner that would be best.
Why the CI test is not triggered? |
Because it only happens if you push to aiida-core with a branch that fulfills
https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#patterns-to-match-branches-and-tags aiida-core/.github/workflows/docker.yml Lines 7 to 9 in c7c289d
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Co-authored-by: Jusong Yu <[email protected]>
…ds not starting with aiida (aiidateam#6573) With the version update of bake-action the `BAKE_METADATA` a field with warning information (buildx.build.warnings) was added that does not contain the key `image.name` so the json query failed. With this commit another json query was added that filters out every field name that does not start with "aiida", so the field with warning information is filtered out. Co-authored-by: Jusong Yu <[email protected]> Cherry-pick: e1467ed
The BAKE_METADATA ha another field with warning information (
buildx.build.warnings
) that does not containimage.name
so the json query failed (. Now I added a json query filtering out every field name that does not start with "aiida".bake_metadata.json