Môi trường Cloud cá nhân với LXD
Phần mềm nguồn mở cho điện toán đám mây đã trở nên đơn giản và phổ biến đến mức người dùng bình thường cũng có thể sở hữu cả một hệ thống cloud cá nhân tại nhà. Trong ảnh dưới đây là hệ thống “điện toán đám mây” chạy trong phòng ngủ nhà mình. Bài viết này giới thiệu cách mình cài đặt hệ thống cloud trên phần cứng lỗi thời sử dụng công nghệ quản lý container và máy ảo LXD trên Ubuntu Linux.
Workaround for Proxy Issues with Git Repo SSH Endpoint in cos-configuration-k8s-operator
The Problem: cos-configuration-k8s-operator and SSH Git Proxies
When working with the cos-configuration-k8s-operator (version 3.5.0, observed on microk8s with cos-lite), users might encounter an issue where proxies are not respected when the git_repo configuration uses an SSH endpoint. Even with JUJU_HTTP_PROXY and JUJU_HTTPS_PROXY environment variables correctly set, the git-sync process within the operator fails to utilize these proxies for SSH-based Git operations. This can lead to failures when the operator attempts to clone repositories in environments requiring proxy access.
New gaming GTune laptop
Another laptop refresh season comes. Buying a laptop with so many requirements within a limited budget is never an easy task and I had a hard time selecting laptop this time too. Many hard requirements are
Limited budget: $2500. Ubuntu 24.04 should run without “major” issues. Opensource drivers tend to have bugs that impact the stability of the system. As this laptop will be my main daily working laptop, stability in major components such as wifi, display, internal webcam, external monitors are hard requirements here.
Run Ollama using podman with amdgpu on Ubuntu 24.04
I have some freetime this afternoon so I decided that I will try running Ollama on podman. Ollama provides a docker image on docker hub at https://hub.docker.com/r/ollama/ollama, so I launched a container following the manual in the docker hub.
podman run -d -v ollama:/root/.ollama -p 11434:11434 \ --name ollama ollama/ollama My laptop (A ThinkPad T14 Gen 3 AMD) has a AMD GPU so I rerun the ollama with GPU supports.
Upload A Disk Volume Directly to Openstack Image
When we upload an image using openstack image create --file, the image file will be transferred to image storage backend through glance api servers. If the image size is huge, the upload process might take time sometimes ends in failure. Glance API might become the bottleneck if multiple huge images are uploaded at the same time. To overcome glance api servers bottleneck, we could instead directly upload the image to ceph following the below procedure.
Verify Ceph Deb Package Build Flag
We can confirm what build flags are enabled at build time by checking the below places.
Default build flags in the source code’s Makefile or build tool’s declaration files (CMakeLists.txt). In the debian/rules file. The build system at build time (dh). As deb packages on different Ubuntu releases have different versions, it is necessary to verify the build flags in deb package and upstream package within the same version. For example, below are the process to verify the build flags of ceph package in Ubuntu 22.
Technical Note: Jq Array Transformation
Problem Given a JSON data below, output the data in CSV/TSV format.
[ { "id": 0, "data": [0, 1, 2] }, { "id": 1, "data": [1, 2, 3] }, { "id": 2, "data": [3, 4, 5] } ] Expected output.
"0\t0,1,2" "1\t1,2,3" "2\t3,4,5" How to JQ provides @tsv and @csv function that convert data to the corresponding format. Each row of the output CSV table should be formated to an array type before these functions can consume.
Migrating my blog to static pages
For many years, I have maintained my blog on blogger.com. Though I find it is a really-easy-to-use blogging platform, I am still unsatisfied with the lack of many necessary features. Many of my frustration when using blogger.com are:
It does not allow me to easily format code. I need to use a thirdparty to help format my code. I would copy the result to generated html of my article. That process is tedious and error-prone.
Technical Note: Convert an ova image to qcow2 format
From Wikipedia of Open Virtualization Format, I learned that an the ova file is just a tar file of ovf directory. So I went open a Windows 10 Developer Evaluation ova file to see what exist inside it.
$ tar -tf WinDev2001Eval.ova WinDev2001Eval.ovf WinDev2001Eval-disk001.vmdk WinDev2001Eval.mf So inside the ova file includes
A virtual machine specification definition .ovf file A hash checksum .mf file A disk image in .vmdk image As qemu-img supports vmdk as disk image file, we actually could convert vmdk file to any other format that we like.
Technical Note: Disk Encryption using Cryptsetup with Vault as Key Management Service
In Linux Operating system, full disk encryption could be achieved by various solutions: encryptfs, dm-crypt… While a step-by-step setup of disk/partition encryption can be referred from official documentation, integration disk encryption with Key Management solution like Hashicorp Vault is unobvious. Fortunately, there are a package named vaultlocker in Ubuntu Universe repository that ease this integration. I decided to spend my free time to make cryptsetup work with Vault.
Notes: A similar request has been made to Cryptsetup but it goes outside of cryptsetup so it was closed.