Saturday, December 12, 2020

What is Life cycle Management in AWS S3 service and how to enable it

 Life Cycle Management is a mechanism that helps the user in transitioning the data between different storage classes automatically without the need for manual intervention. This is a smart way of reducing the storage cost while designing architecture with the S3 service requirement.

One can create a life cycle rule by navigating to Management option in bucket and clicking on create life cycle.



Each life Cycle rule support 5 rule actions using which the objects are transitioned from one storage class to another.

  1. Current Version Transitioning Action
  2. Previous Version Transitioning Action
  3. Permanent deletion of previous versions
  4. Expiring the current version of object based on timeline
  5. Deleting the expired delete markers or incomplete uploads.

Friday, December 11, 2020

Points to be remembered on Versioning in AWS S3 bucket

 Below are the few points to be remembered about AWS S3 versioning

  • Once versioning is enabled on to an AWS S3 bucket, the user will only be able to suspend the services. Once suspended versioning will be disabled for new objects in the bucket, however, the old objects would still have the versioned files.
  • When using public access option on S3 versioning, every new version of an object needs to be manually made public.

  • The public domain of a file would directly points to the latest version of file, if the user wants to point to another version, he/she has to mention the version id in the public URL. for Example, 
https://awscertificationparctise.s3.amazonaws.com/dummy.txt?versionId=q6IPedWI.TefbO4Xr8jcKk_DFH0mP9n1

How to enable versioning in AWS S3

 AWS Simple Storage Service (S3) support simple versioning mechanism which helps the user/company to store multiple version of the same object. This helps us in the use case, wherein which a file should not be overwritten if the user/company tries to upload the same file again.

1.To enable the versioning mechanism in an existing bucket, the user has to simply enable the option under Properties tab of the bucket. as shown in the below image.


2. AWS also allows the user to specify the versioning capability at the time of S3 bucket creation.



Sunday, August 9, 2020

Docker : Selenium Grid on Docker

This blog post, I will be showing you on how to set up a selenium grid using Docker and running multiple chrome and firefox instances on containers. 

Now you might doubt if I have multiple machines, why can't I set up the grid directly on them, well the answer is Yes! you can, but consider a case, where you have limited machines available but with a twist that during automation test, the runs should open only one browser instance on the machine. 

Well, no worries, that is when the containers come to the rescue, the reason is containers mostly act as individual entities depending on few core kernel capabilities, so you can spin chrome or firefox containers thereby supporting the business requirement without need of additional infra.


Before proceeding, make sure that you have the latest Docker setup running on your machine.

Now, we are good with Docker setup. Its time to pull the selenium image from Docker public repositories. Yes, you heard it correct, we are not writing any docker file from scratch because the selenium community has already taken care of this. They have made a public image saving the users from right a Dockerfile with all the dependencies.


You can find the list of available images tag names here. In this example, I will be using the selenium hub image and selenium chrome and firefox images.


First, pull the selenium hub image using the docker command

"docker pull selenium/hub"


The first step is to create a docker network on which the hub and agent can connect with each other
 "docker network create grid"    

Now run the image, in this example, I am naming my container as codeanyway_hub in the command

"docker run -d -p 4444:4444 --net grid --name selhub_codeanyway selenium/hub"



To verify if your grid is up and running, open your browser and open the selenium grid URL 


Now our grid hub is up, now connect your chrome and firefox instances.


First, pull your images


Chrome node:  "docker pull selenium/node-chrome"

Firefox node: "docker pull selenium/node-firefox"

Using the images, create the containers for each chrome and firefox instance.

For Chrome:

docker run --net grid -e HUB_HOST=selhub_codeanyway -v /dev/shm:/dev/shm selenium/node-chrome

For Firefox:
docker run --net grid -e HUB_HOST=selhub_codeanyway -v /dev/shm:/dev/shm selenium/node-firefox


As my requirement is two chrome and two firefox nodes on a separate instances, I will run the docker commands again for both chrome and firefox nodes. Once the commands are run, you can see 4 nodes (2 chrome and  2 firefox nodes) active on the selenium grid.