Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs about how to generate config for act runner with docker and setup it with docker-compose #25256

Merged
merged 8 commits into from
Jun 16, 2023

Conversation

thezzisu
Copy link
Contributor

In this pull request, the following changes are addressed:

  • State user should create config.yaml before start container to avoid errors.
  • Provided instructions to deploy runners using docker compose.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 14, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 14, 2023
@thezzisu
Copy link
Contributor Author

The motivation of this PR is that I have wasted half an hour debugging my network after seen the Error: EOF log when running the runner container. However, the cause is I created a empty config.yaml. I think the documentation should state this to avoid misunderstandings.

@@ -82,6 +82,12 @@ When you are using the docker image, you can specify the configuration file by u
docker run -v $(pwd)/config.yaml:/config.yaml -e CONFIG_FILE=/config.yaml ...
```

You need to create config.yaml before running the container, to avoid `Error: EOF` errors. Neither use the method mentioned above, or just run the following command:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.yaml is not a necessary if you are using a default setting. But if you put an empty file, then what should happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image As I mentioned, the result is `Error: EOF` which is very confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meanwhile, docker mount/volume will create a directory when the mount source is not existing. So maybe creating a config.yaml in advance is the best practice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, maybe you should create an empty config file but not a folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but as the screenshot above create a empty config file will cause the program to crash with a confusing error message. After roughly viewed the source code, I think the runner requires a well formated yaml config to work, but a empty yaml file just cannot make the parser happy.

Copy link
Contributor Author

@thezzisu thezzisu Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thus, it's neede to using generate-config to generate a working config first.
EDT: In the screenshot above, $(pwd)/config.yaml is an already created empty file.

@techknowlogick techknowlogick added type/docs This PR mainly updates/creates documentation skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. backport/v1.20 This PR should be backported to Gitea 1.20 labels Jun 14, 2023
@wolfogre
Copy link
Member

My opinions:

  • Empty config.yaml should be acceptable, the EOF error surprises me. I will I'm going to figure it out and fix it.
  • I think "Make sure that the file is mounted into the container as a volume" is clear enough. That meas you get the file already, of cause "You need to create config.yaml before running the container".
    • image
  • docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml is a good idea, it could be ”How to generate config file with a docker container“
    • image
  • "Set up the runner using docker compose" looks great to me.

So my suggestions are:

  • Remove lines with "Error EOF"
  • Keep docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml and "Set up the runner using docker compose"

@thezzisu
Copy link
Contributor Author

@wolfogre thanks for the suggestion. Also, I've opened a related issue on act_runner at https://gitea.com/gitea/act_runner/issues/240.

@wolfogre
Copy link
Member

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 15, 2023
@wolfogre wolfogre changed the title Enhance documentation of Gitea Runner Docs about how to generate config for act runner with docker and setup it with docker-compose Jun 15, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 16, 2023
@lunny lunny added reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Jun 16, 2023
@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Jun 16, 2023
@wolfogre wolfogre merged commit e00f3c7 into go-gitea:main Jun 16, 2023
@GiteaBot GiteaBot added this to the 1.21.0 milestone Jun 16, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Jun 16, 2023
…p it with docker-compose (go-gitea#25256)

In this pull request, the following changes are addressed:

- State user should create `config.yaml` before start container to avoid
errors.
- Provided instructions to deploy runners using docker compose.
@GiteaBot GiteaBot added backport/done All backports for this PR have been created and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Jun 16, 2023
lunny pushed a commit that referenced this pull request Jun 16, 2023
…p it with docker-compose (#25256) (#25296)

Backport #25256 by @thezzisu

In this pull request, the following changes are addressed:

- State user should create `config.yaml` before start container to avoid
errors.
- Provided instructions to deploy runners using docker compose.

Co-authored-by: Zisu Zhang <thezzisu@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 16, 2023
* giteaofficial/main:
  Show if File is Executable (go-gitea#25287)
  Add devcontainer config for developing Gitea (go-gitea#24781)
  Add link to support page for commercial support (go-gitea#25293)
  Docs about how to generate config for act runner with docker and setup it with docker-compose (go-gitea#25256)
  Fix some UI alignments (go-gitea#25277)
  Remove fomantic inverted variations (go-gitea#25286)
  Fix issue and commit status popup padding (go-gitea#25254)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/v1.20 This PR should be backported to Gitea 1.20 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants