Saturday, January 11, 2025

 Monitoring, Telemetry and Observability are important aspects of infrastructure. The public cloud becomes the gold standard in demonstrating both active and passive monitoring. With a vast landscape of platforms, products, services, solutions, frameworks and dynamic clouds, modern IT infrastructure has enormous complexity to overcome to set up monitoring. Yet, they are seldom explained. In this article, we list five such challenges.

The first is the most obvious by nature of a diverse landscape and this is complexity. Contemporary environments for many teams and organizations are dynamic, complex, ephemeral and distributed. Tools for monitoring must keep up with these. To set up monitoring for a big picture that spans hybrid stacks and environments, one must grapple with disconnected data, alerts and reports and engage in continuously updating tagging schemas to maintain context. So, the solution to addressing complexity, unified observability and security with automated contextualization is a key solution. A comprehensive solution can indeed monitor containers, hosting frameworks like Kubernetes, and cloud resources. Topology and dependency mapping enable this flexible and streamlined observability.

The second challenge is the sprawl of tools and technologies for monitoring that are often also disconnected. Do-it-yourself and open-source solutions for monitoring were partly to blame for this. Leveraging built-in solutions from the cloud eases the overall efficiency and effort involved. This challenge has often resulted in a patchwork view, blind spots and duplicated efforts and redundant monitoring. This implies that a solution would comprise of a single, integrated full-stack platform that reduces licensing costs, increases visibility to support compliance, and empowers proactive issue remediation and robust security.

The third challenge is the sheer size of MELT (Metrics, Logs and Traces) data. With the ever-increasing volume, variety and velocity of data generated, IT Teams are tasked with finding ways to ingest, store, analyze and interpret the information often grappling with numerous and disconnected ways to do each. This results in critical issue being buried under a ton of data or overlooked due to unavailability or inadequate context which results in delayed decision making and potential for errors whose cost and impact to business are both huge and indeterministic. The right modern monitoring tool acts as a single source of truth, enriching data with context and not shying away from using AI to reason vast volumes of data. It would also have sufficient processing to emit only quality alerts and reduce triage efforts.

The fourth challenge is troubleshooting and time to resolution because teams suffering from glitches and outages do not have the luxury to root cause incidents as they must struggle to restore operations and business. As users struggle with frustrations, poor experiences, insufficient information, and the risks of not meeting Service Level Agreements, there is decreased productivity, low team morale and difficulty in retaining the most valuable employees in addition to fines that can be incurred from missed SLAs. A true monitoring solution will come with programmability features that can make triaging and resolving easier. AI can also be used to find patterns and anomalies so that there can be some proactive measures on approaching thresholds rather than being reactive after incidents.

The fifth challenge is the areas of the technological landscape that either do not participate in monitoring or do so insufficiently. In fact, data breaches and hacks that can result from incomplete monitoring have devastating financial consequences, fines and legal fees besides damaged market reputation that erodes stakeholders’ and customers’ trust. A single-entry point for comprehensive monitoring across entire infrastructure is a favored solution to meet this challenge. By visualizing the dependencies and relationships among application components and providing real-time, end-to-end observability with no manual configuration, gaps, or blind spots, a monitoring solution renders a complete picture.

Reference: Previous articles.

#Codingexercise: https://1drv.ms/w/c/d609fb70e39b65c8/Echlm-Nw-wkggNYXMwEAAAABrVDdrKy8p5xOR2KWZOh3Yw?e=hNUMeP


Friday, January 10, 2025

 This is a summary of the book titled “The Equality Machine: harnessing digital technology for a brighter, more inclusive future” written by Orly Lobel and published by Public Affairs in 2022. The author proposes “An Equality Machine” in his drive to use the common grounds of humanity to bridge two disparate and often at opposite ends of the spectrum of people impacted by technology: 1. those who fear new technologies due to their potential to exacerbate existing inequities and 2. those who envision a technological utopia without anticipating risks. The goal of this proposal is to create a better future in which humanity uses “technology for good”. It’s common knowledge that advances in technology such as artificial intelligence and chatbots are recognized both for their potential to empower as well as their drawbacks in meeting equity and fairness. Careful auditing can help algorithms from displaying the same bias as humans do. Making the data more transparent helps to value the labor involved. Feminizing agents and chatbots can normalize existing inequities. New technologies also help to discover gaps in representation and protect people from crime and disease. With their interactions to these technologies, humans are cognizant of their shift in interactions with others and with bots. Makers of chatbots and new technological inventions can explore assumptions that disrupt stereotypes.

The rise of intelligent machines has prompted a need for upholding values of equity and fairness. Technological change has been polarized, with insiders focusing on disruption and embracing new technologies, while outsiders, such as people of color, women, and those from rural areas, worry about exclusion and inequities. To improve machine fairness, humanity must strike a balance between naive optimism and fearful pessimism. Machine learning algorithms can often ascertain identity markers from other data, but this does not address the root causes of inequities. To prevent algorithmic models from reflecting human biases, organizations must be proactive about auditing the output of their AI models as well as their data inputs. Human resources can run hypothetical job candidates through their AI models to test for biases and choose more inclusive data sets. AI decision-making can offer advantages, such as easier dissecting and correcting machine bias than flawed human decision-making. Additionally, predictive algorithmic models can help companies screen a larger pool of applicants for more nuanced qualities, such as high performance and long-term retention. It would be prudent to strike a balance between machine screening and human review.

