-
Notifications
You must be signed in to change notification settings - Fork 284
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
Use env variable for the sleep image in case of using other image ref… #2570
Use env variable for the sleep image in case of using other image ref… #2570
Conversation
Welcome @abhijeet-dhumal! |
Hi @abhijeet-dhumal. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
My main concern with this is that the user may provide an image with a totally different behavior which has no chance to properly run the test. In a disconnected environment, I think, you can just tag one of your local images as It should be loaded into the kind cluster here Line 47 in fc7477d
|
Hello @trasc , Actually the update suggested in this PR allows use of environment variable to pass same image but with digest which in turn helps to automate this test execution in CI/CD pipeline for disconnected environment. Thank you for reviewing ! |
Hi, in my opinion you can work around this issue without any code changes, please try my proposal.
|
Hi @trasc, I greatly value your suggestion and have considered this option to make it work, but it's not feasible! |
@mimowo Thank you for your suggestion, I think it may work, and i will proceed with updating this PR accordingly! |
One more question trying to get to the bottom of your use case. if you just need the hash to be present on the running image for the pod, then instead of supplying the image as env var would it work for you to read the dijest during the build? For example using docker inspect in bash and supplying it to the runner, or reading inside the runner. I think passing the dijest might bring overhead to maintenance for you if we have more testing images. |
Can you elaborate on this? |
/ok-to-test |
dc1b50b
to
f5ddc57
Compare
f5ddc57
to
1a8b4f5
Compare
@@ -20,7 +20,6 @@ set -o pipefail | |||
|
|||
SOURCE_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" | |||
ROOT_DIR="$SOURCE_DIR/.." | |||
export E2E_TEST_IMAGE=gcr.io/k8s-staging-perf-tests/sleep:v0.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here also. On this way try to use my previous suggestion #2570 (comment). It should work for both cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mbobrovskyi I have updated tests accordingly but not sure why PR check e2e tests are failing 🤔
Could you please guide me in what is the issue here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a good question. With tag name and digest I can see an error Error: failed to get image from containerd "sha256:d483aa6092983e8adea8d92d5661f7191f2e1b07ac480ec3a60a1584fea39a3c": image "docker.io/library/import-2024-09-13@sha256:12abe35a0f1d3da31f825e36ed20a1978ca1848d9973aa6c224fd5725ac6ebbc": not found
.
kubectl describe pods test-job-1-ckbj8 -n e2e-9prhl
Name: test-job-1-ckbj8
Namespace: e2e-9prhl
Priority: 100
Priority Class Name: high
Service Account: default
Node: kind-worker2/172.18.0.2
Start Time: Fri, 13 Sep 2024 09:02:24 +0300
Labels: batch.kubernetes.io/controller-uid=3d540ff4-b19d-4aad-9b3f-4cf0af1f0ec6
batch.kubernetes.io/job-name=test-job-1
controller-uid=3d540ff4-b19d-4aad-9b3f-4cf0af1f0ec6
job-name=test-job-1
Annotations: <none>
Status: Pending
IP: 10.244.2.10
IPs:
IP: 10.244.2.10
Controlled By: Job/test-job-1
Containers:
c:
Container ID:
Image: gcr.io/k8s-staging-perf-tests/sleep:v0.1.0@sha256:8d91ddf9f145b66475efda1a1b52269be542292891b5de2a7fad944052bab6ea
Image ID:
Port: <none>
Host Port: <none>
Args:
1m
State: Waiting
Reason: CreateContainerError
Ready: False
Restart Count: 0
Requests:
cpu: 1
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-f6424 (ro)
Conditions:
Type Status
PodReadyToStartContainers True
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
kube-api-access-f6424:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 27s default-scheduler Successfully assigned e2e-9prhl/test-job-1-ckbj8 to kind-worker2
Normal Pulled 3s (x4 over 27s) kubelet Container image "gcr.io/k8s-staging-perf-tests/sleep:v0.1.0@sha256:8d91ddf9f145b66475efda1a1b52269be542292891b5de2a7fad944052bab6ea" already present on machine
Warning Failed 3s (x4 over 27s) kubelet Error: failed to get image from containerd "sha256:d483aa6092983e8adea8d92d5661f7191f2e1b07ac480ec3a60a1584fea39a3c": image "docker.io/library/import-2024-09-13@sha256:12abe35a0f1d3da31f825e36ed20a1978ca1848d9973aa6c224fd5725ac6ebbc": not found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I can see here: Image name with tag and digest. Only digest will be used for pulling.
So no difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So even if we keep image with tag+digest it will work, then wondering why the PR checks are failing 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tested this solution locally with removing images, so it should work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the proposal, just a small question:
# $1 cluster
function cluster_kind_load {
e2e_test_sleep_image_without_sha=${E2E_TEST_SLEEP_IMAGE%%@*}
# ...
docker tag $E2E_TEST_SLEEP_IMAGE "$e2e_test_sleep_image_without_sha"
cluster_kind_load_image "$1" "${e2e_test_sleep_image_without_sha}"
cluster_kind_load_image "$1" "$IMAGE_TAG"
}
would it work @mbobrovskyi ? Seems simpler as there are fewer steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhijeet-dhumal could you please apply this changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you both @mbobrovskyi @mimowo !
I truely appreciate your dedicated efforts toward enhancing this PR. 😊
1a8b4f5
to
6b01e9a
Compare
@abhijeet-dhumal: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
…e reference or same image but with digest in case of disconnected environment
6b01e9a
to
9ab8ab8
Compare
…ch is already pulled. For more information : kubernetes-sigs/kind#2394
9ab8ab8
to
ae5f724
Compare
/lgtm Thanks! |
LGTM label has been added. Git tree hash: fed76e50dbf74951f6674daf7b729bcab03f9655
|
@mbobrovskyi @mimowo @alculquicondor @trasc @apodhrad @denkensk @kerthcet @tenzen-y |
/hold cancel |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhijeet-dhumal, mimowo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
kubernetes-sigs#2570) * Use env variable for the test sleep image in case of using other image reference or same image but with digest in case of disconnected environment * Update E2e test sleep image to use image digest instead of version tag * Incase of kind cluster, manually create tag for image with digest which is already pulled. For more information : kubernetes-sigs/kind#2394
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Added provision to use environment variable for the sleep image in case of using other image reference in case of disconnected environment
Special notes for your reviewer:
Does this PR introduce a user-facing change?