kubevirt / project-infra

Project infrastructure administrative tools
Apache License 2.0
26 stars 138 forks source link

periodics don't use clonerefs init container #430

Closed dhiller closed 4 years ago

dhiller commented 4 years ago

According to test-infra docs for pod utilities adding decorate: true should lead to being in a clone of the target repository for which the job is configured. This obviously works for presubmit and postsubmit type jobs, but for periodics it doesn't. What I observed was that for periodics the clonerefs container was missing in the pod.

Fixing this would reduce the overhead we have to do when working with periodics that update repositories, i.e. manually cloning repositories and the like could be removed.

Example: periodic autoowners update job

❯ oc describe pod 0b1b77d0-912a-11ea-a911-e86a64a85ba2                                                          ↵ INT ⎈ kubevirt-prow-jobs/shift-ovirt-org:8443/dhiller@redhat.com/kubevirt-prow-jobs 
Name:         0b1b77d0-912a-11ea-a911-e86a64a85ba2
Namespace:    kubevirt-prow-jobs
Node:         ovirt-srv05.phx.ovirt.org/66.187.230.7
Start Time:   Fri, 08 May 2020 14:47:23 +0200                                                                                                                                                                                                                 
Labels:       created-by-prow=true                                                                                                                                                                                                                                          prow.k8s.io/build-id=                                                                                                                                                                                                                                         prow.k8s.io/id=0b1b77d0-912a-11ea-a911-e86a64a85ba2                                                                                                                                                                                                           prow.k8s.io/job=periodic-project-infra-autoowners                                                                                                                                                                                               
              prow.k8s.io/type=periodic
Annotations:  kubernetes.io/limit-ranger:
                LimitRanger plugin set: cpu, memory request for container test; cpu, memory request for container sidecar; cpu, memory request for init co...                                                                                                 
              openshift.io/scc: restricted
              prow.k8s.io/job: periodic-project-infra-autoowners                                                               
Status:       Failed     
IP:           10.130.5.151
Init Containers:                                   
  initupload:                                      
    Container ID:  docker://2c01e1f1f7c77d50812b003d2f930072543ef67be79b7d39c0af2858cf6cee35                                   
    Image:         gcr.io/k8s-prow/initupload:v20200204-7e8cd997a                                                              
    Image ID:      docker-pullable://gcr.io/k8s-prow/initupload@sha256:31d38ccb05c85477321065ffd95486d062049ad37d7645ea8bb0c6dea8a80263                                                                                                                       
    Port:          <none>
    Host Port:     <none>
    Command:                                                                                                                   
      /initupload                       
    State:          Terminated                      
      Reason:       Completed           
      Exit Code:    0                                                                                                          
      Started:      Fri, 08 May 2020 14:47:26 +0200
      Finished:     Fri, 08 May 2020 14:47:27 +0200
    Ready:          True                       
    Restart Count:  0                                   
    Requests:                            
      cpu:     100m                                          
      memory:  1Gi                                                                                                                                                                                                                                            
    Environment:                                     
      INITUPLOAD_OPTIONS:  {"bucket":"kubevirt-prow","path_strategy":"explicit","gcs_credentials_file":"/secrets/gcs/service-account.json","dry_run":false}                                                                                                   
      JOB_SPEC:            {"type":"periodic","job":"periodic-project-infra-autoowners","buildid":"1258740279360360448","prowjobid":"0b1b77d0-912a-11ea-a911-e86a64a85ba2"}                                                                                   
    Mounts:                                                                                                                                                                                                                                                   
      /secrets/gcs from gcs-credentials (rw)                                                                                                                                                                                                                  
  place-entrypoint:                                                                                                            
    Container ID:  docker://bd284800d2287054d45521f74382db70e18b6be76820dc4be4802c8fa589c06d                                   
    Image:         gcr.io/k8s-prow/entrypoint:v20200204-7e8cd997a                                                                                                                                                                                             
    Image ID:      docker-pullable://gcr.io/k8s-prow/entrypoint@sha256:eba25f91a21b311ccccea58e472d684942b50a92f1c9a80de489bbe63b22fa13                                                                                                                       
    Port:          <none>                                                                                                                                                                                                                                     
    Host Port:     <none>                                                                                                      
    Command:                                                                                                                                                                                                                                                  
      /bin/cp                                                                                                                  
    Args:                                                                                                                                                                                                                                                     
      /entrypoint                                                                                                              
      /tools/entrypoint                                                                                                                                                                                                                                       
    State:          Terminated                                                                                                                                                                                                                                
      Reason:       Completed                                                                                                  
      Exit Code:    0                                                                                                          
      Started:      Fri, 08 May 2020 14:47:28 +0200                                                                                                                                                                                                           
      Finished:     Fri, 08 May 2020 14:47:28 +0200                                                                            
    Ready:          True                                                                                                       
    Restart Count:  0          
    Requests:                                                                                                                                                                                                                                                 
      cpu:        100m                                                                                                                                                                                                                                        
      memory:     1Gi                                                                                                                                                                                                                                         
    Environment:  <none>                                                                                                                                                                                                                                      
    Mounts:                                                                                                                                                                                                                                                   
      /tools from tools (rw)                                                                                                                                                                                                                                  
Containers:                                                                                                                                                                                                                                                   
  test:                                                                                                                                                                                                                                                       
    Container ID:  docker://7ed23e3bd567451e23ec99fc456cee5f46d67a52ea77757d5b26a42e14ad7654                                                                                                                                                                  
    Image:         docker.io/kubevirtci/autoowners@sha256:025f8ba96ffdc6d3adf17a0058898e17a8fe814314ec3c4bd2af9812aeeda7b7                                                                                                                                    
    Image ID:      docker-pullable://docker.io/kubevirtci/autoowners@sha256:025f8ba96ffdc6d3adf17a0058898e17a8fe814314ec3c4bd2af9812aeeda7b7                                                                                                                  
    Port:          <none>                                                                                                                                                                                                                                     
    Host Port:     <none>                                                                                                                                                                                                                                     
    Command:                                                                                                                                                                                                                                                  
      /tools/entrypoint                                                                                                                                                                                                                                       
    State:          Terminated                                                                                                                                                                                                                                
      Reason:       Error
      Exit Code:    1
      Started:      Fri, 08 May 2020 14:47:29 +0200
      Finished:     Fri, 08 May 2020 14:49:48 +0200
    Ready:          False
    Restart Count:  0
    Requests:
      cpu:     100m
      memory:  1Gi
    Environment:
      GIT_COMMITTER_NAME:   kubevirt-bot
      GIT_COMMITTER_EMAIL:  rmohr+kubebot@redhat.com
      GIT_AUTHOR_NAME:      kubevirt-bot
      GIT_AUTHOR_EMAIL:     rmohr+kubebot@redhat.com
      ARTIFACTS:            /logs/artifacts
      BUILD_ID:             1258740279360360448
      BUILD_NUMBER:         1258740279360360448
      CI:                   true
      GOPATH:               /home/prow/go
      JOB_NAME:             periodic-project-infra-autoowners
      JOB_SPEC:             {"type":"periodic","job":"periodic-project-infra-autoowners","buildid":"1258740279360360448","prowjobid":"0b1b77d0-912a-11ea-a911-e86a64a85ba2"}
      JOB_TYPE:             periodic
      PROW_JOB_ID:          0b1b77d0-912a-11ea-a911-e86a64a85ba2
      ENTRYPOINT_OPTIONS:   {"timeout":7200000000000,"grace_period":15000000000,"artifact_dir":"/logs/artifacts","args":["/bin/sh","-c","mkdir -p /tmp \u0026\u0026 cd /tmp \u0026\u0026 echo 'cat /etc/github/oauth' \u003e /tmp/git-askpass-helper.sh \u0026
\u0026 export GIT_ASKPASS=/tmp/git-askpass-helper.sh \u0026\u0026 git clone https://github.com/kubevirt/project-infra.git \u0026\u0026 cd project-infra \u0026\u0026 autoowners --dry-run=true --github-login=kubevirt-bot --org=kubevirt --repo=project-infra
 --assign=dhiller --target-dir=. --target-subdir=github/ci/prow/files --config-subdir=jobs --github-token-path=/etc/github/oauth\n"],"process_log":"/logs/process-log.txt","marker_file":"/logs/marker-file.txt","metadata_file":"/logs/artifacts/metadata.jso
n"}
    Mounts:
      /etc/github from token (rw)
      /logs from logs (rw)
      /tools from tools (rw)
  sidecar:
    Container ID:  docker://0f3b5cfa57042658a7f74228aa11460ee01e44277005c87b6bfce68c06a01278
    Image:         gcr.io/k8s-prow/sidecar:v20200204-7e8cd997a
    Image ID:      docker-pullable://gcr.io/k8s-prow/sidecar@sha256:75aedfb96e4f935ee5235c5f8674a8625205bd79c08ab8f415d0fe9c41f123cd
    Port:          <none>
    Host Port:     <none>
    Command:
      /sidecar
    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Fri, 08 May 2020 14:47:30 +0200
      Finished:     Fri, 08 May 2020 14:49:49 +0200
    Ready:          False
    Restart Count:  0
    Requests:
      cpu:     100m
      memory:  1Gi
    Environment:
      JOB_SPEC:         {"type":"periodic","job":"periodic-project-infra-autoowners","buildid":"1258740279360360448","prowjobid":"0b1b77d0-912a-11ea-a911-e86a64a85ba2"}
      SIDECAR_OPTIONS:  {"gcs_options":{"items":["/logs/artifacts"],"bucket":"kubevirt-prow","path_strategy":"explicit","gcs_credentials_file":"/secrets/gcs/service-account.json","dry_run":false},"entries":[{"args":["/bin/sh","-c","mkdir -p /tmp \u0026\u
0026 cd /tmp \u0026\u0026 echo 'cat /etc/github/oauth' \u003e /tmp/git-askpass-helper.sh \u0026\u0026 export GIT_ASKPASS=/tmp/git-askpass-helper.sh \u0026\u0026 git clone https://github.com/kubevirt/project-infra.git \u0026\u0026 cd project-infra \u0026\
u0026 autoowners --dry-run=true --github-login=kubevirt-bot --org=kubevirt --repo=project-infra --assign=dhiller --target-dir=. --target-subdir=github/ci/prow/files --config-subdir=jobs --github-token-path=/etc/github/oauth\n"],"process_log":"/logs/proce
ss-log.txt","marker_file":"/logs/marker-file.txt","metadata_file":"/logs/artifacts/metadata.json"}]}
    Mounts:
      /logs from logs (rw)
      /secrets/gcs from gcs-credentials (rw)
Conditions:
  Type           Status
  Initialized    True 
  Ready          False 
  PodScheduled   True 
Volumes:
  token:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  oauth-token
    Optional:    false
  logs:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  tools:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  gcs-credentials:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  gcs
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  node-role.kubernetes.io/compute=true
Tolerations:     node.kubernetes.io/memory-pressure:NoSchedule
Events:
  Type    Reason                 Age   From                                Message
  ----    ------                 ----  ----                                -------
  Normal  SuccessfulMountVolume  50m   kubelet, ovirt-srv05.phx.ovirt.org  MountVolume.SetUp succeeded for volume "logs"
  Normal  SuccessfulMountVolume  50m   kubelet, ovirt-srv05.phx.ovirt.org  MountVolume.SetUp succeeded for volume "tools"
  Normal  SuccessfulMountVolume  50m   kubelet, ovirt-srv05.phx.ovirt.org  MountVolume.SetUp succeeded for volume "gcs-credentials"
  Normal  SuccessfulMountVolume  50m   kubelet, ovirt-srv05.phx.ovirt.org  MountVolume.SetUp succeeded for volume "token"
  Normal  Scheduled              50m   default-scheduler                   Successfully assigned 0b1b77d0-912a-11ea-a911-e86a64a85ba2 to ovirt-srv05.phx.ovirt.org
  Normal  Created                50m   kubelet, ovirt-srv05.phx.ovirt.org  Created container
  Normal  Pulled                 50m   kubelet, ovirt-srv05.phx.ovirt.org  Container image "gcr.io/k8s-prow/initupload:v20200204-7e8cd997a" already present on machine
  Normal  Started                50m   kubelet, ovirt-srv05.phx.ovirt.org  Started container
  Normal  Started                50m   kubelet, ovirt-srv05.phx.ovirt.org  Started container
  Normal  Created                50m   kubelet, ovirt-srv05.phx.ovirt.org  Created container
  Normal  Pulled                 50m   kubelet, ovirt-srv05.phx.ovirt.org  Container image "gcr.io/k8s-prow/entrypoint:v20200204-7e8cd997a" already present on machine
  Normal  Pulled                 50m   kubelet, ovirt-srv05.phx.ovirt.org  Container image "docker.io/kubevirtci/autoowners@sha256:025f8ba96ffdc6d3adf17a0058898e17a8fe814314ec3c4bd2af9812aeeda7b7" already present on machine
  Normal  Created                50m   kubelet, ovirt-srv05.phx.ovirt.org  Created container
  Normal  Started                50m   kubelet, ovirt-srv05.phx.ovirt.org  Started container
  Normal  Pulled                 50m   kubelet, ovirt-srv05.phx.ovirt.org  Container image "gcr.io/k8s-prow/sidecar:v20200204-7e8cd997a" already present on machine
  Normal  Created                50m   kubelet, ovirt-srv05.phx.ovirt.org  Created container
  Normal  Started                50m   kubelet, ovirt-srv05.phx.ovirt.org  Started container
kubevirt-bot commented 4 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

dhiller commented 4 years ago

/close

periodics require extra_refs to be set: https://github.com/kubernetes/test-infra/blob/master/prow/pod-utilities.md#what-the-test-container-can-expect

kubevirt-bot commented 4 years ago

@dhiller: Closing this issue.

In response to [this](https://github.com/kubevirt/project-infra/issues/430#issuecomment-685798790): >/close > >periodics require extra_refs to be set: https://github.com/kubernetes/test-infra/blob/master/prow/pod-utilities.md#what-the-test-container-can-expect Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.