Skip to content

Instantly share code, notes, and snippets.

@orimanabu
orimanabu / hardlink-vs-reflink.md
Created December 5, 2024 01:44
hardlink vs reflink
@orimanabu
orimanabu / container_image_pull_with_curl.md
Created November 20, 2024 15:45
container_image_pull_with_curl.md
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/alpine:pull")
$ curl -s -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/library/alpine/manifests/3.10 | jq .
{
  "manifests": [
    {
      "digest": "sha256:e515aad2ed234a5072c4d2ef86a1cb77d5bfe4b11aa865d9214875734c4eeb3c",
@orimanabu
orimanabu / podman-5.3-test-days-logs-riscv64.md
Created November 4, 2024 14:11
Podman 5.3 Test Days logs - riscv64

Environment

Sipeed Lichee Book 4A

OS

Debian customized by SiPeed

debian@lpi4a1a81:~$ uname -a
Linux lpi4a1a81 5.10.113-zzz-sipeed-20240531+ #13 SMP PREEMPT Fri May 31 13:47:57 HKT 2024 riscv64 GNU/Linux
@orimanabu
orimanabu / compile-latest-podman-on-riscv-debian.sh
Last active November 4, 2024 05:20
Compile Podman on RISC-V Debian
#!/bin/bash -xe
# sudo apt install cargo protobuf-compiler protobuf-codegen
workdir=./work
mkdir -p ${workdir}
pushd ${workdir}
git clone https://github.com/containers/podman.git
git clone https://github.com/containers/conmon.git
@orimanabu
orimanabu / podman-5.3-test-days-logs-aarch64.md
Created November 2, 2024 07:05
Podman 5.3 Test Days logs - aarch64

Environment

Machine model: Apple MacBook Air (13-inch, M2, 2022)

Fedora version

$ cat /etc/fedora-release 
Fedora Asahi Remix release 41 (Forty One)
@orimanabu
orimanabu / rosetta_ioctl.md
Last active August 30, 2024 17:39
Rosettaがやっている実行環境のチェック方法を確認する

(最新版はこちらをご覧ください: https://zenn.dev/orimanabu/articles/rosetta-libkrun)

はじめに

Appleは、Linux用のRosettaバイナリを提供しています。 これを使うと、Apple Silicon上のmacOS上で稼働するaarch64 Linux仮想マシン上で、x86_64バイナリを実行できるようになります[^1]。

Rosettaは、実行環境がVirtualization.framework(Apple純正のVMM用フレームワーク)を使った仮想環境かをチェックしており、そうでなければ実行できないらしく、 そのチェックは「rosettaバイナリに謎のioctl(2)を発行して、特定の文字列が返ってくること」を確認しているようです[^2]。

以下、その様子を再現してみたメモです。

@orimanabu
orimanabu / podman-with-libkrun-vulkaninfo.txt
Created August 6, 2024 14:49
vulkaninfo output from Podman with libkrun
% podman run --rm --device /dev/dri quay.io/slopezpa/fedora-vgpu-llama vulkaninfo
'DISPLAY' environment variable not set... skipping surface info
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
ERROR: [../src/panfrost/vulkan/panvk_device.c:381] Code 0 : WARNING: panvk is not a conformant vulkan implementation, pass PAN_I_WANT_A_BROKEN_VULKAN_DRIVER=1 if you know what you're doing. (VK_ERROR_INCOMPATIBLE_DRIVER)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
@orimanabu
orimanabu / podman-with-libkrun-for-containerized-AI-workload-acceleration.txt
Created August 6, 2024 14:46
Podman with libkrun for containerized AI workload acceleration
% podman run --rm -ti --device /dev/dri -v ~/Downloads:/models:Z quay.io/slopezpa/fedora-vgpu-llama main --temp 0 -m models/Llama-3-ELYZA-JP-8B-q4_k_m.gguf -b 512 -ngl 99 -p "Podmanのlibkrun providerについて教えて下さい"
Log start
main: build = 2238 (56d03d92)
main: built with cc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6) for aarch64-redhat-linux
main: seed = 1722955285
ggml_vulkan: Found 1 Vulkan devices:
Vulkan0: Virtio-GPU Venus (Apple M2) | uma: 1 | fp16: 1 | warp size: 32
llama_model_loader: loaded meta data with 22 key-value pairs and 291 tensors from models/Llama-3-ELYZA-JP-8B-q4_k_m.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = llama
@orimanabu
orimanabu / Podman 5.2 Test Days Log - Container.md
Created July 31, 2024 15:40
Podman 5.2 Test Days Log - Container
ori@asahi-mbp:~$ uname -a
Linux asahi-mbp 6.9.12-400.asahi.fc41.aarch64+16k #1 SMP PREEMPT_DYNAMIC Sun Jul 28 20:21:34 UTC 2024 aarch64 GNU/Linux
ori@asahi-mbp:~$ cat /etc/fedora-release
Fedora Asahi Remix release 41 (Rawhide)
ori@asahi-mbp:~$ rpm -q podman
podman-5.2.0~rc2-1.fc41.aarch64
@orimanabu
orimanabu / Podman 5.2 Test Days Log - Image Pull.md
Created July 31, 2024 15:37
Podman 5.2 Test Days Log - Image Pull
ori@asahi-mbp:~$ uname -a
Linux asahi-mbp 6.9.12-400.asahi.fc41.aarch64+16k #1 SMP PREEMPT_DYNAMIC Sun Jul 28 20:21:34 UTC 2024 aarch64 GNU/Linux
ori@asahi-mbp:~$ cat /etc/fedora-release
Fedora Asahi Remix release 41 (Rawhide)
ori@asahi-mbp:~$ rpm -q podman
podman-5.2.0~rc2-1.fc41.aarch64