Runner doens't stop all containers after finishing #509

Open
opened 2024-03-06 11:12:00 +00:00 by Zig1375 · 7 comments

I have such a workflow:

name: Example

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]
    
jobs:
  test:
    name: test
    runs-on: ubuntu-latest
    steps:
      - name : Checkout
        uses: actions/checkout@v4

      - name: Setup bun
        uses: oven-sh/setup-bun@v1

      - name: Start MongoDB
        uses: supercharge/mongodb-github-action@1.10.0
        with:
          mongodb-version: '7.0'
          mongodb-port: 27017
          mongodb-database: 'testdb'
          mongodb-replica-set: rs0

      - name: Install dependencies
        run: bun i

      - name: Run tests
        run: bun test --timeout 10000

After finishing the "test" job, the "mongo" container is still working and I cannot rerun the task. I have to stop and delete container before...
On the GitHub Actions the same script works as expected.

I have such a workflow: ```yaml name: Example on: push: branches: [ "master" ] pull_request: branches: [ "master" ] jobs: test: name: test runs-on: ubuntu-latest steps: - name : Checkout uses: actions/checkout@v4 - name: Setup bun uses: oven-sh/setup-bun@v1 - name: Start MongoDB uses: supercharge/mongodb-github-action@1.10.0 with: mongodb-version: '7.0' mongodb-port: 27017 mongodb-database: 'testdb' mongodb-replica-set: rs0 - name: Install dependencies run: bun i - name: Run tests run: bun test --timeout 10000 ``` After finishing the "test" job, the "mongo" container is still working and I cannot rerun the task. I have to stop and delete container before... On the GitHub Actions the same script works as expected.
Zettat123 added the
kind
bug
label 2024-03-07 01:29:36 +00:00
Member

I think the reason is that the supercharge/mongodb-github-action action creates a mongodb container that is not managed by act_runner. It's difficult for act_runner to remove the created mongodb container because act_runner cannot get the id of the container.

Maybe you could use services to create a mongodb container for test

I think the reason is that the `supercharge/mongodb-github-action` action [creates a mongodb container](https://github.com/supercharge/mongodb-github-action/blob/b0a1493307c4e9b82ed61f3858d606c5ff190c64/start-mongodb.sh#L96) that is not managed by act_runner. It's difficult for act_runner to remove the created mongodb container because act_runner cannot get the id of the container. Maybe you could use [services](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idservices) to create a mongodb container for test
Author

I used the same action in GitHub Actions before we migrated to Gitea.
I'll try to use services... I was just surprised that act_runner works so differently than GitHub Actions...

I thought the act_runner should be able to get the container ID of a Docker, since the Docker is run by an action command:
https://github.com/supercharge/mongodb-github-action/blob/main/action.yml#L39-L41

So I thought runner runs the docker container from that command and it knows all info to remove it...
Am I wrong?

I used the same action in GitHub Actions before we migrated to Gitea. I'll try to use services... I was just surprised that act_runner works so differently than GitHub Actions... I thought the act_runner should be able to get the container ID of a Docker, since the Docker is run by an action command: https://github.com/supercharge/mongodb-github-action/blob/main/action.yml#L39-L41 So I thought runner runs the docker container from that command and it knows all info to remove it... Am I wrong?
Member

I thought the act_runner should be able to get the container ID of a Docker, since the Docker is run by an action command:
https://github.com/supercharge/mongodb-github-action/blob/main/action.yml#L39-L41

Yes. This container(we'll call it "action_container" later) is created by act_runner and it can be removed by act_runner.

However, in my test, the mongodb container is a container that is created by "action_container". This means that the mongodb container and "action_container" are different containers. Since the mongodb container is not created by act_runner, act_runner cannot get its container ID.

> I thought the act_runner should be able to get the container ID of a Docker, since the Docker is run by an action command: https://github.com/supercharge/mongodb-github-action/blob/main/action.yml#L39-L41 Yes. This container(we'll call it "action_container" later) is created by act_runner and it can be removed by act_runner. However, in my test, the mongodb container is a container that is created by "action_container". This means that the mongodb container and "action_container" are different containers. Since the mongodb container is not created by act_runner, act_runner cannot get its container ID.
Author

I see. Thank you for the clarification.

I see. Thank you for the clarification.
Author

I think the reason is that the supercharge/mongodb-github-action action creates a mongodb container that is not managed by act_runner. It's difficult for act_runner to remove the created mongodb container because act_runner cannot get the id of the container.

Maybe you could use services to create a mongodb container for test

It seems services do not work: #511

> I think the reason is that the `supercharge/mongodb-github-action` action [creates a mongodb container](https://github.com/supercharge/mongodb-github-action/blob/b0a1493307c4e9b82ed61f3858d606c5ff190c64/start-mongodb.sh#L96) that is not managed by act_runner. It's difficult for act_runner to remove the created mongodb container because act_runner cannot get the id of the container. > > Maybe you could use [services](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idservices) to create a mongodb container for test It seems services do not work: https://gitea.com/gitea/act_runner/issues/511

i have a lot of networks standing after a job:
version from runner: v0.2.9
version gitea: 1.21.10

docker network prune -f
Deleted Networks:
GITEA-ACTIONS-TASK-582_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-584_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-594_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-579_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-590_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-592_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-571_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-569_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-572_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-576_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-581_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-583_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-564_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-574_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-575_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-577_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-578_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-586_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-580_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-588_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-589_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-591_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-567_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-570_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-568_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-585_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-587_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-573_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
i have a lot of networks standing after a job: version from runner: v0.2.9 version gitea: 1.21.10 ``` docker network prune -f Deleted Networks: GITEA-ACTIONS-TASK-582_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-584_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-594_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-579_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-590_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-592_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-571_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-569_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-572_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-576_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-581_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-583_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-564_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-574_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-575_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-577_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-578_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-586_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-580_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-588_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-589_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-591_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-567_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-570_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-568_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-585_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-587_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network GITEA-ACTIONS-TASK-573_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network ```
Owner

i have a lot of networks standing after a job:
version from runner: v0.2.9
version gitea: 1.21.10

docker network prune -f
Deleted Networks:
GITEA-ACTIONS-TASK-582_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-584_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-594_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-579_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-590_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-592_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-571_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-569_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-572_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-576_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-581_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-583_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-564_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-574_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-575_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-577_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-578_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-586_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-580_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-588_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-589_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-591_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-567_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-570_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-568_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-585_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-587_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network
GITEA-ACTIONS-TASK-573_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network

Thanks for the report. You can clean them manually. Most of them because of act runner crashed or the previous version's bug before v0.2.9

> i have a lot of networks standing after a job: > version from runner: v0.2.9 > version gitea: 1.21.10 > > ``` > docker network prune -f > Deleted Networks: > GITEA-ACTIONS-TASK-582_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-584_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-594_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-579_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-590_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-592_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-571_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-569_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-572_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-576_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-581_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-583_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-564_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-574_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-575_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-577_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-578_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-586_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-580_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-588_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-589_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-591_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-567_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-570_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-568_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-585_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-587_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > GITEA-ACTIONS-TASK-573_WORKFLOW-Build-And-Test-Python-Project_JOB-integration-test-integration-test-network > ``` > Thanks for the report. You can clean them manually. Most of them because of act runner crashed or the previous version's bug before v0.2.9
Sign in to join this conversation.
No Milestone
No Assignees
4 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#509
No description provided.