k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/cluster/gce/gci/README.md (about) 1 # Container-Optimized OS 2 3 [Container-Optimized OS](https://cloud.google.com/container-optimized-os/docs), 4 (previously Google Container-VM image a.k.a GCI) is a container-optimized OS image for the Google Cloud Platform (GCP). It is 5 primarily for running Google services on GCP. Container-Optimized OS is an open 6 source OS based on 7 the open source [ChromiumOS project](https://www.chromium.org/chromium-os), allowing us greater control over the build management, 8 security compliance, and customizations for GCP. 9 10 Container-Optimized OS is [open source](https://cos.googlesource.com), and is released on milestones. Example milestones are 11 81, 85. Each milestone will experience three release channels -- dev, beta and stable to reach 12 stability. The promotion between those channels are about six weeks. 13 Starting milestone 69, for 14 every 4 milestones, the last milestone will be promoted into LTS image after it 15 becomes stable. 16 For details, please see COS's [Release Channels](https://cloud.google.com/container-optimized-os/docs/concepts/release-channels) and [Support 17 Policy](https://cloud.google.com/container-optimized-os/docs/resources/support-policy). 18 19 ## COS in End-to-End tests 20 21 Container-Optimized OS images are used by kubernetes [End-to-End tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-testing/e2e-tests.md) and 22 [Node End-to-End tests](https://github.com/kubernetes/community/tree/master/contributors/devel/sig-node). To see current 23 active releases, please refer to COS's [Release 24 Notes](https://cloud.google.com/container-optimized-os/docs/release-notes). 25 26 ### How to choose an image in configuration file 27 28 There are three ways to specify an image used by each testing suite: `image`, 29 `image_regex` or `image_family`. 30 31 * `image` is preferred, but manual updates are needed to use a newly released 32 COS image, so the test suites don't use deprecated images. This will result 33 to frequent yaml configuration file update everytime COS releases new 34 image.One future option is to use an autobumper robot to update COS image 35 automatically. e.g: 36 ``` 37 cos-stable: 38 image: cos-77-12371-274-0 39 project: cos-cloud 40 metadata: "user-data</go/src/github.com/containerd/cri/test/e2e_node/init.yaml,containerd-configure-sh</go/src/github.com/containerd/cri/cluster/gce/configure.sh,containerd-extra-init-sh</go/src/github.com/containerd/cri/test/e2e_node/gci-init.sh,containerd-env</workspace/test-infra/jobs/e2e_node/containerd/cri-master/env,gci-update-strategy=update_disabled" 41 ``` 42 43 * `image_family` should be used if you always want to use latest image in the 44 same family. Tests will start to use new images once COS releases 45 new image. This is not predictable and test can potentially be broken because of this. The probability of a 46 breakage due to the OS itself is low for LTS or stable image, but high for dev or beta image. 47 If things went wrong, it will be hard to rollback 48 images using `image_regex` and `image_family`. e.g: 49 ``` 50 cos-stable: 51 image_family: cos-77-lts 52 project: cos-cloud 53 metadata: "user-data</workspace/test-infra/jobs/e2e_node/containerd/init.yaml,cni-template</workspace/test-infra/jobs/e2e_node/containerd/cni.template,containerd-config</workspace/test-infra/jobs/e2e_node/containerd/config.toml" 54 ``` 55 56 * `image_regex` can also 57 be used if you want image with the same naming pattern. Latest image will be 58 chosen when multiple images match the regular expression. However, this 59 option is rarely seen in the test code. 60 61 * To update the images, using image in the same channel is preferred. Keep in 62 mind, 69 is the first LTS image. Before that, COS only has dev, beta and stable 63 images. That is why stable images are used quite frequently in current testing. 64 For now, images should slowly migrate from stable to LTS if possible. For 65 testing using dev or beta, we need to consider the original intention and 66 keep using image in existing channel unless we understand the underlying reason. 67 68 ### What image is needed for your test 69 70 Consider the importance of tests and the stability of Container-Optimized OS, the 71 following guidelines are proposed for image choice in E2E testing. 72 73 * To run release blocking tests, the latest LTS images are preferred. 74 'image' should be used to specify the image. 75 76 * To run presubmit, postsubmit or periodic tests, the latest LTS images are 77 preferred. If tests need two images, you can use the latest two LTS images. 78 LTS images are stable and usually include latest bug and security fix. 79 'image' should be used to specify the image. 80 81 * To integrate continuously with other container 82 related technologies like runc, containerd, docker and kubernetes, the 83 latest LTS or stable images are preferred. 'image_family' should be used to 84 specify the image. 85 86 * To try out latest COS features, the latest dev or beta or stable images are preferred. 87 'image' or 'image_family' should be used to specify the image. 88 89 ### How to find current COS image in each channel 90 91 To find the current COS image, use the following command: 92 93 ```shell 94 $ gcloud compute images list --project=cos-cloud | grep cos-cloud 95 cos-69-10895-385-0 cos-cloud cos-69-lts READY 96 cos-73-11647-534-0 cos-cloud cos-73-lts READY 97 cos-77-12371-274-0 cos-cloud cos-77-lts READY 98 cos-81-12871-119-0 cos-cloud cos-81-lts READY 99 cos-beta-81-12871-117-0 cos-cloud cos-beta READY 100 cos-dev-84-13078-0-0 cos-cloud cos-dev READY 101 cos-stable-81-12871-119-0 cos-cloud cos-stable READY 102 ``` 103 104 COS image will experience dev, beta, stable and LTS stage. Before LTS stage, image is named with its 105 family as a prefix, e.g cos-dev, cos-beta, cos-stable. However, the milestone 106 number in those families may change when channel promotions happen. Only when a milestone becomes LTS, the 107 image will have a new family, and the milestone number in the image name stays the same. The image 108 will be always there even after the milestone is deprecated.