From b12f04b05b95b146154c1d4b63f65fe071b6d605 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Fri, 15 Sep 2023 17:54:17 +0100 Subject: [PATCH 1/2] added changes for apple silicon --- deploy/general.env | 4 ++++ deploy/services.yml | 10 +--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/deploy/general.env b/deploy/general.env index be277245..621226a7 100644 --- a/deploy/general.env +++ b/deploy/general.env @@ -1 +1,5 @@ # any other variables that you may want to use go here + +# This is used to explicitly inform systems that run on Apple silicon to emulate this architecture +# Remove if this causes issues on any other platform +DOCKER_DEFAULT_PLATFORM=linux/amd64 \ No newline at end of file diff --git a/deploy/services.yml b/deploy/services.yml index 06d4ba16..3b08d662 100644 --- a/deploy/services.yml +++ b/deploy/services.yml @@ -159,7 +159,6 @@ services: #---------------------------------------------------------------------------# ocr-service-1: container_name: ocr-service-1 - platform: linux image: cogstacksystems/cogstack-ocr-service:0.2.4 restart: always # mem_swappiness: 0 @@ -193,7 +192,6 @@ services: ocr-service-2: container_name: ocr-service-2 - platform: linux image: cogstacksystems/cogstack-ocr-service:0.2.4 restart: always # mem_swappiness: 0 @@ -227,7 +225,6 @@ services: ocr-service-3: container_name: ocr-service-3 - platform: linux image: cogstacksystems/cogstack-ocr-service:0.2.4 restart: always # mem_swappiness: 0 @@ -261,7 +258,6 @@ services: ocr-service-4: container_name: ocr-service-4 - platform: linux image: cogstacksystems/cogstack-ocr-service:0.2.4 restart: always # mem_swappiness: 0 @@ -446,7 +442,6 @@ services: elasticsearch-1: image: ${ELASTICSEARCH_DOCKER_IMAGE:-opensearchproject/opensearch:2.6.0} container_name: elasticsearch-1 - platform: linux shm_size : 1024mb restart: always # mem_limit: 2g @@ -539,7 +534,6 @@ services: elasticsearch-2: image: ${ELASTICSEARCH_DOCKER_IMAGE:-opensearchproject/opensearch:2.6.0} container_name: elasticsearch-2 - platform: linux shm_size : 1024mb restart: always # mem_limit: 2g @@ -632,7 +626,6 @@ services: elasticsearch-3: image: ${ELASTICSEARCH_DOCKER_IMAGE:-opensearchproject/opensearch:2.6.0} container_name: elasticsearch-3 - platform: linux shm_size : 1024mb restart: always # mem_limit: 2g @@ -1002,7 +995,7 @@ services: - GROUP_ID=${NIFI_GID:-1000} - NIFI_WEB_PROXY_HOST=${NIFI_WEB_PROXY_HOST:-"0.0.0.0:8443,cogstack:8443,nifi:8443"} - NIFI_WEB_PROXY_CONTEXT_PATH=${NIFI_WEB_PROXY_CONTEXT_PATH:-"/,/nifi,/nifi-api,/nifi-api/,/nifi/"} - - NIFI_INTERNAL_PORT=${NIFI_INTERNAL_PORT:-8443} + - NIFI_INTERNAL_PORT=${NIFI_INTERNAL_PORT:-8443}d - NIFI_OUTPUT_PORT=${NIFI_OUTPUT_PORT:-8082} - NIFI_INPUT_SOCKET_PORT=${NIFI_INPUT_SOCKET_PORT:-10000} - NIFI_SECURITY_DIR=${NIFI_SECURITY_DIR:-../security/nifi_certificates/} @@ -1115,7 +1108,6 @@ services: # - no_proxy=$no_proxy container_name: cogstack-jupyter-hub restart: always - platform: linux env_file: - ./jupyter.env environment: From e92d04f63df545c8f8405769db17d441bf936da4 Mon Sep 17 00:00:00 2001 From: adam-sutton-1992 Date: Fri, 15 Sep 2023 18:30:20 +0100 Subject: [PATCH 2/2] added documentation --- docs/deploy/main.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/deploy/main.md b/docs/deploy/main.md index 399b6b9a..ebfa7eb5 100755 --- a/docs/deploy/main.md +++ b/docs/deploy/main.md @@ -114,6 +114,30 @@ Common issues that can be encountered across services.

+#### **Apple Silicon** + +Many services cannot run natively on Apple Silicon (such as M1 and M2 architectures). Common error messages related to Apple silicon follow patterns similar to: +

+ - `no match for platform in manifest` +

+

+ - `no matching manifest for linux/arm64/v8 in the manifest list entries` +

+

+ - `image with reference cogstacksystems/cogstack-ocr-service:0.2.4 was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64` +

+To solve these issues; Rosetta is required and enabled in Docker Desktop. Finally an environment variable is required to be set. + +Rosetta can which can be installed via the following command: +``` +softwareupdate --install-rosetta +``` +When Rosetta and Docker Desktop are installed, Rosetta must be enabled. This done by going to Docker Desktop -> Setting -> General and enabling "Use Virtualization framework". After in the same settings go to "features in development" -> "Use Rosetta for x86/amd64 emulation on Apple Silicon". Finally execute the following command: +``` +export DOCKER_DEFAULT_PLATFORM=linux/amd64 +``` +to set the environment variable. These issues are known to occur on the "cogstack-nifi", "cogstack-ocr-services" and "jupyter-hub" services and may occur on others. + #### **NiFi** When dealing with contaminated deployments ( containers using volumes from previous instances ) :