-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Node Selector assigns wrong architecture for builds #2505
Comments
I can confirm that the issue is not present in v1.0.2. |
Given that 1.0.2 works and hence everything in After testing: jup, @klinux Are you able to look into this and fix the code? I'd revert the PR until it's fixed. |
Is your WP server and agent run on
|
Agent runs on one (random assignment), agent runs on both (one of each).
Yes, that worked (at least) until #2249. See OP. It might be that another commit broke it but I haven't done further bisecting yet and just looked at the history of
I didn't test this but it doesn't matter much for the issue at hand as the matrix assignments as shown in the OP should work. So essentially, the mapping of |
@pat-s my PR do nothing with nodeselector, toleration has no impact with nodeSelector, do you have any evidence about that? |
Nope, not really. You're right. My bad! I was too fast judging on the history...the issue must be somewhere else. |
@pat-s The (I don't know if this is the underlying issue of this as I don't use kubernetes) |
I've done some tests on 61b5672. Pipeline:
Agent on server:
Then agent doesn't pick up job. Then I changed labels on agent:
And agent runs job successfully. But I have no Also I have I guess, that your agent wrongly picks up job that intended for other agent. It's difficult to test as I have no different platforms. Maybe labels will help you somehow (@qwerty287 has mentioned above). |
Ahhh! I missed this commit... Previously I had platform: ${platform}
matrix:
include:
- DISTRIBUTION: ubuntu
platform: linux/amd64 which - before #2480 then - resulted in correct agent assignments as the platform from the matrix assignment was populated to the top level However just replacing this with
doesn't do it (faulty YAML). Also using
results in the wrong assignment. Also the documentation here also needs an update: https://woodpecker-ci.org/docs/next/usage/matrix-workflows#example-matrix-pipeline-using-multiple-platforms Is it actually still possible to set the arch within a matrix statement in current HEAD? I've tried many things and looked into the code but AFAICS matrix:
include:
- DISTRIBUTION: ubuntu
platform: linux/arm64 |
I've figured it out. The matrix notation should look like this matrix:
include:
- DISTRIBUTION: ubuntu
ARCH: arm64 where Then, in the pipeline, [...]
backend_options:
kubernetes:
nodeSelector:
kubernetes.io/arch: "${ARCH}" The documentation also needs to be updated. Will do... |
So, there is nothing wrong with
matrix:
PLATFORM:
- linux/amd64
- windows/arm64
skip_clone: true
steps:
test:
image: alpine
commands:
- echo Hello from ${PLATFORM}
matrix:
PLATFORM:
- linux/amd64
- windows/arm64
labels:
platform: ${PLATFORM}
skip_clone: true
steps:
test:
image: alpine
commands:
- echo Hello from ${PLATFORM} Server log:
^ version from cbd0c26 Cannot reproduce error with the same pipeline on a95f1bc. @pat-s, test again please. |
Component
agent
Describe the bug
Recently, I am seeing builds being assigned to the wrong nodes on our cluster.
Inspecting the pods, I can see that the
platform
env, which comes from the matrix definition, is set toamd64
. However, the nodeSelector is set toarm64
instead.The WF definition is as follows
Could it be that #2048 changed the logic in a way that
nodeSelector
is always set toCI_SYSTEM_PLATFORM
and does not honorplatform
env anymore?woodpecker/pipeline/backend/kubernetes/pod.go
Line 112 in 0eacbe8
Or maybe one of the changes within the recent months caused this behavior?
Tagging @6543 and @zc-devs as you both did modifications in this area lately.
I am not having enough experience in GO to make an educated judgement right now - all I can see is that
CI_SYSTEM_PLATFORM
is not honoringplatform
env and therefore thenodeSelector
is wrong in the end :)System Info
`next-f8e91f00aa`
Additional context
No response
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]The text was updated successfully, but these errors were encountered: