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

Add definitions used to release the E2E base image #3300

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/e2e/base-image/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tekton
23 changes: 23 additions & 0 deletions packages/e2e/base-image/tekton/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Tekton Dashboard E2E base image

## Create a release

To create a release:
- verify the `CHROME_VERSION` and `NODE_VERSION` args in the [`Dockerfile`](../Dockerfile) on the main branch are correct
- set a matching tag value in the `TAGS` environment variable in the [`CronJob`](./cronjob.yaml), e.g. `node20.11.0-chrome121`
- apply the `CronJob` to the default namespace on the dogfooding cluster (`kubectl apply -k .`)
- create a `Job` from the `CronJob` to trigger the release
```bash
kubectl create job --from=cronjob/image-build-cron-trigger-dashboard-e2e-base dashboard-e2e-base-$(date +"%Y%m%d-%H%M")
```
- check the status of the [resulting `PipelineRun`](https://dashboard.dogfooding.tekton.dev/#/namespaces/default/pipelineruns?labelSelector=plumbing.tekton.dev%2Fimage%3Ddashboard-e2e-base)
- confirm the image was [released and properly tagged](https://console.cloud.google.com/gcr/images/tekton-releases/global/dogfooding/dashboard-e2e-base)
- open a PR to update the [E2E test `Dockerfile`](../../Dockerfile) to reference the new image

## Future: automated releases

We're currently leveraging the existing setup for nightly image releases documented at https://github.com/tektoncd/plumbing/tree/main/tekton/cronjobs

However, the `CronJob` is deliberately suspended (i.e. disabled) so that it does not run on a schedule. This is due to the fact that the image is expected to change infrequently, only to pick up new browser / Node.js releases as needed.

For now it must be triggered manually following the instructions above, but in future it will be automatically built and published on any change to its `Dockerfile`.
46 changes: 46 additions & 0 deletions packages/e2e/base-image/tekton/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2024 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
apiVersion: batch/v1
kind: CronJob
metadata:
name: image-build-cron-trigger
spec:
schedule: "12 4 1 * *"
startingDeadlineSeconds: 60
suspend: true
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
initContainers:
- name: git
env:
- name: GIT_REPOSITORY
value: github.com/tektoncd/dashboard
- name: GIT_REVISION
value: main
containers:
- name: trigger
env:
- name: SINK_URL
value: el-image-builder.default.svc.cluster.local:8080
- name: TARGET_IMAGE
value: gcr.io/tekton-releases/dogfooding/dashboard-e2e-base
- name: CONTEXT_PATH
value: packages/e2e/base-image
- name: TAGS
value: latest,node20.11.0-chrome121
22 changes: 22 additions & 0 deletions packages/e2e/base-image/tekton/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- github.com/tektoncd/plumbing/tekton/cronjobs/bases/image-build?ref=main
patchesStrategicMerge:
- cronjob.yaml
nameSuffix: "-dashboard-e2e-base"
Loading