ipfs on arm
This commit is contained in:
parent
027c39c367
commit
ba3727c5cd
20
Makefile
20
Makefile
|
@ -3,7 +3,7 @@ include make/include.mk
|
||||||
##
|
##
|
||||||
# APP
|
# APP
|
||||||
|
|
||||||
app-bootstrap: setup-binfmt setup-nfsd setup-sysctl
|
app-bootstrap: bootstrap-docker bootstrap-host bootstrap-user
|
||||||
|
|
||||||
app-build: user install-build-config
|
app-build: user install-build-config
|
||||||
$(call make,docker-compose-build docker-compose-up)
|
$(call make,docker-compose-build docker-compose-up)
|
||||||
|
@ -15,3 +15,21 @@ app-install: ansible-run
|
||||||
app-tests: ansible-tests
|
app-tests: ansible-tests
|
||||||
|
|
||||||
app-start: ssh-add
|
app-start: ssh-add
|
||||||
|
|
||||||
|
##
|
||||||
|
# BOOTSTRAP
|
||||||
|
|
||||||
|
# target bootstrap-docker: Install and configure docker
|
||||||
|
# on local host
|
||||||
|
.PHONY: bootstrap-docker
|
||||||
|
bootstrap-docker: install-bin-docker setup-docker-group setup-binfmt setup-nfsd setup-sysctl
|
||||||
|
|
||||||
|
# target bootstrap-host: Fire node target
|
||||||
|
# on local host
|
||||||
|
.PHONY: bootstrap-host
|
||||||
|
bootstrap-host: node
|
||||||
|
|
||||||
|
# target bootstrap-user: Fire User target
|
||||||
|
# on local host
|
||||||
|
.PHONY: bootstrap-user
|
||||||
|
bootstrap-user: User
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
FROM ipfs/go-ipfs:v0.13.0-rc1 as dist
|
||||||
|
LABEL maintainer aynic.os <support+docker@asycn.io>
|
||||||
|
ARG DOCKER_BUILD_DIR
|
||||||
|
|
||||||
|
COPY ${DOCKER_BUILD_DIR}/*.sh /container-init.d/
|
||||||
|
RUN chmod +rx /container-init.d/*.sh
|
||||||
|
|
||||||
|
FROM dist as master
|
||||||
|
ARG DOCKER_BUILD_DIR
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
## fix following error on arm64/linux with 2Gb RAM
|
||||||
|
# ERROR p2pnode libp2p/rcmgr_defaults.go:107 ===> OOF! go-libp2p changed DefaultServiceLimits
|
||||||
|
# => changes ('test' represents the old value):
|
||||||
|
# {"op":"test","path":"/SystemLimits/Memory","value":1073741824}
|
||||||
|
# {"op":"replace","path":"/SystemLimits/Memory","value":256560128}
|
||||||
|
# => go-libp2p SetDefaultServiceLimits update needs a review:
|
||||||
|
# Please inspect if changes impact go-ipfs users, and update expectedDefaultServiceLimits in rcmgr_defaults.go to remove this message
|
||||||
|
# FATAL p2pnode libp2p/rcmgr_defaults.go:115 daemon will refuse to run with the resource manager until this is resolved
|
||||||
|
ipfs config --json Swarm.ResourceMgr.Enabled false
|
|
@ -3,28 +3,13 @@
|
||||||
|
|
||||||
# target bootstrap: Update application files and start dockers
|
# target bootstrap: Update application files and start dockers
|
||||||
# on local host
|
# on local host
|
||||||
.PHONY: bootstrap
|
.PHONY: bootstrap app-bootstrap
|
||||||
bootstrap: bootstrap-app bootstrap-host bootstrap-user app-bootstrap ## Update application files and start dockers
|
bootstrap: bootstrap-app app-bootstrap ## Update application files and start dockers
|
||||||
|
|
||||||
# target bootstrap-app: Fire install-bin-git
|
# target bootstrap-app: Fire install-bin-git
|
||||||
.PHONY: bootstrap-app
|
.PHONY: bootstrap-app
|
||||||
bootstrap-app: install-bin-git
|
bootstrap-app: install-bin-git
|
||||||
|
|
||||||
# target bootstrap-docker: Install and configure docker
|
|
||||||
# on local host
|
|
||||||
.PHONY: bootstrap-docker
|
|
||||||
bootstrap-docker: install-bin-docker setup-docker-group setup-sysctl
|
|
||||||
|
|
||||||
# target bootstrap-host: Fire node target
|
|
||||||
# on local host
|
|
||||||
.PHONY: bootstrap-host
|
|
||||||
bootstrap-host: node
|
|
||||||
|
|
||||||
# target bootstrap-user: Fire User target
|
|
||||||
# on local host
|
|
||||||
.PHONY: bootstrap-user
|
|
||||||
bootstrap-user: User
|
|
||||||
|
|
||||||
# target build: Build application docker images to run
|
# target build: Build application docker images to run
|
||||||
# on local host
|
# on local host
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
|
@ -180,7 +165,7 @@ stack:
|
||||||
# target stack-%: Call docker-compose-% target on STACK
|
# target stack-%: Call docker-compose-% target on STACK
|
||||||
## it splits % on dashes and extracts stack from the beginning and command from
|
## it splits % on dashes and extracts stack from the beginning and command from
|
||||||
## the last part of %
|
## the last part of %
|
||||||
## ex: stack-User-up will fire the docker-compose-up target in the User stack
|
## ex: stack-node-up will fire the docker-compose-up target in the node stack
|
||||||
.PHONY: stack-%
|
.PHONY: stack-%
|
||||||
stack-%:
|
stack-%:
|
||||||
$(eval stack := $(subst -$(lastword $(subst -, ,$*)),,$*))
|
$(eval stack := $(subst -$(lastword $(subst -, ,$*)),,$*))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
ENV_VARS += SETUP_SYSCTL_CONFIG
|
ENV_VARS += SETUP_SYSCTL_CONFIG
|
||||||
SETUP_BINFMT ?= false
|
SETUP_BINFMT ?= $(if $(filter-out amd64 x86_64,$(PROCESSOR_ARCHITECTURE)),true,false)
|
||||||
SETUP_BINFMT_ARCH ?= all
|
SETUP_BINFMT_ARCH ?= all
|
||||||
SETUP_NFSD ?= false
|
SETUP_NFSD ?= false
|
||||||
SETUP_NFSD_OSX_CONFIG ?= nfs.server.bonjour=0 nfs.server.mount.regular_files=1 nfs.server.mount.require_resv_port=0 nfs.server.nfsd_threads=16 nfs.server.async=1
|
SETUP_NFSD_OSX_CONFIG ?= nfs.server.bonjour=0 nfs.server.mount.regular_files=1 nfs.server.mount.require_resv_port=0 nfs.server.nfsd_threads=16 nfs.server.async=1
|
||||||
|
|
|
@ -27,7 +27,7 @@ endif
|
||||||
.PHONY: setup-sysctl
|
.PHONY: setup-sysctl
|
||||||
setup-sysctl:
|
setup-sysctl:
|
||||||
ifeq ($(SETUP_SYSCTL),true)
|
ifeq ($(SETUP_SYSCTL),true)
|
||||||
$(SUDO) sysctl -q -w $(SETUP_SYSCTL_CONFIG)
|
$(RUN) $(SUDO) sysctl -q -w $(SETUP_SYSCTL_CONFIG)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# target setup-binfmt: Install binfmt abstraction layer
|
# target setup-binfmt: Install binfmt abstraction layer
|
||||||
|
|
11
make/def.mk
11
make/def.mk
|
@ -69,7 +69,7 @@ GIT_VERSION ?= $(shell git describe --tags $(BRANCH) 2>/dev/
|
||||||
HOSTNAME ?= $(shell hostname 2>/dev/null |sed 's/\..*//')
|
HOSTNAME ?= $(shell hostname 2>/dev/null |sed 's/\..*//')
|
||||||
IGNORE_DRYRUN ?= false
|
IGNORE_DRYRUN ?= false
|
||||||
IGNORE_VERBOSE ?= false
|
IGNORE_VERBOSE ?= false
|
||||||
INSTALL ?= $(SUDO) $(subst &&,&& $(SUDO),$(INSTALL_CMD))
|
INSTALL ?= $(RUN) $(SUDO) $(subst &&,&& $(RUN) $(SUDO),$(INSTALL_CMD))
|
||||||
INSTALL_CMDS ?= APK_INSTALL APT_INSTALL
|
INSTALL_CMDS ?= APK_INSTALL APT_INSTALL
|
||||||
$(foreach cmd,$(INSTALL_CMDS),$(if $(CMD_$(cmd)),$(eval INSTALL_CMD ?= $(CMD_$(cmd)))))
|
$(foreach cmd,$(INSTALL_CMDS),$(if $(CMD_$(cmd)),$(eval INSTALL_CMD ?= $(CMD_$(cmd)))))
|
||||||
LOG_LEVEL ?= $(if $(DEBUG),debug,$(if $(VERBOSE),info,error))
|
LOG_LEVEL ?= $(if $(DEBUG),debug,$(if $(VERBOSE),info,error))
|
||||||
|
@ -126,13 +126,8 @@ OPERATING_SYSTEM := cygwin
|
||||||
else ifeq ($(OS),Windows_NT)
|
else ifeq ($(OS),Windows_NT)
|
||||||
OPERATING_SYSTEM := Windows_NT
|
OPERATING_SYSTEM := Windows_NT
|
||||||
else
|
else
|
||||||
UNAME_S := $(shell uname -s 2>/dev/null)
|
PROCESSOR_ARCHITECTURE := $(shell uname -m 2>/dev/null)
|
||||||
ifeq ($(UNAME_S),Linux)
|
OPERATING_SYSTEM := $(shell uname -s 2>/dev/null)
|
||||||
OPERATING_SYSTEM := Linux
|
|
||||||
endif
|
|
||||||
ifeq ($(UNAME_S),Darwin)
|
|
||||||
OPERATING_SYSTEM := Darwin
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OPERATING_SYSTEM),Darwin)
|
ifeq ($(OPERATING_SYSTEM),Darwin)
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
ENV_VARS += DOCKER_HOST_IFACE DOCKER_HOST_INET
|
ENV_VARS += DOCKER_HOST_IFACE DOCKER_HOST_INET IPFS_PROFILE
|
||||||
|
|
||||||
|
IPFS_PROFILE ?= $(if $(filter-out amd64 x86_64,$(PROCESSOR_ARCHITECTURE)),lowpower,server)
|
||||||
|
|
||||||
# target node: Fire docker-network-create-% for DOCKER_NETWORK_PUBLIC node-ssl-certs stack-node-up
|
# target node: Fire docker-network-create-% for DOCKER_NETWORK_PUBLIC node-ssl-certs stack-node-up
|
||||||
.PHONY: node
|
.PHONY: node
|
||||||
|
|
|
@ -65,7 +65,14 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ssl-certs:/certs
|
- ssl-certs:/certs
|
||||||
ipfs:
|
ipfs:
|
||||||
image: ipfs/go-ipfs:latest
|
build:
|
||||||
|
args:
|
||||||
|
- DOCKER_BUILD_DIR=docker/ipfs
|
||||||
|
context: ../..
|
||||||
|
dockerfile: docker/ipfs/Dockerfile
|
||||||
|
image: ${DOCKER_REPOSITORY_NODE}/ipfs:${DOCKER_IMAGE_TAG}
|
||||||
|
environment:
|
||||||
|
- IPFS_PROFILE=${IPFS_PROFILE}
|
||||||
labels:
|
labels:
|
||||||
- SERVICE_4001_NAME=${COMPOSE_SERVICE_NAME}-ipfs-4001
|
- SERVICE_4001_NAME=${COMPOSE_SERVICE_NAME}-ipfs-4001
|
||||||
- SERVICE_5001_NAME=${COMPOSE_SERVICE_NAME}-ipfs-5001
|
- SERVICE_5001_NAME=${COMPOSE_SERVICE_NAME}-ipfs-5001
|
||||||
|
|
Loading…
Reference in New Issue