Technology can help stakeholders work towards a future of financial equity by enabling access to vast amounts of data, identifying and correcting disparities, and reducing biases. Research shows that algorithms created to reduce bias in the fintech industry were 40% less discriminatory than humans. Research also shows that companies are more likely to penalize women for initiating salary negotiations even though men might be praised for assertiveness. AI and societal shifts towards greater data transparency are empowering workers with a better understanding of their labor market value. Some governments have passed legislation banning employers from asking prospective employees to disclose their past salaries. New digital resources, such as Payscale, are bringing greater transparency to the salary negotiation process. Feminizing AI assistants and chatbots can normalize existing inequities, but companies must reflect on the preference to depict subservient robots as female. This reinforces gender as a binary construct and promotes outmoded views of women's roles in society.

Researchers are using new technologies to detect patterns in representation gaps and address systemic inequities. Natural language processing (NLP) methods are being used to analyze large amounts of information, revealing unequal power dynamics and opportunities. AI can be used to assess whether people with different identity markers are getting equitable representation in media forms. Machine learning and AI analytics can help detect gaps in representation and biases in various media industries and inspire more empowering narratives. Technology can also help protect people from harmful influences by enabling organizations to share data and develop data hubs. AI and health data can also help stakeholders accelerate drug discovery and collaborate to prevent the global spread of viruses. However, democratizing AI use in medical research contexts is crucial to ensure improved health outcomes for everyone, not just the rich.

Algorithms and embodied robots are transforming human connection and social bonds. Algorithmic biases can exacerbate existing class, racial, and social divides, while the growing prevalence of robots with sexual capacities is transforming intimacy and emotional connection. Some argue that framing robots solely as AI-empowered sex dolls is oversimplification, while others worry about the potential for violence against women.

Roboticists can challenge stereotypes by creating robots that challenge assumptions. Embodied robots can support humans in various functions, such as care labor, reception work, and space exploration. However, some critics worry about privacy risks, consent, and misuse of data.

Robots can surprise those they interact with by disrupting expectations. NASA uses feminine-looking robots like Valkyrie to support in-space exploration, while masculine-looking robots like Tank act as "roboceptionists." These robots demonstrate the choice roboticists face when designing robots that cater to existing biases or inspire imaginative new possibilities.


Thursday, January 9, 2025

 This is a summary of the book titled “Future Ready: Your organization’s guide to rethinking climate, resilience and sustainability” written by Alastair MacGregor and Tom Lewis and published by Wiley in 2023. This book is about integrating sustainability and resilience into infrastructure and building projects. They introduce climate science for practitioners and decision makers who grapple with evolving environmental challenges. They recognize the target audience of the book are already aware they need to make changes. Those in the construction industry can support sustainability by adopting innovative technologies and sustainable materials. Those in transportation must prioritize decarbonization. Infrastructure designers must meet urbanization challenges. The authors recommend that they are best served by putting systems for measuring, say emissions, setting targets and implementing strategies to meet those targets. Achieving net zero will involve integrating technologies and understanding carbon markets. Leaders can generate support for these activities. Nature-based solutions provide a holistic and cost-effective approach to addressing challenges of sustainability and resilience.

Climate change has highlighted the need for infrastructure designers and urban planners to incorporate sustainability and resilience in their decision-making. The aftermath of Superstorm Sandy exposed vulnerabilities in current systems, prompting policymakers, urban planners, and industry professionals to shift their approaches to risk management and sustainability. The Future Ready framework, developed by WSP, consists of four lenses for considering decisions: climate, society, technology, and resources. The construction industry can support sustainability by adopting innovative technologies and sustainable materials. Buildings contribute nearly 50% of global greenhouse gas emissions and consume significant natural resources. Decision-makers must rethink building practices, focusing on sustainability, resilience, and long-term value. Innovative projects integrating modern technologies and sustainable materials, such as LEED and BREEAM, can provide potential paths forward.

Transportation innovations have advanced global trade and daily life, but they also contribute to 27% of US GHG emissions, exacerbating climate change and increasing infrastructure risks. To build a resilient, sustainable, and equitable future, decision-makers must prioritize decarbonization. The adoption of electric vehicles and hydrogen fuel cell vehicles will play a crucial role in reducing emissions, but adoption rates and charging infrastructure currently fall short of climate targets. Infrastructure designers are embracing innovations to meet climate and urbanization challenges, such as clean water infrastructure, green infrastructure, electrification, green hydrogen, and high-voltage direct current networks. Leaders in urban areas can enhance resilience with technological innovations, community-based solutions, and sustainable development. Cities contribute significantly to global GHG emissions and face high climate risks due to their dense populations, so they must adopt comprehensive, integrated approaches to climate resilience that address both mitigation and adaptation. Community-based solutions are essential in resilience efforts, as demonstrated by Staten Island's Living Breakwaters project.

