"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;
Showing posts with label Docker. Show all posts
Showing posts with label Docker. Show all posts

December 09, 2023

Good Read - Kubernetes - Basics - Connect the Dots

Basic Kubernetes building blocks.

  • Containerization (like Docker) - Dockerization, Runtime, Commands, Code - Build Image
  • Cloud Basics - Managed solution kubernetes cluster, Identity / Access. Cloud managed solution. Monitor / rebalance pods. Spot instance automation. Optimization features
  • YAML - Write config files, Resources in Kubernetes, Desired state of kubernetes deployment object
  • Networking Basics - pods communication, clusterip, node ports
  • Linux - Command line kubectl tools proficiency, vi

CAST AI is the leading all-in-one platform for Kubernetes automation, optimization, security, and cost management. 


Keep Exploring!!!

November 22, 2023

Secure Google App Engine App - Streamlit App

1. Steps to build/ deploy sample App



2. Enable IAP for App Engine


Add users
To grant access to the application, 
click "Add Principal" 
select the IAP-secured Web App User role






Keep Exploring!!!

July 14, 2023

Docket Notes - Image Sizes

Docker: Reduce the size of a container

using https://alpinelinux.org can reduce the size and deployment time of a container by up to 40%

Install minimum packages

Reducing Docker Image size

  • Bulkier images take time to get pulled.
  • Increased time to spin up a container using it.
  • Include a .dockerignore file.
  • Reduce unnecessary dependencies.
  • multistage build pattern. Made a binary on the build stage and used it to run the container.

.dockerignore

docker-squash

  • Squashing helps with organizing images in logical layers. Instead of having an image with multiple (in almost all cases) unnecessary layers - we can control the structure of the image.

Keep Exploring!!!


February 04, 2023

Without Docker

Without Docker
  • Test team, Package breaks in my environment
  • Product manager - What all I need to install to run it
  • Production Support - Give me software install documentation

And Finally,

Developer - It works in my Environment :)

With Docker

  • Faster Packaging
  • Faster Collaboration
  • Simplified Development Environment
Concept Aspects
  • Image - Class - Docker File Definition
  • Container - Object - Instantiate a Docker Image

Keep Exploring!!!

January 25, 2023

Docker Custom Examples

Some minor fixes working with git project


Keep Exploring!!!

Best practice for container-based deployment system 

  • Use a container-orchestration system such as Kubernetes or Docker Swarm to manage and deploy your containers.
  • Use a container registry such as Docker Hub or Quay to store and manage your container images.
  • Use a continuous integration system such as Jenkins or Travis CI to automate the build and deployment of your containers.
  • Monitor your containers and applications using tools such as Prometheus or Grafana to ensure they are running optimally.
  • Use a service mesh such as Istio or Linkerd to manage the communication between your services.
  • Use a logging and monitoring system such as ELK or Splunk to track the performance of your containers and applications.
  • Use a security scanning tool such as Twistlock or Aqua Security to ensure your containers are secure.
  • Use a configuration management system such as Ansible or Chef to manage the configuration of your containers.
  • Use a deployment automation tool such as Helm or Terraform to automate the deployment of your containers.
  • Use a cloud provider such as Amazon Web Services or Google Cloud Platform to host your containers.

Keep Exploring!!!

December 22, 2021

Why Questions ? Why docker is Faster / Light weight ?

Docker is based on Linux Containers

Linux Containers (LXC) share OS kernel of the host. OS provides resource isolation. Fast provisioning, bare-metal like performance, lightweight 

Ref - Link

Keep Exploring!!!

July 30, 2020

Docker MariaDB Installation



More Reads - Link
Happy Learning!!!

July 26, 2020

Weekend Learning - Introducing KFServing: Serverless Model Serving on Kubernetes



KF Serving
  • Serving story for Kubeflow
  • The concepts behind Kubernetes
  • Serving Frameworks (Seldon core, ml lambdas, Tensorflow Serving)
  • Consistent interfaces for different frameworks
  • ServiceAccount for access
  • Canary - 2 way split (New / Old)
  • Default Standard Deployment
  • Canary - Addressable primary / default
  • Experimental traffic handling
  • Similar to A / B Testing
  • KFServing for ML Problems
  • Knative - Resource Model
  • Production Features of ML KFServing 0.2
  • Use cases at Bloomberg
  • Serving models in production
  • Scaling and handling traffic
  • End to End implementation/scalability and load handling
  • Model production requirements
  • A lot of out of box features for production-grade implementation

  • Bloombergs use cases
  • All data / NLP
KF Serving Transformer concept
  • Implement pre and post processing
  • Add transformer to inference service



Model Explanation
  • Alibi library
  • Accessibility to prediction URL
Kafka Implementation Example
A / B Testing Approach
CI / CD Pipeline


MNIST kfserving
  • Preprocess / postprocess in transformer
  • Download image
  • Run prediction
  • Result upload to bucket
  • Custom model to process
  • Upload to bucket
More Reads
Link1
Sample for KFServing SDK with a custom image
Predict on a InferenceService using Tensorflow

Happy Learning!!!

July 23, 2020

Day #337 - Lessons Learnt in Playing with Docker, Kubernetes, VOLUME in Docker vs VOLUME Kubernetes

Tip #1 - To make flask API multithreaded, Add the option threaded in app.run()

app.run(host= '0.0.0.0',port=4321,threaded=True)

Tip #2 - To run a flask API in Docker, which involves file operations we can specify VOLUME

VOLUME inside docker file definition - Basically with VOLUME command you get performance without externally mounting any volumes.
VOLUME ['/datadir']
Some good example use cases:
  • logs
  • temp folders
Ref - Stackoverflow Answer

Tip #3 - Alternate option to #2 - Provide volume while running docker

docker run -p 8080:8080 Demo-App --volume=/Users/tmp:/app Demo-App

Tip #4. Specify Volume - emptyDir inside Kubernetes for temporary data

Use emptyDir Option. emptyDir volume should NOT be used for persisting data. Data erased when pod is removed.

Happy Learning!!!

July 13, 2020

Docker Mac Days Experiment #1

Finally able to experiment with Docker on Mac. First basic examples

1. Passing arguments to the docker image
2. Install OpenCV
3. Print Image Shape, Can't use imshow inside docker image though :)

Dockerfile - this is case sensitive
1. The contents 
  • Define Workdir the location to default store project documents
  • Packages to install
  • Contents to Copy
  • Entrypoint to Start the code

2. Example code to run inside docker

3. Command to create a docker image
4. Command to run a container

Docker Image Examples





Happy Learning!!!