Skip to content

ShopFactory Cluster

Shopfactory is what we call our production environment. It is built as an API api1.shopfactory.io (https://api1.shopfactory.io/doc/) behind the scenes it is a mix of puppet + some custom workers. To the side we have multiple services (apps, news, blogs etc.) that are running in a Kubernetes cluster. 

The shopfactory api is maintained by the Linux department where Tommy Bjerg is the main contact point. Services are running on top of a Kubernetes cluster that is managed by Infrastructure mainly Lasse. They are only responsible for making sure it is running. What and how we deploy to it is E-com's responsibility. 

Architecture diagram

So what is running where?

Shopfactory is resposible for the Administration, FTP, SOAP API, Storefronts and GraphQL (Admin/Public schema). And our Kubernetes cluster is running all services: Apps, News, Blogs, Heimdal, VAT-Rates, Webhooks and Ragnarok.  

Use cases:

Adding a shard to shopfactory

https://gitlab.group.team.blue/hostedshop/proj/deploy change in https://gitlab.group.team.blue/hostedshop/proj/deploy/-/blob/master/src/Commands/SyncLegacySymlinks.php

Adding a new PHP node to a shopfactory cluster

Repo for sw-deploy: https://gitlab.group.team.blue/hostedshop/proj/deploy

When a new PHP node is added to shopfactory it needs the application code + legacy symlinks before joining the load-balancer. You can populate a node with the following command:

# SSH to codedeploy
ssh smartweb@codedeploy1.shopfactory.io

# Go to
cd /home/smartweb/code/smartweb/install

# This command creates some legacy symlinks that is necessary.
sw-deploy sync:symlinks --nfs-link-in-current-dir

# This command will find a "random" PHP node running in production and copy the whole /code folder to the [target-ip-address]
sw-deploy sync:servers [new-php-node-ip-address]

# Want details about sw-deploy see [https://gitlab.group.team.blue/hostedshop/proj/deploy](https://gitlab.group.team.blue/hostedshop/proj/deploy)

Move a tenant database to a new MySQL

See https://confluence.zitcom.dk/display/FU/Commander