-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Store agent ID in config file #1888
Store agent ID in config file #1888
Conversation
7e5ad3d
to
0d22a51
Compare
|
Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-1888.surge.sh |
dcad119
to
f74e496
Compare
c7651b0
to
09ecdeb
Compare
Do we really need a config file? Why? Why a file per option? May be one (few) yaml config(s) is better? My proposals:
If we want to automatically generate an ID by agent, then
|
There is |
Hey @zc-devs I fully agree with most of your points. The main reason I chose this implementation is for backwards compatibility. Currently the server generates the agent ID for the agent and so far the server can only handle int64 values. It was important to me to improve the current situation with as little additional complexity as possible. This includes the choice of a simple configuration format. Especially since the 1.0.0 release is not far away, I didn't want to introduce any new complex changes here. But I think, especially for the next new and breaking release, everything you suggest (especially the use of UUIDs) is highly preferable over the current implementation. |
|
Ohh... That's sad... Then env var should be renamed in consistent with current state/docs:
|
@anbraten thanks for great explanation. Things became much more clear. I'll add agent registration process in docs later, if no one do it ahead.
That is good news. I'll try it. In #1648 I forgot to add Eventually I realized mistake and added system token in the server configuration. It works also - I have duplicates now :) |
please update branch - so ci runs again as expected :) |
2c53b41
to
590e584
Compare
|
77eb72b
to
38da124
Compare
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #1888 +/- ##
==========================================
+ Coverage 39.25% 39.34% +0.09%
==========================================
Files 177 177
Lines 10713 10739 +26
==========================================
+ Hits 4205 4225 +20
- Misses 6215 6220 +5
- Partials 293 294 +1
☔ View full report in Codecov by Sentry. |
38da124
to
92d1766
Compare
I am not sure what is happening here but it looks like the pipeline has gone through successfully but github is still waiting for feedback: It is similar but not equal to #1895, any ideas? |
It's fixed already, the pipeline must be restarted. Did that, see https://ci.woodpecker-ci.org/repos/3780/pipeline/6322 |
This PR solves the following TODO in
/cmd/agent/agent.go
:woodpecker/cmd/agent/agent.go
Line 112 in 1fa0212
It ensures that the agent ID is persisted in a file and can then, for example, also be bind-mounted in a Docker container. The new
WOODPECKER_AGENT_ID_CONFIG_PATH
WOODPECKER_AGENT_ID_FILE
environment variable makes it possible to configure the file path.