[Jenkins] ลองเพิ่มเครื่อง Agent ที่เป็น Windows

หลังจาก Blog ตอนก่อนหน้าทุกคนคงเข้าใจ Concept ของ Jenkins Controller and Agents Architecture และประโยชน์ของมัน คราวนี้มาลอง Setup กันจริงๆครับ สรุป Step ขั้นตอนคร่าวๆ Jenkins Agent กำหนดให้เครื่อง Agent (Windows) รองรับการ SSH แบบแลก Key และเตรียม เตรียม Path temp ที่เครื่อง Agent (Windows) เอาไว้ ทำหน้าที่เป็น Workspace เวลาที่เครื่อง Controller มาสั่ง Node Agent เข้ามาทำงาน Jenkins Controller เพิ่ม Agent (Windows) มาเป็น Node หนึ่งของเครื่อง Controller (CentOS Stream) แก้ไข Pipeline ปรับ Jenkins File ให้รองรับ Jenkins Controller and Agents Architecture ทดสอบ Build Step : Jenkins Agent ในที่นี้จะเป็นจะเอา OS อะไรก็ได้ครับ ที่มันลง Jenkins ได้ก็พอ แต่อย่าลืม กำหนด JAVA_HOME ให้เรียบร้อยด้วยครับ ถ้าจำไม่ได้ว่าเคย SET JAVA_HOME ยังลองดูจาก Blog นี้ได้เลยครับ จากนั้นกำหนด ssh แบบแลก key เก็บ Private Key ไว้ด้วยนะครับ ต้องไป Add Credential ใน Jenkins Controller ต่อ OpenSSH Server…

PL-900 Short Note

ถ้ามี Account แบบ Work / School จะดีมากนะ เพราะจะได้ลองได้คุ้มๆเลย ถ้าไม่มีลองลำบากอยู่เหมือนกันนะ อย่างผมใช้เมล์ธรรมดาบางอันกดได้ กดไม่ได้ครับ ^__^UPDATE: สอบไปแล้ว แต่เพิ่งมาเจอ Power Apps 30-day free trial – Power Apps Microsoft Power Platform – Data Connectors – Data loss prevention, compliance, privacy, and accessibility – Admin & Management Microsoft Dataverse Power Apps – Power App Studio – Power Apps Type Power Automate Power BI Power Virtual Agents อื่นๆ สำหรับผมตัวที่เล่นได้ Knowledge Check Reference

[CR] Starbucks Pomegranate Orange Sparkling 

ราคา 75 บาท รสชาติ เอาจริงๆนะ ตอนแรก ผมนึกว่าน้ำผลไม้ทั่วไปที่จะออกหวานๆนะ แต่มัน คือ น้ำอัดลมที่มีน้ำทับทิม ผสมน้ำส้ม แต่รสชาติของทับทัมจะเด่นกว่าครับ ไม่หวานมาก เปรี้ยว และขมเล็กน้อย เอามาเพิ่ม Shot ได้ด้วยนะ แต่ผมยังไม่เคยลอง แฮะๆ แต่คิดว่าขมขึ้นกว่า Starbucks-Orangina Orange Juice พลังงาน 120 กิโลแคลอรี (kcal) Reference (พลังงานของแต่ละเมนู) ตามรูปเลยครับ

[Jenkins] Controller and Agents Architecture

Jenkins Controller and Agents Architecture ถ้าใครไปอ่าน doc เก่าๆ Controller (Master) และ Agent (Slave)นะครับ แนวคิดของ Controller and Agents Architecture จะการ CI/CD ที่มีการ Scale-Out เพิ่มจำนวน Node ในที่นี้ Node คือ ตัว Jenkins เพื่อมารองรับกระจาย(Distributed) งานด้าน CI/CD ที่เพิ่มมากขึ้น จากความต้องการ Functional / Time to Market / Quality ยกตัวอย่าง เช่น การ Build และ Execute Unit Test เมื่อมีการ Commit & Push เข้ามาในแต่ละ Branch ครับ ยิ่งถ้ามีหลาย Branch ตัว Jenkins ภาระงานเพิ่มขึ้น ใน Jenkins Controller – ตัวกระจายงาน Agents / Node – ตัวที่ทำงาน ตามชิ้นงานที่ Controller ส่งมาครับ การสื่อสารระหว่าง Controller กับ Agents / Node หลักใช้วิธี SSH ครับ ตัว Controller จะส่ง remote.jar ไปยัง Agents ต่างๆ เพื่อสั่ง Jenkins ของเครื่องปลายทางอีกที แต่ในหลาย Platform มีวิธีพิเศษเพิ่มขึ้นมา เช่น Windows สามารถ WMI…

[.NET] เปิด Visual Studio หน้า Design UI ไม่ขึ้น เจอ Error NuGet process crashed and left an inaccessible lock file

Visual Studio

สำหรับ Blog นี้ ตอนแรกว่าจะไม่เขียนครับ เพราะมันมี Error Message ที่แจ้งชัดเจนอยู่แล้วครับ แต่มีคนถามส่วนตัว 5-6 ท่านและ เลยคิดว่าเขียนดีกว่า จะได้ Google ได้ง่าย เพราะเคสล่าสุดอาจารย์ที่ปรึกษามาถาม และอธิบายไปรอบนึง จากนั้นลูกศิษย์ก็มาถามอีกที … ตัว Error Unable to obtain lock file access on ปัญหา สาเหตุ Unable to obtain lock file access on ‘C:\Users\{yourusername}\AppData\Local\Temp\NuGetScratch\lock\a5caae1e4c2b8a1b973a1eb9525c64844d6ecb11’ for operations on ‘C:\Users\{yourusername}\AppData\Roaming\NuGet\NuGet.Config’. This may mean that a different user or administrator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file C:\Users\{yourusername}\AppData\Local\Temp\NuGetScratch\lock\a5caae1e4c2b8a1b973a1eb9525c64844d6ecb11’…

สรุปงาน Azure Native Meetup #1 (DevOps)

ระหว่างทำงานไปช่วงวันหยุด มีแวะไปฟังงานนี้ครับ เหมือนเห็น Link แว็บๆในกลุ่ม Openchat เลยเข้ามาฟังเรื่อยๆ ระหว่างหา Bug ไป เลยเข้า Track DevOps ยาวเลย หัวข้อตามนี้เลยครับ Track 1: Getting Started Azure Cognitive Service Container Speaker Teerasej Jiraphatchandej Track 2: How to Deploy Azure Function on Azure Arc-enabled Kubernetes. Speaker Piti Champeethong Track 3: Make automation way for fully AKS life cycle via GitHub action Speaker Praparn Luengpoonlap A-S-W-D วนไปวนมาในงาน Reference

[Jenkins] รวม Tools เจ๋งๆ ของ VSCODE ที่มาช่วยจัดการ Jenkinsfile นั้นง่ายขึ้น

jenkins

สำหรับวันนี้ ผมมี Extensions ของ VSCODE ที่มาแนะนำ เพื่อช่วยให้เราสามารถจัดการ JenkinsFile ให้มันง่ายขึ้นครับ ดังนี้ครับ Jenkinsfile คือ อะไร ? Jenkinsfile [formerly JenkinsFile Support]  Jenkins Pipeline Linter Connector – มาดู Config ที่สำคัญครับ Key Value jenkins.pipeline.linter.connector.url URL ชอง Jenkins https://[your_jenkins_server:port]/pipeline-model-converter/validate jenkins.pipeline.linter.connector.crumbUrl ใส่ Crumb URL ใข้กรณีที่ Jenkins เรามีป้องกัน Cross-site Request Forgery (CSRF) โดยมี Template URL ดังนี้ https://[your_jenkins_server:port]/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,%22:%22,//crumb)) jenkins.pipeline.linter.connector.user user ของ jenkins แนะนำว่าใช้สิทธิต่ำๆ พอนะ jenkins.pipeline.linter.connector.pass pass ของ jenkins แนะนำว่าใช้สิทธิต่ำๆ พอนะ jenkins.pipeline.linter.connector.token ถ้าไม่ใช่ user + pass ใช้ Token ได้นะ แต่ของผมใช้ภายในองค์กร เลยใช้ user + pass แหละ jenkins.pipeline.linter.connector.strictssl ติ๊ก เพื่อให้มัน Error Certificate แบบใช้ใน Private Network เราอาจจะไม่ได้กำหนด SSL ใช้มัน ก็ติ๊ก “Set to false to allow invalid ssl connections” – ทดสอบกันครับ สำหรับผู้อ่านที่ผ่านมา หากมี Extensions…

[PODMAN] rootless container error “Disk quota exceeded”

วันนี้เป็นปัญหาที่น่าปวดหัวเหมือนกันหลังจากใช้ Podman ไป 1 ปีนิดๆครับ อยู่ลูกค้าแจ้งปัญหามาว่า Disk quota exceeded มาจากไหน ? เดี๋ยวต้องไปหาที่มาเพิ่ม Solution ตรวจสอบก่อนว่า maxkey มีค่าเท่าไหร่ ด้วยคำสั่ง ลองดูจำนวนปัจจุบันสิ มีค่าเท่าไหร่ (ต้อง Login เข้าไป และรันแยก User นะ เพราะ ตัวระบบมันเก็บค่าแยก Per User (Ref: sysctl – Is kernel.keys.maxkeys per user or per key?) ในกรณีที่ค่าของมันเกิน maxkeys เช่น ต้องไปเพิ่ม maxkeys ต้องใช้ user root นะ ด้วยคำสั่ง นอกจากเพิ่ม maxkeys แล้ว ถ้าลองไปดูใน API keyrings(7) – Linux manual page (man7.org) มันจะมี maxbytes ด้วยนะ อาจจะเพิ่มได้ด้วยกันเลย แต่การเพิ่มมันจะใช้ Memory เพิ่ม ต้องระวังด้วย ลองปรับ maxbytes ต้องใช้ user root นะ ด้วยคำสั่ง ** 10485760 bytes = 10 MB ปรับไปแล้วอย่าลืมเอา maxkeys * maxbytes เดี๋ยวเพิ่มไปแล้ว Server RAM ไม่พอ อย่างของผมปรับ maxkeys = 400 maxbytes = 10485760 // 10 MB ใช้…

[C#] Dapper Error connection assigned to the command is in a pending local transaction. 

ช่วงนี้มีไปช่วยน้องในทีมแก้ปัญหาระบบซื้อขาย Bond โดยน้องเอา Service เดิมที่เคยทำไว้ในผูกกันเป็น Flow ใหม่ครับ แล้วทีนี้เจอ Error หลังจากลองไล่ดู Code พบว่าเป็นส่วนคำสั่งที่เรียก Dapper ให้มันช่วย Query ให้ เลยเพิ่มตัว Transaction ใส่ครอบเข้าไปครับ อีกเคส ต้องไปใส่ Transaction Scope ด้วย พวก BeginTran / Commit