Month: August 2022

AI-coding assistant: Amazon CodeWhisperer

There has been major disruption in technology and software engineering segment for last several years. Different tech giants are trying to come up with different solutions to make the life easier. We are seeing lots of low code/no code platform like Amazon Honeycode, Google AppSheet, Assembla, Appfarm etc. now which can be leveraged with very minimum/no coding expertise in building different business solution. Potentially we might see dynamic shift in coming days.

We all know about Github Copilot which works as AI-coding assistant. Many developers have already adopted this for their development process. Now AWS came up with Amazon CodeWhisperer to provide the similar or better kind of service.

For instance, if you want to write a code in python and comment “Function to upload a code in S3 bucket”, CodeWhisperer will assist with the required code like below:

According to Amazon, this will not only assist with the coding assistance but also consider the followings as well:

  1. It will keep your coding style into consideration:
    CodeWhisperer automatically analyses the comment, determines which cloud services and public libraries are best suited for the specified task, and recommends a code snippet directly in the source code editor. The recommendations are synthesized based on your coding style and variable names and are not simply snippets
  2. Security is considered:
    CodeWhisperer keeps security as a priority, too, claims Amazon. It provides security scans for Java and Python to help developers detect vulnerabilities in their projects and build applications responsibly. It also includes a reference tracker that detects whether a code recommendation might be similar to particular training data. Developers can then easily find and review the code example and decide whether to use the code in their project.

More details can be found at https://aws.amazon.com/codewhisperer/

If anyone wants to preview Amazon Whisperer, need to signup at https://pages.awscloud.com/codewhisperer-sign-up-form.html

We might see that there is minimum/no entry barrier to become a development engineer for many cases in coming days.

Sprint Based Decision Making

As a team, we always come up with different challenges. Without précised and directional discussion, we fail to find proper solution to that. Sprint based decision making can help here to find an optimized solution participated by all the team members which reduces the unstructured discussion.

The steps are

  1. Start with Problems — 7 MINS
  2. Present Problems — 4 MIN PER PERSON
  3. Select Problems to Solve— 6 MIN
  4. Reframe Problems as Standardised Challenges — 6 MIN
  5. Produce Solutions — 7 MIN
  6. Vote on Solutions — 10 MINS
  7. Prioritise Solutions -30 Seconds
  8. Decide what to execute on — 10 MINS
  9. Turn Solutions into Actionable Tasks — 5 MINS

Jonathan has shared it beautifully in the following link. I am confident that it would be really helpful for many of us.

https://medium.muz.li/a-super-simple-exercise-for-solving-almost-any-product-design-challenge-f9e6c0019d7d

OTT Platform with Speke reference server through AWS Elemental

Business Context and Problem Statement

We see overall revenue is declining in voice call for different telco companies. People are using different freely available VoIP solutions like WhatsApp, Viber for both voice and text based communication. To have different revenue stream, companies are focusing on different digital services. In that consideration, one of the top telco service providers in Bangladesh has initiated an OTT platform for their subscriber. All the streams of the platform were unencrypted which was a major concern for them. They wanted to have a secure and protected live streams to their end users which is encrypted and the key is rotated every 5 minutes with an optimized costing. As one of the top AWS solution providers, they came to us how we can help here to achieve their goal.

To provide the required solution, we looked for different available solutions like BuyDRM (https://buydrm.com/) , Intertrust (https://www.expressplay.com/) heavily used by industry leaders but the subscription fee was bit expensive which was not aligned with our client. Considering all the aspect, we started looking for opensource free solutions to be customized and Speke reference server came up to be used with AWS Elemental service to serve the purpose.

We can find the opensource repo of the Speke reference server from the following link:

https://github.com/awslabs/speke-reference-server

The Speke reference server solution is done in Python. After digging further, we found a AWS Cloud formation template was based on python 3.6 which is not supported with latest lambda python version (3.9) and a number of used libraries were deprecated in latest version. We stared doing the refactoring to comply the code with python 3.9 which can be found in the following link.

https://github.com/mizanurbd/speke-lambda-3.9/blob/0e6a81c8d392d739a6e816b309708e8563a7bea8/speke_reference.json

To support python 3.9, the codebase was also refactored shared below:

https://github.com/mizanurbd/speke-lambda-3.9/blob/0e6a81c8d392d739a6e816b309708e8563a7bea8/speke-reference-lambda.zip

After deploying the cloud formation, we need to upload the above code base to function the Speke reference server properly.

After successful implementation, the flow becomes:

The flow is:

Input: <s3-bucket>/<source_folder>/<source_file_name>

DRM:

Output: <s3-bucket>/<output_folder>/<output_file.index.m3u8++>

That S3 has a CloudFront distribution, in this case:

Demo Link: https://yourcloudfrontURL/test/test021/index.m3u8

We ran some tests playing the content on VLC, QuickTime, and Safari.

If we try to read the m3u8 file:

$ curl https://yourcloudfrontURL/test/test021/index.m3u8

#EXTM3U

#EXT-X-VERSION:3

#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-STREAM-INF:BANDWIDTH=1610383,AVERAGE-BANDWIDTH=1610383,CODECS=”avc1.77.30,mp4a.40.2″,RESOLUTION=640×360,FRAME-RATE=23.976

indextest021.m3u8

$ curl https://d7yr8u0dqt3wk.cloudfront.net/test/test021/indextest021.m3u8

#EXTM3U

#EXT-X-VERSION:3

#EXT-X-TARGETDURATION:11

#EXT-X-MEDIA-SEQUENCE:1

#EXT-X-PLAYLIST-TYPE:VOD

#EXT-X-KEY:METHOD=AES-128,URI=”https://d3f9ggqez0f75l.cloudfront.net/test021/78746cf8-58aa-4dc7-810f-10ed3daecf4e&#8221;,IV=0x00000000000000000000000000000001

#EXTINF:10,

indextest021_00001.ts

#EXT-X-KEY:METHOD=AES-128,URI=”https://d3f9ggqez0f75l.cloudfront.net/test021/78746cf8-58aa-4dc7-810f-10ed3daecf4e&#8221;,IV=0x00000000000000000000000000000002

#EXTINF:6,

indextest021_00002.ts

#EXT-X-ENDLIST

Here, we have a Key URI: https://yourcloudfrontURL/test021/78746cf8-58aa-4dc7-810f-10ed3daecf4e&nbsp;

This is a key pointing to an S3 Bucket origin. Every time we convert content through MediaConvert and give a ResourceID, it creates a key with that resource ID on the bucket.

The above POC was aligned with the need. Right now, their existing solution is in process to be refactored leveraging AWS Services, Speke reference server and other relevant technology stakes.