Apply resource limitation on container during job #475

Closed
opened 2024-01-29 16:56:52 +00:00 by l.minopoli · 3 comments

Hi,
i'm trying act_runner running inside docker.

My intention is to apply a limitation about the maximum amount of resource that the runner can use.
Inside docker-compose I used this properties:

deploy:
  replicas: 1
  resources:
    reservations:
      cpus: "0.1"
      memory: 20M
    limits:
      cpus: "0.5"
      memory: 500M

but the runner keeps running other containers, that I'm assuming are running "outside" this specification.
So I tried to put a limitation on the job itself, but the options seems to be ignored:

name: Example
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]

jobs:
  release-image:
    runs-on: ubuntu-latest
    container:
      image: catthehacker/ubuntu:act-latest
      # options: --cpu-quota=400000 --memory=500m # --cpus 0.5 --cpu-shares=500 
      options: --cpus=0.4 --memory=250m
    steps:

I'm start thinking that maybe this is a feature not covered by gitea yet. I'm assuming that I may make everything working with DinD, but at an higher performance price.

Is there a way to make the containers.options working the way i'm expecting?

Hi, i'm trying act_runner running inside docker. My intention is to apply a limitation about the maximum amount of resource that the runner can use. Inside docker-compose I used this properties: deploy: replicas: 1 resources: reservations: cpus: "0.1" memory: 20M limits: cpus: "0.5" memory: 500M but the runner keeps running other containers, that I'm assuming are running "outside" this specification. So I tried to put a limitation on the job itself, but the options seems to be ignored: ``` name: Example run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 on: [push] jobs: release-image: runs-on: ubuntu-latest container: image: catthehacker/ubuntu:act-latest # options: --cpu-quota=400000 --memory=500m # --cpus 0.5 --cpu-shares=500 options: --cpus=0.4 --memory=250m steps: ``` I'm start thinking that maybe this is a feature not covered by gitea yet. I'm assuming that I may make everything working with DinD, but at an higher performance price. Is there a way to make the containers.options working the way i'm expecting?

This issue is similar to this other one (I'd like to inject Docker configuration params into started child containers).

I've opened a PR for it more than 3 months ago... it's still waiting for merge🙄

This issue is similar to [this](https://gitea.com/gitea/act_runner/issues/79#issuecomment-746463) other one (I'd like to inject Docker configuration params into started child containers). I've opened a [PR](https://gitea.com/gitea/act/pulls/80) for it more than 3 months ago... it's still waiting for merge🙄
Author

This issue is similar to this other one (I'd like to inject Docker configuration params into started child containers).

I've opened a PR for it more than 3 months ago... it's still waiting for merge🙄

I see, there is no way to poke the mantainer?
That sounds like a very simple fix, I don't understand why it's still pending...

Thank you for replying 😃

> This issue is similar to [this](https://gitea.com/gitea/act_runner/issues/79#issuecomment-746463) other one (I'd like to inject Docker configuration params into started child containers). > > I've opened a [PR](https://gitea.com/gitea/act/pulls/80) for it more than 3 months ago... it's still waiting for merge🙄 > I see, there is no way to poke the mantainer? That sounds like a very simple fix, I don't understand why it's still pending... Thank you for replying 😃
Member

closed by gitea/act#80

closed by https://gitea.com/gitea/act/pulls/80
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/act_runner#475
No description provided.