Organizations must establish systems for measuring emissions, set targets, and implement strategies to achieve net-zero emissions. This involves accurately measuring GHG emissions, setting science-based targets, and implementing comprehensive strategies. Scientists set a deadline of 2050 to achieve net-zero emissions, but sooner it is better. Tools like wedge diagrams, gap analyses, backcasting, and life cycle assessment can help manage pathways to net zero. Integrating technologies and understanding carbon markets is crucial for achieving net-zero goals. Energy efficiency measures, industry-specific technologies, and carbon removal offsets can help reduce emissions. Carbon markets use compliance-based and voluntary schemes to encourage reductions of emissions and investments in renewables. Assessment systems and standardized reporting frameworks are necessary to manage climate-related risks. Scenario analysis tools like the American Society of Civil Engineers' Future World Vision can help decision-makers visualize potential climate risks and develop adaptive strategies. Innovation must continue to reach global net-zero targets.

Leaders can support climate-related initiatives by achieving early successes, educating stakeholders, and fostering engagement. They should focus on measurable strategies and address issues such as employee retention and regulatory uncertainties. External engagement is crucial for public sector organizations, involving diverse stakeholders. Nature-based solutions (NbS) offer a cost-effective, adaptive, and sustainable approach to environmental challenges, enhancing infrastructure resilience and community well-being. Examples include the restoration of oyster reefs in Florida, which serve as natural barriers against storm waves, protect infrastructure, and improve water quality. Community engagement is essential for tailoring solutions to local needs and addressing climate challenges.

#Codingexercise: https://1drv.ms/w/c/d609fb70e39b65c8/EVdE3xARiidMgiSKPiX554EBVSwvZ0dDxvVyIzK5X2k7gA?e=c7iNMK

Tuesday, January 7, 2025

 

This is a summary of the book titled “The Equality Machine: harnessing digital technology for a brighter, more inclusive future” written by Orly Lobel and published by Public Affairs in 2022. The author proposes “An Equality Machine” in his drive to use the common grounds of humanity to bridge two disparate and often at opposite ends of the spectrum of people impacted by technology: 1. those who fear new technologies due to their potential to exacerbate existing inequities and 2. those who envision a technological utopia without anticipating risks. The goal of this proposal is to create a better future in which humanity uses “technology for good”. It’s common knowledge that advances in technology such as artificial intelligence and chatbots are recognized both for their potential to empower as well as their drawbacks in meeting equity and fairness. Careful auditing can help algorithms from displaying the same bias as humans do. Making the data more transparent helps to value the labor involved. Feminizing agents and chatbots can normalize existing inequities. New technologies also help to discover gaps in representation and protect people from crime and disease. With their interactions to these technologies, humans are cognizant of their shift in interactions with others and with bots. Makers of chatbots and new technological inventions can explore assumptions that disrupt stereotypes.

The rise of intelligent machines has prompted a need for upholding values of equity and fairness. Technological change has been polarized, with insiders focusing on disruption and embracing new technologies, while outsiders, such as people of color, women, and those from rural areas, worry about exclusion and inequities. To improve machine fairness, humanity must strike a balance between naive optimism and fearful pessimism. Machine learning algorithms can often ascertain identity markers from other data, but this does not address the root causes of inequities. To prevent algorithmic models from reflecting human biases, organizations must be proactive about auditing the output of their AI models as well as their data inputs. Human resources can run hypothetical job candidates through their AI models to test for biases and choose more inclusive data sets. AI decision-making can offer advantages, such as easier dissecting and correcting machine bias than flawed human decision-making. Additionally, predictive algorithmic models can help companies screen a larger pool of applicants for more nuanced qualities, such as high performance and long-term retention. It would be prudent to strike a balance between machine screening and human review.

Technology can help stakeholders work towards a future of financial equity by enabling access to vast amounts of data, identifying and correcting disparities, and reducing biases. Research shows that algorithms created to reduce bias in the fintech industry were 40% less discriminatory than humans. Research also shows that companies are more likely to penalize women for initiating salary negotiations even though men might be praised for assertiveness. AI and societal shifts towards greater data transparency are empowering workers with a better understanding of their labor market value. Some governments have passed legislation banning employers from asking prospective employees to disclose their past salaries. New digital resources, such as Payscale, are bringing greater transparency to the salary negotiation process. Feminizing AI assistants and chatbots can normalize existing inequities, but companies must reflect on the preference to depict subservient robots as female. This reinforces gender as a binary construct and promotes outmoded views of women's roles in society.

Researchers are using new technologies to detect patterns in representation gaps and address systemic inequities. Natural language processing (NLP) methods are being used to analyze large amounts of information, revealing unequal power dynamics and opportunities. AI can be used to assess whether people with different identity markers are getting equitable representation in media forms. Machine learning and AI analytics can help detect gaps in representation and biases in various media industries and inspire more empowering narratives. Technology can also help protect people from harmful influences by enabling organizations to share data and develop data hubs. AI and health data can also help stakeholders accelerate drug discovery and collaborate to prevent the global spread of viruses. However, democratizing AI use in medical research contexts is crucial to ensure improved health outcomes for everyone, not just the rich.

Algorithms and embodied robots are transforming human connection and social bonds. Algorithmic biases can exacerbate existing class, racial, and social divides, while the growing prevalence of robots with sexual capacities is transforming intimacy and emotional connection. Some argue that framing robots solely as AI-empowered sex dolls is oversimplification, while others worry about the potential for violence against women.

