Switch to ARM architecture (M1 chip)

Edit on GitHub

This document describes how to switch Docker based projects to ARM architecture. This lets you run Spryker projects on M1 based Apple devices.

To switch to ARM architecture, follow the steps:

Update Sass

Replace x86 based Sass with an ARM based one:

  1. In package.json, remove node-sass dependencies.
  2. Add sass and sass-loader dependencies.
...
"sass": "~1.32.13",
"sass-loader": "~10.2.0",
...
  1. Update @spryker/oryx-for-zed:
...
"@spryker/oryx-for-zed": "~2.11.5",
...
  1. In frontend/configs/development.js, add configuration for saas-loader:
loader: 'sass-loader',
options: {
   implementation: require('sass'),
}
  1. Enter the Docker SDK CLI:
docker/sdk cli
  1. Update package-lock.json and install dependencies based on your package manager:
    • npm:
    npm install
    
    • yarn:
    yarn install
    
  2. Rebuild Yves:
npm run yves
  1. Rebuild Zed
npm run zed

Update RabbitMQ and Jenkins services

In the deploy file, update RabbitMQ and Jenkins to ARM supporting versions. Example:

services:
...
    broker:
        engine: rabbitmq
        version: '3.9'
        api:
            username: 'spryker'
            password: 'secret'
        endpoints:
            queue.spryker.local:
            localhost:5672:
                protocol: tcp
...
        scheduler:
        engine: jenkins
        version: '2.324'
        endpoints:
            scheduler.spryker.local:
...

Enable Jenkins CSRF protection

  1. In the deploy file, enable the usage of the CSRF variable:
...
services:
  scheduler:
    csrf-protection-enabled: true
...
  1. In the config file, enable Jenkins CSRF protection by defining the CSRF variable:
...
$config[SchedulerJenkinsConstants::JENKINS_CONFIGURATION] = [
    SchedulerConfig::SCHEDULER_JENKINS => [
        SchedulerJenkinsConfig::SCHEDULER_JENKINS_CSRF_ENABLED => (bool)getenv('SPRYKER_JENKINS_CSRF_PROTECTION_ENABLED'),
    ],
];
...

Now your project supports ARM architecture and you can run it on M1 based Apple devices.