Skip to content

Commit 7225392

Browse files
committed
Add container registry option to k8s test network
Add new TEST_NETWORK_THIRD_PARTY_CONTAINER_REGISTRY config env var to optionally use an alternative registry for couchdb etc. See #1410 Signed-off-by: James Taylor <jamest@uk.ibm.com>
1 parent a2c40e6 commit 7225392

11 files changed

Lines changed: 54 additions & 50 deletions

ci/scripts/run-k8s-test-network-basic.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#
77
set -euo pipefail
88

9+
# TODO delete me
10+
export THIRD_PARTY_CONTAINER_REGISTRY=quay.io/lib
11+
912
# Test matrix parameters
1013
export CONTAINER_CLI=${CONTAINER_CLI:-docker}
1114
export CLIENT_LANGUAGE=${CLIENT_LANGUAGE:-typescript}

test-network-k8s/kube/org0/org0-job-scrub-fabric-volumes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
restartPolicy: "Never"
1919
containers:
2020
- name: main
21-
image: busybox:latest
21+
image: ${THIRD_PARTY_CONTAINER_REGISTRY}/busybox:latest
2222
command:
2323
- sh
2424
- -c

test-network-k8s/kube/org1/org1-job-scrub-fabric-volumes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
restartPolicy: "Never"
1919
containers:
2020
- name: main
21-
image: busybox:latest
21+
image: ${THIRD_PARTY_CONTAINER_REGISTRY}/busybox:latest
2222
command:
2323
- sh
2424
- -c

test-network-k8s/kube/org1/org1-peer1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spec:
9595
mountPath: /var/hyperledger/fabric/config/tls
9696
readOnly: true
9797
- name: couchdb
98-
image: couchdb:${COUCHDB_VERSION}
98+
image: ${THIRD_PARTY_CONTAINER_REGISTRY}/couchdb:${COUCHDB_VERSION}
9999
imagePullPolicy: IfNotPresent
100100
env:
101101
- name: "COUCHDB_USER"

test-network-k8s/kube/org1/org1-peer2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ spec:
9696
mountPath: /var/hyperledger/fabric/config/tls
9797
readOnly: true
9898
- name: couchdb
99-
image: couchdb:${COUCHDB_VERSION}
99+
image: ${THIRD_PARTY_CONTAINER_REGISTRY}/couchdb:${COUCHDB_VERSION}
100100
imagePullPolicy: IfNotPresent
101101
env:
102102
- name: "COUCHDB_USER"

test-network-k8s/kube/org2/org2-job-scrub-fabric-volumes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
restartPolicy: "Never"
1919
containers:
2020
- name: main
21-
image: busybox:latest
21+
image: ${THIRD_PARTY_CONTAINER_REGISTRY}/busybox:latest
2222
command:
2323
- sh
2424
- -c

test-network-k8s/kube/org2/org2-peer1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spec:
9595
mountPath: /var/hyperledger/fabric/config/tls
9696
readOnly: true
9797
- name: couchdb
98-
image: couchdb:${COUCHDB_VERSION}
98+
image: ${THIRD_PARTY_CONTAINER_REGISTRY}/couchdb:${COUCHDB_VERSION}
9999
imagePullPolicy: IfNotPresent
100100
env:
101101
- name: "COUCHDB_USER"

test-network-k8s/kube/org2/org2-peer2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ spec:
9494
mountPath: /var/hyperledger/fabric/config/tls
9595
readOnly: true
9696
- name: couchdb
97-
image: couchdb:${COUCHDB_VERSION}
97+
image: ${THIRD_PARTY_CONTAINER_REGISTRY}/couchdb:${COUCHDB_VERSION}
9898
imagePullPolicy: IfNotPresent
9999
env:
100100
- name: "COUCHDB_USER"

test-network-k8s/network

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -28,44 +28,45 @@ function context() {
2828
export ${name}="${!override_name:-${default_value}}"
2929
}
3030