Roboticists can challenge stereotypes by creating robots that challenge assumptions. Embodied robots can support humans in various functions, such as care labor, reception work, and space exploration. However, some critics worry about privacy risks, consent, and misuse of data.

Robots can surprise those they interact with by disrupting expectations. NASA uses feminine-looking robots like Valkyrie to support in-space exploration, while masculine-looking robots like Tank act as "roboceptionists." These robots demonstrate the choice roboticists face when designing robots that cater to existing biases or inspire imaginative new possibilities.

#codingexercise: CodingExercise-01-07-2025.docx

Monday, January 6, 2025

 With year over year advances in Large language models are becoming popular faster than ever, this is a summary of all the advances made last year including the learnings. First, the GPT-4 barrier was completely broken. Among seventy other competitors who overtook GPT-4 including Google’s Gemini and Anthropics’ Claude3, LLMs have successfully tackled long inputs where entire books can be thrown at the LLM and it would answer questions with high precision and recall and even solved coding challenges with trainable samples that users provide. Second, these models can now run on laptops even though GPT-4 earlier used to require datacenters with one or more $40,000 plus GPU. On a laptop, 64 GB of RAM is sufficient to train these models. Third, these competitions reduced the prices of LLMs significantly and provided more value by virtue of increased efficiency. Earlier the price was $30 per million tokens on OpenAI for GPT-4 while GPT-4o is now $2.50 per million tokens. These price drops are driven by two factors: increased competition and increased efficiency. The price drops tie to how much energy is being used for running prompts and the efficiency thing is really important for those concerned with the LLM’s environmental impact. Fourth, LLMs are becoming multi-modal. In computer vision, being able to vectorize images as well as text and use them in queries with vector search has proved tremendously successful in many use cases. Now, audio and video are starting to emerge. In Nov 2023, GPT-4 was the leader with multimodal vision and that is now caught up by many other models. For example, Amazon’s Nova has garnered support for both image and video and is available on their public cloud. This brings us to our fifth advancement, voice and live camera mode are science fiction come to life. Just a year back, audio, and live video mode were just an illusion. OpenAI’s Whisper speech-to-text model and a text-to-speech model enabled conversations with ChatGPT’s mobile apps but the actual model just saw text. The GPT-4o in 2024 is a true multi-model model that could accept audio input and generate incredibly realistic sounding speech without the separation. Sixth, prompt driven app generation is now mainstream and virtually permeated every industry sector. We knew they were good at writing code and entire static websites could be created with a single prompt, but Claude Artifacts took it up a notch by writing an on-demand interactive application that lets you use it directly inside the Claude interface. Seventh, universal access to the best models lasted just a few short months. OpenAI made GPT-4o free to all users unlike earlier where users did not know the latest as they were allowed access to earlier versions. This has changed with a monthly subscription service where they can keep up with the latest. Eighth, “Agents” still haven’t really happened yet. The term itself was extremely frustrating in that it did not clarify the purpose as whether the agents did low-level work or could also do high-level composites. And to make it more ambiguous, the term autonomous was thrown into the mix. They were not supposed to make meaningful decisions themselves because that eventually hits a roadblock or leads to hallucinations. And just as if to prove that, prompt injection leveraged this ambiguity. Ninth, Evals really matter. As one expert put it, the boring but crucial secret behind good system prompt is test-driven development. You don’t write down a system prompt and then find ways to test it. You write down tests and then find a system prompt that passes them. Tenth, there is a rise of inference-scaling “reasoning” models. This is an extension of chain-of-thought prompting trick where if you get a model to talk out loud about a problem it’s solving, you often get a result which the model would not have achieved otherwise. The biggest innovation here is that it opens up a new way to scale the model as they take on harder problems by spending more compute on inference.

Reference: previous articles & simonwillison.net


Sunday, January 5, 2025

 

Setting up a Databricks instance to allow users to run their notebooks, jobs, and Delta Live Tables (DLT) queries on serverless compute involves several steps and considerations. Here's an overview of the process and how it differs from all-purpose compute clusters:

Enabling Serverless Compute

To set up serverless compute:

  1. An account admin must enable the feature in the account console:
    • Navigate to Settings > Feature enablement
    • Enable "Serverless compute for workflows, notebooks, and Delta Live Tables"
  1. Ensure your Databricks workspace meets the requirements:
    • Unity Catalog must be enabled
    • The workspace must be in a supported region

Types of Serverless Compute

Databricks offers several types of serverless compute:

  • Serverless compute for notebooks
  • Serverless compute for jobs
  • Serverless SQL warehouses
  • Serverless DLT pipelines
  • Mosaic AI Model Serving
  • Mosaic AI Model Training for forecasting

Benefits of Serverless Compute

Serverless compute offers several advantages:

  • Rapid startup and scaling times
  • Automatic resource allocation and management
  • Pay only for compute used
  • Reduced management overhead
  • Automatic security patching and upgrades

Differences from All-Purpose Compute Clusters

