Skip to content

Commit ce8c653

Browse files
committed
Squashed code for initial open-source GitHub release
Original ref: a0867e69deb41b0731d1a42da3fa20ca9c9ebf56
0 parents  commit ce8c653

File tree

551 files changed

+16437
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

551 files changed

+16437
-0
lines changed

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/tmp/*
2+
!/tmp/.gitkeep
3+
4+
/artifacts/
5+
/roles/*
6+
!/roles/cs.*
7+
8+
/vars/*
9+
/vars/global/*
10+
/vars/project/*
11+
!/var/global/.gitkeep
12+
!/var/project/.gitkeep
13+
14+
*.pyc
15+
__pycache__/
16+
*.retry
17+
*.box
18+
*.tmp
19+
.tmp.*
20+
21+
/test.*

LICENSE

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
MIT LICENSE
2+
3+
Copyright 2016-2020 creativestyle GmbH
4+
5+
https://creativestyle.de
6+
Creativestyle GmbH
7+
Erika-Mann-Straße 53
8+
80636 München
9+
Deutschland
10+
11+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
12+
and associated documentation files (the "Software"), to deal in the Software without restriction,
13+
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
15+
subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included in all copies or substantial
18+
portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
21+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25+

README.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<p align="center">
2+
<img alt="MageSuite" width="211" src="https://avatars2.githubusercontent.com/u/56443641?s=200&v=4">
3+
</p>
4+
5+
<p align="center">
6+
<em>Ansible-based infrastructure-as-code for hosting and deploying Magento-based shops.</em>
7+
</p>
8+
9+
# Infrastructure Provisioning
10+
11+
## MageSuite ecosystem
12+
13+
Altough it's possible to use this code to hosting any Magento based shop,
14+
some features are only avaialble (and tailored for) [MageSuite](https://magesuite.io/) ecosystem.
15+
16+
## Cloud infrastructre
17+
18+
Currently the full feature set is only available when using AWS as the cloud platform, however,
19+
it's possible (and tested) to use this code to provision any CentOS 7 VM including local development environment.
20+
21+
_PS There's also an [experimental docker container](https://github.com/mageops/docker-centos-systemd) which can
22+
be fully provisioned by this code and run a full CentOS installation like a VM. This is intended to be used
23+
only for local development though and not yet supported_.
24+
25+
## Feature highlights
26+
27+
- Out-of-the-box autoscaling
28+
- Zero-downtime deployments<sup>1</sup>
29+
- Nodes are warmed up when new code is being deployed before being attached
30+
to the varnish load-balancer to avoid cache generation penalty after traffic hit
31+
- Varnish caching tailored for Magento with multiple configurable custom features
32+
- Redis Magento cache backend with
33+
- Separate redis instance for session storage
34+
- Customizable multi-website / multi-shop deployments
35+
- Letsencrypt certificates support
36+
- Cloudfront CDN
37+
- Media stored on S3
38+
- Seamless image optimization via Lambda@Edge (with webp support)
39+
- Support for file sharing across nodes via AWS EFS
40+
- Per path pattern customizable PHP limits
41+
- Customizable request throttling (rate-limiting)
42+
- On-demand import instance
43+
- EC2 instance started for scheduled imports automatically and terminated
44+
once the import is finished
45+
- Allows to use a different instance type for heavy scheduled imports
46+
and perform them without disrupting the site performance for end-users
47+
- Customizable rules for routing traffic to separate set of special purpose extra-instances
48+
- Routing rules based on user-agent and request path patterns
49+
- Useful for processing heavy workloads without disrupting shop performance (e.g. ERP Magento API integrations)
50+
- Magento queue consumers support with RabbitMQ and supervisord
51+
- Logs pushed to CloudWatch with slack notifications for critical errors
52+
- VPC and SG-based network communication rules allowing internal service communication
53+
strictly on a need-to basis
54+
- ... any many more!
55+
56+
<sup>1</sup> Needs at least 2 app nodes and requires certain MageSuite extensions. Also it might not be
57+
possible depending on changes in relation to previous release in the code being deployed (DB migrations, ...).
58+
59+
## Initial open-source release
60+
61+
The code has been cleaned up and all commits squashed for the first public release.
62+
63+
The previous internal repository had **2000+ commits**, **300+ merge requests** created by
64+
10+ contributors across **3+ years of development**.
65+
66+
The current state is a result of hundreds of hours of meetings, debugging, brainstorms
67+
investigations and combined expertise of all our developers, PMs and clients.
68+
69+
A lot of the solutions are tailored for solving real-world problems and use-cases that came
70+
up when hosting and maintaining highly-customized Magento-based shops. The value of such
71+
experience-based solutions cannot be overestimated. It wouldn't be possible to come up and
72+
design all of these tiny details form scratch without having went through the all of problems first-hand.
73+
74+
## Documentation
75+
76+
At the time of open source release most of the documentation was scattered
77+
across internal creativestyle services thus any leftovers have been removed
78+
to avoid confusion. New documentation will start appearing shortly as part
79+
of this repository succesively.
80+
81+
82+
<p align="right">
83+
<em>Brought to life by</em><br/>
84+
<a href="https://creativestyle.pl">
85+
<img src="https://images.squarespace-cdn.com/content/59144053ff7c509585045a38/1494845103833-S34MR8ONLUWAXOKQSM7O/CS_logo_colour.png?format=500w&content-type=image%2Fpng" width="160"/>
86+
</a>
87+
</p>

ansible.cfg

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[defaults]
2+
ansible_python_interpreter = python
3+
4+
remote_user = root
5+
host_key_checking = no
6+
7+
retry_files_enabled = no
8+
9+
forks = 20
10+
internal_poll_interval = 0.001
11+
12+
stdout_callback = yaml
13+
deprecation_warnings = yes
14+
show_custom_stats = yes
15+
display_failed_stderr = yes
16+
display_ok_hosts = yes
17+
display_skipped_hosts = yes
18+
19+
bin_ansible_callbacks = yes
20+
21+
# fact_caching = yaml
22+
fact_caching_connection = tmp/fact_cache
23+
fact_caching_timeout = 2700
24+
fact_caching_prefix = mageops-facts
25+
26+
callback_whitelist = timer, profile_tasks
27+
28+
[callback_profile_tasks]
29+
task_output_limit = 50
30+
order = descending
31+
32+
[inventory]
33+
enable_plugins = host_list, script, auto, yaml, ini, aws_ec2, constructed
34+
cache = no
35+
cache_plugin = yaml
36+
cache_connection = tmp/inventory_cache
37+
cache_timeout = 1800
38+
cache_prefix = mageops-inventory
39+
40+
41+
[ssh_connection]
42+
pipelining = yes
43+
control_path_dir = ~/.local/var/ssh
44+
control_path = %(directory)s/%%C
45+
ssh_args = -o ControlMaster=auto -o ControlPersist=30m -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
46+
47+
[persistent_connection]
48+
command_timeout = 30
49+
connect_timeout = 30
50+
connect_retry_timeout = 30

docs/assets/aws-diagram.png

496 KB
Loading

docs/assets/creativestyle.png

11.4 KB
Loading

docs/assets/mageops.png

10.9 KB
Loading

filter_plugins/__init__.py

Whitespace-only changes.

filter_plugins/sanitize.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from __future__ import (absolute_import, division, print_function)
2+
__metaclass__ = type
3+
4+
5+
from ansible.plugins.inventory import to_safe_group_name
6+
7+
class FilterModule(object):
8+
def filters(self):
9+
return {
10+
'to_safe_group_name': to_safe_group_name,
11+
}
12+

0 commit comments

Comments
 (0)