From 273b8ce1ceaa3e79dcea70b54753cd5664ee2ac3 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Wed, 7 Apr 2021 17:11:29 -0400 Subject: [PATCH 1/2] [dev] Update go to 1.16.3 --- .gitpod.yml | 2 +- .werft/run-integration-tests.yaml | 4 ++-- .werft/wipe-devstaging.yaml | 2 +- WORKSPACE.yaml | 3 ++- components/docker-up/BUILD.yaml | 3 --- components/gitpod-protocol/go/BUILD.yaml | 3 +-- components/supervisor/BUILD.yaml | 3 --- components/ws-daemon/BUILD.yaml | 2 ++ components/ws-manager/BUILD.yaml | 1 - components/ws-proxy/BUILD.yaml | 1 + dev/gpctl/BUILD.yaml | 1 + dev/image/Dockerfile | 12 +++++++----- install/installer/BUILD.yaml | 2 ++ 13 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index aaba3d147027ed..d2ca82308c2625 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -32,7 +32,7 @@ tasks: - before: scripts/branch-namespace.sh init: yarn --network-timeout 100000 && yarn build - name: Go - init: leeway exec --filter-type go -v -- go mod download + init: leeway exec --filter-type go -v -- go mod verify openMode: split-right vscode: extensions: diff --git a/.werft/run-integration-tests.yaml b/.werft/run-integration-tests.yaml index a97bee579e63af..80d0f965525f4d 100644 --- a/.werft/run-integration-tests.yaml +++ b/.werft/run-integration-tests.yaml @@ -36,7 +36,7 @@ pod: - bash - -c - | - + echo "[prep] preparing config." gcloud auth activate-service-account --key-file /mnt/secrets/gcp-sa/service-account.json @@ -74,6 +74,6 @@ pod: echo "[prep|DONE]" /entrypoint.sh -kubeconfig=/config/kubeconfig -namespace={{ .Annotations.namespace }} -username=$USERNAME 2>&1 | ts "[int-tests] " - + RC=${PIPESTATUS[0]} if [ $RC -eq 1 ]; then echo "[int-tests|FAIL]"; else echo "[int-tests|DONE]"; fi \ No newline at end of file diff --git a/.werft/wipe-devstaging.yaml b/.werft/wipe-devstaging.yaml index afd7b357f91612..730d2f63f4d8a5 100644 --- a/.werft/wipe-devstaging.yaml +++ b/.werft/wipe-devstaging.yaml @@ -22,7 +22,7 @@ pod: mountPath: /mnt/secrets/gcp-sa readOnly: true command: - - bash + - bash - -c - | sleep 1 diff --git a/WORKSPACE.yaml b/WORKSPACE.yaml index 64907224f39973..5159d8f906cd09 100644 --- a/WORKSPACE.yaml +++ b/WORKSPACE.yaml @@ -4,10 +4,11 @@ defaultArgs: coreYarnLockBase: ../.. publishToNPM: true -defaultVariant: +defaultVariant: config: go: lintCommand: ["golangci-lint", "run", "--disable", "govet,typecheck"] + buildCommand: ["go", "build", "-trimpath", "-ldflags='-buildid= -w -s'"] variants: - name: oss diff --git a/components/docker-up/BUILD.yaml b/components/docker-up/BUILD.yaml index 28758f40cbef7f..4fb4a6657a29b1 100644 --- a/components/docker-up/BUILD.yaml +++ b/components/docker-up/BUILD.yaml @@ -15,7 +15,6 @@ packages: - ["go", "generate"] config: dontTest: true - buildCommand: ["go", "build", "-trimpath", "-ldflags='-buildid= -w -s'"] - name: bin-runc-facade type: go srcs: @@ -30,7 +29,6 @@ packages: - ["rmdir", "runc-facade"] config: dontTest: true - buildCommand: ["go", "build", "-trimpath", "-ldflags='-buildid= -w -s'"] - name: bin-slirp-docker-proxy type: go srcs: @@ -45,7 +43,6 @@ packages: - ["rmdir", "slirp-docker-proxy"] config: dontTest: true - buildCommand: ["go", "build", "-trimpath", "-ldflags='-buildid= -w -s'"] - name: app type: generic deps: diff --git a/components/gitpod-protocol/go/BUILD.yaml b/components/gitpod-protocol/go/BUILD.yaml index 3edc9805815635..af3d59074a8387 100644 --- a/components/gitpod-protocol/go/BUILD.yaml +++ b/components/gitpod-protocol/go/BUILD.yaml @@ -10,5 +10,4 @@ packages: - GOOS=linux config: packaging: library - buildFlags: - - "-ldflags=-w" + buildCommand: ["go", "build", "-trimpath", "-ldflags=-buildid="] diff --git a/components/supervisor/BUILD.yaml b/components/supervisor/BUILD.yaml index dbf04587577a78..5d38f40f1537f2 100644 --- a/components/supervisor/BUILD.yaml +++ b/components/supervisor/BUILD.yaml @@ -15,9 +15,6 @@ packages: env: - CGO_ENABLED=0 - GOOS=linux - config: - buildFlags: - - "-ldflags=-w" - name: docker type: docker srcs: diff --git a/components/ws-daemon/BUILD.yaml b/components/ws-daemon/BUILD.yaml index c9745571a833e2..bf04c4d76414b1 100644 --- a/components/ws-daemon/BUILD.yaml +++ b/components/ws-daemon/BUILD.yaml @@ -17,6 +17,7 @@ packages: - GOOS=linux config: packaging: app + buildCommand: ["go", "build", "-trimpath", "-ldflags=-buildid="] - name: content-initializer type: go srcs: @@ -37,6 +38,7 @@ packages: config: packaging: app dontTest: true + buildCommand: ["go", "build", "-trimpath", "-ldflags=-buildid="] - name: docker type: docker deps: diff --git a/components/ws-manager/BUILD.yaml b/components/ws-manager/BUILD.yaml index 998d7d6b774bac..829e808b8a31be 100644 --- a/components/ws-manager/BUILD.yaml +++ b/components/ws-manager/BUILD.yaml @@ -18,7 +18,6 @@ packages: - GOOS=linux config: packaging: app - buildCommand: ["go", "build", "-trimpath", "-ldflags", "-w -extldflags \"-static\""] - name: docker type: docker deps: diff --git a/components/ws-proxy/BUILD.yaml b/components/ws-proxy/BUILD.yaml index 0d31f309da2e96..54cc58aef0ca19 100644 --- a/components/ws-proxy/BUILD.yaml +++ b/components/ws-proxy/BUILD.yaml @@ -17,6 +17,7 @@ packages: - GOOS=linux config: packaging: app + buildCommand: ["go", "build", "-trimpath", "-ldflags=-buildid="] - name: docker type: docker srcs: diff --git a/dev/gpctl/BUILD.yaml b/dev/gpctl/BUILD.yaml index 5e3bea99407af5..8e72e8b0c2e61f 100644 --- a/dev/gpctl/BUILD.yaml +++ b/dev/gpctl/BUILD.yaml @@ -18,3 +18,4 @@ packages: config: packaging: app dontTest: true + diff --git a/dev/image/Dockerfile b/dev/image/Dockerfile index 6e7d9da2be1af0..894c431da25249 100644 --- a/dev/image/Dockerfile +++ b/dev/image/Dockerfile @@ -114,11 +114,13 @@ ENV PATH=/home/gitpod/.nvm/versions/node/v${GITPOD_NODE_VERSION}/bin:$PATH # Fix the Go version ENV GOPATH=$HOME/go-packages ENV GOROOT=$HOME/go -RUN go get golang.org/dl/go1.16 && \ - go1.16 download && \ - mv $(which go1.16) $(which go) -ENV GOPATH=/workspace/go \ - PATH=/workspace/go/bin:$PATH +RUN go get golang.org/dl/go1.16.3 \ + && go1.16.3 download \ + && mv $(which go1.16.3) $(which go) +ENV GOPATH=/workspace/go +ENV PATH=/workspace/go/bin:$PATH + +ENV GOFLAGS="-mod=readonly" ## Register leeway autocompletion in bashrc RUN bash -c "echo . \<\(leeway bash-completion\) >> ~/.bashrc" diff --git a/install/installer/BUILD.yaml b/install/installer/BUILD.yaml index 448f354a8ea424..6140914fa62c3c 100644 --- a/install/installer/BUILD.yaml +++ b/install/installer/BUILD.yaml @@ -9,6 +9,8 @@ packages: env: - CGO_ENABLED=0 - GOOS=linux + config: + packaging: app - name: docker type: docker srcs: From 8e1096347d146972d69287828314be3787aaacb7 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Wed, 7 Apr 2021 19:56:26 -0400 Subject: [PATCH 2/2] Update dev-environment image --- .gitpod.yml | 2 +- .werft/build.yaml | 2 +- .werft/run-integration-tests.yaml | 2 +- .werft/wipe-devstaging.yaml | 2 +- components/gitpod-protocol/go/gitpod-config_test.go | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index d2ca82308c2625..081435c78e21d9 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,4 @@ -image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:pluggable-workspace-cluster.9 +image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-go163.38 workspaceLocation: gitpod/gitpod-ws.code-workspace checkoutLocation: gitpod ports: diff --git a/.werft/build.yaml b/.werft/build.yaml index e59278cd24a435..602ebcffe1f3d9 100644 --- a/.werft/build.yaml +++ b/.werft/build.yaml @@ -30,7 +30,7 @@ pod: - name: MYSQL_TCP_PORT value: 23306 - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:pluggable-workspace-cluster.9 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-go163.38 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/run-integration-tests.yaml b/.werft/run-integration-tests.yaml index 80d0f965525f4d..59747eb33affbd 100644 --- a/.werft/run-integration-tests.yaml +++ b/.werft/run-integration-tests.yaml @@ -22,7 +22,7 @@ pod: emptyDir: {} initContainers: - name: gcloud - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:pluggable-workspace-cluster.9 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-go163.38 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/wipe-devstaging.yaml b/.werft/wipe-devstaging.yaml index 730d2f63f4d8a5..5e11bc2c641e39 100644 --- a/.werft/wipe-devstaging.yaml +++ b/.werft/wipe-devstaging.yaml @@ -14,7 +14,7 @@ pod: secretName: gcp-sa-gitpod-dev-deployer containers: - name: wipe-devstaging - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:pluggable-workspace-cluster.9 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-go163.38 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/components/gitpod-protocol/go/gitpod-config_test.go b/components/gitpod-protocol/go/gitpod-config_test.go index 82beccf126a881..03970542666f46 100644 --- a/components/gitpod-protocol/go/gitpod-config_test.go +++ b/components/gitpod-protocol/go/gitpod-config_test.go @@ -24,7 +24,7 @@ func TestGitpodConfig(t *testing.T) { { Desc: "parsing", Content: ` -image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:pluggable-workspace-cluster.9 +image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-go163.38 workspaceLocation: gitpod/gitpod-ws.code-workspace checkoutLocation: gitpod ports: @@ -43,7 +43,7 @@ vscode: - hangxingliu.vscode-nginx-conf-hint@0.1.0:UATTe2sTFfCYWQ3jw4IRsw== - zxh404.vscode-proto3@0.4.2:ZnPmyF/Pb8AIWeCqc83gPw==`, Expectation: &GitpodConfig{ - Image: "eu.gcr.io/gitpod-core-dev/dev/dev-environment:pluggable-workspace-cluster.9", + Image: "eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-go163.38", WorkspaceLocation: "gitpod/gitpod-ws.code-workspace", CheckoutLocation: "gitpod", Ports: []*PortsItems{