如何为drone.io中的构建配置硬盘内存限制 [英] how to configure hard memory limit for builds in drone.io

查看:162
本文介绍了如何为drone.io中的构建配置硬盘内存限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我错过了它,但是我看不到有任何方法可以控制任何给定构建的硬内存限制(我的构建因此而被谋杀了).构建内存限制是基于客户端提供的构建参数(这意味着单个客户端可以关闭所有组件)还是在某个地方我可以将服务配置为每个构建仅允许512mb(例如)?

Perhaps I am missing it, but I see no method to control the the hard memory limit for any given build (I have builds being murdered because of it). Is the build memory limit based on the build params supplied by the client (this means a single client can bring down everything) or is there someplace I can configure the service to only allow 512mb (for example) per build?

推荐答案

您可以通过设置全局DRONE_LIMIT_MEM变量(与服务器一起使用)来限制每个容器的最大内存量.应该将其设置为以字节为单位的内存量,例如:

You can limit the max amount of memory per-container by setting the global DRONE_LIMIT_MEM variable (with the server). This should be set to the amount of memory in bytes, for example:

DRONE_LIMIT_MEM_SWAP=512000000
DRONE_LIMIT_MEM=512000000

这些限制在Drone启动容器[1]时传递给Docker.它等效于以下Docker命令:

These limits are passed to Docker when Drone starts a container [1]. It is the equivalent to the following Docker command:

docker run --memory=512000000 <image>

[1] https://docs.docker.com/config/containers/resource_constraints/#limit-a-containers-access-to-memory

这篇关于如何为drone.io中的构建配置硬盘内存限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