Skip to content

Commit

Permalink
Download custom chaincode containers for ARM only when Fabric version…
Browse files Browse the repository at this point in the history
… is lower than 2.5

Signed-off-by: Jakub Dzikowski <[email protected]>
  • Loading branch information
dzikowski committed Sep 9, 2024
1 parent 0a02f3a commit 108ced2
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,9 @@ chaincodeBuild() {
# pull required images upfront in case of arm64 (Apple Silicon) architecture
# see https://stackoverflow.com/questions/69699421/hyperledger-fabric-chaincode-installation-failed-no-matching-manifest-for-linu
if [ "$(uname -m)" = "arm64" ]; then
# also, starting from Fabric 2.5, the base images for chaincode are available for arm64, so we don't need to pull them separately
# and we use \`sort -V\` to compare versions, because \`sort\` handles versions like \`2.4\` and \`2.10\` correctly
if [ "$(uname -m)" = "arm64" ] && [ "$(printf '%s\\n' "$FABRIC_VERSION" "2.5" | sort -V | head -n1)" = "$FABRIC_VERSION" ]; then
if [ "$CHAINCODE_LANG" = "node" ]; then
dockerPullIfMissing "hyperledger/fabric-nodeenv:$FABRIC_NODEENV_VERSION"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,9 @@ chaincodeBuild() {
# pull required images upfront in case of arm64 (Apple Silicon) architecture
# see https://stackoverflow.com/questions/69699421/hyperledger-fabric-chaincode-installation-failed-no-matching-manifest-for-linu
if [ "$(uname -m)" = "arm64" ]; then
# also, starting from Fabric 2.5, the base images for chaincode are available for arm64, so we don't need to pull them separately
# and we use \`sort -V\` to compare versions, because \`sort\` handles versions like \`2.4\` and \`2.10\` correctly
if [ "$(uname -m)" = "arm64" ] && [ "$(printf '%s\\n' "$FABRIC_VERSION" "2.5" | sort -V | head -n1)" = "$FABRIC_VERSION" ]; then
if [ "$CHAINCODE_LANG" = "node" ]; then
dockerPullIfMissing "hyperledger/fabric-nodeenv:$FABRIC_NODEENV_VERSION"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3276,7 +3276,9 @@ chaincodeBuild() {
# pull required images upfront in case of arm64 (Apple Silicon) architecture
# see https://stackoverflow.com/questions/69699421/hyperledger-fabric-chaincode-installation-failed-no-matching-manifest-for-linu
if [ "$(uname -m)" = "arm64" ]; then
# also, starting from Fabric 2.5, the base images for chaincode are available for arm64, so we don't need to pull them separately
# and we use \`sort -V\` to compare versions, because \`sort\` handles versions like \`2.4\` and \`2.10\` correctly
if [ "$(uname -m)" = "arm64" ] && [ "$(printf '%s\\n' "$FABRIC_VERSION" "2.5" | sort -V | head -n1)" = "$FABRIC_VERSION" ]; then
if [ "$CHAINCODE_LANG" = "node" ]; then
dockerPullIfMissing "hyperledger/fabric-nodeenv:$FABRIC_NODEENV_VERSION"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4683,7 +4683,9 @@ chaincodeBuild() {
# pull required images upfront in case of arm64 (Apple Silicon) architecture
# see https://stackoverflow.com/questions/69699421/hyperledger-fabric-chaincode-installation-failed-no-matching-manifest-for-linu
if [ "$(uname -m)" = "arm64" ]; then
# also, starting from Fabric 2.5, the base images for chaincode are available for arm64, so we don't need to pull them separately
# and we use \`sort -V\` to compare versions, because \`sort\` handles versions like \`2.4\` and \`2.10\` correctly
if [ "$(uname -m)" = "arm64" ] && [ "$(printf '%s\\n' "$FABRIC_VERSION" "2.5" | sort -V | head -n1)" = "$FABRIC_VERSION" ]; then
if [ "$CHAINCODE_LANG" = "node" ]; then
dockerPullIfMissing "hyperledger/fabric-nodeenv:$FABRIC_NODEENV_VERSION"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5190,7 +5190,9 @@ chaincodeBuild() {
# pull required images upfront in case of arm64 (Apple Silicon) architecture
# see https://stackoverflow.com/questions/69699421/hyperledger-fabric-chaincode-installation-failed-no-matching-manifest-for-linu
if [ "$(uname -m)" = "arm64" ]; then
# also, starting from Fabric 2.5, the base images for chaincode are available for arm64, so we don't need to pull them separately
# and we use \`sort -V\` to compare versions, because \`sort\` handles versions like \`2.4\` and \`2.10\` correctly
if [ "$(uname -m)" = "arm64" ] && [ "$(printf '%s\\n' "$FABRIC_VERSION" "2.5" | sort -V | head -n1)" = "$FABRIC_VERSION" ]; then
if [ "$CHAINCODE_LANG" = "node" ]; then
dockerPullIfMissing "hyperledger/fabric-nodeenv:$FABRIC_NODEENV_VERSION"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ chaincodeBuild() {

# pull required images upfront in case of arm64 (Apple Silicon) architecture
# see https://stackoverflow.com/questions/69699421/hyperledger-fabric-chaincode-installation-failed-no-matching-manifest-for-linu
if [ "$(uname -m)" = "arm64" ]; then
# also, starting from Fabric 2.5, the base images for chaincode are available for arm64, so we don't need to pull them separately
# and we use `sort -V` to compare versions, because `sort` handles versions like `2.4` and `2.10` correctly
if [ "$(uname -m)" = "arm64" ] && [ "$(printf '%s\n' "$FABRIC_VERSION" "2.5" | sort -V | head -n1)" = "$FABRIC_VERSION" ]; then
if [ "$CHAINCODE_LANG" = "node" ]; then
dockerPullIfMissing "hyperledger/fabric-nodeenv:$FABRIC_NODEENV_VERSION"
fi
Expand Down

0 comments on commit 108ced2

Please sign in to comment.