Serverless compute differs from all-purpose clusters in several ways:

  1. Resource Management: Serverless compute is managed by Databricks, while all-purpose clusters require manual configuration and management
  2. Scaling: Serverless includes a smarter, more responsive autoscaler compared to classic compute
  3. Version Updates: Databricks automatically and safely upgrades serverless compute to the latest versions
  4. Network Isolation: Serverless compute runs within a network boundary for the workspace, with additional security layers
  5. Compute Plane: Serverless runs in a compute layer within the Databricks account, while classic compute runs in the customer's cloud account
  6. Access Control: All workspace users can use serverless compute without needing cluster creation permissions

 

Security Considerations

When setting up serverless compute:

  • Be aware that serverless compute for notebooks and jobs has unrestricted internet access by default
  • Consider configuring network security features for more control

Understand that serverless workloads are executed within multiple layers of isolation for data protection

Usage and Optimization

To optimize serverless compute usage:

  • Leverage the automatic infrastructure optimization provided by Databricks
  • Monitor performance using built-in tools in the Azure Portal
  • Take advantage of the promotional discounts currently offered (50% for Workflows and DLT, 30% for Notebooks)

By setting up serverless compute, you can provide users with a more streamlined experience for running notebooks, jobs, and DLT queries, while reducing management overhead and potentially lowering costs compared to traditional all-purpose compute clusters.

Reference: previous articles

Saturday, January 4, 2025

 

Some of the best practices for IaC derive from the software development tenets such as using version control to prevent manual changes and enabling managing, testing, reviewing, and bringing it to production.  Also, like software development, a culture of collaborative development in version-controlled repositories enables individual features to be brought into the code with little disruption to others. Some practices like structuring the project do not apply rigorously to IaC where small projects might decide to keep everything in one folder and larger ones in many folders. Most of the other best practices are rather specific to IaC. Some of these are listed below.

1.      Using remote state: State is as important as version control and ranks among the top best practices specific to IaC because it helps the compiler know what the incremental changes are from what it remembers as having “applied” last time to the infrastructure. A state that support state locking and stored elsewhere to the version control helps it to be treated as immutable and for its backups. It’s even helpful to enable versioning if stored on the public cloud storage accounts for quick and easy state recovery.

2.      Using existing shared and community modules: Instead of writing our own modules for everything and reinventing the wheel, this helps to save time and harness the power of the community. Some are provided by the IaC provider.

3.      Import existing infrastructure: When parts of the infrastructure are created manually, this best practice keeps the IaC in sync with the changes and helps to avoid further manual changes by pushing out the subsequent changes through the pipeline to update code and state together.

4.      Avoiding variables hardcoding: assigning a value to a variable makes it brittle when the IaC must be repurposed or deployed differently. Instead reading it from some data source dynamically helps to keep it in sync when IaC changes.

5.      Always formatting and validating: just like the compiler is unavoidable, striving to use the format and validate tools help to keep the IaC clean and catch any issues that were missed since it is declarative.

6.      Using consistent naming conventions:  This doesn’t require us to be dogmatic but finding something that is comfortable does help. The consistency makes every part of the IaC easy to understand and follow along from project to project.

7.      Tagging the resources: The public clouds offer sufficient documentation for the merits of tagging  and capturing it in IaC along with the consistency definitely helps. Access control policies and cost management features can be implemented using tags.

8.      Writing policy as code: Although policies stand apart from resources, they can and should be captured in code for systems to be operational and secure from deployment onwards. It is also easy to verify the rules when they are in code.

9.      Implementing a secrets management strategy: This comes helpful to preventing disclosure of secrets in files, logs and pipeline artifacts. If necessary, they could be passed in as environment variables although a better option would be store it as a secret.

10.  Enabling debugging and troubleshooting: These features such as enhanced logging on demand can be helpful to narrow down problematic code.

11.  Building modules wherever possible: When there is no community module available, this practice encourages rapid development by just instantiating the object with a suitable set of parameters.

12.  Using loops and conditionals:  Since there can be multiple instances of the code to be managed, using built-in operators and functions can be quite nifty and keep the code readable. Count and foreach are some examples.

13.  Using functions: Along with the above practice, functions are even readily available from the IaC Provider and help to enforce the Do-not Repeat Yourself aka DRY principle. There is a large library of functions to explore and use by virtue of the built-ins from an IaC provider.

14.  Using Dynamic Blocks: Just like the benefits of using functions, this helps to provide flexibility in building resources so that the addition of say, a new rule, does not require to change the configuration.

15.  Using workspaces: this provides a scope for all the definitions so that they can be reused in their entirety, say for different environments.

16.  Maintaining lifecycle of resources:  Determining what changes to recognize can help with keeping the resource definitions and associated change output more manageable.

17.  Using variable validations:  This does a pretty good job of validating inputs especially when the system must fail fast and display helpful error messages before actual deployments.

18.  Leveraging helper tools: Usually, there are many more tools available for use with IaC and pipelines outside the compiler, formatter and validator. Leveraging these can save time and cost.

19.  Using IDE Extensions: This comes helpful when the code is authored in an Integrated Development Environment so that mistakes can be caught as early as when IaC is authored.

20.  Keeping UpToDate with the documentations from the IaC provider because nothing is set in stone, and change is the only constant. The advisories help to prevent mistakes going ahead and are worth reading.

