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

build: drop base image #2771

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dkoshkin
Copy link

What this PR does / why we need it:
Stop building the base image and instead move the simple logic directly into the driver and syncer images.

We want to still keep running tdnf -y upgrade to upgrade packages with CVE fixes.

Although, when I just checked tdnf -y upgrade was a no-op.

trivy image --severity HIGH,CRITICAL photon:4.0
2024-01-25T00:49:18.939Z	WARN	No OS package is detected. Make sure you haven't deleted any files that contain information about the installed packages.
2024-01-25T00:49:18.940Z	WARN	e.g. files under "/lib/apk/db/", "/var/lib/dpkg/" and "/var/lib/rpm"
2024-01-25T00:49:18.940Z	INFO	Detected OS: photon
2024-01-25T00:49:18.940Z	INFO	Detecting Photon Linux vulnerabilities...
2024-01-25T00:49:18.940Z	INFO	Number of PL dependency files: 0

photon:4.0 (photon 4.0)
=======================
Total: 0 (HIGH: 0, CRITICAL: 0)

docker run -it photon:4.0 bash
root [ / ]# tdnf -y upgrade
Refreshing metadata for: 'VMware Photon Extras 4.0 (x86_64)'
Refreshing metadata for: 'VMware Photon Linux 4.0 (x86_64)'
Refreshing metadata for: 'VMware Photon Linux 4.0 (x86_64) Updates'
Nothing to do.                          248315 100%

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #2768

Testing done:
A PR must be marked "[WIP]", if no test result is provided. A WIP PR won't be reviewed, nor merged.
The requester can determine a sufficient test, e.g. build for a cosmetic change, E2E test in a predeployed setup, etc.
For new features, new tests should be done, in addition to regression tests.
If jtest is used to trigger precheckin tests, paste the result after jtest completes and remove [WIP] in the PR subject.
The review cycle will start, only after "[WIP]" is removed from the PR subject.

Tested by building the images locally with make images.

Special notes for your reviewer:

Release note:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 25, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dkoshkin
Once this PR has been reviewed and has the lgtm label, please assign raunakshah for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 25, 2024
@svcbot-qecnsdp
Copy link

Started Vanilla block pre-checkin pipeline... Build Number: 2618

@svcbot-qecnsdp
Copy link

Build ID: 2618
Block vanilla build status: SUCCESS 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
------------------------------

Ran 1 of 816 Specs in 76.146 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 815 Skipped
PASS

Ginkgo ran 1 suite in 2m25.589066339s
Test Suite Passed

@@ -17,7 +17,7 @@
ARG GOLANG_IMAGE=golang:1.21

# This build arg allows the specification of a custom base image.
ARG BASE_IMAGE=gcr.io/cloud-provider-vsphere/extra/csi-driver-base:latest
ARG BASE_IMAGE=photon:4.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a possibility of observing "docker image pull rate limit" error from docker.io/library/photon:4.0 ?

Copy link
Author

@dkoshkin dkoshkin Jan 25, 2024

Choose a reason for hiding this comment

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

Good question @chethanv28, the limit is 100 requests per IP per 6 hours. Depending on how the runners are setup the image may be cached between runs.
I can't answer if thats enough or not for sure, but looking at the PRs and commit history I don't think that would be a problem.

Copy link
Member

Choose a reason for hiding this comment

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

We need to make sure our internal pipelines are not affected due to this rate limit.

cc: @sashrith

Copy link
Contributor

Choose a reason for hiding this comment

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

we are setting this base image variable while building the syncer and driver images which is passed to docker buildx to override the default in the dockerfile

GOLANG_IMAGE=${CUSTOM_REPO_FOR_GOLANG:-}golang:1.21

we can do something similar to that here as well

Copy link
Author

Choose a reason for hiding this comment

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

I can change that @sashrith, but is all of CI using the release.sh script? If not then we may not want to pass in the ARG since now we would need to remember to change the value in multiple different places.

I also see

- sed -i "s#ARG GOLANG_IMAGE=.*#ARG GOLANG_IMAGE=$CNS_IMAGE_GOLANG#g" images/driver/Dockerfile
- sed -i "s#ARG GOLANG_IMAGE=.*#ARG GOLANG_IMAGE=$CNS_IMAGE_GOLANG#g" images/syncer/Dockerfile
, is this still being used in CI?

Copy link
Contributor

@sashrith sashrith Feb 9, 2024

Choose a reason for hiding this comment

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

I think this file is used for pushing the image to gcr repo and @divyenpatel has more context on this.
All of the other jobs use release.sh script.

@chethanv28
Copy link
Collaborator

Build ID: 2618
Block vanilla build status: SUCCESS 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
------------------------------

Ran 1 of 816 Specs in 76.146 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 815 Skipped
PASS

Ginkgo ran 1 suite in 2m25.589066339s
Test Suite Passed

Ran basic e2e test using the internal infra.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rebuild base images at release time to fix CVEs
7 participants