Skip to content

Commit

Permalink
Merge pull request #444 from zhuyuanmao/add-m1-chip-support
Browse files Browse the repository at this point in the history
Support M1 chip development.
  • Loading branch information
yeasy authored May 17, 2022
2 parents c7031f3 + 3ae77c6 commit 0e57291
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ IS_RELEASE=false
DOCKER_BASE_x86_64=python:3.6
DOCKER_BASE_ppc64le=ppc64le/python:3.6
DOCKER_BASE_s390x=s390x/python:3.6
DOCKER_BASE_arm64=python:3.6
DOCKER_BASE=$(DOCKER_BASE_$(ARCH))
BASE_VERSION ?= $(ARCH)-$(VERSION)

Expand Down Expand Up @@ -303,13 +304,21 @@ HELP_FUN = \
print "\n"; }

api-engine: # for debug only now
docker build -t hyperledger/cello-api-engine:latest -f build_image/docker/common/api-engine/Dockerfile.in ./
if [ "$(ARCH)" = "arm64" ]; then \
docker build -t hyperledger/cello-api-engine:latest -f build_image/docker/common/api-engine/Dockerfile.in ./ --platform linux/amd64; \
else \
docker build -t hyperledger/cello-api-engine:latest -f build_image/docker/common/api-engine/Dockerfile.in ./; \
fi

dashboard: # for debug only now
docker build -t hyperledger/cello-dashboard:latest -f build_image/docker/common/dashboard/Dockerfile.in ./

docker-rest-agent: # for debug only now
docker build -t hyperledger/cello-agent-docker:latest -f build_image/docker/agent/docker-rest-agent/Dockerfile.in ./ --build-arg pip=$(PIP)
if [ "$(ARCH)" = "arm64" ]; then \
docker build -t hyperledger/cello-agent-docker:latest -f build_image/docker/agent/docker-rest-agent/Dockerfile.in ./ --build-arg pip=$(PIP) --platform linux/amd64; \
else \
docker build -t hyperledger/cello-agent-docker:latest -f build_image/docker/agent/docker-rest-agent/Dockerfile.in ./ --build-arg pip=$(PIP); \
fi

start-dashboard:
make -C src/dashboard start;
Expand Down
12 changes: 8 additions & 4 deletions bootup/docker-compose-files/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,25 @@ services:
ports:
- "8080:8080"
volumes:
- /var/run/:/host/var/run/
- /opt/cello:/opt/cello
# - /etc/localtime:/etc/localtime
networks:
- cello-net

# cello docker agent may deploy to an individual server. This cofig only serves development purpose.
cello-docker-agent:
image: hyperledger/cello-agent-docker
container_name: cello.docker.agent
container_name: cello-docker-agent
hostname: cello.docker.agent
restart: always
ports:
- "2375:2375"
- "5001:5001"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DOCKER_URL=unix://var/run/docker.sock
- STORAGE_PATH=/opt/hyperledger
networks:
- cello-net

Expand All @@ -77,7 +81,7 @@ networks:
name: cello-net

volumes:
cello-docker-agent:
cello-api-engine:
cello-postgres:
cello-dashboard:
cello-dashboard:
cello-docker-agent:
7 changes: 4 additions & 3 deletions src/agent/docker-rest-agent/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
FAIL_CODE = 'Fail'

docker_url = os.getenv("DOCKER_URL")
storage_path = os.getenv("STORAGE_PATH")

client = docker.DockerClient(docker_url)
res = {'code': '', 'data': {}, 'msg': ''}
Expand Down Expand Up @@ -39,12 +40,12 @@ def create_node():
'HLF_NODE_BOOTSTRAP_BLOCK':request.form.get('bootstrap_block'),
'HLF_NODE_PEER_CONFIG':request.form.get('peer_config_file'),
'HLF_NODE_ORDERER_CONFIG':request.form.get('orderer_config_file'),
'platform': 'linux/amd64',
}
port_map = ast.literal_eval(request.form.get("port_map"))
volumes = [
'/var/run/:/host/var/run/',
'/opt/hyperledger/fabric/{}:/etc/hyperledger/fabric'.format(node_name),
'/opt/hyperledger/production/{}:/var/hyperledger/production'.format(node_name)
'{}/fabric/{}:/etc/hyperledger/fabric'.format(storage_path, node_name),
'{}/production/{}:/var/hyperledger/production'.format(storage_path, node_name)
]
if request.form.get('type') == "peer":
peer_envs = {
Expand Down

0 comments on commit 0e57291

Please sign in to comment.