#codingexercise: CodingExercise-01-04-2025.docx

Friday, January 3, 2025

 This is a summary of the book titled “Your AI Survival Guide” written by Sal Rashidi and published by Wiley in 2024. Sal argues that organizations cannot afford to be Laggards and Late majority sections of people adopting AI even if they are non-technical because that is here to stay and unless they want to be eliminated in business. So, the only choices are the Early Majority who adopt technology once it has demonstrated its advantages, early adopters who are more on the forefront, and innovators who pioneer the use of AI in their respective fields. Each group plays a crucial role in the adoption of lifecycle of technology which usually spans the duration until something better replaces it, so there is no wrong pick, but the author’s book lays out everything that helps you uncover your “why” to building your team and making your AI responsible. With applications already ranging from agriculture to HR, the time to be proactive is Now. His playbook involves assessing which AI strategy fits you and your team, selecting relevant use cases, planning how to launch your AI project, choosing the right tools and partners to go live, ensuring the team is gritty, ambitious, and resilient and incorporating human oversight onto AI decision making.

To successfully implement AI within a company, it is essential to balance established protocols with the need to adapt to changing times. To achieve this, consider the reasons for deploying AI, develop an AI strategy, and start small and scale quickly. Choose a qualified AI consultant or development firm that fits your budget and goals. Set a realistic pace for your project. Conduct an AI readiness assessment to determine the best AI strategy for your company. Score yourself on various categories, such as market strategy, business understanding, workforce acumen, company culture, role of technology, and data availability.

Select relevant use cases that align with your chosen AI strategy and measure the criticality and complexity of each use case. For criticality, measure how the use case will affect sales, growth, operations, culture, public perception, and deployment challenges. For complexity, measure how the use case will affect resources for other projects, change management, and ownership. Plan how to launch your AI project well to ensure success and adaptability.

To launch an AI project successfully, outline your vision, business value, and key performance indicators (KPIs). Prioritize project management by defining roles, deliverables, and tracking progress. Align goals, methods, and expectations, and establish performance benchmarks. Outline a plan for post-launch support, including ongoing maintenance, enterprise integration, and security measures. Establish a risk mitigation process for handling unintended consequences. Choose the right AI tool according to your needs and expertise, ranging from low-cost to high-cost, requiring technical expertise. Research options, assess risks and rewards, and collaborate with experts to create standard operating procedures. Ensure your team is gritty, ambitious, and resilient by familiarizing yourself with AI archetypes. To integrate AI successfully, focus on change management, create a manifesto, align company leadership, plan transitions, communicate changes regularly, celebrate small wins, emphasize iteration over perfection, and monitor progress through monthly retrospectives.

AI projects require human oversight to ensure ethical, transparent, and trustworthy systems. Principles for responsible AI include transparency, accountability, fairness, privacy, inclusiveness, and diversity. AI is expected to transform various sectors, generating $9.5 to $15.4 trillion annually. Legal professionals can use AI to review contracts, HR benefits from AI-powered chatbots, and sales teams can leverage AI for automated follow-up emails and personalized pitches. AI will drive trends and raise new challenges for businesses, such as automating complex tasks, scaling personalized marketing, and disrupting management consulting. However, AI opportunities come with risks such as cyber threats, privacy and bias concerns, and a growing skills gap. To seize AI opportunities while mitigating risks, businesses must learn how AI applies to their industry, assess their capabilities, identify high-potential use cases, build a capable team, create a change management plan, and keep a human in the loop to catch errors and address ethical issues.


Thursday, January 2, 2025

 Serverless SQL in Azure offers a flexible and cost-effective way to manage SQL databases and data processing without the need to manage the underlying infrastructure. Here are some key aspects:

Azure SQL Database Serverless

Autoscaling: Automatically scales compute based on workload demand. It bills for the amount of compute used per second2.

Auto-Pause and Resume: Pauses databases during inactive periods when only storage is billed and resumes when activity returns.

Configurable Parameters: You can configure the minimum and maximum vCores, memory, and IO limits.

Cost-Effective: Ideal for single databases with intermittent, unpredictable usage patterns.

Azure Synapse Analytics Serverless SQL Pool

Query Service: Provides a query service over data in your data lake, allowing you to query data in place without moving it.

T-SQL Support: Uses familiar T-SQL syntax for querying data.

High Reliability: Built for large-scale data processing with built-in query execution fault-tolerance.

Pay-Per-Use: You are only charged for the data processed by your queries.

Benefits

Scalability: Easily scales to accommodate varying workloads.

Cost Efficiency: Only pay for what you use, making it cost-effective for unpredictable workloads.

Ease of Use: No infrastructure setup or maintenance required.

The product Neon Database was launched in 2021 for going serverless on a cloud platform as a relational database. Recently it has become cloud native to Azure just like it has been on AWS. This deeper integration of Neon in Azure facilitates rapid app development because postgres sql is the developers’ choice. Serverless reduces operational overhead and frees the developers to focus on the data model, access and CI/CD integration to suit their needs. In fact, Microsoft’s investments in GitHub, VSCode, TypeScript, OpenAI and Copilot align well with the developers’ agenda.

