You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/deployment/aws.rst
+53-3Lines changed: 53 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,62 @@ Amazon Web Services
5
5
6
6
AWS is a Cloud platform service offering compute power, data storage, and a wide array of other IT solutions and utilities for modern organizations. AWS was launched in 2006, and has since become one of the most popular cloud platforms currently available.
7
7
8
+
We should have an account in `AWS <https://aws.amazon.com/>`_ to use aws services.
8
9
It offers many featured services for compute, storage, networking, analytics, application services, deployment, identity and access management, directory services, security and many more cloud services.
9
10
10
-
To use AWS for python, check `this<https://aws.amazon.com/developer/language/python/>`_
11
+
To use AWS for python, check `https://aws.amazon.com/developer/language/python/<https://aws.amazon.com/developer/language/python/>`_
11
12
12
-
We use `Boto3 <https://github.com/boto/boto3>`_ (python package) which provides interfaces to Amazon Web Services, it makes us easy to integrate our Python application, library, or script with AWS services
13
+
We can use `Boto3 <https://github.com/boto/boto3>`_ (python package) which provides interfaces to Amazon Web Services, it makes us easy to integrate our Python application, library, or script with AWS services
13
14
14
15
Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of services like Amazon S3(Simple storage service) and Amazon EC2(Elastic Compute Cloud).
15
16
16
-
.. Boto provides an easy to use, object-oriented API as well as low-level direct service access.
17
+
.. Boto provides an easy to use, object-oriented API as well as low-level direct service access.
18
+
19
+
20
+
21
+
22
+
Amazon Elastic Cloud Compute (EC2)
23
+
++++++++++++++++++++++++++++++++++++++++++
24
+
`Amazon Elastic Compute Cloud (Amazon EC2) <https://aws.amazon.com/ec2/>`_ is a web service that provides resizeable computing capacity.
25
+
26
+
We use Amazon EC2 to launch a virtual servers and also configure security , networking, and manage storage. It enables us to scale up or down depending the requirement.
27
+
28
+
+ It provides virtual computing environments called as `instances`
29
+
+ Various configurations of CPU, memory, storage, and networking capacity are available for our instances, known as instance types.
30
+
31
+
32
+
33
+
34
+
35
+
Amazon Elastic Beanstalk
36
+
++++++++++++++++++++++++++++++++++
37
+
`AWS Elastic Beanstalk <https://aws.amazon.com/elasticbeanstalk/>`_ is a service for deploying and scaling web applications and services.
38
+
Elastic Beanstalk will also run instances (Computing environments) EC2, and it has some additional components like Elastic Load Balancer, Auto-Scaling Group, Security Group.
39
+
40
+
We pay only for the EC2 instances or S3 buckets and aws-DB we use and the other features like Elastic Load Balancer, Auto-Scaling Group, Security Group in Elastic Beanstalk do not cost anything.
41
+
42
+
43
+
44
+
45
+
46
+
Amazon Lambda
47
+
++++++++++++++++++++++++++++++++++
48
+
`Amazon Lambda <https://aws.amazon.com/lambda/>`_ is a computing service which automatically manages the server. AWS Lambda executes our code only when needed and scales automatically, from a few requests per day to thousands per second.
49
+
50
+
We only pay for the compute time we comsume , and there will be no charge if the code is not running.
51
+
52
+
The initial purpose of lambda is to simplify building on-demand applications that are responsive to events.
53
+
AWS starts a Lambda instance within milliseconds of an event.
54
+
55
+
56
+
57
+
58
+
Deployment in AWS services:
59
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60
+
Once we connect with the server using ssh , then the deployment will be same for all services. Which is same as in the example mentioned in the next chapter
Copy file name to clipboardExpand all lines: source/deployment/docker.rst
+91Lines changed: 91 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,3 +13,94 @@ Containerization is an approach in which an application or service, its dependen
13
13
The containerized application can be tested as a unit and deployed as a container image instance to the host operating system (OS).
14
14
15
15
Docker is an open-source tool for automating the deployment of applications.
16
+
17
+
18
+
19
+
Docker Compose
20
+
++++++++++++++++++++
21
+
`Compose <https://docs.docker.com/compose/overview/>`_ is a tool for running multi-container applications like for example a container with a DataBase and an application.
22
+
We can start/stop multiple services using compose with a single command.
23
+
24
+
We can create multiple compose files each for production, staging, development, testing, as well as CI,
25
+
and each will be isolated with each other.
26
+
27
+
To use compose
28
+
29
+
+ Create a :code:`Dockerfile` where all our environment configuration and initial packages are mentioned.
30
+
+ Create a file :code:`docker-compose.yml` , and mention all the services which we would be using.
31
+
+ Finally run :code:`docker-compose up` .
32
+
33
+
34
+
:code:`Dockerfile`
35
+
36
+
.. code-block:: shell
37
+
38
+
FROM python:3.4-alpine # 1
39
+
ADD . /code #2
40
+
WORKDIR /code #3
41
+
ADD requirements.txt /code/ #4
42
+
RUN pip install -r requirements.txt #5
43
+
44
+
45
+
46
+
In the above file we
47
+
48
+
+ In :code:`#1` we are building an image starting with the Python 3.4 image
49
+
+ In :code:`#2` and :code:`#3` we are adding directory :code:` . ` into the path :code:`/code` in the image and making it the working directory.
50
+
+ In :code:`#4` and :code:`#5` we adding the requirements file to the :code:`/code/` directory and installing all requirements.
51
+
52
+
.. + In :code:`#6` we are running the command :code:`python app.py`
0 commit comments