From a2176718ec040c8a6e577124d0a588a8c24fb494 Mon Sep 17 00:00:00 2001 From: Kyle Brennan Date: Wed, 22 Mar 2023 14:37:14 -0400 Subject: [PATCH] [dev image] update to Jammy (#16718) * [dev image] update to Jammy Ref: https://github.com/gitpod-io/workspace-images/pull/1017 no more `python-dev` ref: https://github.com/lewagon/data-setup/issues/219#issuecomment-1207519811 https://wiki.termux.com/wiki/No_more_-dev_packages * [dev image] update images latest dev image * [ws-manager] avoid false positive linter errors * [ws-daemon] fix ineffectual assignment for err golangci-lint is catching more errors since upgrading to go 1.19.5 * Update to more recent gcloud * Moar timeout --- .github/actions/delete-preview/Dockerfile | 2 +- .github/actions/deploy-gitpod/Dockerfile | 2 +- .../deploy-monitoring-satellite/Dockerfile | 2 +- .github/actions/preview-create/Dockerfile | 2 +- .github/workflows/build.yml | 4 ++-- .github/workflows/ide-integration-tests.yml | 4 ++-- .github/workflows/preview-env-gc.yml | 2 +- .gitpod.yml | 2 +- .werft/aks-installer-tests.yaml | 2 +- .werft/build.yaml | 2 +- .werft/cleanup-installer-tests.yaml | 2 +- .werft/debug.yaml | 2 +- .werft/eks-installer-tests.yaml | 2 +- .werft/gke-installer-tests.yaml | 2 +- .werft/k3s-installer-tests.yaml | 2 +- .werft/platform-trigger-werft-cleanup.yaml | 2 +- .werft/workspace-run-integration-tests.yaml | 2 +- WORKSPACE.yaml | 2 +- .../pkg/internal/session/workspace.go | 1 - components/ws-manager/pkg/manager/manager.go | 3 +++ components/ws-manager/pkg/manager/monitor.go | 18 +++++++++++++++++- dev/image/Dockerfile | 5 ++--- 22 files changed, 42 insertions(+), 25 deletions(-) diff --git a/.github/actions/delete-preview/Dockerfile b/.github/actions/delete-preview/Dockerfile index fe6d1f7fa36aaa..b77875eace4943 100644 --- a/.github/actions/delete-preview/Dockerfile +++ b/.github/actions/delete-preview/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 +FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 USER root ENV OCI_TOOL_VERSION="0.2.0" diff --git a/.github/actions/deploy-gitpod/Dockerfile b/.github/actions/deploy-gitpod/Dockerfile index fe6d1f7fa36aaa..b77875eace4943 100644 --- a/.github/actions/deploy-gitpod/Dockerfile +++ b/.github/actions/deploy-gitpod/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 +FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 USER root ENV OCI_TOOL_VERSION="0.2.0" diff --git a/.github/actions/deploy-monitoring-satellite/Dockerfile b/.github/actions/deploy-monitoring-satellite/Dockerfile index fe6d1f7fa36aaa..b77875eace4943 100644 --- a/.github/actions/deploy-monitoring-satellite/Dockerfile +++ b/.github/actions/deploy-monitoring-satellite/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 +FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 USER root ENV OCI_TOOL_VERSION="0.2.0" diff --git a/.github/actions/preview-create/Dockerfile b/.github/actions/preview-create/Dockerfile index fe6d1f7fa36aaa..b77875eace4943 100644 --- a/.github/actions/preview-create/Dockerfile +++ b/.github/actions/preview-create/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 +FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 USER root ENV OCI_TOOL_VERSION="0.2.0" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da2891de343dfd..33837b5ef63849 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,7 @@ jobs: cancel-in-progress: ${{ needs.configuration.outputs.is_main_branch == 'false' }} runs-on: [ self-hosted ] container: - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 volumes: - /var/tmp:/var/tmp - /tmp:/tmp @@ -148,7 +148,7 @@ jobs: ports: - 23306:23306 container: - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 volumes: - /var/tmp:/var/tmp - /tmp:/tmp diff --git a/.github/workflows/ide-integration-tests.yml b/.github/workflows/ide-integration-tests.yml index a3cd9af830cf73..143ef16c2a8359 100644 --- a/.github/workflows/ide-integration-tests.yml +++ b/.github/workflows/ide-integration-tests.yml @@ -21,7 +21,7 @@ jobs: name: Configuration runs-on: [self-hosted] container: - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 outputs: name: ${{ steps.configuration.outputs.name }} version: ${{ steps.configuration.outputs.version }} @@ -89,7 +89,7 @@ jobs: needs: [configuration, infrastructure] runs-on: [self-hosted] container: - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 volumes: - /var/tmp:/var/tmp - /tmp:/tmp diff --git a/.github/workflows/preview-env-gc.yml b/.github/workflows/preview-env-gc.yml index 0cbeb8494f4b34..b2db5cdd79efa3 100644 --- a/.github/workflows/preview-env-gc.yml +++ b/.github/workflows/preview-env-gc.yml @@ -8,7 +8,7 @@ jobs: name: "Find stale preview environments" runs-on: [self-hosted] container: - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 outputs: names: ${{ steps.set-matrix.outputs.names }} count: ${{ steps.set-matrix.outputs.count }} diff --git a/.gitpod.yml b/.gitpod.yml index 1992733ea8e9db..c788b2df944eeb 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,4 @@ -image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 +image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workspaceLocation: gitpod/gitpod-ws.code-workspace checkoutLocation: gitpod ports: diff --git a/.werft/aks-installer-tests.yaml b/.werft/aks-installer-tests.yaml index a4b7f8013a55b5..e4d9c2b745638e 100644 --- a/.werft/aks-installer-tests.yaml +++ b/.werft/aks-installer-tests.yaml @@ -65,7 +65,7 @@ pod: secretName: self-hosted-github-oauth containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/build.yaml b/.werft/build.yaml index 91a87498345240..376d4523508ed4 100644 --- a/.werft/build.yaml +++ b/.werft/build.yaml @@ -70,7 +70,7 @@ pod: - name: MYSQL_TCP_PORT value: 23306 - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workingDir: /workspace imagePullPolicy: IfNotPresent resources: diff --git a/.werft/cleanup-installer-tests.yaml b/.werft/cleanup-installer-tests.yaml index a08969fd7210dd..308eebe467726a 100644 --- a/.werft/cleanup-installer-tests.yaml +++ b/.werft/cleanup-installer-tests.yaml @@ -25,7 +25,7 @@ pod: secretName: aks-credentials containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/debug.yaml b/.werft/debug.yaml index 142cecbe06e5d9..d8154e7046fada 100644 --- a/.werft/debug.yaml +++ b/.werft/debug.yaml @@ -54,7 +54,7 @@ pod: - name: MYSQL_TCP_PORT value: 23306 - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/eks-installer-tests.yaml b/.werft/eks-installer-tests.yaml index afa8c1a56634f9..fec3ced653c0d8 100644 --- a/.werft/eks-installer-tests.yaml +++ b/.werft/eks-installer-tests.yaml @@ -65,7 +65,7 @@ pod: secretName: self-hosted-github-oauth containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/gke-installer-tests.yaml b/.werft/gke-installer-tests.yaml index e952aa8cb662f3..2882853e57d338 100644 --- a/.werft/gke-installer-tests.yaml +++ b/.werft/gke-installer-tests.yaml @@ -65,7 +65,7 @@ pod: secretName: self-hosted-github-oauth containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/k3s-installer-tests.yaml b/.werft/k3s-installer-tests.yaml index 7c8802de2d90ca..27e38d6c551314 100644 --- a/.werft/k3s-installer-tests.yaml +++ b/.werft/k3s-installer-tests.yaml @@ -65,7 +65,7 @@ pod: secretName: self-hosted-github-oauth containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/platform-trigger-werft-cleanup.yaml b/.werft/platform-trigger-werft-cleanup.yaml index af026395aa852d..8cc3687f58d04a 100644 --- a/.werft/platform-trigger-werft-cleanup.yaml +++ b/.werft/platform-trigger-werft-cleanup.yaml @@ -22,7 +22,7 @@ pod: secretName: gcp-sa-gitpod-dev-deployer containers: - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/workspace-run-integration-tests.yaml b/.werft/workspace-run-integration-tests.yaml index 26f6f9a01cca74..5a1588f20048a8 100644 --- a/.werft/workspace-run-integration-tests.yaml +++ b/.werft/workspace-run-integration-tests.yaml @@ -22,7 +22,7 @@ pod: secretName: github-token-gitpod-bot containers: - name: gcloud - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2 workingDir: /workspace imagePullPolicy: IfNotPresent env: diff --git a/WORKSPACE.yaml b/WORKSPACE.yaml index 46d728a75a5576..3ad7364515ffd1 100644 --- a/WORKSPACE.yaml +++ b/WORKSPACE.yaml @@ -34,7 +34,7 @@ defaultVariant: - "**/node_modules/**" config: go: - lintCommand: ["sh", "-c", "golangci-lint run --disable govet,errcheck,typecheck,staticcheck,structcheck --allow-parallel-runners --timeout 5m"] + lintCommand: ["sh", "-c", "golangci-lint run --disable govet,errcheck,typecheck,staticcheck,structcheck --allow-parallel-runners --timeout 15m"] variants: - name: oss srcs: diff --git a/components/ws-daemon/pkg/internal/session/workspace.go b/components/ws-daemon/pkg/internal/session/workspace.go index bd9e502e8251a4..a2e4efd9d671f5 100644 --- a/components/ws-daemon/pkg/internal/session/workspace.go +++ b/components/ws-daemon/pkg/internal/session/workspace.go @@ -310,7 +310,6 @@ func (s *Workspace) UpdateGitStatus(ctx context.Context, persistentVolumeClaim b err = s.Persist() if err != nil { log.WithError(err).WithFields(s.OWI()).Warn("cannot persist latest Git status") - err = nil } return s.LastGitStatus, nil diff --git a/components/ws-manager/pkg/manager/manager.go b/components/ws-manager/pkg/manager/manager.go index ef8ba10bd3e31d..35f80393b62f0b 100644 --- a/components/ws-manager/pkg/manager/manager.go +++ b/components/ws-manager/pkg/manager/manager.go @@ -893,6 +893,7 @@ func (m *Manager) deleteWorkspacePVC(ctx context.Context, pvcName string) error return nil } +//nolint:unused func (m *Manager) deleteWorkspaceSecrets(ctx context.Context, podName string) error { secret := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ @@ -1586,6 +1587,7 @@ func (m *Manager) connectToWorkspaceDaemon(ctx context.Context, wso workspaceObj return wsdaemon.NewWorkspaceContentServiceClient(conn), nil } +//nolint:unused func (m *Manager) createWorkspaceSnapshotFromPVC(ctx context.Context, pvcName string, pvcVolumeSnapshotName string, pvcVolumeSnapshotClassName string, workspaceID string, labels map[string]string) error { // create snapshot object out of PVC volumeSnapshot := &volumesnapshotv1.VolumeSnapshot{ @@ -1611,6 +1613,7 @@ func (m *Manager) createWorkspaceSnapshotFromPVC(ctx context.Context, pvcName st return nil } +//nolint:unused func (m *Manager) waitForWorkspaceVolumeSnapshotReady(ctx context.Context, pvcVolumeSnapshotName string, log *logrus.Entry) (pvcVolumeSnapshotContentName string, readyVolumeSnapshot bool, err error) { log = log.WithField("VolumeSnapshot.Name", pvcVolumeSnapshotName) diff --git a/components/ws-manager/pkg/manager/monitor.go b/components/ws-manager/pkg/manager/monitor.go index ba92fb72f5061f..40d6d191e98cd1 100644 --- a/components/ws-manager/pkg/manager/monitor.go +++ b/components/ws-manager/pkg/manager/monitor.go @@ -62,6 +62,7 @@ var ( // wsdaemonRetryInterval is the time in between attempts to work with ws-daemon. // // Note: this is a variable rather than a constant so that tests can modify this value. + //nolint:unused wsdaemonRetryInterval = 5 * time.Second ) @@ -75,8 +76,10 @@ type Monitor struct { probeMap sync.Map + //nolint:unused initializerMap sync.Map - finalizerMap sync.Map + //nolint:unused + finalizerMap sync.Map act actingManager @@ -505,6 +508,7 @@ type actingManager interface { modifyFinalizer(ctx context.Context, workspaceID string, finalizer string, add bool) error } +//nolint:unused func (m *Monitor) clearInitializerFromMap(podName string) { m.initializerMap.Delete(podName) } @@ -602,6 +606,8 @@ func (m *Monitor) traceWorkspaceState(state string, wso *workspaceObjects) opent } // waitForWorkspaceReady waits until the workspace's content and Theia to become available. +// +//nolint:unused func (m *Monitor) waitForWorkspaceReady(ctx context.Context, pod *corev1.Pod) (err error) { span, ctx := tracing.FromContext(ctx, "waitForWorkspaceReady") defer tracing.FinishSpan(span, &err) @@ -715,6 +721,8 @@ func (m *Monitor) waitForWorkspaceReady(ctx context.Context, pod *corev1.Pod) (e // probeWorkspaceReady continually HTTP GETs a workspace's ready URL until we've tried a certain number of times // or the workspace responded with status code 200. +// +//nolint:unused func (m *Monitor) probeWorkspaceReady(ctx context.Context, pod *corev1.Pod) (result *WorkspaceProbeResult, err error) { span, ctx := tracing.FromContext(ctx, "probeWorkspaceReady") defer tracing.FinishSpan(span, &err) @@ -775,6 +783,8 @@ func (m *Monitor) probeWorkspaceReady(ctx context.Context, pod *corev1.Pod) (res // initializeWorkspaceContent talks to a ws-daemon daemon on the node of the pod and initializes the workspace content. // If we're already initializing the workspace, thus function will return immediately. If we were not initializing, // prior to this call this function returns once initialization is complete. +// +//nolint:unused func (m *Monitor) initializeWorkspaceContent(ctx context.Context, pod *corev1.Pod) (err error) { span, ctx := tracing.FromContext(ctx, "initializeWorkspaceContent") defer tracing.FinishSpan(span, &err) @@ -939,6 +949,8 @@ func (m *Monitor) initializeWorkspaceContent(ctx context.Context, pod *corev1.Po } // retryIfUnavailable makes multiple attempts to execute op if op returns an UNAVAILABLE gRPC status code +// +//nolint:unused func retryIfUnavailable(ctx context.Context, op func(ctx context.Context) error) (err error) { for i := 0; i < wsdaemonMaxAttempts; i++ { err := op(ctx) @@ -959,6 +971,7 @@ func retryIfUnavailable(ctx context.Context, op func(ctx context.Context) error) return grpc_status.Error(codes.Unavailable, "workspace content initialization is currently unavailable") } +//nolint:unused func shouldDisableRemoteStorage(pod *corev1.Pod) bool { wso := &workspaceObjects{Pod: pod} tpe, err := wso.WorkspaceType() @@ -975,6 +988,8 @@ func shouldDisableRemoteStorage(pod *corev1.Pod) bool { } // finalizeWorkspaceContent talks to a ws-daemon daemon on the node of the pod and creates a backup of the workspace content. +// +//nolint:unused func (m *Monitor) finalizeWorkspaceContent(ctx context.Context, wso *workspaceObjects) { span, ctx := tracing.FromContext(ctx, "finalizeWorkspaceContent") defer tracing.FinishSpan(span, nil) @@ -1407,6 +1422,7 @@ func workspaceObjectListOptions(namespace string) *client.ListOptions { } } +//nolint:unused func handleGRPCError(ctx context.Context, err error) error { if err == nil { return err diff --git a/dev/image/Dockerfile b/dev/image/Dockerfile index 66344ffb411722..1041a0c5278e83 100644 --- a/dev/image/Dockerfile +++ b/dev/image/Dockerfile @@ -2,7 +2,7 @@ # Licensed under the GNU Affero General Public License (AGPL). # See License.AGPL.txt in the project root for license information. -FROM gitpod/workspace-full:2022-11-09-13-54-49 +FROM gitpod/workspace-full:2023-03-06-18-43-51 ENV TRIGGER_REBUILD 26 @@ -151,7 +151,7 @@ ARG GCS_DIR=/opt/google-cloud-sdk ENV PATH=$GCS_DIR/bin:$PATH RUN sudo chown gitpod: /opt \ && mkdir $GCS_DIR \ - && curl -fsSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-400.0.0-linux-x86_64.tar.gz \ + && curl -fsSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-420.0.0-linux-x86_64.tar.gz \ | tar -xzvC /opt \ && /opt/google-cloud-sdk/install.sh --quiet --usage-reporting=false --bash-completion=true \ --additional-components gke-gcloud-auth-plugin docker-credential-gcr alpha beta \ @@ -163,7 +163,6 @@ ENV USE_GKE_GCLOUD_AUTH_PLUGIN=True # Install tools for gsutil RUN sudo install-packages \ gcc \ - python-dev \ python-setuptools RUN sudo python3 -m pip uninstall crcmod; sudo python3 -m pip install --no-cache-dir -U crcmod