This is another DevOps Project, the idea of this project like the following:-
sample django web application on with the following specs:–
app should be production ready taking into consideration things such as scalability, availability & security.
The infrastructure to run this application is up to you but it should be automated via terraform or cloud formation. Infrastructure well architected framework will be used to evaluate the infrastructure as a whole.
harden the application for a production ready environment.
Regarding to Wikipedia, Serverless computing is a cloud computing execution model in which the cloud provider runs the server, and dynamically manages the allocation of machine resources. Pricing is based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity
Today i will show you an example how to create serverless website but this time not using Amazon AWS, Azure or OCI but Alibaba Cloud Provider.
Create a Function Compute Service
Go to the console page and click through to Function Compute.
Click the add button beside Services.
In the Service slide out, give your service a name, an optional description, and then slide open the Advanced Settings.
In Advanced Settings you can grant access for Functions to the Internet, to VPC resources, and you can attach storage and a log service to a Function. You can also configure roles.
For our tutorial, we will need Internet access so make sure this configuration is on.
We will leave VPC and Log Configs as they are.
In the Role Config section, select Create New Role, and in the dropdown list pick AliyunOSSReadOnlyAccess as we will be accessing our static webpages from an Object Storage Service bucket.
You will see a summary of the Role you created.
Click Confirm Authorization Policy.
You have successfully added the Role to the Service.
ou will see the details of the Function Compute Service you just created.
Now let’s create a Function in the Service. Click the add button next to Functions.
You will see the Create Function process. The first part of the process is Function Template.
There are many Function Templates available, including an empty Function for writing your own bespoke Functions.
Alibaba Cloud-supplied Template Functions are very useful as they have relevant method invocation and demo code for getting started quickly with Function Compute.
let’s choose the flask-web Function written in Python2.7.
We are now at the Configure Triggers section of creating a Function.
Select HTTP Trigger from the dropdown list. Give the Trigger a name and choose Authorization details (anonymous does not require authorization).
Choose your HTTP methods and click Next. We are going to build a simple web-form application so we will need both the GET and POST HTTP methods.
Now we arrive at the Configure Function Settings.
Give the Function a name then scroll down to Code details.
We’ll leave the supplied code for now. Scroll down to below the code sample.
You will see Environment Variable input options and Runtime Environment details.
Click Next at Configure Function Permissions.
Verify the Configuration details and click Create.
You will arrive at the Function’s IDE. Here you can enter new code, edit the code directly, upload code folders, run, test, and fix your code.
Copy the URL as we will need to add this to our static webpages so they can connect to our Function Compute Service and Function.
Set Up and Configure an OSS Bucket
Click through to Object Storage Service on the Products page.
If you haven’t yet activated Object Storage Service, go ahead and activate it. In the OSS console, click Create Bucket.
Choose a name for the OSS Bucket and pick the region – you cannot change the region later. Select the Storage Class – you also cannot change this later.
We have selected Public Read for the Access Control List.
When you’re ready, click OK.
You will see the Overview page for your bucket. Make a note of the public Internet URL.
In the Files tab, upload your static web files.
I uploaded a simple index.html homepage and a background picture.
In Basic Settings, click Configure to configure your Static Pages.
Add the homepage details and click Save.
Now go to a new browser window and access the OSS URL you saved earlier.
Back in the Function Compute console, you can now test the flask-app paths directly from the code.
We already tested index.html with no Path variable. Next, we test the app route signin with GET and check the Headers and status code.
The signin page code is working correctly. You can also check the Body to make sure the correct HTML will render on the page. Notice that because I entered the path variable, signin is appended to the URL.
Of course, any errors you encounter will show up in the Logs section for easy debugging.
Now, let’s test this page on the Internet.
If you get an error here, implement a soft link for the page in OSS. Go to the OSS bucket and click More dropdown for the HTML file in question and choose Set soft link.
Give the link a name and click OK.
A link file will appear in the list of static files and you will now be able to access the page online with the relevant soft link and it will render as above.
Back in Function Compute, we can test the POST method in the console with the correct username and password details in the same way.
Add the POST variables to the form upload section in the Body tab.
This blog post is one of that kind that took much time and consume so much energy, to complete this post it took me around ten days to make sure that I will cover most of the available services and make it readable for people, Be sure the services can change while you are reading this post ; if you have any comments,or add something to this post, please send me an email – using contact us page or by comments below.
I am writing this post to share a different cloud providers services and the comparison between each one of them, this will show various naming services for each one of them.
Earlier we used to store our data to H.D.D or USB flash, Cloud Computing services have replaced such hard drive technology. Cloud Computing service is nothing but providing services like Storage, Databases, Servers, networking, and software through the Internet.
Cloud Computing is moving so fast, in 2020 the cloud now is more mature, going multi-cloud, and likely to become more focused on vertical and a sales ground war as the leading vendors battle for market share.
GCP : Google Cloud Provider
OCI :- oracle cloud infrastructure
None : not meaning the services is not available necessarily by cloud provider but i didn’t look deeper into this or i didn’t use it before.
When the company will move to the cloud, the biggest question to ask , how much it will cost ? there are different ways to determine your IaaS cost, but at first you need to know that PaaS and IaaS much cheapter than IaaS, Each cloud vendor having their own calculator so at least you can estimate the value for one year or understand how much it will cost ? which is good.
Let’s Start with Azure for example ( since i post a lot about it recently )
When you are estimate the price for any cloud you should take different factors in your mind such as the following :-
Tier it’s free , Basic … etc
How will the clinet/customer pay ? monthly , Yearly , Pay as you go .. etc
Supprot for the cloud which option you will choose
The deployement princing for example in Azure Dev/test .. etc
Now Azure provides the client with real pricing calculator that allow people to estimate the cost, From here.
to use the portal you should know what services you will choose, and some esstinal information such as How many VM, Database, networking, after you add all the information the report will be generated depends on the period of paying.
But what if i want to move from On Premis to the cloud , is this tool will work ? Total Cost of Ownership or TCO from here
The TCO Calculator helps you understand the cost areas that affect your applications today, such as server hardware, software licenses, electricity, and labor by Define the following :-
Servers : -details of your current on-premises
Databases :- on-premises database infrastructure
Storage :- on-premises storage infrastructure
Networking :- on-premises environment
The Genterated report will be like this :-
As i already mentioned each Cloud vendor having different apporach of Cloud Pricing but it’s all the same, in AWS you can access the pricing from here , also they have somthing called SIMPLE MONTHLY CALCULATOR From here.
When you generate an estimate, you can either add services directly to your estimate or create a group and add the services to your group.
The AWS Pricing Calculator is an estimation tool that provides an approximate cost of using AWS services based on the usage parameters that you specify. The AWS Pricing Calculator is not a quote tool, and does not guarantee the cost for your actual use of AWS services. The cost estimated by the AWS Pricing Calculator may vary from your actual costs for a number of reasons. Common reasons the estimate may be different from your actual cost include different thing such as Actual Usage, Region used, Change in price, Taxes ( depends on the Region ) .. etc
From Oracle , the portal is very simple to use, you can estimate everything using this portal here from Infrastcure cost, database, Application, … etc .
If you use PuTTY to connect to your instance and get either of the following errors, Error: Server refused our key or Error: No supported authentication methods available, verify that you are connecting with the appropriate user name for your AMI. Enter the user name in the User name box in the PuTTY Configuration window.
The appropriate user names are as follows:
For an Amazon Linux AMI, the user name is ec2-user.
For a RHEL AMI, the user name is ec2-user or root.
For an Ubuntu AMI, the user name is ubuntu or root.
For a Centos AMI, the user name is centos.
For a Fedora AMI, the user name is ec2-user.
For SUSE, the user name is ec2-user or root.
Otherwise, if ec2-user and root don’t work, check with the AMI provider.
The Data Uploaded to the Cloud Vendor Amazon web services ( AWS ) But the client decided to move their data on-premises for the first sight you will think this is hard and needs a lot of work but thank you SQL Developer and Jeff Smith and he is the product manage for SQL Developer amazing man by the way and crossfitter at the same time 😛
However Lets start :-
Open SQL developer
Choose Database copy option from tools menu.
Select source database should be AWS
Provide hostname only for the AWS
Test your connection.
Select destination database should be Oracle
Provide hostname only for the AWS.
Provide hostname/IP for the server.
Test your connection.
Press Next Button, if the migration done before on the same schema press replace and next.
Press Next after choose what you want to move, Data, Functions , Or trigger … etc
Check Proceed to summary and Press the finish button the migration will start after this, it will take some time depend on internet connection and data size.