{"task": {"agent_timeout": 3000, "task": "codegen__containerd__containerd-11106", "verifier_timeout": 3000, "instruction": "This is a code generation task. You are expected to write working code that solves the described problem.\n<issue>\n      ### What is the problem you're trying to solve\n\nConfigure Image Registry is a helpful feature. \nhttps://github.com/containerd/containerd/blob/main/docs/cri/registry.md\n\nAs the title says, I want to set a timeout for the image registry.\nThe timeout is set to 30 seconds as hard coding in the current implementation.\nhttps://github.com/containerd/containerd/blob/26d6fd0c3fe505ad3bb1525c4514ef21c19c24d4/core/remotes/docker/config/hosts.go#L150\n\nThis means that if a proxy image registry is down or unreachable, the client must wait **30 seconds for each blob**. It's too long.\n\nDoes it happen in such a case? For example, the proxy registry is on the Kubernetes cluster and uses NodePort to access the proxy registry from containerd. In such a scenario, NodePort can't be used until CNI is ready. Since all blobs for the CNI pod's images must wait 30 seconds for fallback, the image pulling for the CNI pod takes a lot of time.\n\nFor instance, blocking the path to the proxy server with iptables and trying to retrieve the cilium image requires 270 seconds in my local. This is the best case for Kubernetes because when a node is ready, kubelet will fetch images of various pods, including DaemonSet. However, CNI images are not always the priority when pulling images.\n\n### Describe the solution you'd like\n\n```\n$ cat config/certs.d/_default/hosts.toml\n[host.\"https://my-registry-cache.local:8443\"]\n  skip_verify = true\n  capabilities = [\"pull\", \"resolve\"]\n  timeout = \"1s\"\n```\n\n### Additional context\n\nI'd like to contribute if it will be accptance.\n\n</issue>\nFocus on implementing the required functionality correctly and efficiently. Treat this as a programming challenge.\nYou are not allowed to read git history.\n", "memory": "8192m", "runnable": false, "difficulty": "hard", "language": "", "cpus": "", "instruction_truncated": false, "category": "code-generation", "compose": false, "has_solution": true, "oracle": null, "docker_image": "", "taskset": "devopsgym", "tags": ["code-generation", "devops-bench"]}, "runs": []}