31-
context FABRIC_VERSION 2.5
32-
context FABRIC_CA_VERSION 1.5
33-
34-
context CLUSTER_RUNTIME kind # or k3s for Rancher
35-
context CONTAINER_CLI docker # or nerdctl for containerd
36-
context CONTAINER_NAMESPACE "" # or "--namespace k8s.io" for containerd / nerdctl
37-
38-
context FABRIC_CONTAINER_REGISTRY ghcr.io/hyperledger
39-
context FABRIC_PEER_IMAGE ${FABRIC_CONTAINER_REGISTRY}/fabric-peer:${FABRIC_VERSION}
40-
context COUCHDB_VERSION 3.4.2
41-
context NETWORK_NAME test-network
42-
context CLUSTER_NAME kind
43-
context KUBE_NAMESPACE ${NETWORK_NAME}
44-
context NS ${KUBE_NAMESPACE}
45-
context ORG0_NS ${NS}
46-
context ORG1_NS ${NS}
47-
context ORG2_NS ${NS}
48-
context DOMAIN localho.st
49-
context CHANNEL_NAME mychannel
50-
context ORDERER_TYPE raft # or bft for BFT Orderer (for Fabric v3.0+)
51-
context ORDERER_TIMEOUT 10s # see https://github.com/hyperledger/fabric/issues/3372
52-
context TEMP_DIR ${PWD}/build
53-
context CHAINCODE_BUILDER ccaas # see https://github.com/hyperledgendary/fabric-builder-k8s/blob/main/docs/TEST_NETWORK_K8S.md
54-
context K8S_CHAINCODE_BUILDER_IMAGE ghcr.io/hyperledger-labs/fabric-builder-k8s/k8s-fabric-peer
55-
context K8S_CHAINCODE_BUILDER_VERSION 0.15.1 # For Fabric v2.5+, 0.11.0 or later should be specified
56-
57-
context LOG_FILE network.log
58-
context DEBUG_FILE network-debug.log
59-
context LOG_ERROR_LINES 2
60-
context LOCAL_REGISTRY_NAME kind-registry
61-
context LOCAL_REGISTRY_INTERFACE 127.0.0.1
62-
context LOCAL_REGISTRY_PORT 5000
63-
context STAGE_DOCKER_IMAGES false
64-
context NGINX_HTTP_PORT 80
65-
context NGINX_HTTPS_PORT 443
66-
67-
context RCAADMIN_USER rcaadmin
68-
context RCAADMIN_PASS rcaadminpw
31+
context FABRIC_VERSION 2.5
32+
context FABRIC_CA_VERSION 1.5
33+
34+
context CLUSTER_RUNTIME kind # or k3s for Rancher
35+
context CONTAINER_CLI docker # or nerdctl for containerd
36+
context CONTAINER_NAMESPACE "" # or "--namespace k8s.io" for containerd / nerdctl
37+
38+
context FABRIC_CONTAINER_REGISTRY ghcr.io/hyperledger
39+
context FABRIC_PEER_IMAGE ${FABRIC_CONTAINER_REGISTRY}/fabric-peer:${FABRIC_VERSION}
40+
context THIRD_PARTY_CONTAINER_REGISTRY docker.io # or a suitable alternative, e.g. quay.io/lib
41+
context COUCHDB_VERSION 3.4.2
42+
context NETWORK_NAME test-network
43+
context CLUSTER_NAME kind
44+
context KUBE_NAMESPACE ${NETWORK_NAME}
45+
context NS ${KUBE_NAMESPACE}
46+
context ORG0_NS ${NS}
47+
context ORG1_NS ${NS}
48+
context ORG2_NS ${NS}
49+
context DOMAIN localho.st
50+
context CHANNEL_NAME mychannel
51+
context ORDERER_TYPE raft # or bft for BFT Orderer (for Fabric v3.0+)
52+
context ORDERER_TIMEOUT 10s # see https://github.com/hyperledger/fabric/issues/3372
53+
context TEMP_DIR ${PWD}/build
54+
context CHAINCODE_BUILDER ccaas
55+
context K8S_CHAINCODE_BUILDER_IMAGE ghcr.io/hyperledger-labs/fabric-builder-k8s/k8s-fabric-peer
56+
context K8S_CHAINCODE_BUILDER_VERSION 0.15.1 # For Fabric v2.5+, 0.11.0 or later should be specified
57+
58+
context LOG_FILE network.log
59+
context DEBUG_FILE network-debug.log
60+
context LOG_ERROR_LINES 2
61+
context LOCAL_REGISTRY_NAME kind-registry
62+
context LOCAL_REGISTRY_INTERFACE 127.0.0.1
63+
context LOCAL_REGISTRY_PORT 5000
64+
context STAGE_DOCKER_IMAGES false
65+
context NGINX_HTTP_PORT 80
66+
context NGINX_HTTPS_PORT 443
67+
68+
context RCAADMIN_USER rcaadmin
69+
context RCAADMIN_PASS rcaadminpw
6970

7071
function print_help() {
7172
set +x

test-network-k8s/scripts/cluster.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ function pull_docker_images() {
4444
$CONTAINER_CLI pull ${CONTAINER_NAMESPACE} ${FABRIC_CONTAINER_REGISTRY}/fabric-ca:$FABRIC_CA_VERSION
4545
$CONTAINER_CLI pull ${CONTAINER_NAMESPACE} ${FABRIC_CONTAINER_REGISTRY}/fabric-orderer:$FABRIC_VERSION
4646
$CONTAINER_CLI pull ${CONTAINER_NAMESPACE} ${FABRIC_PEER_IMAGE}
47-
$CONTAINER_CLI pull ${CONTAINER_NAMESPACE} couchdb:$COUCHDB_VERSION
47+
$CONTAINER_CLI pull ${CONTAINER_NAMESPACE} ${THIRD_PARTY_CONTAINER_REGISTRY}/couchdb:$COUCHDB_VERSION
4848

4949
$CONTAINER_CLI pull ${CONTAINER_NAMESPACE} ghcr.io/hyperledger/fabric-rest-sample:latest
50-
$CONTAINER_CLI pull ${CONTAINER_NAMESPACE} redis:6.2.5
50+
$CONTAINER_CLI pull ${CONTAINER_NAMESPACE} ${THIRD_PARTY_CONTAINER_REGISTRY}/redis:6.2.5
5151

5252
pop_fn
5353
}

0 commit comments

Comments
 (0)