Skip to content

Commit

Permalink
[dev image] update to Jammy (gitpod-io#16718)
Browse files Browse the repository at this point in the history
* [dev image] update to Jammy

Ref: gitpod-io/workspace-images#1017

no more `python-dev`

ref:
lewagon/data-setup#219 (comment)
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
  • Loading branch information
kylos101 authored Mar 22, 2023
1 parent afb0a26 commit a217671
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/actions/delete-preview/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy-gitpod/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy-monitoring-satellite/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/preview-create/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ide-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-env-gc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .werft/aks-installer-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .werft/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .werft/cleanup-installer-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .werft/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .werft/eks-installer-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .werft/gke-installer-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .werft/k3s-installer-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .werft/platform-trigger-werft-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .werft/workspace-run-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion components/ws-daemon/pkg/internal/session/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions components/ws-manager/pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand All @@ -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)

Expand Down
18 changes: 17 additions & 1 deletion components/ws-manager/pkg/manager/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand All @@ -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

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions dev/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit a217671

Please sign in to comment.