Even the ask for a vector store from AI can be facilitated within a relational database as both Azure SQL and Neon have demonstrated. The compute seamlessly scale up for expensive index builds and back down for normal queries or RAG queries. Since pause during inacitivity and resume for load is automated in serverless, the cost savings are significant. In addition, both databases focus on data privacy.

The following is a way to test the ai vector cosine similarity in a relational database.

1. Step 1: upload a dataset to a storage account from where it can be accessed easily. This must be a csv file with headers like:

id,url,title,text,title_vector,content_vector,vector_id

Sample uploaded file looks like this:



2. Step 2: Use Azure Portal Query Editor or any client to run the following SQL:

a. 00-setup-blob-access.sql

/*

 Cleanup if needed

*/

if not exists(select * from sys.symmetric_keys where [name] = '##MS_DatabaseMasterKey##')

begin

 create master key encryption by password = 'Pa$$w0rd!'

end

go

if exists(select * from sys.[external_data_sources] where name = 'openai_playground')

begin

 drop external data source [openai_playground];

end

go

if exists(select * from sys.[database_scoped_credentials] where name = 'openai_playground')

begin

 drop database scoped credential [openai_playground];

end

go

/*

 Create database scoped credential and external data source.

 File is assumed to be in a path like:

 https://saravinoteblogs.blob.core.windows.net/playground/wikipedia/vector_database_wikipedia_articles_embedded.csv

 Please note that it is recommened to avoid using SAS tokens: the best practice is to use Managed Identity as described here:

 https://learn.microsoft.com/en-us/sql/relational-databases/import-export/import-bulk-data-by-using-bulk-insert-or-openrowset-bulk-sql-server?view=sql-server-ver16#bulk-importing-from-azure-blob-storage

*/

create database scoped credential [openai_playground]

with identity = 'SHARED ACCESS SIGNATURE',

secret = 'sp=rwdme&st=2024-11-22T03:37:08Z&se=2024-11-29T11:37:08Z&spr=https&sv=2022-11-02&sr=b&sig=EWag2qRCAY7kRsF7LtBRRRExdWgR5h4XWrU%2'; -- make sure not to include the ? at the beginning

go

create external data source [openai_playground]

with

(

 type = blob_storage,

  location = 'https://saravinoteblogs.blob.core.windows.net/playground',

  credential = [openai_playground]

);

Go

b. 01-import-wikipedia.sql:

/*

Create table

*/

drop table if exists [dbo].[wikipedia_articles_embeddings];

create table [dbo].[wikipedia_articles_embeddings]

(

[id] [int] not null,

[url] [varchar](1000) not null,

[title] [varchar](1000) not null,

[text] [varchar](max) not null,

[title_vector] [varchar](max) not null,

[content_vector] [varchar](max) not null,

[vector_id] [int] not null

)

go

/*

Import data

*/

bulk insert dbo.[wikipedia_articles_embeddings]

from 'wikipedia/vector_database_wikipedia_articles_embedded.csv'

with (

data_source = 'openai_playground',

    format = 'csv',

    firstrow = 2,

    codepage = '65001',

fieldterminator = ',',

rowterminator = '0x0a',

    fieldquote = '"',

    batchsize = 1000,

    tablock

)

go

/*

Add primary key

*/

alter table [dbo].[wikipedia_articles_embeddings]

add constraint pk__wikipedia_articles_embeddings primary key clustered (id)

go

/*

Add index on title

*/

create index [ix_title] on [dbo].[wikipedia_articles_embeddings](title)

go

/*

Verify data

*/

select top (10) * from [dbo].[wikipedia_articles_embeddings]

go

select * from [dbo].[wikipedia_articles_embeddings] where title = 'Alan Turing'

go

c. 02-use-native-vectors.sql:

/*

    Add columns to store the native vectors

*/

alter table wikipedia_articles_embeddings

add title_vector_ada2 vector(1536);

alter table wikipedia_articles_embeddings

add content_vector_ada2 vector(1536);

go

/*

    Update the native vectors

*/

update

    wikipedia_articles_embeddings

set

    title_vector_ada2 = cast(title_vector as vector(1536)),

    content_vector_ada2 = cast(content_vector as vector(1536))

go

/*

    Remove old columns

*/

alter table wikipedia_articles_embeddings

drop column title_vector;

go

alter table wikipedia_articles_embeddings

drop column content_vector;

go

/*

Verify data

*/

select top (10) * from [dbo].[wikipedia_articles_embeddings]

go

select * from [dbo].[wikipedia_articles_embeddings] where title = 'Alan Turing'

go

d. 03-store-openai-credentials.sql

/*

    Create database credentials to store API key

*/

if exists(select * from sys.[database_scoped_credentials] where name = 'https://postssearch.openai.azure.com')

begin

