Magento Cloud: Overview and Setup (P1)

1. What is Magento Cloud ?

Magento Commerce Cloud is a managed, automated hosting platform for the Magento Commerce software. Magento Commerce Cloud comes with a variety of additional features that sets it apart from the on-premise Magento Commerce and Magento Open Source platforms:

Cloud Benefits

Magento Commerce Cloud provides a pre-provisioned infrastructure that includes PHP, MySQL, Redis, RabbitMQ, and Elasticsearch technologies; a git-based workflow with automatic build and deploy for efficient Rapid development and Continuous deployment every time you push code changes in a Platform as a Service (PaaS) environment; highly Customizable environment configuration files and tools; and AWS hosting that offers a Scalable and Secure environment for online sales and retailing.

Technology stack

Think of the Magento Commerce Cloud as five functional layers, as shown here:

Cloud Stack

Amazon Web Services (AWS) powers the underlying Infrastructure as a Service (IaaS) for Magento Commerce Cloud. Each Magento Commerce Cloud plan provides a PaaS Integration environment for developing, testing, and integrating services, see Magento Commerce Cloud architecture for a comparison and additional features. Performance tools provide granular visibility into the site performance and PHP profiling. Fastly caches site assets and, as customers access the site and stores, loads the cached assets fast. The Fastly Image Optimization (IO) offloads image processing and resizing load, freeing servers to process orders and conversions efficiently.

2. Setup Magento Cloud

a. Prerequisite

Your company have registed a Magento Cloud Plan.

After your company purchases a subscription plan for Magento Commerce Cloud, the only person who initially has access to the project and code is the Project Owner.

The Project Owner is the person in your business or finance organization that manages payments and other business-related issues for the Magento Commerce Cloud account. The Project Owner serves as the point of contact with Magento.

To quickly onboard your project so you can develop your site for live deployment, you need to complete specific set up steps and onboarding tasks. Typically, the Project Owner begins the process by securing Admin access and creating Technical Admin users that can help with set up, customization, and development work.

b. Create access key Magento

Access URL below and register an account : https://marketplace.magento.com

Save public and private key.

c. Install Magento Cloud CLI on local machine

curl -sS https://accounts.magento.cloud/cli/installer | php
source $HOME/.bashrc
export PATH=$PATH:$HOME/.magento-cloud/bin

Verify the magento-cloud command is in your path by entering the following command:

magento-cloud list

d. Create SSH Keys and add to Magento

To check for SSH keys, enter the following command:

ls ~/.ssh

If you have SSH keys, a directory listing is displayed similar to the following:

id_rsa  id_rsa.pub  known_hosts

If you have SSH keys you can skip the step create SSH keys

To create an SSH key pair:

ssh-keygen -t rsa

When prompted to “Enter a file in which to save the key,” press Enter to save the file to the default location. The prompt displays the location.

When prompted to enter a secure passphrase, enter a phrase to use like a password

After creating the SSH key pair, start the ssh-agent:

eval "$(ssh-agent -s)"

Add the SSH key to the ssh-agent

ssh-add ~/.ssh/id_rsa

Add a public SSH key to your Magento account

magento-cloud login
magento-cloud ssh-key:add ~/.ssh/id_rsa.pub

e. Initialized environment Master

After new project is created, add Variables

Name : env:COMPOSER_AUTH

Value : {
“http-basic”: {
“repo.magento.com”: {
“username”: “<public-key>”,
“password”: “<private-key>”
}
}
}

After add Variable, initialized environment Master with profile Magento Enterprise Cloud Edition

If the project is failed to build, check the log

If the log have follow content that mean you have Incorrect credentials

Troubleshooting

Log in to the machine on which your SSH keys are located.

Log in to your project:

magento-cloud login

List your projects:

magento-cloud project:list

If necessary, clone a project.

magento-cloud project:get 

Choose Directory and branch to clone project

Change to a project directory.

Update auth.json and redeploy the environment

  • Open auth.json in a text editor.
  • Change the value of username to your Magento Commerce public key.
  • Change the value of password to your Magento Commerce private key.
  • Save your changes to auth.json and exit the text editor.

Add, commit, and push your changes:

git add -A
git commit -m "<message>"
git push

If the log have follow content that mean the file failed to checksum

Troubleshooting

Change to a project directory.

Delete file “composer.lock”

Copy the lastest “composer.lock” from https://github.com/magento/magento-cloud to project directory.

Add, commit, and push your changes

If build success you can access Magento via URL :

f. Create User Admin

From local host, SSH into Magento workspace

Run command below to create user admin

php bin/magento admin:user:create --admin-user=abc --admin-password=xyz –admin-email=abc@xyz.com --admin-firstname=abc –admin-lastname=xyz

Access URL : <URL>/admin to check if user admin is created

Leave a Reply

Your email address will not be published. Required fields are marked *