Posts

Showing posts from July, 2025

qwen 3 (0.6B) - running in google colab

Image
Trying to run qwen 3 with 0.6 billion parameters on google colab using code straight from hugging face here. (https://huggingface.co/Qwen/Qwen3-0.6B).  The code looks like this.  from transformers import AutoModelForCausalLM, AutoTokenizer model_name = "Qwen/Qwen3-0.6B" # load the tokenizer and the model tokenizer = AutoTokenizer.from_pretrained( model_name ) model = AutoModelForCausalLM.from_pretrained(     model_name ,     torch_dtype = "auto" ,     device_map = "auto" ) # prepare the model input prompt = "Give me a short introduction to large language model." messages = [     { "role" : "user" , "content" : prompt } ] text = tokenizer .apply_chat_template(     messages ,     tokenize = False ,     add_generation_prompt = True ,     enable_thinking = True # Switches between thinking and non-thinking modes. Default is True. ) model_inputs = tokenizer ([ text ], return_tensors = "p...

aws assume role basics

Image
AWS Assume role allow a principal (an IAM user or role) to temporarily assume a different IAM role and receive temporary credentials (AccessKeyId, SecretAccessKey, SessionToken). You use this when: Accessing another AWS account (cross-account access), Escalating privileges temporarily, Following least privilege principles. So you need to create a role, define who can assume this newly create role and finally you need to specify what permission tied to it. Otherwise, there's no reason to do this. :)  In your IAM console, click on Create Role.  Then select "Custom Trust policy".       Then specify, the principal who can assume this role.  {   "Version" : "2012-10-17" ,   "Statement" : [     {       "Sid" : "Statement1" ,       "Effect" : "Allow" ,       "Principal" : {         "AWS" : "arn:aws:iam::your-aws-id:user/jeremydev"       },   ...

kong service mesh - setup and deploy to AKS manually for testing purposes

Image
To install kong service mesh via helm run the following command in your cloud shell. helm repo add kong-mesh https://kong.github.io/kong-mesh-charts helm repo update helm install --create-namespace --namespace kong-mesh-system kong-mesh kong-mesh/kong-mesh Takes abit of time to spin this up.  kubectl apply -f https://raw.githubusercontent.com/kumahq/kuma-counter-demo/refs/heads/main/k8s/000-with-kuma.yaml kubectl wait -n kuma-demo --for=condition=ready pod --selector=app=demo-app --timeout=90s And then you can see some of the pods being spined up. Also notice we have our namespace labeled (kuma.io/sidecar-injection: enabled). To turn on, mutual tls, we can use the following yaml. apiVersion : kuma.io/v1alpha1 kind : Mesh metadata :   name : default spec :   meshServices :     mode : Exclusive   mtls :     backends :       - name : ca-1         type : builtin     enabledBackend : ca-1 And the enable appl...

aks new feature - configuring different vm sku for the same node pool

Image
AKS allows us to have different VM sku in the same node pool. For example, lets say you have a single node pool, we are restricted to use the same sku 'standard_ds3_v2' and subsequent VM would require us to use the same sku.  AKS allow different vm sku now.  You can easily set it up by enabling this feature in your cluster. az extension add --name aks-preview az extension update --name aks-preview az feature registration create --namespace Microsoft.ContainerService --name VMsAgentPoolPreview az feature show --namespace "Microsoft.ContainerService" --name "VMsAgentPoolPreview" Next create your cluster with the preview VMs. az aks create --resource-group my-aks-rg --name myakscluster --vm-set-type "VirtualMachines" --node-count 1 --node-vm-size standard_a2_v2 --generate-ssh-keys   Your cluster no longer uses VMSS scale set. Instead you can see VM directly provision in your management cluster resource group.  Add a user pool in to your cluster  az ak...

az cli - The behavior of this command has been altered by the following extension: aks-preview An RSA key file or key value must be supplied to SSH Key Value. You can use --generate-ssh-keys to let CLI generate one for you

 When running az cli to create aks cluster i bump into this issue " The behavior of this command has been altered by the following extension: aks-preview" An RSA key file or key value must be supplied to SSH Key Value. You can use --generate-ssh-keys to let CLI generate one for you " To resolve this issue, all you need to do is, add the followings --generate-ssh-keys to your az cli command as shown here: az aks create --resource-group rg-aks-mixed-pools --name myakscluster --vm-set-type "VirtualMachines" --node-count 1 --generate-ssh-keys

azure synapse - your file cannot be opened because it does not exist or it is used by another process.

Image
When creating Azure Synapse I created data lake manually. Then I found that there's some issues trying to run SQL query against external csv file.  I checked I have given it Storage Blob Data Contributor access to the data lake and it matches the identity.   And provided the required permission from storage perspective. I also noticed that i can preview the data - but unable to execute query using SELECT OPENROWSET.  The solution, I didn't have my user account assigned the proper permission. I need to have Storage Blob Data Contributor for my user as well.  You have have noticed this when you're trying to create a pool - sql or spark pool.  And then, I was able to run query:

azure synapse - This endpoint does not support BlobStorageEvents or SoftDelete. Please disable these account features if you would like to use this endpoint

Image
Bump into this error while trying to setup my Synapse workspace.   'This endpoint does not support BlobStorageEvents or SoftDelete. Please disable these account features if you would like to use this endpoint' Operation returned an invalid status code 'Conflict' It turns out that in order to setup my connection to ADL Gen2, that i create manually which comes with these options enabled. So it you're creating your Azure Data Lake manually, please disable these options.  To resolve these, please disable these 2 options and then re-test your connection. 

github actions faqs

Working with different stage does not mean you have access to the previous stage that download code repository Github action different stage that runs will not have access to code downloaded or checkout from previous. Something that tripped me while trying to reuse create a reusable workflow template.  Stages that does not specified "needs" it will run one after another (sequentially) Here we have build and containerize stage. without specifying needs, build will run first and then containerize.  jobs :   build :     runs-on : ubuntu-latest     steps :       - name : Checkout code         uses : actions/checkout@v4       - name : Setup dotnet         uses : actions/setup-dotnet@v4         with :           dotnet-version : '${{ inputs.dotnet-version }}'     containerize :           permissions :   ...

Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under your-repository/.github/workflows/test.yaml'. Did you forget to run actions/checkout before running your local action?

 This error simply means github actions try to retrieve and run your yaml from ./github/workflows/test.yaml folder but couldn't find it.  Make sure you place your workflow yaml into this folder.  What if you want to place it in subfolder in ,/github/workflows?  No you cannot do that - it is not supported.  But you can reuse a workflow in this manner main.yaml -> test.yaml -> child.yaml.  So main calles test which in turn call another reusable workflow.

github action - reusable workflow within the same repository

Image
To call a reusable workflow within github, the workflow must and must exist in .github/workflows folder. For example, We have 2 files here main.yaml and test.yaml.  main.yaml calls test.yaml.  main.yaml. name : Hello World Workflow on :   push :     branches :       - main   workflow_dispatch :   jobs :   build :     runs-on : ubuntu-latest     steps :       - name : Checkout self repo         uses : actions/checkout@v4       - name : Checkout gha core         uses : actions/checkout@v4         with :           repository : mitzenjeremywoo/gha-core           path : gha-core           token : ${{ secrets.GITHUB_TOKEN }}   # or PAT if private       - name : Say hello         run : ls -al -R ${{ github.workspace }...

azure aks can't create kubenet networking for a cluster

Image
Interestingly we can't seems to create AKS with kubenet networking.

k8s mutating and validation webhook

The flow for k8s mutation and validation webhook can be illustrated here: Key points of interest are :- - Mutations happen first and may change the object - Validations happen after all mutations, working on the final mutated object -All webhooks in each phase are executed in defined order 1. User/API Client sends a request (e.g., create Pod)        │        ▼ 2. API Server handles:    - Authentication    - Authorization        │        ▼ 3. Admission Phase Begins        │        ▼ 4. MUTATING Webhooks (in order)    ┌──────────────────────────────┐    │ MutatingWebhook #1           │◄─── Can modify object    └──────────────────────────────┘              │              ▼    ┌──────────────────────────────┐  ...