drop database scoped credential [https://postssearch.openai.azure.com];

end

create database scoped credential [https://postssearch.openai.azure.com]

with identity = 'HTTPEndpointHeaders', secret = '{"api-key": "7cGuGvTm7FQEJtzFIrZBZpOCJxXbAsGOMDd8uG0RIBivUXIfOUJRJQQJ99AKACYeBjFXJ3w3AAABACOGAL8U"}';

go

e. 04-create-get-embeddings-procedure.sql:

/*

    Get the embeddings for the input text by calling the OpenAI API

*/

create or alter procedure dbo.get_embedding

@deployedModelName nvarchar(1000),

@inputText nvarchar(max),

@embedding vector(1536) output

as

declare @retval int, @response nvarchar(max);

declare @payload nvarchar(max) = json_object('input': @inputText);

declare @url nvarchar(1000) = 'https://postssearch.openai.azure.com/openai/deployments/' + @deployedModelName + '/embeddings?api-version=2023-03-15-preview'

exec @retval = sp_invoke_external_rest_endpoint

    @url = @url,

    @method = 'POST',

    @credential = [https://postssearch.openai.azure.com],

    @payload = @payload,

    @response = @response output;

declare @re nvarchar(max) = null;

if (@retval = 0) begin

    set @re = json_query(@response, '$.result.data[0].embedding')

end else begin

    select @response as 'Error message from OpenAI API';

end

set @embedding = cast(@re as vector(1536));

return @retval

go

f. 05-find-similar-articles.sql:

/*

    Get the embeddings for the input text by calling the OpenAI API

    and then search the most similar articles (by title)

    Note: postssearchembedding needs to be replaced with the deployment name of your embedding model in Azure OpenAI

*/

declare @inputText nvarchar(max) = 'the foundation series by isaac asimov';

declare @retval int, @embedding vector(1536);

exec @retval = dbo.get_embedding 'postssearchembedding', @inputText, @embedding output;

select top(10)

    a.id,

    a.title,

    a.url,

    vector_distance('cosine', @embedding, title_vector_ada2) cosine_distance

from

    dbo.wikipedia_articles_embeddings a

order by

    cosine_distance;

go

3. Finally, manually review the results.




Wednesday, January 1, 2025

 This is a summary of the book titled “Your AI Survival Guide” written by Sal Rashidi and published by Wiley in 2024. Sal argues that organizations cannot afford to be Laggards and Late majority sections of people adopting AI even if they are non-technical because that is here to stay and unless they want to be eliminated in business. So, the only choices are the Early Majority who adopt technology once it has demonstrated its advantages, early adopters who are more on the forefront, and innovators who pioneer the use of AI in their respective fields. Each group plays a crucial role in the adoption of lifecycle of technology which usually spans the duration until something better replaces it, so there is no wrong pick, but the author’s book lays out everything that helps you uncover your “why” to building your team and making your AI responsible. With applications already ranging from agriculture to HR, the time to be proactive is now. His playbook involves assessing which AI strategy fits you and your team, selecting relevant use cases, planning how to launch your AI project, choosing the right tools and partners to go live, ensuring the team is gritty, ambitious, and resilient and incorporating human oversight onto AI decision making.

To successfully implement AI within a company, it is essential to balance established protocols with the need to adapt to changing times. To achieve this, consider the reasons for deploying AI, develop an AI strategy, and start small and scale quickly. Choose a qualified AI consultant or development firm that fits your budget and goals. Set a realistic pace for your project. Conduct an AI readiness assessment to determine the best AI strategy for your company. Score yourself on various categories, such as market strategy, business understanding, workforce acumen, company culture, role of technology, and data availability.

Select relevant use cases that align with your chosen AI strategy and measure the criticality and complexity of each use case. For criticality, measure how the use case will affect sales, growth, operations, culture, public perception, and deployment challenges. For complexity, measure how the use case will affect resources for other projects, change management, and ownership. Plan how to launch your AI project well to ensure success and adaptability.

To launch an AI project successfully, outline your vision, business value, and key performance indicators (KPIs). Prioritize project management by defining roles, deliverables, and tracking progress. Align goals, methods, and expectations, and establish performance benchmarks. Outline a plan for post-launch support, including ongoing maintenance, enterprise integration, and security measures. Establish a risk mitigation process for handling unintended consequences. Choose the right AI tool according to your needs and expertise, ranging from low-cost to high-cost, requiring technical expertise. Research options, assess risks and rewards, and collaborate with experts to create standard operating procedures. Ensure your team is gritty, ambitious, and resilient by familiarizing yourself with AI archetypes. To integrate AI successfully, focus on change management, create a manifesto, align company leadership, plan transitions, communicate changes regularly, celebrate small wins, emphasize iteration over perfection, and monitor progress through monthly retrospectives.

AI projects require human oversight to ensure ethical, transparent, and trustworthy systems. Principles for responsible AI include transparency, accountability, fairness, privacy, inclusiveness, and diversity. AI is expected to transform various sectors, generating $9.5 to $15.4 trillion annually. Legal professionals can use AI to review contracts, HR benefits from AI-powered chatbots, and sales teams can leverage AI for automated follow-up emails and personalized pitches. AI will drive trends and raise new challenges for businesses, such as automating complex tasks, scaling personalized marketing, and disrupting management consulting. However, AI opportunities come with risks such as cyber threats, privacy and bias concerns, and a growing skills gap. To seize AI opportunities while mitigating risks, businesses must learn how AI applies to their industry, assess their capabilities, identify high-potential use cases, build a capable team, create a change management plan, and keep a human in the loop to catch errors and address ethical issues.