From 7172d822c7f3ee660bef632cbbcba7f7d8daa40c Mon Sep 17 00:00:00 2001 From: Christian Weichel Date: Wed, 14 Oct 2020 14:04:47 +0000 Subject: [PATCH] [ws-daemon] Fold ws-manager-node into ws-daemon --- .werft/build.js | 10 +- chart/templates/image-builder-deployment.yaml | 1 - chart/templates/server-deployment.yaml | 10 +- chart/templates/ws-daemon-clusterrole.yaml | 20 +- chart/templates/ws-daemon-configmap.yaml | 141 +- chart/templates/ws-daemon-daemonset.yaml | 29 +- chart/templates/ws-daemon-networkpolicy.yaml | 3 +- chart/templates/ws-daemon-tlssecret.yaml | 4 +- chart/templates/ws-manager-configmap.yaml | 10 +- .../ws-manager-node-clusterrole.yaml | 36 - .../ws-manager-node-clusterrolebinding.yaml | 20 - .../templates/ws-manager-node-configmap.yaml | 88 - .../templates/ws-manager-node-daemonset.yaml | 104 - .../ws-manager-node-networkpolicy.yaml | 41 - .../ws-manager-node-serviceaccount.yaml | 12 - .../templates/ws-manager-node-tlssecret.yaml | 25 - chart/values.yaml | 17 +- components/BUILD.yaml | 2 - components/common-go/kubernetes/kubernetes.go | 2 +- .../ws-scheduler/pkg/scheduler/scheduler.go | 2 +- components/supervisor/BUILD.yaml | 1 - components/supervisor/go.mod | 3 - components/supervisor/go.sum | 4 + .../pkg/{backup/backup.go => iwh/iwh.go} | 179 +- .../supervisor/pkg/supervisor/services.go | 27 +- .../supervisor/pkg/supervisor/supervisor.go | 25 +- components/supervisor/pkg/supervisor/tasks.go | 6 +- .../{wssync.proto => daemon.proto} | 2 +- .../go/{wssync.pb.go => daemon.pb.go} | 153 +- components/ws-daemon-api/go/go.mod | 1 + components/ws-daemon-api/go/go.sum | 7 + components/ws-daemon-api/go/workspace.pb.go | 283 +- .../typescript/src/daemon_grpc_pb.js | 156 + .../typescript/src/daemon_pb.d.ts | 225 ++ .../src/{wssync_pb.js => daemon_pb.js} | 432 +-- .../ws-daemon-api/typescript/src/index.ts | 3 +- .../typescript/src/workspace_grpc_pb.js | 50 +- .../typescript/src/workspace_pb.d.ts | 230 +- .../typescript/src/workspace_pb.js | 607 +++ .../typescript/src/wssync_grpc_pb.d.ts | 98 - .../typescript/src/wssync_grpc_pb.js | 156 - .../typescript/src/wssync_pb.d.ts | 236 -- .../ws-daemon-api/typescript/wssync_pb.js | 3313 ----------------- components/ws-daemon-api/workspace.proto | 19 + components/ws-daemon/README.md | 4 +- components/ws-daemon/cmd/generate-config.go | 38 - components/ws-daemon/cmd/root.go | 7 +- components/ws-daemon/cmd/run.go | 32 +- components/ws-daemon/config-schema.json | 178 - components/ws-daemon/example-config.json | 4 +- components/ws-daemon/go.mod | 10 +- components/ws-daemon/go.sum | 14 + .../pkg/{syncd => content}/config.go | 44 +- .../workspace.go => content/livebackup.go} | 2 +- .../pkg/{syncd => content}/service.go | 66 +- .../pkg/{syncd => content}/workspace.go | 7 +- components/ws-daemon/pkg/daemon/config.go | 29 + components/ws-daemon/pkg/daemon/daemon.go | 153 + .../pkg/diskguard/guard.go | 38 +- .../pkg/dispatch/dispatch.go | 11 +- components/ws-daemon/pkg/hosts/config.go | 69 + .../hostsgov => ws-daemon/pkg/hosts}/hosts.go | 42 +- .../pkg/hosts}/kubernetes.go | 2 +- .../hostsgov => ws-daemon/pkg/hosts}/proxy.go | 28 +- .../pkg/hosts}/tcpproxy.go | 2 +- .../ws-daemon/pkg/internal/session/store.go | 44 +- .../pkg/internal/session/workspace_test.go | 9 - .../pkg/resources}/.gitignore | 0 .../pkg/resources/controller.go} | 62 +- .../pkg/resources/controller_test.go} | 20 +- .../pkg/resources}/dispatch.go | 18 +- .../pkg/resources/limiter.go} | 2 +- .../pkg/resources/limiter_test.go} | 18 +- .../pkg/resources}/ttlcache.go | 2 +- .../pkg/uidmap/uidmap.go | 10 +- .../shiftfs-module-loader/entrypoint.sh | 4 + .../shiftfs-module-loader/leeway.Dockerfile | 4 + components/ws-manager-api/core.proto | 2 +- components/ws-manager-api/go/core.pb.go | 2 +- components/ws-manager-node-api/generate.sh | 9 - components/ws-manager-node-api/go/BUILD.yaml | 10 - components/ws-manager-node-api/go/canary.go | 101 - components/ws-manager-node-api/go/go.mod | 8 - components/ws-manager-node-api/go/go.sum | 70 - .../go/ws-manager-node.pb.go | 334 -- .../ws-manager-node-api/ws-manager-node.proto | 32 - components/ws-manager-node/.gitignore | 1 - components/ws-manager-node/.golangci.yml | 9 - components/ws-manager-node/BUILD.yaml | 38 - components/ws-manager-node/cmd/newgidmap.go | 56 - components/ws-manager-node/cmd/newuidmap.go | 56 - components/ws-manager-node/cmd/root.go | 95 - components/ws-manager-node/cmd/run.go | 120 - components/ws-manager-node/debug.Dockerfile | 10 - components/ws-manager-node/debug.sh | 33 - components/ws-manager-node/go.mod | 80 - components/ws-manager-node/go.sum | 587 --- components/ws-manager-node/leeway.Dockerfile | 14 - components/ws-manager-node/main.go | 15 - .../ws-manager-node/pkg/daemon/config.go | 50 - .../ws-manager-node/pkg/daemon/daemon.go | 176 - .../ws-manager-node/pkg/protocol/generate.sh | 8 - .../ws-manager-node/pkg/protocol/protocol.go | 7 - .../pkg/protocol/protocol.pb.go | 80 - .../pkg/protocol/protocol.proto | 11 - components/ws-manager-node/rebuild-locally.sh | 19 - .../ws-manager/pkg/manager/annotations.go | 2 +- components/ws-manager/pkg/manager/config.go | 8 +- components/ws-manager/pkg/manager/create.go | 2 +- .../pkg/manager/integration_test.go | 38 +- components/ws-manager/pkg/manager/manager.go | 36 +- .../ws-manager/pkg/manager/manager_ee.go | 8 +- components/ws-manager/pkg/manager/monitor.go | 30 +- .../pkg/manager/monitor_integration_test.go | 10 +- gitpod-ws.theia-workspace | 1 - .../modules/storage/templates/values.tpl | 4 +- .../modules/storage/templates/values.tpl | 4 +- install/helm/templates/gcp/ws-sync-key.yaml | 2 +- install/helm/values/gcp/buckets.yaml | 4 +- 119 files changed, 2702 insertions(+), 7246 deletions(-) delete mode 100644 chart/templates/ws-manager-node-clusterrole.yaml delete mode 100644 chart/templates/ws-manager-node-clusterrolebinding.yaml delete mode 100644 chart/templates/ws-manager-node-configmap.yaml delete mode 100644 chart/templates/ws-manager-node-daemonset.yaml delete mode 100644 chart/templates/ws-manager-node-networkpolicy.yaml delete mode 100644 chart/templates/ws-manager-node-serviceaccount.yaml delete mode 100644 chart/templates/ws-manager-node-tlssecret.yaml rename components/supervisor/pkg/{backup/backup.go => iwh/iwh.go} (50%) rename components/ws-daemon-api/{wssync.proto => daemon.proto} (99%) rename components/ws-daemon-api/go/{wssync.pb.go => daemon.pb.go} (80%) create mode 100644 components/ws-daemon-api/typescript/src/daemon_grpc_pb.js create mode 100644 components/ws-daemon-api/typescript/src/daemon_pb.d.ts rename components/ws-daemon-api/typescript/src/{wssync_pb.js => daemon_pb.js} (69%) delete mode 100644 components/ws-daemon-api/typescript/src/wssync_grpc_pb.d.ts delete mode 100644 components/ws-daemon-api/typescript/src/wssync_grpc_pb.js delete mode 100644 components/ws-daemon-api/typescript/src/wssync_pb.d.ts delete mode 100644 components/ws-daemon-api/typescript/wssync_pb.js delete mode 100644 components/ws-daemon/cmd/generate-config.go delete mode 100644 components/ws-daemon/config-schema.json rename components/ws-daemon/pkg/{syncd => content}/config.go (52%) rename components/ws-daemon/pkg/{safetynet/workspace.go => content/livebackup.go} (99%) rename components/ws-daemon/pkg/{syncd => content}/service.go (93%) rename components/ws-daemon/pkg/{syncd => content}/workspace.go (95%) create mode 100644 components/ws-daemon/pkg/daemon/config.go create mode 100644 components/ws-daemon/pkg/daemon/daemon.go rename components/{ws-manager-node => ws-daemon}/pkg/diskguard/guard.go (73%) rename components/{ws-manager-node => ws-daemon}/pkg/dispatch/dispatch.go (95%) create mode 100644 components/ws-daemon/pkg/hosts/config.go rename components/{ws-manager-node/pkg/hostsgov => ws-daemon/pkg/hosts}/hosts.go (81%) rename components/{ws-manager-node/pkg/hostsgov => ws-daemon/pkg/hosts}/kubernetes.go (99%) rename components/{ws-manager-node/pkg/hostsgov => ws-daemon/pkg/hosts}/proxy.go (79%) rename components/{ws-manager-node/pkg/hostsgov => ws-daemon/pkg/hosts}/tcpproxy.go (99%) rename components/{ws-manager-node/pkg/resourcegov => ws-daemon/pkg/resources}/.gitignore (100%) rename components/{ws-manager-node/pkg/resourcegov/governer.go => ws-daemon/pkg/resources/controller.go} (87%) rename components/{ws-manager-node/pkg/resourcegov/governer_test.go => ws-daemon/pkg/resources/controller_test.go} (92%) rename components/{ws-manager-node/pkg/resourcegov => ws-daemon/pkg/resources}/dispatch.go (88%) rename components/{ws-manager-node/pkg/resourcegov/controller.go => ws-daemon/pkg/resources/limiter.go} (99%) rename components/{ws-manager-node/pkg/resourcegov/controller_test.go => ws-daemon/pkg/resources/limiter_test.go} (75%) rename components/{ws-manager-node/pkg/resourcegov => ws-daemon/pkg/resources}/ttlcache.go (98%) rename components/{ws-manager-node => ws-daemon}/pkg/uidmap/uidmap.go (97%) delete mode 100755 components/ws-manager-node-api/generate.sh delete mode 100644 components/ws-manager-node-api/go/BUILD.yaml delete mode 100644 components/ws-manager-node-api/go/canary.go delete mode 100644 components/ws-manager-node-api/go/go.mod delete mode 100644 components/ws-manager-node-api/go/go.sum delete mode 100644 components/ws-manager-node-api/go/ws-manager-node.pb.go delete mode 100644 components/ws-manager-node-api/ws-manager-node.proto delete mode 100644 components/ws-manager-node/.gitignore delete mode 100644 components/ws-manager-node/.golangci.yml delete mode 100644 components/ws-manager-node/BUILD.yaml delete mode 100644 components/ws-manager-node/cmd/newgidmap.go delete mode 100644 components/ws-manager-node/cmd/newuidmap.go delete mode 100644 components/ws-manager-node/cmd/root.go delete mode 100644 components/ws-manager-node/cmd/run.go delete mode 100644 components/ws-manager-node/debug.Dockerfile delete mode 100755 components/ws-manager-node/debug.sh delete mode 100644 components/ws-manager-node/go.mod delete mode 100644 components/ws-manager-node/go.sum delete mode 100644 components/ws-manager-node/leeway.Dockerfile delete mode 100644 components/ws-manager-node/main.go delete mode 100644 components/ws-manager-node/pkg/daemon/config.go delete mode 100644 components/ws-manager-node/pkg/daemon/daemon.go delete mode 100755 components/ws-manager-node/pkg/protocol/generate.sh delete mode 100644 components/ws-manager-node/pkg/protocol/protocol.go delete mode 100644 components/ws-manager-node/pkg/protocol/protocol.pb.go delete mode 100644 components/ws-manager-node/pkg/protocol/protocol.proto delete mode 100755 components/ws-manager-node/rebuild-locally.sh diff --git a/.werft/build.js b/.werft/build.js index 79fe6185a7b549..64c61f3f16ed78 100644 --- a/.werft/build.js +++ b/.werft/build.js @@ -110,8 +110,8 @@ async function deployToDev(version, previewWithHttps, workspaceFeatureFlags) { const namespace = `staging-${destname}`; const domain = `${destname}.staging.gitpod-dev.com`; const url = `${!!previewWithHttps ? "https" : "http"}://${domain}`; - const wssyncPort = `1${Math.floor(Math.random()*1000)}`; - const wsmanNodePort = `2${Math.floor(Math.random()*1000)}`; + const wsdaemonPort = `1${Math.floor(Math.random()*1000)}`; + const registryProxyPort = `2${Math.floor(Math.random()*1000)}`; const registryNodePort = `${30000 + Math.floor(Math.random()*1000)}`; try { @@ -168,7 +168,7 @@ async function deployToDev(version, previewWithHttps, workspaceFeatureFlags) { exec(`/usr/local/bin/helm3 delete jaeger-${destname} || echo jaeger-${destname} was not installed yet`, {slice: 'predeploy cleanup'}); let objs = []; - ["ws-scheduler", "node-daemon", "cluster", "workspace", "jaeger", "jaeger-agent", "ws-sync", "ws-manager-node"].forEach(comp => + ["ws-scheduler", "node-daemon", "cluster", "workspace", "jaeger", "jaeger-agent", "ws-sync", "ws-manager-node", "ws-daemon"].forEach(comp => ["ClusterRole", "ClusterRoleBinding", "PodSecurityPolicy"].forEach(kind => shell .exec(`kubectl get ${kind} -l component=${comp} --no-headers -o=custom-columns=:metadata.name | grep ${namespace}-ns`) @@ -203,8 +203,8 @@ async function deployToDev(version, previewWithHttps, workspaceFeatureFlags) { flags+=` --set version=${version}`; flags+=` --set hostname=${domain}`; flags+=` --set devBranch=${destname}`; - flags+=` --set components.wsSync.servicePort=${wssyncPort}`; - flags+=` --set components.wsManagerNode.registryProxyPort=${wsmanNodePort}`; + flags+=` --set components.wsDaemon.servicePort=${wsdaemonPort}`; + flags+=` --set components.wsDaemon.registryProxyPort=${registryProxyPort}`; flags+=` --set ingressMode=${context.Annotations.ingressMode || "hosts"}`; workspaceFeatureFlags.forEach((f, i) => { flags+=` --set components.server.defaultFeatureFlags[${i}]='${f}'` diff --git a/chart/templates/image-builder-deployment.yaml b/chart/templates/image-builder-deployment.yaml index 634ebfd622ec14..e36cbcd59be1bf 100644 --- a/chart/templates/image-builder-deployment.yaml +++ b/chart/templates/image-builder-deployment.yaml @@ -3,7 +3,6 @@ {{ $comp := .Values.components.imageBuilder -}} {{- $this := dict "root" . "gp" $.Values "comp" $comp -}} -{{- $thisWsSync := dict "root" . "comp" .Values.components.wsSync -}} {{- if not $comp.disabled -}} apiVersion: apps/v1 kind: Deployment diff --git a/chart/templates/server-deployment.yaml b/chart/templates/server-deployment.yaml index dc8bec0a543903..dd1a04661c3e14 100644 --- a/chart/templates/server-deployment.yaml +++ b/chart/templates/server-deployment.yaml @@ -145,7 +145,7 @@ spec: {{- end }} - name: SESSION_SECRET value: {{ $comp.sessionSecret | quote }} - {{- if eq .Values.components.wsSync.remoteStorage.kind "minio" }} + {{- if eq .Values.components.wsDaemon.remoteStorage.kind "minio" }} - name: GITPOD_STORAGE_CLIENT value: minio - name: MINIO_END_POINT @@ -195,13 +195,13 @@ spec: secretKeyRef: name: server-proxy-apikey key: apikey -{{- if (or .Values.components.wsSync.remoteStorage.gcloud $comp.storage) }} +{{- if (or .Values.components.wsDaemon.remoteStorage.gcloud $comp.storage) }} - name: GCLOUD_PROJECT_ID - value: {{ .Values.components.wsSync.remoteStorage.gcloud.projectId }} + value: {{ .Values.components.wsDaemon.remoteStorage.gcloud.projectId }} - name: GCLOUD_REGION - value: {{ .Values.components.wsSync.remoteStorage.gcloud.region }} + value: {{ .Values.components.wsDaemon.remoteStorage.gcloud.region }} - name: GCLOUD_CREDENTIALS_FILE - value: {{ base .Values.components.wsSync.remoteStorage.gcloud.credentialsFile }} + value: {{ base .Values.components.wsDaemon.remoteStorage.gcloud.credentialsFile }} {{- end }} - name: GITPOD_GARBAGE_COLLECTION_DISABLED value: {{ $comp.garbageCollection.disabled | default "false" | quote }} diff --git a/chart/templates/ws-daemon-clusterrole.yaml b/chart/templates/ws-daemon-clusterrole.yaml index 972a12704424ca..26d1f660a06faf 100644 --- a/chart/templates/ws-daemon-clusterrole.yaml +++ b/chart/templates/ws-daemon-clusterrole.yaml @@ -18,4 +18,22 @@ rules: verbs: - "use" resourceNames: - - "{{ .Release.Namespace }}-ns-privileged-unconfined" \ No newline at end of file + - "{{ .Release.Namespace }}-ns-privileged-unconfined" +- apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - update + - patch +- apiGroups: + - "" + resources: + - pods + - services + verbs: + - get + - list + - watch \ No newline at end of file diff --git a/chart/templates/ws-daemon-configmap.yaml b/chart/templates/ws-daemon-configmap.yaml index d860c1b55e38fc..a0b9fe2ffa59da 100644 --- a/chart/templates/ws-daemon-configmap.yaml +++ b/chart/templates/ws-daemon-configmap.yaml @@ -1,7 +1,97 @@ # Copyright (c) 2020 TypeFox GmbH. All rights reserved. # Licensed under the MIT License. See License-MIT.txt in the project root for license information. -{{ $comp := .Values.components.wsSync -}} +{{- define "ws-daemon.config" }} +{{ $comp := .comp -}} +{{ with .root }} +daemon: + runtime: + namespace: {{ .Release.Namespace | quote }} + containerRuntime: + runtime: "containerd" + containerd: + socket: "/mnt/containerd.sock" + nodeToContainerMapping: + {{- range $idx, $pth := $comp.containerRuntime.nodeRoots }} + {{ $pth | quote }}: "/mnt/node{{ $idx }}" + {{- end }} + mounts: + proc: "/mnt/mounts" + content: + workingArea: "/mnt/workingarea" + {{- if (and $comp.workspaceSizeLimit (not (eq $comp.workspaceSizeLimit ""))) }} + workspaceSizeLimit: {{ ($comp.workspaceSizeLimit | default "0g") | quote }} + {{- end }} + storage: +{{ toYaml $comp.remoteStorage | indent 6 }} + backup: + timeout: "5m" + attempts: 3 + fullWorkspaceBackup: + workdir: "/mnt/node0/gitpod-{{ .Release.Namespace }}" + uidmapper: + procLocation: "/proc" + rootUIDRange: + start: 33333 + size: 1 + userUIDRange: + - start: 100000 + size: 70000 + resources: + cgroupBasePath: "/mnt/node-cgroups" + # We don't split our actual budget equally amongst participants. Instead we assume we have a maximum + # number of over-consumers. We hand out CPU in buckets: + # three minutes of 5 CPUs: 5 [numCPU] * 100 [jiffies/sec] * (3 * 60) [seconds] = 90000 + # five minutes of 4 CPUs: 4 [numCPU] * 100 [jiffies/sec] * (5 * 60) [seconds] = 120000 + # remainder of 2 CPUs where a user has to stay below sustained use of 1.8 CPUs for 5 minutes: + # 1.8 [numCPU] * 100 [jiffies/sec] * (5 * 60) [seconds] = 54000 + # + # Compared to the actual budget, this is severe overbooking: + # budget is (numCPU * overbookingFactor * jiffies/sec * controlPeriod[sec]) / numWS = [jiffies / workspace] + # (16 * 1 * 100 * (15 * 60)) / 25 = 57600 + # + # We express everything in jiffies/sec where 1 jiffie is 1% of a CPU core. + cpuBuckets: + - budget: 90000 + limit: 500 + - budget: 120000 + limit: 400 + - budget: 54000 + limit: 200 + processPriorities: + supervisor: 0 + theia: 5 + shell: 6 + default: 10 + controlPeriod: "15m" + samplingPeriod: "10s" + hosts: + enabled: true + nodeHostsFile: "/mnt/hosts" + serviceProxy: + enabled: true + mapping: + - selector: "component=registry-facade,feature=registry" + alias: {{ (printf "reg.%s" (.Values.components.registryFacade.hostname | default .Values.hostname)) | quote }} + proxyPort: {{ $comp.registryProxyPort }} + disk: + path: "/mnt/wsdaemon-workingarea" + minBytesAvail: 21474836480 +service: + address: ":{{ $comp.servicePort }}" + tls: + ca: "/certs/ca.crt" + crt: "/certs/tls.crt" + key: "/certs/tls.key" +prometheus: + address: ":9500" +pprof: + address: ":6060" +{{ end }} +{{ end }} + +{{ $comp := .Values.components.wsDaemon -}} +{{- $this := dict "root" . "gp" $.Values "comp" $comp -}} {{- if not $comp.disabled -}} apiVersion: v1 kind: ConfigMap @@ -14,50 +104,5 @@ metadata: heritage: "{{ .Release.Service }}" data: config.json: |- - { - "syncd": { - "workingArea": "/mnt/workingarea", - "backup": { - "timeout": "5m", - "attempts": 3 - }, - {{- if (and $comp.workspaceSizeLimit (not (eq $comp.workspaceSizeLimit ""))) }} - "workspaceSizeLimit": {{ ($comp.workspaceSizeLimit | default "0g") | quote }}, - {{- end }} - "storage": {{ toJson $comp.remoteStorage }}, - "fullWorkspaceBackup": { - "enabled": {{ $comp.fullWorkspaceBackup.enabled }}, - "workdir": "/mnt/node0/gitpod-{{ .Release.Namespace }}", - "cri": { - "nodeToContainerMapping": { - {{- range $idx, $pth := $comp.fullWorkspaceBackup.nodeRoots }} - {{ if gt $idx 0 }},{{ end -}}{{ $pth | quote }}: "/mnt/node{{ $idx }}" - {{- end }} - }, - "mounts": { - "proc": "/mnt/mounts" - }, - "runtime": "containerd", - "containerd": { - "socket": "/mnt/containerd.sock" - } - } - }, - "namespace": "{{ .Release.Namespace }}" - }, - "service": { - "address": ":{{ $comp.servicePort }}", - "tls": { - "ca": "/certs/ca.crt", - "crt": "/certs/tls.crt", - "key": "/certs/tls.key" - } - }, - "prometheus": { - "address": ":9500" - }, - "pprof": { - "address": "localhost:6060" - } - } -{{- end -}} \ No newline at end of file +{{ (include "ws-daemon.config" $this) | fromYaml | toPrettyJson | indent 4 }} +{{- end }} \ No newline at end of file diff --git a/chart/templates/ws-daemon-daemonset.yaml b/chart/templates/ws-daemon-daemonset.yaml index e57047b55bd760..873b20bfcae888 100644 --- a/chart/templates/ws-daemon-daemonset.yaml +++ b/chart/templates/ws-daemon-daemonset.yaml @@ -1,7 +1,7 @@ # Copyright (c) 2020 TypeFox GmbH. All rights reserved. # Licensed under the MIT License. See License-MIT.txt in the project root for license information. -{{ $comp := .Values.components.wsSync -}} +{{ $comp := .Values.components.wsDaemon -}} {{- $this := dict "root" . "gp" $.Values "comp" $comp -}} {{- if not $comp.disabled -}} apiVersion: apps/v1 @@ -53,6 +53,7 @@ spec: operator: "Exists" effect: "NoExecute" serviceAccountName: ws-daemon + hostPID: true volumes: - hostPath: path: {{ $comp.hostWorkspaceArea }} @@ -64,12 +65,11 @@ spec: - name: config configMap: name: {{ template "gitpod.comp.configMap" $this }} - {{- if $comp.fullWorkspaceBackup.enabled }} - name: containerd-socket hostPath: - path: {{ $comp.fullWorkspaceBackup.containerd.socket }} + path: {{ $comp.containerRuntime.containerd.socket }} type: Socket - {{- range $idx, $pth := $comp.fullWorkspaceBackup.nodeRoots }} + {{- range $idx, $pth := $comp.containerRuntime.nodeRoots }} - name: node-fs{{ $idx }} hostPath: path: {{ $pth }} @@ -79,7 +79,14 @@ spec: hostPath: path: /proc/mounts type: File - {{- end }} + - name: node-cgroups + hostPath: + path: {{ $comp.cgroupsRoot | default "/sys/fs/cgroup" }} + type: Directory + - name: node-hosts + hostPath: + path: {{ $comp.nodeHosts | default "/etc/hosts" }} + type: File {{- if $comp.userNamespaces.shiftfsModuleLoader.enabled }} - name: node-linux-src hostPath: @@ -108,10 +115,9 @@ spec: mountPropagation: Bidirectional - mountPath: /config name: config - {{- if $comp.fullWorkspaceBackup.enabled }} - mountPath: /mnt/containerd.sock name: containerd-socket - {{- range $idx, $pth := $comp.fullWorkspaceBackup.nodeRoots }} + {{- range $idx, $pth := $comp.containerRuntime.nodeRoots }} - mountPath: /mnt/node{{ $idx }} name: node-fs{{ $idx }} {{- end }} @@ -119,7 +125,11 @@ spec: name: node-mounts readOnly: true mountPropagation: HostToContainer - {{- end }} + - mountPath: /mnt/node-cgroups + name: node-cgroups + mountPropagation: HostToContainer + - mountPath: /mnt/hosts + name: node-hosts - mountPath: /certs name: tls-certs {{- if $comp.volumeMounts }} @@ -139,6 +149,9 @@ spec: - name: rpc containerPort: {{ $comp.servicePort }} hostPort: {{ $comp.servicePort }} + - name: registry-proxy + containerPort: {{ $comp.registryProxyPort }} + hostPort: {{ $comp.registryProxyPort }} - name: metrics containerPort: 9500 securityContext: diff --git a/chart/templates/ws-daemon-networkpolicy.yaml b/chart/templates/ws-daemon-networkpolicy.yaml index e2cf6d70b7c45e..2155d2ec49d28a 100644 --- a/chart/templates/ws-daemon-networkpolicy.yaml +++ b/chart/templates/ws-daemon-networkpolicy.yaml @@ -1,7 +1,7 @@ # Copyright (c) 2020 TypeFox GmbH. All rights reserved. # Licensed under the MIT License. See License-MIT.txt in the project root for license information. -{{ $comp := .Values.components.wsSync -}} +{{ $comp := .Values.components.wsDaemon -}} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: @@ -23,7 +23,6 @@ spec: - protocol: TCP port: {{ $comp.servicePort }} from: - # Allow ingress on port 3000 from component: - podSelector: matchLabels: app: {{ template "gitpod.fullname" . }} diff --git a/chart/templates/ws-daemon-tlssecret.yaml b/chart/templates/ws-daemon-tlssecret.yaml index 32325d9adadebb..305c62d76fca3a 100644 --- a/chart/templates/ws-daemon-tlssecret.yaml +++ b/chart/templates/ws-daemon-tlssecret.yaml @@ -1,10 +1,10 @@ # Copyright (c) 2020 TypeFox GmbH. All rights reserved. # Licensed under the MIT License. See License-MIT.txt in the project root for license information. -{{ $comp := .Values.components.wsSync -}} +{{ $comp := .Values.components.wsDaemon -}} {{- $this := dict "root" . "gp" $.Values "comp" $comp -}} {{- if not $comp.disabled -}} -{{- $altNames := list ( printf "%s.%s" (include "gitpod.fullname" .) .Release.Namespace ) ( printf "%s.%s.svc" "ws-daemon" .Release.Namespace ) ( printf "wssync" ) -}} +{{- $altNames := list ( printf "%s.%s" (include "gitpod.fullname" .) .Release.Namespace ) ( printf "%s.%s.svc" "ws-daemon" .Release.Namespace ) ( printf "wsdaemon" ) -}} {{- $ca := genCA "wssync-ca" 365 -}} {{- $cert := genSignedCert (include "gitpod.fullname" . ) nil $altNames 365 $ca -}} apiVersion: v1 diff --git a/chart/templates/ws-manager-configmap.yaml b/chart/templates/ws-manager-configmap.yaml index 4ca5105f251125..be9ef04b14c5a3 100644 --- a/chart/templates/ws-manager-configmap.yaml +++ b/chart/templates/ws-manager-configmap.yaml @@ -22,8 +22,8 @@ data: "namespace": "{{ .Release.Namespace }}", "schedulerName": "{{ .Values.workspaceScheduler }}", "dryRun": false, - "wssync": { - "port": {{ .Values.components.wsSync.servicePort }}, + "wsdaemon": { + "port": {{ .Values.components.wsDaemon.servicePort }}, "tls": { "ca": "/certs/ca.crt", "crt": "/certs/tls.crt", @@ -70,7 +70,7 @@ data: "urlTemplate": "{{- template "gitpod.scheme" $this -}}://{{ $.Values.hostname }}/workspace/{{"{{ .Prefix }}"}}/", "portUrlTemplate": "{{- template "gitpod.scheme" $this -}}://{{"{{ .WorkspacePort }}"}}-{{"{{ .Prefix }}"}}.ws{{- if $.Values.installation.shortname -}}-{{ $.Values.installation.shortname }}{{- end -}}.{{ $.Values.hostname }}", {{- end }} - "workspaceHostPath": "{{ .Values.components.wsSync.hostWorkspaceArea }}", + "workspaceHostPath": "{{ .Values.components.wsDaemon.hostWorkspaceArea }}", "theiaHostPath": "{{ .Values.components.nodeDaemon.theiaHostBasePath }}/theia/theia-{{ .Values.version }}", "podTemplate": { {{- if $wscomp.templates }} @@ -92,7 +92,7 @@ data: }, {{ if $comp.eventTraceLogLocation }}"eventTraceLog": "{{ $comp.eventTraceLogLocation }}",{{- end }} "reconnectionInterval": "30s", - "registryFacadeHost": {{ (printf "reg.%s:%v" (.Values.components.registryFacade.hostname | default .Values.hostname) .Values.components.wsManagerNode.registryProxyPort) | quote }} + "registryFacadeHost": {{ (printf "reg.%s:%v" (.Values.components.registryFacade.hostname | default .Values.hostname) .Values.components.wsDaemon.registryProxyPort) | quote }} {{- if and (not $wsproxy.disabled) (eq .Values.ingressMode "noDomain") -}} , "ingressPortAllocator": { "ingressRange": { @@ -105,7 +105,7 @@ data: {{ if $comp.additionalConfig }}, {{ $comp.additionalConfig | toJson | trim | trimPrefix "{" | trimSuffix "}" }}{{- end }} }, "content": { - "storage": {{ toJson .Values.components.wsSync.remoteStorage }} + "storage": {{ toJson .Values.components.wsDaemon.remoteStorage }} }, "rpcServerAddr": ":8080", "pprofAddr": "localhost:6060", diff --git a/chart/templates/ws-manager-node-clusterrole.yaml b/chart/templates/ws-manager-node-clusterrole.yaml deleted file mode 100644 index d95a20910535b1..00000000000000 --- a/chart/templates/ws-manager-node-clusterrole.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2020 TypeFox GmbH. All rights reserved. -# Licensed under the MIT License. See License-MIT.txt in the project root for license information. - -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRole -metadata: - labels: - app: {{ template "gitpod.fullname" . }} - component: ws-manager-node - kind: role - stage: {{ .Values.installation.stage }} - name: {{ .Release.Namespace }}-ns-ws-manager-node -rules: - - apiGroups: ["policy"] - resources: ["podsecuritypolicies"] - verbs: ["use"] - resourceNames: - - {{ .Release.Namespace }}-ns-privileged - - apiGroups: - - "" - resources: - - nodes - verbs: - - get - - list - - update - - patch - - apiGroups: - - "" - resources: - - pods - - services - verbs: - - get - - list - - watch \ No newline at end of file diff --git a/chart/templates/ws-manager-node-clusterrolebinding.yaml b/chart/templates/ws-manager-node-clusterrolebinding.yaml deleted file mode 100644 index 270efce86d5afa..00000000000000 --- a/chart/templates/ws-manager-node-clusterrolebinding.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2020 TypeFox GmbH. All rights reserved. -# Licensed under the MIT License. See License-MIT.txt in the project root for license information. - -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: {{ .Release.Namespace }}-ns-ws-manager-node - labels: - app: {{ template "gitpod.fullname" . }} - component: ws-manager-node - kind: role-binding - stage: {{ .Values.installation.stage }} -subjects: -- kind: ServiceAccount - name: ws-manager-node - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: {{ .Release.Namespace }}-ns-ws-manager-node - apiGroup: rbac.authorization.k8s.io \ No newline at end of file diff --git a/chart/templates/ws-manager-node-configmap.yaml b/chart/templates/ws-manager-node-configmap.yaml deleted file mode 100644 index a506fc553a59ca..00000000000000 --- a/chart/templates/ws-manager-node-configmap.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright (c) 2020 TypeFox GmbH. All rights reserved. -# Licensed under the MIT License. See License-MIT.txt in the project root for license information. - -{{ $comp := .Values.components.wsManagerNode -}} -{{- if not $comp.disabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: ws-manager-node-config - labels: - app: {{ template "gitpod.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -data: - # We don't split our actual budget equally amongst participants. Instead we assume we have a maximum - # number of over-consumers. We hand out CPU in buckets: - # three minutes of 5 CPUs: 5 [numCPU] * 100 [jiffies/sec] * (3 * 60) [seconds] = 90000 - # five minutes of 4 CPUs: 4 [numCPU] * 100 [jiffies/sec] * (5 * 60) [seconds] = 120000 - # remainder of 2 CPUs where a user has to stay below sustained use of 1.8 CPUs for 5 minutes: - # 1.8 [numCPU] * 100 [jiffies/sec] * (5 * 60) [seconds] = 54000 - # - # Compared to the actual budget, this is severe overbooking: - # budget is (numCPU * overbookingFactor * jiffies/sec * controlPeriod[sec]) / numWS = [jiffies / workspace] - # (16 * 1 * 100 * (15 * 60)) / 25 = 57600 - # - # We express everything in jiffies/sec where 1 jiffie is 1% of a CPU core. - config.json: |- - { - "daemon": { - "namespace": "{{ .Release.Namespace }}", - "containerd": "/mnt/containerd.sock", - "containerRuntime": { - "runtime": "containerd", - "containerd": { - "socket": "/mnt/containerd.sock" - } - }, - "uidmapper": { - "procLocation": "/proc", - "rootUIDRange": { - "start": 33333, - "size": 1 - }, - "userUIDRange": [ - {"start": 100000, "size": 70000} - ] - }, - "resources": { - "cgroupBasePath": "/mnt/node-cgroups", - "cpuBuckets": [ - {"budget": 90000, "limit": 500}, - {"budget": 120000, "limit": 400}, - {"budget": 54000, "limit": 200} - ], - "processPriorities": { - "supervisor": 0, - "theia": 5, - "shell": 6, - "default": 10 - }, - "controlPeriod": "15m", - "samplingPeriod": "10s" - }, - "disk": [ - { - "path": "/mnt/wssync-workingarea", - "minBytesAvail": 21474836480 - } - ], - "hosts": { - "nodeHostsFile": "/mnt/hosts", - "serviceProxy": { - "enabled": true, - "mapping": [ - { - "selector": "component=registry-facade,feature=registry", - "alias": {{ (printf "reg.%s" (.Values.components.registryFacade.hostname | default .Values.hostname)) | quote }}, - "proxyPort": {{ $comp.registryProxyPort }} - } - ] - } - } - }, - "prometheusAddr": ":9500", - "pprofAddr": "localhost:6060" - } -{{- end -}} \ No newline at end of file diff --git a/chart/templates/ws-manager-node-daemonset.yaml b/chart/templates/ws-manager-node-daemonset.yaml deleted file mode 100644 index cc6b98ba0c8e15..00000000000000 --- a/chart/templates/ws-manager-node-daemonset.yaml +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright (c) 2020 TypeFox GmbH. All rights reserved. -# Licensed under the MIT License. See License-MIT.txt in the project root for license information. - -{{ $comp := .Values.components.wsManagerNode -}} -{{- $this := dict "root" . "gp" $.Values "comp" $comp -}} -{{- if not $comp.disabled -}} -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: ws-manager-node - labels: - app: {{ template "gitpod.fullname" $ }} - component: ws-manager-node - kind: daemonset - stage: {{ .Values.installation.stage }} -spec: - selector: - matchLabels: - app: {{ template "gitpod.fullname" $ }} - component: ws-manager-node - kind: daemonset - stage: {{ .Values.installation.stage }} - template: - metadata: - labels: - app: {{ template "gitpod.fullname" $ }} - component: ws-manager-node - kind: daemonset - stage: {{ .Values.installation.stage }} - annotations: - prometheus.io/scrape: 'true' - prometheus.io/path: "/metrics" - prometheus.io/port: '9500' - checksum/tlskey: {{ include (print $.Template.BasePath "/ws-manager-node-tlssecret.yaml") $ | sha256sum }} - spec: -{{ include "gitpod.workspaceAffinity" $this | indent 6 }} - serviceAccountName: ws-manager-node - hostPID: true - volumes: - - hostPath: - path: {{ .Values.components.wsSync.hostWorkspaceArea }} - type: DirectoryOrCreate - name: wssync-workingarea - - name: containerd-socket - hostPath: - path: {{ $comp.containerdSocket | default "/run/containerd/containerd.sock" }} - type: Socket - - name: node-cgroups - hostPath: - path: {{ $comp.cgroupsRoot | default "/sys/fs/cgroup" }} - type: Directory - - name: node-hosts - hostPath: - path: {{ $comp.nodeHosts | default "/etc/hosts" }} - type: File - - name: tls-certs - secret: - secretName: ws-manager-node-tls - - name: config - configMap: - name: {{ template "gitpod.comp.configMap" $this }} -{{- if $comp.volumes }} -{{ toYaml $comp.volumes | indent 6 }} -{{- end }} - containers: - - name: ws-manager-node - volumeMounts: - - mountPath: /mnt/wssync-workingarea - name: wssync-workingarea - mountPropagation: Bidirectional - - mountPath: /mnt/containerd.sock - name: containerd-socket - - mountPath: /mnt/node-cgroups - name: node-cgroups - mountPropagation: HostToContainer - - mountPath: /mnt/hosts - name: node-hosts - - mountPath: /config - name: config - - mountPath: /certs - name: tls-certs -{{- if $comp.volumeMounts }} -{{ toYaml $comp.volumeMounts | indent 8 }} -{{- end }} - args: ["run", "-v", "--config", "/config/config.json"] - image: {{ template "gitpod.comp.imageFull" $this }} -{{ include "gitpod.container.imagePullPolicy" $this | indent 8 }} -{{ include "gitpod.container.resources" $this | indent 8 }} -{{ include "gitpod.container.defaultEnv" $this | indent 8 }} -{{ include "gitpod.container.tracingEnv" $this | indent 8 }} - - name: NODENAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - ports: - - name: registry-proxy - containerPort: {{ $comp.registryProxyPort }} - hostPort: {{ $comp.registryProxyPort }} - - name: metrics - containerPort: 9500 - securityContext: - privileged: true -{{ toYaml .Values.defaults | indent 6 }} -{{ end }} \ No newline at end of file diff --git a/chart/templates/ws-manager-node-networkpolicy.yaml b/chart/templates/ws-manager-node-networkpolicy.yaml deleted file mode 100644 index e276a66befde84..00000000000000 --- a/chart/templates/ws-manager-node-networkpolicy.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2020 TypeFox GmbH. All rights reserved. -# Licensed under the MIT License. See License-MIT.txt in the project root for license information. - -{{ $comp := .Values.components.wsManagerNode -}} -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: ws-manager-node - labels: - app: {{ template "gitpod.fullname" . }} - component: ws-manager-node - kind: networkpolicy - stage: {{ .Values.installation.stage }} -spec: - podSelector: - matchLabels: - app: {{ template "gitpod.fullname" . }} - component: ws-manager-node - policyTypes: - - Ingress - ingress: - - ports: - - protocol: TCP - port: {{ $comp.servicePort }} - from: - # Allow ingress on port 3000 from component: - - podSelector: - matchLabels: - app: {{ template "gitpod.fullname" . }} - component: ws-manager - - ports: - - protocol: TCP - port: 9500 - from: - - namespaceSelector: - matchLabels: - chart: monitoring - - podSelector: - matchLabels: - app: prometheus - component: server \ No newline at end of file diff --git a/chart/templates/ws-manager-node-serviceaccount.yaml b/chart/templates/ws-manager-node-serviceaccount.yaml deleted file mode 100644 index 5f4d254722b7e5..00000000000000 --- a/chart/templates/ws-manager-node-serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2020 TypeFox GmbH. All rights reserved. -# Licensed under the MIT License. See License-MIT.txt in the project root for license information. - -apiVersion: v1 -kind: ServiceAccount -metadata: - name: ws-manager-node - labels: - app: {{ template "gitpod.fullname" . }} - component: ws-manager-node - kind: service-account - stage: {{ .Values.installation.stage }} \ No newline at end of file diff --git a/chart/templates/ws-manager-node-tlssecret.yaml b/chart/templates/ws-manager-node-tlssecret.yaml deleted file mode 100644 index f876186ee5e81b..00000000000000 --- a/chart/templates/ws-manager-node-tlssecret.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2020 TypeFox GmbH. All rights reserved. -# Licensed under the MIT License. See License-MIT.txt in the project root for license information. - -{{ $comp := .Values.components.wsManagerNode -}} -{{- $this := dict "root" . "gp" $.Values "comp" $comp -}} -{{- if not $comp.disabled -}} -{{- $altNames := list ( printf "%s.%s" (include "gitpod.fullname" .) .Release.Namespace ) ( printf "%s.%s.svc" "ws-manager-node" .Release.Namespace ) ( printf "ws-manager-node" ) -}} -{{- $ca := genCA "wsman-node-ca" 365 -}} -{{- $cert := genSignedCert (include "gitpod.fullname" . ) nil $altNames 365 $ca -}} -apiVersion: v1 -kind: Secret -metadata: - name: ws-manager-node-tls - labels: - app: {{ template "gitpod.fullname" $ }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" - annotations: - checksum/checksd-config: {{ $cert.Cert | indent 2 | sha256sum }} -data: - ca.crt: {{ $ca.Cert | b64enc }} - tls.crt: {{ $cert.Cert | b64enc }} - tls.key: {{ $cert.Key | b64enc }} -{{- end -}} \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml index 80a3161fbe003f..4cde3ee9cdb75b 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -359,29 +359,22 @@ components: expose: false containerPort: 9500 - wsManagerNode: - name: "ws-manager-node" - registryProxyPort: 8081 - resources: - cpu: 100m - memory: 32Mi - - wsSync: + wsDaemon: name: "ws-daemon" hostWorkspaceArea: /var/gitpod/workspaces servicePort: 8080 workspaceSizeLimit: "" - fullWorkspaceBackup: - enabled: true - nodeRoots: - - /var/lib + containerRuntime: runtime: containerd containerd: socket: /run/containerd/containerd.sock + nodeRoots: + - /var/lib userNamespaces: shiftfsModuleLoader: enabled: false imageName: "shiftfs-module-loader" + registryProxyPort: 8081 remoteStorage: kind: minio minio: diff --git a/components/BUILD.yaml b/components/BUILD.yaml index 11ee6a7e2a4e2b..f2787ecff857de 100644 --- a/components/BUILD.yaml +++ b/components/BUILD.yaml @@ -20,7 +20,6 @@ packages: - components/theia/app:docker - components/theia/static-server:docker - components/ws-manager-bridge:docker - - components/ws-manager-node:docker - components/ws-manager:docker - components/ws-proxy:docker - components/ws-daemon:docker @@ -40,7 +39,6 @@ packages: - components/supervisor:app - components/theia/static-server:app - components/ws-manager-bridge:app - - components/ws-manager-node:app - components/ws-manager:app - components/ee/ws-scheduler:app - components/ws-daemon:app diff --git a/components/common-go/kubernetes/kubernetes.go b/components/common-go/kubernetes/kubernetes.go index 9f3b63bc3184fb..ad9dc017ce984e 100644 --- a/components/common-go/kubernetes/kubernetes.go +++ b/components/common-go/kubernetes/kubernetes.go @@ -42,7 +42,7 @@ const ( // TraceIDAnnotation adds a Jaeger/OpenTracing header to the pod so that we can trace it's behaviour TraceIDAnnotation = "gitpod/traceid" - // CPULimitAnnotation enforces a strict CPU limit on a workspace by virtue of ws-manager-node + // CPULimitAnnotation enforces a strict CPU limit on a workspace by virtue of ws-daemon CPULimitAnnotation = "gitpod/cpuLimit" ) diff --git a/components/ee/ws-scheduler/pkg/scheduler/scheduler.go b/components/ee/ws-scheduler/pkg/scheduler/scheduler.go index a7141e8caf8fbd..13fe9c3cbface8 100644 --- a/components/ee/ws-scheduler/pkg/scheduler/scheduler.go +++ b/components/ee/ws-scheduler/pkg/scheduler/scheduler.go @@ -377,7 +377,7 @@ func (s *Scheduler) gatherPotentialNodesFor(ctx context.Context, pod *corev1.Pod if node.Spec.Unschedulable { continue } - // filter: 4: our own diskpressure signal coming from ws-manager-node. + // filter: 4: our own diskpressure signal coming from ws-daemon. // This is not part of the label selector as labelSets cannot negate // labels. Otherwise !gitpod.io/diskPressure would be a valid selector. if _, fullDisk := node.Labels["gitpod.io/diskPressure"]; fullDisk { diff --git a/components/supervisor/BUILD.yaml b/components/supervisor/BUILD.yaml index 69332da54521d5..d4275fe9083490 100644 --- a/components/supervisor/BUILD.yaml +++ b/components/supervisor/BUILD.yaml @@ -11,7 +11,6 @@ packages: - components/content-service:lib - components/supervisor-api/go:lib - components/ws-daemon-api/go:lib - - components/ws-manager-node-api/go:lib env: - CGO_ENABLED=0 - GOOS=linux diff --git a/components/supervisor/go.mod b/components/supervisor/go.mod index f7ebcd5cff0913..e0a254042f066d 100644 --- a/components/supervisor/go.mod +++ b/components/supervisor/go.mod @@ -9,7 +9,6 @@ require ( github.com/gitpod-io/gitpod/content-service v0.0.0-00010101000000-000000000000 github.com/gitpod-io/gitpod/content-service/api v0.0.0-00010101000000-000000000000 github.com/gitpod-io/gitpod/supervisor/api v0.0.0-00010101000000-000000000000 - github.com/gitpod-io/gitpod/ws-manager-node/api v0.0.0-00010101000000-000000000000 github.com/gitpod-io/gitpod/ws-daemon/api v0.0.0-00010101000000-000000000000 github.com/golang/protobuf v1.4.2 github.com/google/go-cmp v0.5.2 @@ -35,8 +34,6 @@ replace github.com/gitpod-io/gitpod/content-service/api => ../content-service-ap replace github.com/gitpod-io/gitpod/supervisor/api => ../supervisor-api/go // leeway -replace github.com/gitpod-io/gitpod/ws-manager-node/api => ../ws-manager-node-api/go // leeway - replace github.com/gitpod-io/gitpod/ws-daemon/api => ../ws-daemon-api/go // leeway replace k8s.io/api => k8s.io/api v0.0.0-20190620084959-7cf5895f2711 // leeway indirect from components/common-go:lib diff --git a/components/supervisor/go.sum b/components/supervisor/go.sum index 2983f8c5e961a2..ba2e998be3a0ee 100644 --- a/components/supervisor/go.sum +++ b/components/supervisor/go.sum @@ -133,6 +133,9 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= +github.com/fatih/gomodifytags v1.9.0/go.mod h1:TbUyEjH1Zo0GkJd2Q52oVYqYcJ0eGNqG8bsiOb75P9c= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gernest/wow v0.1.0/go.mod h1:dEPabJRi5BneI1Nev1VWo0ZlcTWibHWp43qxKms4elY= @@ -598,6 +601,7 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180824175216-6c1c5e93cdc1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/components/supervisor/pkg/backup/backup.go b/components/supervisor/pkg/iwh/iwh.go similarity index 50% rename from components/supervisor/pkg/backup/backup.go rename to components/supervisor/pkg/iwh/iwh.go index 025d125961e57a..1a3d0fbcb04a61 100644 --- a/components/supervisor/pkg/backup/backup.go +++ b/components/supervisor/pkg/iwh/iwh.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package backup +package iwh import ( "context" @@ -12,13 +12,61 @@ import ( csapi "github.com/gitpod-io/gitpod/content-service/api" "github.com/gitpod-io/gitpod/content-service/pkg/git" supervisor "github.com/gitpod-io/gitpod/supervisor/api" - wssync "github.com/gitpod-io/gitpod/ws-daemon/api" + daemon "github.com/gitpod-io/gitpod/ws-daemon/api" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) +// NewInWorkspaceHelper creates a new in-workspace helper +func NewInWorkspaceHelper(checkoutLocation string, pauseTheia chan<- bool) *InWorkspaceHelper { + return &InWorkspaceHelper{ + backup: &backupService{ + checkoutLocation: checkoutLocation, + contentReadyChan: make(chan struct{}), + pauseChan: pauseTheia, + triggerBackup: make(chan chan<- bool), + }, + idmapper: &idmapperService{ + triggerUIDMap: make(chan *triggerNewuidmapReq), + }, + } +} + +// InWorkspaceHelper provides services backed by ws-daemon canaries +type InWorkspaceHelper struct { + backup *backupService + idmapper *idmapperService +} + +// RegisterGRPC registers a gRPC service +func (iwh *InWorkspaceHelper) RegisterGRPC(srv *grpc.Server) { + type grpcIWH struct { + *backupIWH + *idmapperIWH + } + daemon.RegisterInWorkspaceHelperServer(srv, grpcIWH{ + backupIWH: &backupIWH{iwh.backup}, + idmapperIWH: &idmapperIWH{iwh.idmapper}, + }) +} + +// ContentState provides access to the workspace's content state +func (iwh *InWorkspaceHelper) ContentState() ContentState { + return iwh.backup +} + +// BackupService provides access to the canary-backed backup service +func (iwh *InWorkspaceHelper) BackupService() BackupService { + return iwh.backup +} + +// IDMapperService provides access to the canary-backed id mapper service +func (iwh *InWorkspaceHelper) IDMapperService() IDMapperService { + return iwh.idmapper +} + // ContentState signals the workspace content state type ContentState interface { MarkContentReady(src csapi.WorkspaceInitSource) @@ -26,18 +74,16 @@ type ContentState interface { ContentSource() (src csapi.WorkspaceInitSource, ok bool) } -// NewInWorkspaceHelper produces a new NewInWorkspaceHelper -func NewInWorkspaceHelper(checkoutLocation string, pauseTheia chan<- bool) *InWorkspaceHelper { - return &InWorkspaceHelper{ - checkoutLocation: checkoutLocation, - contentReadyChan: make(chan struct{}), - pauseChan: pauseTheia, - triggerBackup: make(chan chan<- bool), - } +// BackupService is the supervisor-facing, canary backed, backup service +type BackupService interface { + Available() bool + Prepare(ctx context.Context, req *supervisor.PrepareBackupRequest) (*supervisor.PrepareBackupResponse, error) } -// InWorkspaceHelper implements the in-workspace helper for ws-daemon -type InWorkspaceHelper struct { +var _ ContentState = &backupService{} +var _ BackupService = &backupService{} + +type backupService struct { checkoutLocation string pauseChan chan<- bool triggerBackup chan chan<- bool @@ -50,19 +96,19 @@ type InWorkspaceHelper struct { // MarkContentReady marks the workspace content as available. // This function is not synchronized and must be called from a single thread/go routine only. -func (iwh *InWorkspaceHelper) MarkContentReady(src csapi.WorkspaceInitSource) { +func (iwh *backupService) MarkContentReady(src csapi.WorkspaceInitSource) { iwh.contentSource = src close(iwh.contentReadyChan) } // ContentReady returns a chan that closes when the content becomes available -func (iwh *InWorkspaceHelper) ContentReady() <-chan struct{} { +func (iwh *backupService) ContentReady() <-chan struct{} { return iwh.contentReadyChan } // ContentSource returns the init source of the workspace content. // The value returned here is only OK after ContentReady() was closed. -func (iwh *InWorkspaceHelper) ContentSource() (src csapi.WorkspaceInitSource, ok bool) { +func (iwh *backupService) ContentSource() (src csapi.WorkspaceInitSource, ok bool) { select { case <-iwh.contentReadyChan: default: @@ -72,7 +118,7 @@ func (iwh *InWorkspaceHelper) ContentSource() (src csapi.WorkspaceInitSource, ok } // Prepare prepares a workspace content backup, e.g. when the container is about to shut down -func (iwh *InWorkspaceHelper) Prepare(ctx context.Context, req *supervisor.PrepareBackupRequest) (*supervisor.PrepareBackupResponse, error) { +func (iwh *backupService) Prepare(ctx context.Context, req *supervisor.PrepareBackupRequest) (*supervisor.PrepareBackupResponse, error) { rc := make(chan bool) select { @@ -95,24 +141,18 @@ func (iwh *InWorkspaceHelper) Prepare(ctx context.Context, req *supervisor.Prepa return &supervisor.PrepareBackupResponse{}, nil } -// RegisterGRPC registers an InWorkspaceHelperServer gRPC service using this helper implementation -func (iwh *InWorkspaceHelper) RegisterGRPC(srv *grpc.Server) { - wssync.RegisterInWorkspaceHelperServer(srv, &iwhserver{iwh}) - supervisor.RegisterBackupServiceServer(srv, &iwhserver{iwh}) -} - // CanaryAvailable returns true if there's a backup canary available -func (iwh *InWorkspaceHelper) CanaryAvailable() bool { +func (iwh *backupService) Available() bool { return atomic.LoadInt32(&iwh.canaryAvailable) > 0 } -type iwhserver struct { - *InWorkspaceHelper +type backupIWH struct { + *backupService } // BackupCanary can prepare workspace content backups. The canary is supposed to be triggered // when the workspace is about to shut down, e.g. using the PreStop hook of a Kubernetes container. -func (iwh *iwhserver) BackupCanary(srv wssync.InWorkspaceHelper_BackupCanaryServer) error { +func (iwh *backupIWH) BackupCanary(srv daemon.InWorkspaceHelper_BackupCanaryServer) error { atomic.AddInt32(&iwh.canaryAvailable, 1) defer atomic.AddInt32(&iwh.canaryAvailable, -1) @@ -121,7 +161,7 @@ func (iwh *iwhserver) BackupCanary(srv wssync.InWorkspaceHelper_BackupCanaryServ return status.Error(codes.FailedPrecondition, "trigger chan closed") } - err := srv.Send(&wssync.BackupCanaryRequest{}) + err := srv.Send(&daemon.BackupCanaryRequest{}) if err != nil { return err } @@ -139,7 +179,7 @@ func (iwh *iwhserver) BackupCanary(srv wssync.InWorkspaceHelper_BackupCanaryServ // PauseTheia can pause the Theia process and all its children. As long as the request stream // is held Theia will be paused. // This is a stop-the-world mechanism for preventing concurrent modification during backup. -func (iwh *iwhserver) PauseTheia(srv wssync.InWorkspaceHelper_PauseTheiaServer) error { +func (iwh *backupIWH) PauseTheia(srv daemon.InWorkspaceHelper_PauseTheiaServer) error { iwh.pauseChan <- true defer func() { iwh.pauseChan <- false @@ -150,7 +190,7 @@ func (iwh *iwhserver) PauseTheia(srv wssync.InWorkspaceHelper_PauseTheiaServer) return err } - return srv.SendAndClose(&wssync.PauseTheiaResponse{}) + return srv.SendAndClose(&daemon.PauseTheiaResponse{}) } const ( @@ -164,7 +204,7 @@ const ( ) // GitStatus provides the current state of the main Git repo at the workspace's checkout location -func (iwh *iwhserver) GitStatus(ctx context.Context, req *wssync.GitStatusRequest) (*wssync.GitStatusResponse, error) { +func (iwh *backupIWH) GitStatus(ctx context.Context, req *daemon.GitStatusRequest) (*daemon.GitStatusResponse, error) { // // BEWARE // This functionality is duplicated in ws-daemon. @@ -178,5 +218,82 @@ func (iwh *iwhserver) GitStatus(ctx context.Context, req *wssync.GitStatusReques } res := s.ToAPI() - return &wssync.GitStatusResponse{Repo: res}, nil + return &daemon.GitStatusResponse{Repo: res}, nil +} + +// IDMapperService is the supervisor-facing, canary-backed UID/GID mapping service for user namespace support +type IDMapperService interface { + Available() bool + WriteIDMap(ctx context.Context, req *daemon.UidmapCanaryRequest) error +} + +type triggerNewuidmapReq struct { + Req *daemon.UidmapCanaryRequest + Resp chan error +} + +var _ IDMapperService = &idmapperService{} + +type idmapperService struct { + canaryAvailable int32 + triggerUIDMap chan *triggerNewuidmapReq +} + +// CanaryAvailable returns true if there's a canaray available. +// If there isn't, calling Newuidmap or Newguidmap won't succeed. +func (iwh *idmapperService) Available() bool { + return atomic.LoadInt32(&iwh.canaryAvailable) > 0 +} + +// WriteIDMap asks the canary to create a new uidmap. If there's no canary +// available, this function will block until one becomes available or the +// context is canceled. +func (iwh *idmapperService) WriteIDMap(ctx context.Context, req *daemon.UidmapCanaryRequest) error { + trigger := &triggerNewuidmapReq{ + Req: req, + Resp: make(chan error, 1), + } + + select { + case iwh.triggerUIDMap <- trigger: + case <-ctx.Done(): + return ctx.Err() + } + + select { + case err := <-trigger.Resp: + return err + case <-ctx.Done(): + return ctx.Err() + } +} + +type idmapperIWH struct { + *idmapperService +} + +func (iwh *idmapperIWH) UidmapCanary(srv daemon.InWorkspaceHelper_UidmapCanaryServer) error { + atomic.AddInt32(&iwh.canaryAvailable, 1) + defer atomic.AddInt32(&iwh.canaryAvailable, -1) + + for { + select { + case req := <-iwh.triggerUIDMap: + err := srv.Send(req.Req) + if err != nil { + req.Resp <- err + } + resp, err := srv.Recv() + if err != nil { + req.Resp <- err + } + if resp.ErrorCode > 0 { + req.Resp <- status.Error(codes.Code(resp.ErrorCode), resp.Message) + } + + req.Resp <- nil + case <-srv.Context().Done(): + // canary dropped out - we're done here + } + } } diff --git a/components/supervisor/pkg/supervisor/services.go b/components/supervisor/pkg/supervisor/services.go index 5448edd2be29a4..bbc95b0fdc4d5d 100644 --- a/components/supervisor/pkg/supervisor/services.go +++ b/components/supervisor/pkg/supervisor/services.go @@ -13,8 +13,8 @@ import ( "github.com/gitpod-io/gitpod/common-go/log" csapi "github.com/gitpod-io/gitpod/content-service/api" "github.com/gitpod-io/gitpod/supervisor/api" - "github.com/gitpod-io/gitpod/supervisor/pkg/backup" - ndeapi "github.com/gitpod-io/gitpod/ws-manager-node/api" + "github.com/gitpod-io/gitpod/supervisor/pkg/iwh" + daemon "github.com/gitpod-io/gitpod/ws-daemon/api" "github.com/golang/protobuf/ptypes" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -39,7 +39,7 @@ type RegisterableRESTService interface { } type statusService struct { - IWH *backup.InWorkspaceHelper + IWH *iwh.InWorkspaceHelper Ports *portsManager Tasks *tasksManager IDEReady <-chan struct{} @@ -85,10 +85,11 @@ func (s *statusService) ContentStatus(ctx context.Context, req *api.ContentStatu csapi.WorkspaceInitFromPrebuild: api.ContentSource_from_prebuild, } + cs := s.IWH.ContentState() if req.Wait { select { - case <-s.IWH.ContentReady(): - src, _ := s.IWH.ContentSource() + case <-cs.ContentReady(): + src, _ := cs.ContentSource() return &api.ContentStatusResponse{ Available: true, Source: srcmap[src], @@ -98,7 +99,7 @@ func (s *statusService) ContentStatus(ctx context.Context, req *api.ContentStatu } } - src, ok := s.IWH.ContentSource() + src, ok := cs.ContentSource() if !ok { return &api.ContentStatusResponse{ Available: false, @@ -113,7 +114,7 @@ func (s *statusService) ContentStatus(ctx context.Context, req *api.ContentStatu func (s *statusService) BackupStatus(ctx context.Context, req *api.BackupStatusRequest) (*api.BackupStatusResponse, error) { return &api.BackupStatusResponse{ - CanaryAvailable: s.IWH.CanaryAvailable(), + CanaryAvailable: s.IWH.BackupService().Available(), }, nil } @@ -549,7 +550,7 @@ func (is *InfoService) WorkspaceInfo(context.Context, *api.WorkspaceInfoRequest) // ControlService implements the supervisor control service type ControlService struct { - UidmapCanary *ndeapi.InWorkspaceHelper + UidmapCanary iwh.IDMapperService } // RegisterGRPC registers the gRPC info service @@ -559,26 +560,26 @@ func (c *ControlService) RegisterGRPC(srv *grpc.Server) { // Newuidmap establishes a new UID mapping in a user namespace func (c *ControlService) Newuidmap(ctx context.Context, req *api.NewuidmapRequest) (*api.NewuidmapResponse, error) { - if !c.UidmapCanary.CanaryAvailable() { + if !c.UidmapCanary.Available() { return nil, status.Error(codes.Unavailable, "service unavailable") } - mapping := make([]*ndeapi.UidmapCanaryRequest_Mapping, len(req.Mapping)) + mapping := make([]*daemon.UidmapCanaryRequest_Mapping, len(req.Mapping)) for i, m := range req.Mapping { - mapping[i] = &ndeapi.UidmapCanaryRequest_Mapping{ + mapping[i] = &daemon.UidmapCanaryRequest_Mapping{ ContainerId: m.ContainerId, HostId: m.HostId, Size: m.Size, } } - ndereq := &ndeapi.UidmapCanaryRequest{ + ndereq := &daemon.UidmapCanaryRequest{ Pid: req.Pid, Gid: req.Gid, Mapping: mapping, } - err := c.UidmapCanary.Newuidmap(ctx, ndereq) + err := c.UidmapCanary.WriteIDMap(ctx, ndereq) if err != nil { return nil, err } diff --git a/components/supervisor/pkg/supervisor/supervisor.go b/components/supervisor/pkg/supervisor/supervisor.go index 5a52d2b6512ba2..9e0c68135d5301 100644 --- a/components/supervisor/pkg/supervisor/supervisor.go +++ b/components/supervisor/pkg/supervisor/supervisor.go @@ -20,16 +20,15 @@ import ( "syscall" "time" + "github.com/gitpod-io/gitpod/common-go/log" + csapi "github.com/gitpod-io/gitpod/content-service/api" "github.com/gitpod-io/gitpod/content-service/pkg/executor" "github.com/gitpod-io/gitpod/content-service/pkg/initializer" - "github.com/gitpod-io/gitpod/supervisor/pkg/backup" "github.com/gitpod-io/gitpod/supervisor/pkg/dropwriter" + "github.com/gitpod-io/gitpod/supervisor/pkg/iwh" "github.com/gitpod-io/gitpod/supervisor/pkg/terminal" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/gitpod-io/gitpod/common-go/log" - csapi "github.com/gitpod-io/gitpod/content-service/api" - ndeapi "github.com/gitpod-io/gitpod/ws-manager-node/api" + "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/soheilhy/cmux" "google.golang.org/grpc" ) @@ -114,16 +113,15 @@ func Run(options ...RunOption) { shutdown = make(chan struct{}) ideReady = make(chan struct{}) pauseIDE = make(chan bool) - iwh = backup.NewInWorkspaceHelper(cfg.RepoRoot, pauseIDE) + iwh = iwh.NewInWorkspaceHelper(cfg.RepoRoot, pauseIDE) portMgmt = newPortsManager( uint32(cfg.IDEPort), uint32(cfg.APIEndpointPort), ) - termMux = terminal.NewMux() - termMuxSrv = terminal.NewMuxTerminalService(termMux) - uidmapCanary = ndeapi.NewInWorkspaceHelper() + termMux = terminal.NewMux() + termMuxSrv = terminal.NewMuxTerminalService(termMux) ) - taskManager := newTasksManager(cfg, termMuxSrv, iwh) + taskManager := newTasksManager(cfg, termMuxSrv, iwh.ContentState()) termMuxSrv.DefaultWorkdir = cfg.RepoRoot @@ -138,14 +136,13 @@ func Run(options ...RunOption) { apiServices = append(apiServices, termMuxSrv) apiServices = append(apiServices, &RegistrableTokenService{tokenService}) apiServices = append(apiServices, &InfoService{cfg: cfg}) - apiServices = append(apiServices, uidmapCanary.Server()) - apiServices = append(apiServices, &ControlService{UidmapCanary: uidmapCanary}) + apiServices = append(apiServices, &ControlService{UidmapCanary: iwh.IDMapperService()}) apiServices = append(apiServices, opts.AdditionalServices...) var wg sync.WaitGroup wg.Add(4) go startAndWatchIDE(ctx, cfg, &wg, ideReady, pauseIDE) - go startContentInit(ctx, cfg, &wg, iwh) + go startContentInit(ctx, cfg, &wg, iwh.ContentState()) go startAPIEndpoint(ctx, cfg, &wg, apiServices) go portMgmt.Run(ctx, &wg) go taskManager.Run(ctx, &wg) @@ -464,7 +461,7 @@ func startAPIEndpoint(ctx context.Context, cfg *Config, wg *sync.WaitGroup, serv l.Close() } -func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst backup.ContentState) { +func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst iwh.ContentState) { defer wg.Done() defer log.Info("supervisor: workspace content available") diff --git a/components/supervisor/pkg/supervisor/tasks.go b/components/supervisor/pkg/supervisor/tasks.go index 211d3a669341e0..b87078ce80cee9 100644 --- a/components/supervisor/pkg/supervisor/tasks.go +++ b/components/supervisor/pkg/supervisor/tasks.go @@ -19,7 +19,7 @@ import ( "github.com/gitpod-io/gitpod/common-go/log" csapi "github.com/gitpod-io/gitpod/content-service/api" "github.com/gitpod-io/gitpod/supervisor/api" - "github.com/gitpod-io/gitpod/supervisor/pkg/backup" + "github.com/gitpod-io/gitpod/supervisor/pkg/iwh" "github.com/gitpod-io/gitpod/supervisor/pkg/terminal" ) @@ -77,10 +77,10 @@ type tasksManager struct { mu sync.RWMutex ready chan struct{} terminalService *terminal.MuxTerminalService - contentState backup.ContentState + contentState iwh.ContentState } -func newTasksManager(config *Config, terminalService *terminal.MuxTerminalService, contentState backup.ContentState) *tasksManager { +func newTasksManager(config *Config, terminalService *terminal.MuxTerminalService, contentState iwh.ContentState) *tasksManager { return &tasksManager{ config: config, terminalService: terminalService, diff --git a/components/ws-daemon-api/wssync.proto b/components/ws-daemon-api/daemon.proto similarity index 99% rename from components/ws-daemon-api/wssync.proto rename to components/ws-daemon-api/daemon.proto index 570cbe028ba763..c74549a052af3a 100644 --- a/components/ws-daemon-api/wssync.proto +++ b/components/ws-daemon-api/daemon.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package wssync; +package wsdaemon; import "content-service-api/initializer.proto"; diff --git a/components/ws-daemon-api/go/wssync.pb.go b/components/ws-daemon-api/go/daemon.pb.go similarity index 80% rename from components/ws-daemon-api/go/wssync.pb.go rename to components/ws-daemon-api/go/daemon.pb.go index 364eda61598e11..fe29191b381ed3 100644 --- a/components/ws-daemon-api/go/wssync.pb.go +++ b/components/ws-daemon-api/go/daemon.pb.go @@ -3,7 +3,7 @@ // See License-AGPL.txt in the project root for license information. // Code generated by protoc-gen-go. DO NOT EDIT. -// source: wssync.proto +// source: daemon.proto package api @@ -64,7 +64,7 @@ func (x WorkspaceContentState) String() string { } func (WorkspaceContentState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{0} + return fileDescriptor_3ec90cbc4aa12fc6, []int{0} } // InitWorkspaceRequest intialises a new workspace folder in the working area @@ -77,11 +77,11 @@ type InitWorkspaceRequest struct { Initializer *api.WorkspaceInitializer `protobuf:"bytes,3,opt,name=initializer,proto3" json:"initializer,omitempty"` // full_workspace_backup means we ignore the initializer and wait for a workspace pod with the given instance ID to // appear at our local containerd. - FullWorkspaceBackup bool `protobuf:"varint,4,opt,name=full_workspace_backup,json=fullWorkspaceBackup,proto3" json:"fullWorkspaceBackup,omitempty"` + FullWorkspaceBackup bool `protobuf:"varint,4,opt,name=full_workspace_backup,json=fullWorkspaceBackup,proto3" json:"full_workspace_backup,omitempty"` // content_manifest describes the layers that comprise the workspace image content. // This manifest is not used to actually download content, but to produce a new manifest for snapshots and backups. // This field is ignored if full_workspace_backup is false. - ContentManifest []byte `protobuf:"bytes,5,opt,name=content_manifest,json=contentManifest,proto3" json:"contentManifest,omitempty"` + ContentManifest []byte `protobuf:"bytes,5,opt,name=content_manifest,json=contentManifest,proto3" json:"content_manifest,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -91,7 +91,7 @@ func (m *InitWorkspaceRequest) Reset() { *m = InitWorkspaceRequest{} } func (m *InitWorkspaceRequest) String() string { return proto.CompactTextString(m) } func (*InitWorkspaceRequest) ProtoMessage() {} func (*InitWorkspaceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{0} + return fileDescriptor_3ec90cbc4aa12fc6, []int{0} } func (m *InitWorkspaceRequest) XXX_Unmarshal(b []byte) error { @@ -152,7 +152,7 @@ type WorkspaceMetadata struct { // owner is the ID of the Gitpod user to whom we'll bill this workspace and who we consider responsible for its content Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` // meta_id is the workspace ID of this currently running workspace instance on the "meta pool" side - MetaId string `protobuf:"bytes,2,opt,name=meta_id,json=metaId,proto3" json:"metaId,omitempty"` + MetaId string `protobuf:"bytes,2,opt,name=meta_id,json=metaId,proto3" json:"meta_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -162,7 +162,7 @@ func (m *WorkspaceMetadata) Reset() { *m = WorkspaceMetadata{} } func (m *WorkspaceMetadata) String() string { return proto.CompactTextString(m) } func (*WorkspaceMetadata) ProtoMessage() {} func (*WorkspaceMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{1} + return fileDescriptor_3ec90cbc4aa12fc6, []int{1} } func (m *WorkspaceMetadata) XXX_Unmarshal(b []byte) error { @@ -207,7 +207,7 @@ func (m *InitWorkspaceResponse) Reset() { *m = InitWorkspaceResponse{} } func (m *InitWorkspaceResponse) String() string { return proto.CompactTextString(m) } func (*InitWorkspaceResponse) ProtoMessage() {} func (*InitWorkspaceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{2} + return fileDescriptor_3ec90cbc4aa12fc6, []int{2} } func (m *InitWorkspaceResponse) XXX_Unmarshal(b []byte) error { @@ -241,7 +241,7 @@ func (m *WaitForInitRequest) Reset() { *m = WaitForInitRequest{} } func (m *WaitForInitRequest) String() string { return proto.CompactTextString(m) } func (*WaitForInitRequest) ProtoMessage() {} func (*WaitForInitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{3} + return fileDescriptor_3ec90cbc4aa12fc6, []int{3} } func (m *WaitForInitRequest) XXX_Unmarshal(b []byte) error { @@ -279,7 +279,7 @@ func (m *WaitForInitResponse) Reset() { *m = WaitForInitResponse{} } func (m *WaitForInitResponse) String() string { return proto.CompactTextString(m) } func (*WaitForInitResponse) ProtoMessage() {} func (*WaitForInitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{4} + return fileDescriptor_3ec90cbc4aa12fc6, []int{4} } func (m *WaitForInitResponse) XXX_Unmarshal(b []byte) error { @@ -313,7 +313,7 @@ func (m *TakeSnapshotRequest) Reset() { *m = TakeSnapshotRequest{} } func (m *TakeSnapshotRequest) String() string { return proto.CompactTextString(m) } func (*TakeSnapshotRequest) ProtoMessage() {} func (*TakeSnapshotRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{5} + return fileDescriptor_3ec90cbc4aa12fc6, []int{5} } func (m *TakeSnapshotRequest) XXX_Unmarshal(b []byte) error { @@ -353,7 +353,7 @@ func (m *TakeSnapshotResponse) Reset() { *m = TakeSnapshotResponse{} } func (m *TakeSnapshotResponse) String() string { return proto.CompactTextString(m) } func (*TakeSnapshotResponse) ProtoMessage() {} func (*TakeSnapshotResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{6} + return fileDescriptor_3ec90cbc4aa12fc6, []int{6} } func (m *TakeSnapshotResponse) XXX_Unmarshal(b []byte) error { @@ -395,7 +395,7 @@ func (m *DisposeWorkspaceRequest) Reset() { *m = DisposeWorkspaceRequest func (m *DisposeWorkspaceRequest) String() string { return proto.CompactTextString(m) } func (*DisposeWorkspaceRequest) ProtoMessage() {} func (*DisposeWorkspaceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{7} + return fileDescriptor_3ec90cbc4aa12fc6, []int{7} } func (m *DisposeWorkspaceRequest) XXX_Unmarshal(b []byte) error { @@ -433,7 +433,7 @@ func (m *DisposeWorkspaceRequest) GetBackup() bool { type DisposeWorkspaceResponse struct { // git_status is the current state of the Git repo in this workspace prior to disposal. // If the workspace has no Git repo at its checkout location, this is nil. - GitStatus *api.GitStatus `protobuf:"bytes,1,opt,name=git_status,json=gitStatus,proto3" json:"gitStatus,omitempty"` + GitStatus *api.GitStatus `protobuf:"bytes,1,opt,name=git_status,json=gitStatus,proto3" json:"git_status,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -443,7 +443,7 @@ func (m *DisposeWorkspaceResponse) Reset() { *m = DisposeWorkspaceRespon func (m *DisposeWorkspaceResponse) String() string { return proto.CompactTextString(m) } func (*DisposeWorkspaceResponse) ProtoMessage() {} func (*DisposeWorkspaceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c7b25cc593b9e14, []int{8} + return fileDescriptor_3ec90cbc4aa12fc6, []int{8} } func (m *DisposeWorkspaceResponse) XXX_Unmarshal(b []byte) error { @@ -472,59 +472,60 @@ func (m *DisposeWorkspaceResponse) GetGitStatus() *api.GitStatus { } func init() { - proto.RegisterEnum("wssync.WorkspaceContentState", WorkspaceContentState_name, WorkspaceContentState_value) - proto.RegisterType((*InitWorkspaceRequest)(nil), "wssync.InitWorkspaceRequest") - proto.RegisterType((*WorkspaceMetadata)(nil), "wssync.WorkspaceMetadata") - proto.RegisterType((*InitWorkspaceResponse)(nil), "wssync.InitWorkspaceResponse") - proto.RegisterType((*WaitForInitRequest)(nil), "wssync.WaitForInitRequest") - proto.RegisterType((*WaitForInitResponse)(nil), "wssync.WaitForInitResponse") - proto.RegisterType((*TakeSnapshotRequest)(nil), "wssync.TakeSnapshotRequest") - proto.RegisterType((*TakeSnapshotResponse)(nil), "wssync.TakeSnapshotResponse") - proto.RegisterType((*DisposeWorkspaceRequest)(nil), "wssync.DisposeWorkspaceRequest") - proto.RegisterType((*DisposeWorkspaceResponse)(nil), "wssync.DisposeWorkspaceResponse") + proto.RegisterEnum("wsdaemon.WorkspaceContentState", WorkspaceContentState_name, WorkspaceContentState_value) + proto.RegisterType((*InitWorkspaceRequest)(nil), "wsdaemon.InitWorkspaceRequest") + proto.RegisterType((*WorkspaceMetadata)(nil), "wsdaemon.WorkspaceMetadata") + proto.RegisterType((*InitWorkspaceResponse)(nil), "wsdaemon.InitWorkspaceResponse") + proto.RegisterType((*WaitForInitRequest)(nil), "wsdaemon.WaitForInitRequest") + proto.RegisterType((*WaitForInitResponse)(nil), "wsdaemon.WaitForInitResponse") + proto.RegisterType((*TakeSnapshotRequest)(nil), "wsdaemon.TakeSnapshotRequest") + proto.RegisterType((*TakeSnapshotResponse)(nil), "wsdaemon.TakeSnapshotResponse") + proto.RegisterType((*DisposeWorkspaceRequest)(nil), "wsdaemon.DisposeWorkspaceRequest") + proto.RegisterType((*DisposeWorkspaceResponse)(nil), "wsdaemon.DisposeWorkspaceResponse") } func init() { - proto.RegisterFile("wssync.proto", fileDescriptor_9c7b25cc593b9e14) -} - -var fileDescriptor_9c7b25cc593b9e14 = []byte{ - // 557 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x5d, 0x8f, 0xd2, 0x4c, - 0x14, 0xde, 0x76, 0x77, 0x79, 0x97, 0xc3, 0x7e, 0xf4, 0x1d, 0x40, 0x6a, 0x5d, 0x23, 0x69, 0x76, - 0x23, 0x6b, 0x02, 0x24, 0x18, 0x13, 0x6f, 0x41, 0xd9, 0x95, 0xb8, 0x8b, 0x58, 0x50, 0x12, 0x6f, - 0x9a, 0xa1, 0x9d, 0x65, 0x27, 0x40, 0xa7, 0x76, 0xa6, 0x12, 0xbd, 0xf6, 0x4f, 0xfa, 0x6f, 0x4c, - 0xdb, 0xa1, 0xcb, 0x67, 0xbc, 0x9b, 0xd3, 0xe7, 0xe3, 0x4c, 0xcf, 0x73, 0x5a, 0x38, 0x9e, 0x73, - 0xfe, 0xd3, 0x73, 0x6a, 0x7e, 0xc0, 0x04, 0x43, 0x99, 0xa4, 0x32, 0x2e, 0x1d, 0xe6, 0x09, 0xe2, - 0x89, 0x2a, 0x27, 0xc1, 0x0f, 0xea, 0x90, 0x2a, 0xf6, 0x69, 0x9d, 0x7a, 0x54, 0x50, 0x3c, 0xa5, - 0xbf, 0x48, 0x90, 0xd0, 0xcd, 0xdf, 0x2a, 0x14, 0x3a, 0x1e, 0x15, 0x43, 0x16, 0x4c, 0xb8, 0x8f, - 0x1d, 0x62, 0x91, 0xef, 0x21, 0xe1, 0x02, 0x9d, 0x82, 0x4a, 0x5d, 0x5d, 0x29, 0x2b, 0x95, 0xac, - 0xa5, 0x52, 0x17, 0xbd, 0x81, 0xa3, 0x19, 0x11, 0xd8, 0xc5, 0x02, 0xeb, 0x6a, 0x59, 0xa9, 0xe4, - 0x1a, 0x4f, 0x6b, 0xb2, 0x71, 0xaa, 0xbd, 0x93, 0x04, 0x2b, 0xa5, 0xa2, 0x6b, 0xc8, 0x2d, 0x35, - 0xd5, 0xf7, 0x63, 0xe5, 0x45, 0x4d, 0x5e, 0x4e, 0xde, 0xed, 0xd1, 0xa1, 0xf3, 0xc8, 0xb5, 0x96, - 0x85, 0xa8, 0x01, 0xc5, 0xfb, 0x70, 0x3a, 0xb5, 0xe7, 0x0b, 0xa6, 0x3d, 0xc2, 0xce, 0x24, 0xf4, - 0xf5, 0x83, 0xb2, 0x52, 0x39, 0xb2, 0xf2, 0x11, 0x98, 0xba, 0xb4, 0x62, 0x08, 0x5d, 0x81, 0x26, - 0xfb, 0xd8, 0x33, 0xec, 0xd1, 0x7b, 0xc2, 0x85, 0x7e, 0x58, 0x56, 0x2a, 0xc7, 0xd6, 0x99, 0x7c, - 0x7e, 0x27, 0x1f, 0x9b, 0x2d, 0xf8, 0x7f, 0xe3, 0x2d, 0x50, 0x01, 0x0e, 0xd9, 0xdc, 0x23, 0x81, - 0x9c, 0x42, 0x52, 0xa0, 0x12, 0xfc, 0x17, 0xbd, 0x9d, 0x4d, 0xdd, 0x78, 0x0e, 0x59, 0x2b, 0x13, - 0x95, 0x1d, 0xd7, 0x2c, 0x41, 0x71, 0x6d, 0x92, 0xdc, 0x67, 0x1e, 0x27, 0xe6, 0x05, 0xa0, 0x21, - 0xa6, 0xe2, 0x9a, 0x05, 0x11, 0xbe, 0x63, 0xc0, 0x66, 0x11, 0xf2, 0x2b, 0x2c, 0x29, 0xbe, 0x84, - 0xfc, 0x00, 0x4f, 0x48, 0xdf, 0xc3, 0x3e, 0x7f, 0x60, 0x3b, 0xd5, 0x15, 0x28, 0xac, 0xd2, 0x12, - 0x39, 0xd2, 0x60, 0x3f, 0x0c, 0xa6, 0x92, 0x18, 0x1d, 0xcd, 0x26, 0x94, 0xde, 0x53, 0xee, 0x33, - 0x4e, 0xfe, 0x99, 0xf9, 0x13, 0xc8, 0xc8, 0x29, 0xab, 0xf1, 0x94, 0x65, 0x65, 0x0e, 0x40, 0xdf, - 0xb4, 0x90, 0x0d, 0xdf, 0x02, 0x8c, 0xa9, 0xb0, 0xb9, 0xc0, 0x22, 0xe4, 0xb1, 0x57, 0xb4, 0x29, - 0x6b, 0x79, 0xdf, 0x50, 0xd1, 0x8f, 0x09, 0x56, 0x76, 0xbc, 0x38, 0xbe, 0xfa, 0x0c, 0xc5, 0xd4, - 0xee, 0x5d, 0xc2, 0x8f, 0x10, 0x82, 0x8e, 0xe0, 0xa0, 0xfb, 0xa9, 0xdb, 0xd6, 0xf6, 0xd0, 0x29, - 0x40, 0xbf, 0x3d, 0x18, 0x74, 0xba, 0x37, 0xf6, 0x97, 0x9e, 0xa6, 0xa0, 0x13, 0xc8, 0x36, 0xbf, - 0x36, 0x3b, 0xb7, 0xcd, 0xd6, 0x6d, 0x5b, 0x53, 0xd1, 0x19, 0xe4, 0x86, 0x56, 0xb3, 0xd7, 0x93, - 0xf8, 0x7e, 0xe3, 0x8f, 0x0a, 0xa5, 0x0d, 0xcf, 0xe4, 0x0e, 0xa8, 0x0b, 0x27, 0x2b, 0x71, 0xa1, - 0xf3, 0xc5, 0x3e, 0x6f, 0xfb, 0x1e, 0x8c, 0xe7, 0x3b, 0x50, 0x19, 0xd3, 0x1e, 0xfa, 0x00, 0xb9, - 0xa5, 0xfc, 0x90, 0x91, 0x7e, 0x1d, 0x1b, 0xd1, 0x1b, 0xcf, 0xb6, 0x62, 0xa9, 0xd3, 0x47, 0x38, - 0x5e, 0xce, 0x12, 0xa5, 0xf4, 0x2d, 0x8b, 0x60, 0x9c, 0x6f, 0x07, 0x53, 0xb3, 0x21, 0x68, 0xeb, - 0x59, 0xa1, 0x17, 0x0b, 0xcd, 0x8e, 0x45, 0x30, 0xca, 0xbb, 0x09, 0x0b, 0xe3, 0xd6, 0xd5, 0xb7, - 0x97, 0x63, 0x2a, 0x1e, 0xc2, 0x51, 0xcd, 0x61, 0xb3, 0xfa, 0x98, 0x0a, 0x9f, 0xb9, 0x55, 0xca, - 0xe4, 0xa9, 0x3e, 0xe7, 0xd5, 0xc8, 0xa1, 0x8e, 0x7d, 0x3a, 0xca, 0xc4, 0xff, 0x9a, 0xd7, 0x7f, - 0x03, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x45, 0x30, 0xdf, 0xaa, 0x04, 0x00, 0x00, + proto.RegisterFile("daemon.proto", fileDescriptor_3ec90cbc4aa12fc6) +} + +var fileDescriptor_3ec90cbc4aa12fc6 = []byte{ + // 562 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x5d, 0x73, 0xd2, 0x4c, + 0x14, 0x6e, 0xd2, 0x8f, 0x17, 0x0e, 0xfd, 0xc8, 0xbb, 0x2d, 0x12, 0x51, 0x2b, 0x66, 0xda, 0x19, + 0xaa, 0x03, 0xcc, 0xe0, 0x85, 0xde, 0x82, 0xd2, 0x0e, 0x33, 0x94, 0x62, 0x40, 0x99, 0xd1, 0x8b, + 0xcc, 0x42, 0xb6, 0x74, 0x07, 0xc8, 0xc6, 0xec, 0x46, 0x66, 0xfc, 0x01, 0xfe, 0x57, 0xff, 0x85, + 0x93, 0x64, 0x09, 0x01, 0x1a, 0xbd, 0xdb, 0x93, 0xe7, 0xe3, 0x6c, 0xce, 0x73, 0x12, 0x38, 0xb4, + 0x31, 0x99, 0x33, 0xa7, 0xea, 0x7a, 0x4c, 0x30, 0x94, 0x59, 0xf0, 0xa8, 0x2e, 0x5e, 0x8e, 0x99, + 0x23, 0x88, 0x23, 0x2a, 0x9c, 0x78, 0x3f, 0xe8, 0x98, 0x54, 0xb0, 0x4b, 0x6b, 0xd4, 0xa1, 0x82, + 0xe2, 0x19, 0xfd, 0x49, 0xbc, 0x48, 0x60, 0xfc, 0x52, 0xe1, 0xac, 0xed, 0x50, 0x31, 0x64, 0xde, + 0x94, 0xbb, 0x78, 0x4c, 0x4c, 0xf2, 0xdd, 0x27, 0x5c, 0xa0, 0x63, 0x50, 0xa9, 0xad, 0x2b, 0x25, + 0xa5, 0x9c, 0x35, 0x55, 0x6a, 0xa3, 0x77, 0x90, 0x99, 0x13, 0x81, 0x6d, 0x2c, 0xb0, 0xae, 0x96, + 0x94, 0x72, 0xae, 0xfe, 0xac, 0xba, 0x6c, 0x56, 0x8d, 0xd5, 0xb7, 0x92, 0x62, 0xc6, 0x64, 0x74, + 0x0d, 0xb9, 0x44, 0x5b, 0x7d, 0x37, 0xd4, 0x5e, 0x54, 0xe5, 0xf5, 0xe4, 0xed, 0x56, 0x0e, 0xed, + 0x15, 0xd7, 0x4c, 0x0a, 0x51, 0x1d, 0xf2, 0xf7, 0xfe, 0x6c, 0x66, 0x2d, 0x96, 0x4c, 0x6b, 0x84, + 0xc7, 0x53, 0xdf, 0xd5, 0xf7, 0x4a, 0x4a, 0x39, 0x63, 0x9e, 0x06, 0x60, 0xec, 0xd2, 0x0c, 0x21, + 0x74, 0x05, 0x9a, 0xec, 0x63, 0xcd, 0xb1, 0x43, 0xef, 0x09, 0x17, 0xfa, 0x7e, 0x49, 0x29, 0x1f, + 0x9a, 0x27, 0xf2, 0xf9, 0xad, 0x7c, 0x6c, 0x34, 0xe1, 0xff, 0xad, 0xb7, 0x40, 0x67, 0xb0, 0xcf, + 0x16, 0x0e, 0xf1, 0xe4, 0x1c, 0xa2, 0x02, 0x15, 0xe0, 0xbf, 0xe0, 0xed, 0x2c, 0x6a, 0x87, 0x93, + 0xc8, 0x9a, 0x07, 0x41, 0xd9, 0xb6, 0x8d, 0x02, 0xe4, 0x37, 0x66, 0xc9, 0x5d, 0xe6, 0x70, 0x62, + 0x5c, 0x00, 0x1a, 0x62, 0x2a, 0xae, 0x99, 0x17, 0xe0, 0x29, 0x23, 0x36, 0xf2, 0x70, 0xba, 0xc6, + 0x92, 0xe2, 0x4b, 0x38, 0x1d, 0xe0, 0x29, 0xe9, 0x3b, 0xd8, 0xe5, 0x0f, 0x2c, 0x55, 0x5d, 0x86, + 0xb3, 0x75, 0x5a, 0x24, 0x47, 0x1a, 0xec, 0xfa, 0xde, 0x4c, 0x12, 0x83, 0xa3, 0xd1, 0x80, 0xc2, + 0x47, 0xca, 0x5d, 0xc6, 0xc9, 0x3f, 0x53, 0x7f, 0x02, 0x07, 0x72, 0xca, 0x6a, 0x38, 0x65, 0x59, + 0x19, 0x03, 0xd0, 0xb7, 0x2d, 0x64, 0xc3, 0xf7, 0x00, 0x13, 0x2a, 0x2c, 0x2e, 0xb0, 0xf0, 0x79, + 0xe8, 0x95, 0xab, 0x3f, 0xdd, 0xcc, 0xfb, 0x86, 0x8a, 0x7e, 0x48, 0x30, 0xb3, 0x93, 0xe5, 0xf1, + 0xf5, 0x27, 0xc8, 0xc7, 0x76, 0x1f, 0x22, 0x7e, 0x80, 0x10, 0x94, 0x81, 0xbd, 0xee, 0x5d, 0xb7, + 0xa5, 0xed, 0xa0, 0x63, 0x80, 0x7e, 0x6b, 0x30, 0x68, 0x77, 0x6f, 0xac, 0xcf, 0x3d, 0x4d, 0x41, + 0x47, 0x90, 0x6d, 0x7c, 0x69, 0xb4, 0x3b, 0x8d, 0x66, 0xa7, 0xa5, 0xa9, 0xe8, 0x04, 0x72, 0x43, + 0xb3, 0xd1, 0xeb, 0x49, 0x7c, 0xb7, 0xfe, 0x5b, 0x85, 0xc2, 0x96, 0x67, 0x74, 0x07, 0x64, 0xc2, + 0xd1, 0x5a, 0x5c, 0xe8, 0x7c, 0xb5, 0xd1, 0x8f, 0x7d, 0x13, 0xc5, 0x97, 0xa9, 0xb8, 0x8c, 0x6a, + 0x07, 0x75, 0x20, 0x97, 0xc8, 0x10, 0x3d, 0x4f, 0x7c, 0x23, 0x5b, 0x0b, 0x50, 0x7c, 0x91, 0x82, + 0xc6, 0x6e, 0x77, 0x70, 0x98, 0xcc, 0x14, 0x25, 0x04, 0x8f, 0xac, 0x44, 0xf1, 0x3c, 0x0d, 0x8e, + 0x0d, 0xbf, 0x81, 0xb6, 0x99, 0x1b, 0x7a, 0xb5, 0x52, 0xa5, 0xac, 0x45, 0xd1, 0xf8, 0x1b, 0x65, + 0x69, 0xde, 0x7c, 0xf3, 0xf5, 0x6a, 0x42, 0xc5, 0x83, 0x3f, 0xaa, 0x8e, 0xd9, 0xbc, 0x36, 0xa1, + 0xc2, 0x65, 0x76, 0x85, 0x32, 0x79, 0xaa, 0x2d, 0x78, 0x25, 0xf2, 0xa8, 0x61, 0x97, 0x8e, 0x0e, + 0xc2, 0xff, 0xcf, 0xdb, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcf, 0xe8, 0x0b, 0xd6, 0xc0, 0x04, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -552,7 +553,7 @@ type WorkspaceContentServiceClient interface { } type workspaceContentServiceClient struct { - cc grpc.ClientConnInterface `json:"cc,omitempty"` + cc grpc.ClientConnInterface } func NewWorkspaceContentServiceClient(cc grpc.ClientConnInterface) WorkspaceContentServiceClient { @@ -561,7 +562,7 @@ func NewWorkspaceContentServiceClient(cc grpc.ClientConnInterface) WorkspaceCont func (c *workspaceContentServiceClient) InitWorkspace(ctx context.Context, in *InitWorkspaceRequest, opts ...grpc.CallOption) (*InitWorkspaceResponse, error) { out := new(InitWorkspaceResponse) - err := c.cc.Invoke(ctx, "/wssync.WorkspaceContentService/InitWorkspace", in, out, opts...) + err := c.cc.Invoke(ctx, "/wsdaemon.WorkspaceContentService/InitWorkspace", in, out, opts...) if err != nil { return nil, err } @@ -570,7 +571,7 @@ func (c *workspaceContentServiceClient) InitWorkspace(ctx context.Context, in *I func (c *workspaceContentServiceClient) WaitForInit(ctx context.Context, in *WaitForInitRequest, opts ...grpc.CallOption) (*WaitForInitResponse, error) { out := new(WaitForInitResponse) - err := c.cc.Invoke(ctx, "/wssync.WorkspaceContentService/WaitForInit", in, out, opts...) + err := c.cc.Invoke(ctx, "/wsdaemon.WorkspaceContentService/WaitForInit", in, out, opts...) if err != nil { return nil, err } @@ -579,7 +580,7 @@ func (c *workspaceContentServiceClient) WaitForInit(ctx context.Context, in *Wai func (c *workspaceContentServiceClient) TakeSnapshot(ctx context.Context, in *TakeSnapshotRequest, opts ...grpc.CallOption) (*TakeSnapshotResponse, error) { out := new(TakeSnapshotResponse) - err := c.cc.Invoke(ctx, "/wssync.WorkspaceContentService/TakeSnapshot", in, out, opts...) + err := c.cc.Invoke(ctx, "/wsdaemon.WorkspaceContentService/TakeSnapshot", in, out, opts...) if err != nil { return nil, err } @@ -588,7 +589,7 @@ func (c *workspaceContentServiceClient) TakeSnapshot(ctx context.Context, in *Ta func (c *workspaceContentServiceClient) DisposeWorkspace(ctx context.Context, in *DisposeWorkspaceRequest, opts ...grpc.CallOption) (*DisposeWorkspaceResponse, error) { out := new(DisposeWorkspaceResponse) - err := c.cc.Invoke(ctx, "/wssync.WorkspaceContentService/DisposeWorkspace", in, out, opts...) + err := c.cc.Invoke(ctx, "/wsdaemon.WorkspaceContentService/DisposeWorkspace", in, out, opts...) if err != nil { return nil, err } @@ -640,7 +641,7 @@ func _WorkspaceContentService_InitWorkspace_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wssync.WorkspaceContentService/InitWorkspace", + FullMethod: "/wsdaemon.WorkspaceContentService/InitWorkspace", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WorkspaceContentServiceServer).InitWorkspace(ctx, req.(*InitWorkspaceRequest)) @@ -658,7 +659,7 @@ func _WorkspaceContentService_WaitForInit_Handler(srv interface{}, ctx context.C } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wssync.WorkspaceContentService/WaitForInit", + FullMethod: "/wsdaemon.WorkspaceContentService/WaitForInit", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WorkspaceContentServiceServer).WaitForInit(ctx, req.(*WaitForInitRequest)) @@ -676,7 +677,7 @@ func _WorkspaceContentService_TakeSnapshot_Handler(srv interface{}, ctx context. } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wssync.WorkspaceContentService/TakeSnapshot", + FullMethod: "/wsdaemon.WorkspaceContentService/TakeSnapshot", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WorkspaceContentServiceServer).TakeSnapshot(ctx, req.(*TakeSnapshotRequest)) @@ -694,7 +695,7 @@ func _WorkspaceContentService_DisposeWorkspace_Handler(srv interface{}, ctx cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wssync.WorkspaceContentService/DisposeWorkspace", + FullMethod: "/wsdaemon.WorkspaceContentService/DisposeWorkspace", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WorkspaceContentServiceServer).DisposeWorkspace(ctx, req.(*DisposeWorkspaceRequest)) @@ -703,7 +704,7 @@ func _WorkspaceContentService_DisposeWorkspace_Handler(srv interface{}, ctx cont } var _WorkspaceContentService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "wssync.WorkspaceContentService", + ServiceName: "wsdaemon.WorkspaceContentService", HandlerType: (*WorkspaceContentServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -724,5 +725,5 @@ var _WorkspaceContentService_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "wssync.proto", + Metadata: "daemon.proto", } diff --git a/components/ws-daemon-api/go/go.mod b/components/ws-daemon-api/go/go.mod index 94fe02ce256883..202c048566a0a4 100644 --- a/components/ws-daemon-api/go/go.mod +++ b/components/ws-daemon-api/go/go.mod @@ -3,6 +3,7 @@ module github.com/gitpod-io/gitpod/ws-daemon/api go 1.14 require ( + github.com/fatih/gomodifytags v1.9.0 // indirect github.com/gitpod-io/gitpod/content-service/api v0.0.0-00010101000000-000000000000 github.com/golang/mock v1.4.3 github.com/golang/protobuf v1.3.5 diff --git a/components/ws-daemon-api/go/go.sum b/components/ws-daemon-api/go/go.sum index a1a2974e520d70..b0cdbb9e0af25b 100644 --- a/components/ws-daemon-api/go/go.sum +++ b/components/ws-daemon-api/go/go.sum @@ -6,6 +6,12 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= +github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= +github.com/fatih/gomodifytags v1.9.0 h1:57iX6liPpgl5LiFIc/gf6opTK5jkBSjuZPsKvRJKvFU= +github.com/fatih/gomodifytags v1.9.0/go.mod h1:TbUyEjH1Zo0GkJd2Q52oVYqYcJ0eGNqG8bsiOb75P9c= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= @@ -42,6 +48,7 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20180824175216-6c1c5e93cdc1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= diff --git a/components/ws-daemon-api/go/workspace.pb.go b/components/ws-daemon-api/go/workspace.pb.go index 1a6f0ef5dcd539..f92cbcb1e5ee3a 100644 --- a/components/ws-daemon-api/go/workspace.pb.go +++ b/components/ws-daemon-api/go/workspace.pb.go @@ -231,6 +231,163 @@ func (m *GitStatusResponse) GetRepo() *api.GitStatus { return nil } +type UidmapCanaryResponse struct { + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + ErrorCode uint32 `protobuf:"varint,2,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UidmapCanaryResponse) Reset() { *m = UidmapCanaryResponse{} } +func (m *UidmapCanaryResponse) String() string { return proto.CompactTextString(m) } +func (*UidmapCanaryResponse) ProtoMessage() {} +func (*UidmapCanaryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dac718ecaafc2333, []int{6} +} + +func (m *UidmapCanaryResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UidmapCanaryResponse.Unmarshal(m, b) +} +func (m *UidmapCanaryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UidmapCanaryResponse.Marshal(b, m, deterministic) +} +func (m *UidmapCanaryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UidmapCanaryResponse.Merge(m, src) +} +func (m *UidmapCanaryResponse) XXX_Size() int { + return xxx_messageInfo_UidmapCanaryResponse.Size(m) +} +func (m *UidmapCanaryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UidmapCanaryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_UidmapCanaryResponse proto.InternalMessageInfo + +func (m *UidmapCanaryResponse) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *UidmapCanaryResponse) GetErrorCode() uint32 { + if m != nil { + return m.ErrorCode + } + return 0 +} + +type UidmapCanaryRequest struct { + Pid int64 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` + Gid bool `protobuf:"varint,2,opt,name=gid,proto3" json:"gid,omitempty"` + Mapping []*UidmapCanaryRequest_Mapping `protobuf:"bytes,3,rep,name=mapping,proto3" json:"mapping,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UidmapCanaryRequest) Reset() { *m = UidmapCanaryRequest{} } +func (m *UidmapCanaryRequest) String() string { return proto.CompactTextString(m) } +func (*UidmapCanaryRequest) ProtoMessage() {} +func (*UidmapCanaryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dac718ecaafc2333, []int{7} +} + +func (m *UidmapCanaryRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UidmapCanaryRequest.Unmarshal(m, b) +} +func (m *UidmapCanaryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UidmapCanaryRequest.Marshal(b, m, deterministic) +} +func (m *UidmapCanaryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UidmapCanaryRequest.Merge(m, src) +} +func (m *UidmapCanaryRequest) XXX_Size() int { + return xxx_messageInfo_UidmapCanaryRequest.Size(m) +} +func (m *UidmapCanaryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UidmapCanaryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_UidmapCanaryRequest proto.InternalMessageInfo + +func (m *UidmapCanaryRequest) GetPid() int64 { + if m != nil { + return m.Pid + } + return 0 +} + +func (m *UidmapCanaryRequest) GetGid() bool { + if m != nil { + return m.Gid + } + return false +} + +func (m *UidmapCanaryRequest) GetMapping() []*UidmapCanaryRequest_Mapping { + if m != nil { + return m.Mapping + } + return nil +} + +type UidmapCanaryRequest_Mapping struct { + ContainerId uint32 `protobuf:"varint,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + HostId uint32 `protobuf:"varint,2,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"` + Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UidmapCanaryRequest_Mapping) Reset() { *m = UidmapCanaryRequest_Mapping{} } +func (m *UidmapCanaryRequest_Mapping) String() string { return proto.CompactTextString(m) } +func (*UidmapCanaryRequest_Mapping) ProtoMessage() {} +func (*UidmapCanaryRequest_Mapping) Descriptor() ([]byte, []int) { + return fileDescriptor_dac718ecaafc2333, []int{7, 0} +} + +func (m *UidmapCanaryRequest_Mapping) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UidmapCanaryRequest_Mapping.Unmarshal(m, b) +} +func (m *UidmapCanaryRequest_Mapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UidmapCanaryRequest_Mapping.Marshal(b, m, deterministic) +} +func (m *UidmapCanaryRequest_Mapping) XXX_Merge(src proto.Message) { + xxx_messageInfo_UidmapCanaryRequest_Mapping.Merge(m, src) +} +func (m *UidmapCanaryRequest_Mapping) XXX_Size() int { + return xxx_messageInfo_UidmapCanaryRequest_Mapping.Size(m) +} +func (m *UidmapCanaryRequest_Mapping) XXX_DiscardUnknown() { + xxx_messageInfo_UidmapCanaryRequest_Mapping.DiscardUnknown(m) +} + +var xxx_messageInfo_UidmapCanaryRequest_Mapping proto.InternalMessageInfo + +func (m *UidmapCanaryRequest_Mapping) GetContainerId() uint32 { + if m != nil { + return m.ContainerId + } + return 0 +} + +func (m *UidmapCanaryRequest_Mapping) GetHostId() uint32 { + if m != nil { + return m.HostId + } + return 0 +} + +func (m *UidmapCanaryRequest_Mapping) GetSize() uint32 { + if m != nil { + return m.Size + } + return 0 +} + func init() { proto.RegisterType((*BackupCanaryRequest)(nil), "wsbs.BackupCanaryRequest") proto.RegisterType((*BackupCanaryResponse)(nil), "wsbs.BackupCanaryResponse") @@ -238,6 +395,9 @@ func init() { proto.RegisterType((*PauseTheiaResponse)(nil), "wsbs.PauseTheiaResponse") proto.RegisterType((*GitStatusRequest)(nil), "wsbs.GitStatusRequest") proto.RegisterType((*GitStatusResponse)(nil), "wsbs.GitStatusResponse") + proto.RegisterType((*UidmapCanaryResponse)(nil), "wsbs.UidmapCanaryResponse") + proto.RegisterType((*UidmapCanaryRequest)(nil), "wsbs.UidmapCanaryRequest") + proto.RegisterType((*UidmapCanaryRequest_Mapping)(nil), "wsbs.UidmapCanaryRequest.Mapping") } func init() { @@ -245,27 +405,38 @@ func init() { } var fileDescriptor_dac718ecaafc2333 = []byte{ - // 317 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x41, 0x4f, 0xea, 0x40, - 0x14, 0x85, 0x99, 0x17, 0xf2, 0xde, 0xf3, 0x6a, 0xa2, 0x0c, 0x28, 0xa5, 0x2b, 0xd2, 0xc4, 0x58, - 0x17, 0x6d, 0x09, 0xee, 0x5d, 0xc0, 0x42, 0x8d, 0x1b, 0x83, 0x26, 0x26, 0xee, 0x86, 0xf1, 0x06, - 0x26, 0xe0, 0xcc, 0x38, 0x77, 0x2a, 0xc1, 0xff, 0xeb, 0xff, 0x30, 0xd2, 0x56, 0x50, 0xd8, 0xb5, - 0xe7, 0x9e, 0x39, 0x73, 0xbf, 0x33, 0x70, 0xb8, 0x30, 0x6e, 0x46, 0x56, 0x48, 0x4c, 0xad, 0x33, - 0xde, 0xf0, 0xfa, 0x82, 0xc6, 0x14, 0x9e, 0x4a, 0xa3, 0x3d, 0x6a, 0x9f, 0x10, 0xba, 0x37, 0x25, - 0x31, 0x11, 0x56, 0x65, 0x4a, 0x2b, 0xaf, 0xc4, 0x5c, 0xbd, 0xa3, 0x2b, 0xcc, 0xd1, 0x31, 0x34, - 0x07, 0x42, 0xce, 0x72, 0x3b, 0x14, 0x5a, 0xb8, 0xe5, 0x08, 0x5f, 0x73, 0x24, 0x1f, 0xf5, 0xa0, - 0xf5, 0x53, 0x26, 0x6b, 0x34, 0x21, 0x0f, 0xe0, 0x1f, 0xe5, 0x52, 0x22, 0x51, 0xf0, 0xa7, 0xcb, - 0xe2, 0xff, 0xa3, 0xea, 0x37, 0x6a, 0x42, 0xe3, 0x4e, 0xe4, 0x84, 0x0f, 0x53, 0x54, 0xa2, 0x8a, - 0x69, 0x01, 0xdf, 0x14, 0x8b, 0x90, 0x88, 0xc3, 0xd1, 0x95, 0xf2, 0xf7, 0x5e, 0xf8, 0x9c, 0x2a, - 0xe7, 0x00, 0x1a, 0x1b, 0x5a, 0x79, 0x5b, 0x02, 0x75, 0x87, 0xd6, 0x04, 0xac, 0xcb, 0xe2, 0xfd, - 0x7e, 0x27, 0x2d, 0x91, 0x4a, 0xa2, 0x74, 0x7d, 0x60, 0x65, 0xeb, 0x7f, 0x30, 0x68, 0xdc, 0xe8, - 0xc7, 0xaa, 0x8e, 0x6b, 0x9c, 0x5b, 0x74, 0xfc, 0x16, 0x0e, 0x36, 0x51, 0x78, 0x98, 0x7e, 0xf5, - 0x93, 0xee, 0xc2, 0x0b, 0x3b, 0xbb, 0x66, 0xc5, 0x82, 0xb5, 0x98, 0xf5, 0x18, 0x1f, 0x02, 0xac, - 0x81, 0x78, 0xbb, 0xb0, 0x6f, 0x71, 0x87, 0xc1, 0xf6, 0xa0, 0x64, 0xaf, 0xc5, 0x8c, 0x5f, 0xc2, - 0xde, 0xf7, 0xea, 0xfc, 0xa4, 0xb0, 0xfe, 0x2e, 0x24, 0x6c, 0x6f, 0xe9, 0x55, 0xc2, 0xe0, 0xfc, - 0xe9, 0x6c, 0xa2, 0xfc, 0x34, 0x1f, 0xa7, 0xd2, 0xbc, 0x64, 0x13, 0xe5, 0xad, 0x79, 0x4e, 0x94, - 0x29, 0xbf, 0xb2, 0x05, 0x25, 0xb4, 0xd4, 0x32, 0x13, 0x56, 0x8d, 0xff, 0xae, 0x5e, 0xf9, 0xe2, - 0x33, 0x00, 0x00, 0xff, 0xff, 0x28, 0x91, 0x8f, 0xe2, 0x25, 0x02, 0x00, 0x00, + // 481 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x5d, 0x8b, 0xd3, 0x40, + 0x14, 0xdd, 0x6c, 0xca, 0xd6, 0xde, 0x6e, 0x71, 0x3b, 0xad, 0x36, 0x1b, 0x10, 0xba, 0x01, 0x21, + 0x22, 0x49, 0x97, 0xfa, 0x28, 0xf8, 0xd0, 0x3e, 0x68, 0x11, 0x51, 0xa2, 0x22, 0xfa, 0x52, 0xa6, + 0xc9, 0x25, 0x1d, 0x76, 0x93, 0x19, 0x67, 0x26, 0x16, 0xf7, 0x67, 0xf9, 0x4f, 0xfc, 0x47, 0x92, + 0x8f, 0xd9, 0x6d, 0x6d, 0xde, 0xee, 0x3d, 0xb9, 0x73, 0xe6, 0x9e, 0x39, 0x27, 0xf0, 0x78, 0xc7, + 0xe5, 0x8d, 0x12, 0x34, 0xc6, 0x50, 0x48, 0xae, 0x39, 0xe9, 0xec, 0xd4, 0x46, 0xb9, 0xcf, 0x63, + 0x9e, 0x6b, 0xcc, 0x75, 0xa0, 0x50, 0xfe, 0x62, 0x31, 0x06, 0x54, 0xb0, 0x19, 0xcb, 0x99, 0x66, + 0xf4, 0x96, 0xdd, 0xa1, 0xac, 0x87, 0xbd, 0x27, 0x30, 0x5a, 0xd0, 0xf8, 0xa6, 0x10, 0x4b, 0x9a, + 0x53, 0xf9, 0x3b, 0xc2, 0x9f, 0x05, 0x2a, 0xed, 0x5d, 0xc3, 0xf8, 0x10, 0x56, 0x82, 0xe7, 0x0a, + 0x89, 0x03, 0x5d, 0x55, 0xc4, 0x31, 0x2a, 0xe5, 0x9c, 0x4e, 0x2d, 0xff, 0x51, 0x64, 0x5a, 0x6f, + 0x04, 0xc3, 0x4f, 0xb4, 0x50, 0xf8, 0x65, 0x8b, 0x8c, 0x1a, 0x9a, 0x31, 0x90, 0x7d, 0xb0, 0x26, + 0xf1, 0x08, 0x5c, 0xbc, 0x65, 0xfa, 0xb3, 0xa6, 0xba, 0x50, 0x66, 0x72, 0x01, 0xc3, 0x3d, 0xac, + 0xb9, 0x2d, 0x80, 0x8e, 0x44, 0xc1, 0x1d, 0x6b, 0x6a, 0xf9, 0xfd, 0xf9, 0x65, 0xd8, 0x48, 0x6a, + 0x14, 0x85, 0x0f, 0x07, 0xaa, 0x31, 0xef, 0x23, 0x8c, 0xbf, 0xb2, 0x24, 0xa3, 0x2d, 0x4b, 0x67, + 0xa8, 0x14, 0x4d, 0xb1, 0x62, 0xea, 0x45, 0xa6, 0x25, 0xcf, 0x00, 0x50, 0x4a, 0x2e, 0xd7, 0x31, + 0x4f, 0xb0, 0x52, 0x34, 0x88, 0x7a, 0x15, 0xb2, 0xe4, 0x09, 0x7a, 0x7f, 0x2d, 0x18, 0x1d, 0x32, + 0x56, 0xcb, 0x92, 0x0b, 0xb0, 0x05, 0x4b, 0x2a, 0x32, 0x3b, 0x2a, 0xcb, 0x12, 0x49, 0x59, 0xd2, + 0xbc, 0x49, 0x59, 0x92, 0xd7, 0xd0, 0xcd, 0xa8, 0x10, 0x2c, 0x4f, 0x1d, 0x7b, 0x6a, 0xfb, 0xfd, + 0xf9, 0x55, 0x58, 0xfa, 0x12, 0xb6, 0xf0, 0x85, 0x1f, 0xea, 0xc1, 0xc8, 0x9c, 0x70, 0xbf, 0x43, + 0xb7, 0xc1, 0xc8, 0x15, 0x9c, 0x97, 0xb2, 0x29, 0xcb, 0x51, 0xae, 0x9b, 0x4b, 0x07, 0x51, 0xff, + 0x1e, 0x5b, 0x25, 0x64, 0x02, 0xdd, 0x2d, 0x57, 0x7a, 0xdd, 0x2c, 0x30, 0x88, 0xce, 0xca, 0x76, + 0x95, 0x10, 0x02, 0x1d, 0xc5, 0xee, 0xd0, 0xb1, 0x2b, 0xb4, 0xaa, 0xe7, 0x7f, 0x4e, 0x61, 0xb8, + 0xca, 0xbf, 0x99, 0xcc, 0xbc, 0xc3, 0x5b, 0x81, 0x92, 0xbc, 0x87, 0xf3, 0x7d, 0xbf, 0x89, 0x5b, + 0x2f, 0xdb, 0x96, 0x01, 0xf7, 0xb2, 0xed, 0x5b, 0xed, 0xe2, 0x89, 0x6f, 0x5d, 0x5b, 0x64, 0x09, + 0xf0, 0xe0, 0x3a, 0x99, 0xd4, 0xe3, 0x47, 0xe1, 0x70, 0x9d, 0xe3, 0x0f, 0x4d, 0x40, 0x4e, 0x7c, + 0x8b, 0xbc, 0x81, 0xde, 0xbd, 0xbf, 0xe4, 0x69, 0x3d, 0xfa, 0x7f, 0x6a, 0xdc, 0xc9, 0x11, 0x6e, + 0x18, 0x4a, 0x45, 0xfb, 0x4f, 0x6d, 0x14, 0xb5, 0x05, 0xc4, 0x28, 0x6a, 0xb1, 0xa6, 0x56, 0xb4, + 0x78, 0xf9, 0xe3, 0x45, 0xca, 0xf4, 0xb6, 0xd8, 0x84, 0x31, 0xcf, 0x66, 0x29, 0xd3, 0x82, 0x27, + 0x01, 0xe3, 0x4d, 0x35, 0xdb, 0xa9, 0x20, 0xa1, 0x98, 0xf1, 0x7c, 0x46, 0x05, 0xdb, 0x9c, 0x55, + 0x7f, 0xd6, 0xab, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x92, 0x50, 0x81, 0x99, 0x03, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -291,6 +462,8 @@ type InWorkspaceHelperClient interface { // This is a stop-the-world mechanism for preventing concurrent modification during backup. PauseTheia(ctx context.Context, opts ...grpc.CallOption) (InWorkspaceHelper_PauseTheiaClient, error) GitStatus(ctx context.Context, in *GitStatusRequest, opts ...grpc.CallOption) (*GitStatusResponse, error) + // UidmapCanary can establish a uid mapping of a new user namespace spawned within the workspace. + UidmapCanary(ctx context.Context, opts ...grpc.CallOption) (InWorkspaceHelper_UidmapCanaryClient, error) } type inWorkspaceHelperClient struct { @@ -375,6 +548,37 @@ func (c *inWorkspaceHelperClient) GitStatus(ctx context.Context, in *GitStatusRe return out, nil } +func (c *inWorkspaceHelperClient) UidmapCanary(ctx context.Context, opts ...grpc.CallOption) (InWorkspaceHelper_UidmapCanaryClient, error) { + stream, err := c.cc.NewStream(ctx, &_InWorkspaceHelper_serviceDesc.Streams[2], "/wsbs.InWorkspaceHelper/UidmapCanary", opts...) + if err != nil { + return nil, err + } + x := &inWorkspaceHelperUidmapCanaryClient{stream} + return x, nil +} + +type InWorkspaceHelper_UidmapCanaryClient interface { + Send(*UidmapCanaryResponse) error + Recv() (*UidmapCanaryRequest, error) + grpc.ClientStream +} + +type inWorkspaceHelperUidmapCanaryClient struct { + grpc.ClientStream +} + +func (x *inWorkspaceHelperUidmapCanaryClient) Send(m *UidmapCanaryResponse) error { + return x.ClientStream.SendMsg(m) +} + +func (x *inWorkspaceHelperUidmapCanaryClient) Recv() (*UidmapCanaryRequest, error) { + m := new(UidmapCanaryRequest) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // InWorkspaceHelperServer is the server API for InWorkspaceHelper service. type InWorkspaceHelperServer interface { // BackupCanary can prepare workspace content backups. The canary is supposed to be triggered @@ -388,6 +592,8 @@ type InWorkspaceHelperServer interface { // This is a stop-the-world mechanism for preventing concurrent modification during backup. PauseTheia(InWorkspaceHelper_PauseTheiaServer) error GitStatus(context.Context, *GitStatusRequest) (*GitStatusResponse, error) + // UidmapCanary can establish a uid mapping of a new user namespace spawned within the workspace. + UidmapCanary(InWorkspaceHelper_UidmapCanaryServer) error } // UnimplementedInWorkspaceHelperServer can be embedded to have forward compatible implementations. @@ -403,6 +609,9 @@ func (*UnimplementedInWorkspaceHelperServer) PauseTheia(srv InWorkspaceHelper_Pa func (*UnimplementedInWorkspaceHelperServer) GitStatus(ctx context.Context, req *GitStatusRequest) (*GitStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GitStatus not implemented") } +func (*UnimplementedInWorkspaceHelperServer) UidmapCanary(srv InWorkspaceHelper_UidmapCanaryServer) error { + return status.Errorf(codes.Unimplemented, "method UidmapCanary not implemented") +} func RegisterInWorkspaceHelperServer(s *grpc.Server, srv InWorkspaceHelperServer) { s.RegisterService(&_InWorkspaceHelper_serviceDesc, srv) @@ -478,6 +687,32 @@ func _InWorkspaceHelper_GitStatus_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _InWorkspaceHelper_UidmapCanary_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(InWorkspaceHelperServer).UidmapCanary(&inWorkspaceHelperUidmapCanaryServer{stream}) +} + +type InWorkspaceHelper_UidmapCanaryServer interface { + Send(*UidmapCanaryRequest) error + Recv() (*UidmapCanaryResponse, error) + grpc.ServerStream +} + +type inWorkspaceHelperUidmapCanaryServer struct { + grpc.ServerStream +} + +func (x *inWorkspaceHelperUidmapCanaryServer) Send(m *UidmapCanaryRequest) error { + return x.ServerStream.SendMsg(m) +} + +func (x *inWorkspaceHelperUidmapCanaryServer) Recv() (*UidmapCanaryResponse, error) { + m := new(UidmapCanaryResponse) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + var _InWorkspaceHelper_serviceDesc = grpc.ServiceDesc{ ServiceName: "wsbs.InWorkspaceHelper", HandlerType: (*InWorkspaceHelperServer)(nil), @@ -499,6 +734,12 @@ var _InWorkspaceHelper_serviceDesc = grpc.ServiceDesc{ Handler: _InWorkspaceHelper_PauseTheia_Handler, ClientStreams: true, }, + { + StreamName: "UidmapCanary", + Handler: _InWorkspaceHelper_UidmapCanary_Handler, + ServerStreams: true, + ClientStreams: true, + }, }, Metadata: "workspace.proto", } diff --git a/components/ws-daemon-api/typescript/src/daemon_grpc_pb.js b/components/ws-daemon-api/typescript/src/daemon_grpc_pb.js new file mode 100644 index 00000000000000..0efe54ea90da5f --- /dev/null +++ b/components/ws-daemon-api/typescript/src/daemon_grpc_pb.js @@ -0,0 +1,156 @@ +/** + * Copyright (c) 2020 TypeFox GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('grpc'); +var daemon_pb = require('./daemon_pb.js'); +var content$service$api_initializer_pb = require('@gitpod/content-service/lib'); + +function serialize_wsdaemon_DisposeWorkspaceRequest(arg) { + if (!(arg instanceof daemon_pb.DisposeWorkspaceRequest)) { + throw new Error('Expected argument of type wsdaemon.DisposeWorkspaceRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsdaemon_DisposeWorkspaceRequest(buffer_arg) { + return daemon_pb.DisposeWorkspaceRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_wsdaemon_DisposeWorkspaceResponse(arg) { + if (!(arg instanceof daemon_pb.DisposeWorkspaceResponse)) { + throw new Error('Expected argument of type wsdaemon.DisposeWorkspaceResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsdaemon_DisposeWorkspaceResponse(buffer_arg) { + return daemon_pb.DisposeWorkspaceResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_wsdaemon_InitWorkspaceRequest(arg) { + if (!(arg instanceof daemon_pb.InitWorkspaceRequest)) { + throw new Error('Expected argument of type wsdaemon.InitWorkspaceRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsdaemon_InitWorkspaceRequest(buffer_arg) { + return daemon_pb.InitWorkspaceRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_wsdaemon_InitWorkspaceResponse(arg) { + if (!(arg instanceof daemon_pb.InitWorkspaceResponse)) { + throw new Error('Expected argument of type wsdaemon.InitWorkspaceResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsdaemon_InitWorkspaceResponse(buffer_arg) { + return daemon_pb.InitWorkspaceResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_wsdaemon_TakeSnapshotRequest(arg) { + if (!(arg instanceof daemon_pb.TakeSnapshotRequest)) { + throw new Error('Expected argument of type wsdaemon.TakeSnapshotRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsdaemon_TakeSnapshotRequest(buffer_arg) { + return daemon_pb.TakeSnapshotRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_wsdaemon_TakeSnapshotResponse(arg) { + if (!(arg instanceof daemon_pb.TakeSnapshotResponse)) { + throw new Error('Expected argument of type wsdaemon.TakeSnapshotResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsdaemon_TakeSnapshotResponse(buffer_arg) { + return daemon_pb.TakeSnapshotResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_wsdaemon_WaitForInitRequest(arg) { + if (!(arg instanceof daemon_pb.WaitForInitRequest)) { + throw new Error('Expected argument of type wsdaemon.WaitForInitRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsdaemon_WaitForInitRequest(buffer_arg) { + return daemon_pb.WaitForInitRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_wsdaemon_WaitForInitResponse(arg) { + if (!(arg instanceof daemon_pb.WaitForInitResponse)) { + throw new Error('Expected argument of type wsdaemon.WaitForInitResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsdaemon_WaitForInitResponse(buffer_arg) { + return daemon_pb.WaitForInitResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +var WorkspaceContentServiceService = exports.WorkspaceContentServiceService = { + // initWorkspace intialises a new workspace folder in the working area +initWorkspace: { + path: '/wsdaemon.WorkspaceContentService/InitWorkspace', + requestStream: false, + responseStream: false, + requestType: daemon_pb.InitWorkspaceRequest, + responseType: daemon_pb.InitWorkspaceResponse, + requestSerialize: serialize_wsdaemon_InitWorkspaceRequest, + requestDeserialize: deserialize_wsdaemon_InitWorkspaceRequest, + responseSerialize: serialize_wsdaemon_InitWorkspaceResponse, + responseDeserialize: deserialize_wsdaemon_InitWorkspaceResponse, + }, + // WaitForInit waits until a workspace is fully initialized. +// If the workspace is already initialized, this function returns immediately. +// If there is no initialization is going on, an error is returned. +waitForInit: { + path: '/wsdaemon.WorkspaceContentService/WaitForInit', + requestStream: false, + responseStream: false, + requestType: daemon_pb.WaitForInitRequest, + responseType: daemon_pb.WaitForInitResponse, + requestSerialize: serialize_wsdaemon_WaitForInitRequest, + requestDeserialize: deserialize_wsdaemon_WaitForInitRequest, + responseSerialize: serialize_wsdaemon_WaitForInitResponse, + responseDeserialize: deserialize_wsdaemon_WaitForInitResponse, + }, + // TakeSnapshot creates a backup/snapshot of a workspace +takeSnapshot: { + path: '/wsdaemon.WorkspaceContentService/TakeSnapshot', + requestStream: false, + responseStream: false, + requestType: daemon_pb.TakeSnapshotRequest, + responseType: daemon_pb.TakeSnapshotResponse, + requestSerialize: serialize_wsdaemon_TakeSnapshotRequest, + requestDeserialize: deserialize_wsdaemon_TakeSnapshotRequest, + responseSerialize: serialize_wsdaemon_TakeSnapshotResponse, + responseDeserialize: deserialize_wsdaemon_TakeSnapshotResponse, + }, + // disposeWorkspace cleans up a workspace, possibly after taking a final backup +disposeWorkspace: { + path: '/wsdaemon.WorkspaceContentService/DisposeWorkspace', + requestStream: false, + responseStream: false, + requestType: daemon_pb.DisposeWorkspaceRequest, + responseType: daemon_pb.DisposeWorkspaceResponse, + requestSerialize: serialize_wsdaemon_DisposeWorkspaceRequest, + requestDeserialize: deserialize_wsdaemon_DisposeWorkspaceRequest, + responseSerialize: serialize_wsdaemon_DisposeWorkspaceResponse, + responseDeserialize: deserialize_wsdaemon_DisposeWorkspaceResponse, + }, +}; + +exports.WorkspaceContentServiceClient = grpc.makeGenericClientConstructor(WorkspaceContentServiceService); diff --git a/components/ws-daemon-api/typescript/src/daemon_pb.d.ts b/components/ws-daemon-api/typescript/src/daemon_pb.d.ts new file mode 100644 index 00000000000000..c28872aa3f684c --- /dev/null +++ b/components/ws-daemon-api/typescript/src/daemon_pb.d.ts @@ -0,0 +1,225 @@ +/** + * Copyright (c) 2020 TypeFox GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + +// package: wsdaemon +// file: daemon.proto + +import * as jspb from "google-protobuf"; +import * as content_service_api_initializer_pb from "@gitpod/content-service/lib"; + +export class InitWorkspaceRequest extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): WorkspaceMetadata | undefined; + setMetadata(value?: WorkspaceMetadata): void; + + hasInitializer(): boolean; + clearInitializer(): void; + getInitializer(): content_service_api_initializer_pb.WorkspaceInitializer | undefined; + setInitializer(value?: content_service_api_initializer_pb.WorkspaceInitializer): void; + + getFullWorkspaceBackup(): boolean; + setFullWorkspaceBackup(value: boolean): void; + + getContentManifest(): Uint8Array | string; + getContentManifest_asU8(): Uint8Array; + getContentManifest_asB64(): string; + setContentManifest(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): InitWorkspaceRequest.AsObject; + static toObject(includeInstance: boolean, msg: InitWorkspaceRequest): InitWorkspaceRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: InitWorkspaceRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): InitWorkspaceRequest; + static deserializeBinaryFromReader(message: InitWorkspaceRequest, reader: jspb.BinaryReader): InitWorkspaceRequest; +} + +export namespace InitWorkspaceRequest { + export type AsObject = { + id: string, + metadata?: WorkspaceMetadata.AsObject, + initializer?: content_service_api_initializer_pb.WorkspaceInitializer.AsObject, + fullWorkspaceBackup: boolean, + contentManifest: Uint8Array | string, + } +} + +export class WorkspaceMetadata extends jspb.Message { + getOwner(): string; + setOwner(value: string): void; + + getMetaId(): string; + setMetaId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WorkspaceMetadata.AsObject; + static toObject(includeInstance: boolean, msg: WorkspaceMetadata): WorkspaceMetadata.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WorkspaceMetadata, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WorkspaceMetadata; + static deserializeBinaryFromReader(message: WorkspaceMetadata, reader: jspb.BinaryReader): WorkspaceMetadata; +} + +export namespace WorkspaceMetadata { + export type AsObject = { + owner: string, + metaId: string, + } +} + +export class InitWorkspaceResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): InitWorkspaceResponse.AsObject; + static toObject(includeInstance: boolean, msg: InitWorkspaceResponse): InitWorkspaceResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: InitWorkspaceResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): InitWorkspaceResponse; + static deserializeBinaryFromReader(message: InitWorkspaceResponse, reader: jspb.BinaryReader): InitWorkspaceResponse; +} + +export namespace InitWorkspaceResponse { + export type AsObject = { + } +} + +export class WaitForInitRequest extends jspb.Message { + getId(): string; + setId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WaitForInitRequest.AsObject; + static toObject(includeInstance: boolean, msg: WaitForInitRequest): WaitForInitRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WaitForInitRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WaitForInitRequest; + static deserializeBinaryFromReader(message: WaitForInitRequest, reader: jspb.BinaryReader): WaitForInitRequest; +} + +export namespace WaitForInitRequest { + export type AsObject = { + id: string, + } +} + +export class WaitForInitResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WaitForInitResponse.AsObject; + static toObject(includeInstance: boolean, msg: WaitForInitResponse): WaitForInitResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WaitForInitResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WaitForInitResponse; + static deserializeBinaryFromReader(message: WaitForInitResponse, reader: jspb.BinaryReader): WaitForInitResponse; +} + +export namespace WaitForInitResponse { + export type AsObject = { + } +} + +export class TakeSnapshotRequest extends jspb.Message { + getId(): string; + setId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TakeSnapshotRequest.AsObject; + static toObject(includeInstance: boolean, msg: TakeSnapshotRequest): TakeSnapshotRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TakeSnapshotRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TakeSnapshotRequest; + static deserializeBinaryFromReader(message: TakeSnapshotRequest, reader: jspb.BinaryReader): TakeSnapshotRequest; +} + +export namespace TakeSnapshotRequest { + export type AsObject = { + id: string, + } +} + +export class TakeSnapshotResponse extends jspb.Message { + getUrl(): string; + setUrl(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TakeSnapshotResponse.AsObject; + static toObject(includeInstance: boolean, msg: TakeSnapshotResponse): TakeSnapshotResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TakeSnapshotResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TakeSnapshotResponse; + static deserializeBinaryFromReader(message: TakeSnapshotResponse, reader: jspb.BinaryReader): TakeSnapshotResponse; +} + +export namespace TakeSnapshotResponse { + export type AsObject = { + url: string, + } +} + +export class DisposeWorkspaceRequest extends jspb.Message { + getId(): string; + setId(value: string): void; + + getBackup(): boolean; + setBackup(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DisposeWorkspaceRequest.AsObject; + static toObject(includeInstance: boolean, msg: DisposeWorkspaceRequest): DisposeWorkspaceRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DisposeWorkspaceRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DisposeWorkspaceRequest; + static deserializeBinaryFromReader(message: DisposeWorkspaceRequest, reader: jspb.BinaryReader): DisposeWorkspaceRequest; +} + +export namespace DisposeWorkspaceRequest { + export type AsObject = { + id: string, + backup: boolean, + } +} + +export class DisposeWorkspaceResponse extends jspb.Message { + hasGitStatus(): boolean; + clearGitStatus(): void; + getGitStatus(): content_service_api_initializer_pb.GitStatus | undefined; + setGitStatus(value?: content_service_api_initializer_pb.GitStatus): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DisposeWorkspaceResponse.AsObject; + static toObject(includeInstance: boolean, msg: DisposeWorkspaceResponse): DisposeWorkspaceResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DisposeWorkspaceResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DisposeWorkspaceResponse; + static deserializeBinaryFromReader(message: DisposeWorkspaceResponse, reader: jspb.BinaryReader): DisposeWorkspaceResponse; +} + +export namespace DisposeWorkspaceResponse { + export type AsObject = { + gitStatus?: content_service_api_initializer_pb.GitStatus.AsObject, + } +} + +export interface WorkspaceContentStateMap { + NONE: 0; + SETTING_UP: 1; + AVAILABLE: 2; + WRAPPING_UP: 3; +} + +export const WorkspaceContentState: WorkspaceContentStateMap; + diff --git a/components/ws-daemon-api/typescript/src/wssync_pb.js b/components/ws-daemon-api/typescript/src/daemon_pb.js similarity index 69% rename from components/ws-daemon-api/typescript/src/wssync_pb.js rename to components/ws-daemon-api/typescript/src/daemon_pb.js index d4bede83b6ba06..eb68236ed77b0f 100644 --- a/components/ws-daemon-api/typescript/src/wssync_pb.js +++ b/components/ws-daemon-api/typescript/src/daemon_pb.js @@ -19,16 +19,16 @@ var global = Function('return this')(); var content$service$api_initializer_pb = require('@gitpod/content-service/lib'); goog.object.extend(proto, content$service$api_initializer_pb); -goog.exportSymbol('proto.wssync.DisposeWorkspaceRequest', null, global); -goog.exportSymbol('proto.wssync.DisposeWorkspaceResponse', null, global); -goog.exportSymbol('proto.wssync.InitWorkspaceRequest', null, global); -goog.exportSymbol('proto.wssync.InitWorkspaceResponse', null, global); -goog.exportSymbol('proto.wssync.TakeSnapshotRequest', null, global); -goog.exportSymbol('proto.wssync.TakeSnapshotResponse', null, global); -goog.exportSymbol('proto.wssync.WaitForInitRequest', null, global); -goog.exportSymbol('proto.wssync.WaitForInitResponse', null, global); -goog.exportSymbol('proto.wssync.WorkspaceContentState', null, global); -goog.exportSymbol('proto.wssync.WorkspaceMetadata', null, global); +goog.exportSymbol('proto.wsdaemon.DisposeWorkspaceRequest', null, global); +goog.exportSymbol('proto.wsdaemon.DisposeWorkspaceResponse', null, global); +goog.exportSymbol('proto.wsdaemon.InitWorkspaceRequest', null, global); +goog.exportSymbol('proto.wsdaemon.InitWorkspaceResponse', null, global); +goog.exportSymbol('proto.wsdaemon.TakeSnapshotRequest', null, global); +goog.exportSymbol('proto.wsdaemon.TakeSnapshotResponse', null, global); +goog.exportSymbol('proto.wsdaemon.WaitForInitRequest', null, global); +goog.exportSymbol('proto.wsdaemon.WaitForInitResponse', null, global); +goog.exportSymbol('proto.wsdaemon.WorkspaceContentState', null, global); +goog.exportSymbol('proto.wsdaemon.WorkspaceMetadata', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -39,16 +39,16 @@ goog.exportSymbol('proto.wssync.WorkspaceMetadata', null, global); * @extends {jspb.Message} * @constructor */ -proto.wssync.InitWorkspaceRequest = function(opt_data) { +proto.wsdaemon.InitWorkspaceRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.wssync.InitWorkspaceRequest, jspb.Message); +goog.inherits(proto.wsdaemon.InitWorkspaceRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.wssync.InitWorkspaceRequest.displayName = 'proto.wssync.InitWorkspaceRequest'; + proto.wsdaemon.InitWorkspaceRequest.displayName = 'proto.wsdaemon.InitWorkspaceRequest'; } /** * Generated by JsPbCodeGenerator. @@ -60,16 +60,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.wssync.WorkspaceMetadata = function(opt_data) { +proto.wsdaemon.WorkspaceMetadata = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.wssync.WorkspaceMetadata, jspb.Message); +goog.inherits(proto.wsdaemon.WorkspaceMetadata, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.wssync.WorkspaceMetadata.displayName = 'proto.wssync.WorkspaceMetadata'; + proto.wsdaemon.WorkspaceMetadata.displayName = 'proto.wsdaemon.WorkspaceMetadata'; } /** * Generated by JsPbCodeGenerator. @@ -81,16 +81,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.wssync.InitWorkspaceResponse = function(opt_data) { +proto.wsdaemon.InitWorkspaceResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.wssync.InitWorkspaceResponse, jspb.Message); +goog.inherits(proto.wsdaemon.InitWorkspaceResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.wssync.InitWorkspaceResponse.displayName = 'proto.wssync.InitWorkspaceResponse'; + proto.wsdaemon.InitWorkspaceResponse.displayName = 'proto.wsdaemon.InitWorkspaceResponse'; } /** * Generated by JsPbCodeGenerator. @@ -102,16 +102,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.wssync.WaitForInitRequest = function(opt_data) { +proto.wsdaemon.WaitForInitRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.wssync.WaitForInitRequest, jspb.Message); +goog.inherits(proto.wsdaemon.WaitForInitRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.wssync.WaitForInitRequest.displayName = 'proto.wssync.WaitForInitRequest'; + proto.wsdaemon.WaitForInitRequest.displayName = 'proto.wsdaemon.WaitForInitRequest'; } /** * Generated by JsPbCodeGenerator. @@ -123,16 +123,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.wssync.WaitForInitResponse = function(opt_data) { +proto.wsdaemon.WaitForInitResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.wssync.WaitForInitResponse, jspb.Message); +goog.inherits(proto.wsdaemon.WaitForInitResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.wssync.WaitForInitResponse.displayName = 'proto.wssync.WaitForInitResponse'; + proto.wsdaemon.WaitForInitResponse.displayName = 'proto.wsdaemon.WaitForInitResponse'; } /** * Generated by JsPbCodeGenerator. @@ -144,16 +144,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.wssync.TakeSnapshotRequest = function(opt_data) { +proto.wsdaemon.TakeSnapshotRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.wssync.TakeSnapshotRequest, jspb.Message); +goog.inherits(proto.wsdaemon.TakeSnapshotRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.wssync.TakeSnapshotRequest.displayName = 'proto.wssync.TakeSnapshotRequest'; + proto.wsdaemon.TakeSnapshotRequest.displayName = 'proto.wsdaemon.TakeSnapshotRequest'; } /** * Generated by JsPbCodeGenerator. @@ -165,16 +165,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.wssync.TakeSnapshotResponse = function(opt_data) { +proto.wsdaemon.TakeSnapshotResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.wssync.TakeSnapshotResponse, jspb.Message); +goog.inherits(proto.wsdaemon.TakeSnapshotResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.wssync.TakeSnapshotResponse.displayName = 'proto.wssync.TakeSnapshotResponse'; + proto.wsdaemon.TakeSnapshotResponse.displayName = 'proto.wsdaemon.TakeSnapshotResponse'; } /** * Generated by JsPbCodeGenerator. @@ -186,16 +186,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.wssync.DisposeWorkspaceRequest = function(opt_data) { +proto.wsdaemon.DisposeWorkspaceRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.wssync.DisposeWorkspaceRequest, jspb.Message); +goog.inherits(proto.wsdaemon.DisposeWorkspaceRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.wssync.DisposeWorkspaceRequest.displayName = 'proto.wssync.DisposeWorkspaceRequest'; + proto.wsdaemon.DisposeWorkspaceRequest.displayName = 'proto.wsdaemon.DisposeWorkspaceRequest'; } /** * Generated by JsPbCodeGenerator. @@ -207,16 +207,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.wssync.DisposeWorkspaceResponse = function(opt_data) { +proto.wsdaemon.DisposeWorkspaceResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.wssync.DisposeWorkspaceResponse, jspb.Message); +goog.inherits(proto.wsdaemon.DisposeWorkspaceResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.wssync.DisposeWorkspaceResponse.displayName = 'proto.wssync.DisposeWorkspaceResponse'; + proto.wsdaemon.DisposeWorkspaceResponse.displayName = 'proto.wsdaemon.DisposeWorkspaceResponse'; } @@ -232,8 +232,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.wssync.InitWorkspaceRequest.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.InitWorkspaceRequest.toObject(opt_includeInstance, this); +proto.wsdaemon.InitWorkspaceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.wsdaemon.InitWorkspaceRequest.toObject(opt_includeInstance, this); }; @@ -242,14 +242,14 @@ proto.wssync.InitWorkspaceRequest.prototype.toObject = function(opt_includeInsta * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.wssync.InitWorkspaceRequest} msg The msg instance to transform. + * @param {!proto.wsdaemon.InitWorkspaceRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.InitWorkspaceRequest.toObject = function(includeInstance, msg) { +proto.wsdaemon.InitWorkspaceRequest.toObject = function(includeInstance, msg) { var f, obj = { id: jspb.Message.getFieldWithDefault(msg, 1, ""), - metadata: (f = msg.getMetadata()) && proto.wssync.WorkspaceMetadata.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.wsdaemon.WorkspaceMetadata.toObject(includeInstance, f), initializer: (f = msg.getInitializer()) && content$service$api_initializer_pb.WorkspaceInitializer.toObject(includeInstance, f), fullWorkspaceBackup: jspb.Message.getFieldWithDefault(msg, 4, false), contentManifest: msg.getContentManifest_asB64() @@ -266,23 +266,23 @@ proto.wssync.InitWorkspaceRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.InitWorkspaceRequest} + * @return {!proto.wsdaemon.InitWorkspaceRequest} */ -proto.wssync.InitWorkspaceRequest.deserializeBinary = function(bytes) { +proto.wsdaemon.InitWorkspaceRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.InitWorkspaceRequest; - return proto.wssync.InitWorkspaceRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.wsdaemon.InitWorkspaceRequest; + return proto.wsdaemon.InitWorkspaceRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.wssync.InitWorkspaceRequest} msg The message object to deserialize into. + * @param {!proto.wsdaemon.InitWorkspaceRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.InitWorkspaceRequest} + * @return {!proto.wsdaemon.InitWorkspaceRequest} */ -proto.wssync.InitWorkspaceRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.wsdaemon.InitWorkspaceRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -294,8 +294,8 @@ proto.wssync.InitWorkspaceRequest.deserializeBinaryFromReader = function(msg, re msg.setId(value); break; case 2: - var value = new proto.wssync.WorkspaceMetadata; - reader.readMessage(value,proto.wssync.WorkspaceMetadata.deserializeBinaryFromReader); + var value = new proto.wsdaemon.WorkspaceMetadata; + reader.readMessage(value,proto.wsdaemon.WorkspaceMetadata.deserializeBinaryFromReader); msg.setMetadata(value); break; case 3: @@ -324,9 +324,9 @@ proto.wssync.InitWorkspaceRequest.deserializeBinaryFromReader = function(msg, re * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.wssync.InitWorkspaceRequest.prototype.serializeBinary = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.wssync.InitWorkspaceRequest.serializeBinaryToWriter(this, writer); + proto.wsdaemon.InitWorkspaceRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -334,11 +334,11 @@ proto.wssync.InitWorkspaceRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.wssync.InitWorkspaceRequest} message + * @param {!proto.wsdaemon.InitWorkspaceRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.InitWorkspaceRequest.serializeBinaryToWriter = function(message, writer) { +proto.wsdaemon.InitWorkspaceRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getId(); if (f.length > 0) { @@ -352,7 +352,7 @@ proto.wssync.InitWorkspaceRequest.serializeBinaryToWriter = function(message, wr writer.writeMessage( 2, f, - proto.wssync.WorkspaceMetadata.serializeBinaryToWriter + proto.wsdaemon.WorkspaceMetadata.serializeBinaryToWriter ); } f = message.getInitializer(); @@ -384,29 +384,29 @@ proto.wssync.InitWorkspaceRequest.serializeBinaryToWriter = function(message, wr * optional string id = 1; * @return {string} */ -proto.wssync.InitWorkspaceRequest.prototype.getId = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** @param {string} value */ -proto.wssync.InitWorkspaceRequest.prototype.setId = function(value) { +proto.wsdaemon.InitWorkspaceRequest.prototype.setId = function(value) { jspb.Message.setProto3StringField(this, 1, value); }; /** * optional WorkspaceMetadata metadata = 2; - * @return {?proto.wssync.WorkspaceMetadata} + * @return {?proto.wsdaemon.WorkspaceMetadata} */ -proto.wssync.InitWorkspaceRequest.prototype.getMetadata = function() { - return /** @type{?proto.wssync.WorkspaceMetadata} */ ( - jspb.Message.getWrapperField(this, proto.wssync.WorkspaceMetadata, 2)); +proto.wsdaemon.InitWorkspaceRequest.prototype.getMetadata = function() { + return /** @type{?proto.wsdaemon.WorkspaceMetadata} */ ( + jspb.Message.getWrapperField(this, proto.wsdaemon.WorkspaceMetadata, 2)); }; -/** @param {?proto.wssync.WorkspaceMetadata|undefined} value */ -proto.wssync.InitWorkspaceRequest.prototype.setMetadata = function(value) { +/** @param {?proto.wsdaemon.WorkspaceMetadata|undefined} value */ +proto.wsdaemon.InitWorkspaceRequest.prototype.setMetadata = function(value) { jspb.Message.setWrapperField(this, 2, value); }; @@ -414,7 +414,7 @@ proto.wssync.InitWorkspaceRequest.prototype.setMetadata = function(value) { /** * Clears the message field making it undefined. */ -proto.wssync.InitWorkspaceRequest.prototype.clearMetadata = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.clearMetadata = function() { this.setMetadata(undefined); }; @@ -423,7 +423,7 @@ proto.wssync.InitWorkspaceRequest.prototype.clearMetadata = function() { * Returns whether this field is set. * @return {boolean} */ -proto.wssync.InitWorkspaceRequest.prototype.hasMetadata = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.hasMetadata = function() { return jspb.Message.getField(this, 2) != null; }; @@ -432,14 +432,14 @@ proto.wssync.InitWorkspaceRequest.prototype.hasMetadata = function() { * optional contentservice.WorkspaceInitializer initializer = 3; * @return {?proto.contentservice.WorkspaceInitializer} */ -proto.wssync.InitWorkspaceRequest.prototype.getInitializer = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.getInitializer = function() { return /** @type{?proto.contentservice.WorkspaceInitializer} */ ( jspb.Message.getWrapperField(this, content$service$api_initializer_pb.WorkspaceInitializer, 3)); }; /** @param {?proto.contentservice.WorkspaceInitializer|undefined} value */ -proto.wssync.InitWorkspaceRequest.prototype.setInitializer = function(value) { +proto.wsdaemon.InitWorkspaceRequest.prototype.setInitializer = function(value) { jspb.Message.setWrapperField(this, 3, value); }; @@ -447,7 +447,7 @@ proto.wssync.InitWorkspaceRequest.prototype.setInitializer = function(value) { /** * Clears the message field making it undefined. */ -proto.wssync.InitWorkspaceRequest.prototype.clearInitializer = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.clearInitializer = function() { this.setInitializer(undefined); }; @@ -456,7 +456,7 @@ proto.wssync.InitWorkspaceRequest.prototype.clearInitializer = function() { * Returns whether this field is set. * @return {boolean} */ -proto.wssync.InitWorkspaceRequest.prototype.hasInitializer = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.hasInitializer = function() { return jspb.Message.getField(this, 3) != null; }; @@ -467,13 +467,13 @@ proto.wssync.InitWorkspaceRequest.prototype.hasInitializer = function() { * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ -proto.wssync.InitWorkspaceRequest.prototype.getFullWorkspaceBackup = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.getFullWorkspaceBackup = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false)); }; /** @param {boolean} value */ -proto.wssync.InitWorkspaceRequest.prototype.setFullWorkspaceBackup = function(value) { +proto.wsdaemon.InitWorkspaceRequest.prototype.setFullWorkspaceBackup = function(value) { jspb.Message.setProto3BooleanField(this, 4, value); }; @@ -482,7 +482,7 @@ proto.wssync.InitWorkspaceRequest.prototype.setFullWorkspaceBackup = function(va * optional bytes content_manifest = 5; * @return {!(string|Uint8Array)} */ -proto.wssync.InitWorkspaceRequest.prototype.getContentManifest = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.getContentManifest = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; @@ -492,7 +492,7 @@ proto.wssync.InitWorkspaceRequest.prototype.getContentManifest = function() { * This is a type-conversion wrapper around `getContentManifest()` * @return {string} */ -proto.wssync.InitWorkspaceRequest.prototype.getContentManifest_asB64 = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.getContentManifest_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getContentManifest())); }; @@ -505,14 +505,14 @@ proto.wssync.InitWorkspaceRequest.prototype.getContentManifest_asB64 = function( * This is a type-conversion wrapper around `getContentManifest()` * @return {!Uint8Array} */ -proto.wssync.InitWorkspaceRequest.prototype.getContentManifest_asU8 = function() { +proto.wsdaemon.InitWorkspaceRequest.prototype.getContentManifest_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getContentManifest())); }; /** @param {!(string|Uint8Array)} value */ -proto.wssync.InitWorkspaceRequest.prototype.setContentManifest = function(value) { +proto.wsdaemon.InitWorkspaceRequest.prototype.setContentManifest = function(value) { jspb.Message.setProto3BytesField(this, 5, value); }; @@ -531,8 +531,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.wssync.WorkspaceMetadata.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.WorkspaceMetadata.toObject(opt_includeInstance, this); +proto.wsdaemon.WorkspaceMetadata.prototype.toObject = function(opt_includeInstance) { + return proto.wsdaemon.WorkspaceMetadata.toObject(opt_includeInstance, this); }; @@ -541,11 +541,11 @@ proto.wssync.WorkspaceMetadata.prototype.toObject = function(opt_includeInstance * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.wssync.WorkspaceMetadata} msg The msg instance to transform. + * @param {!proto.wsdaemon.WorkspaceMetadata} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.WorkspaceMetadata.toObject = function(includeInstance, msg) { +proto.wsdaemon.WorkspaceMetadata.toObject = function(includeInstance, msg) { var f, obj = { owner: jspb.Message.getFieldWithDefault(msg, 1, ""), metaId: jspb.Message.getFieldWithDefault(msg, 2, "") @@ -562,23 +562,23 @@ proto.wssync.WorkspaceMetadata.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.WorkspaceMetadata} + * @return {!proto.wsdaemon.WorkspaceMetadata} */ -proto.wssync.WorkspaceMetadata.deserializeBinary = function(bytes) { +proto.wsdaemon.WorkspaceMetadata.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.WorkspaceMetadata; - return proto.wssync.WorkspaceMetadata.deserializeBinaryFromReader(msg, reader); + var msg = new proto.wsdaemon.WorkspaceMetadata; + return proto.wsdaemon.WorkspaceMetadata.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.wssync.WorkspaceMetadata} msg The message object to deserialize into. + * @param {!proto.wsdaemon.WorkspaceMetadata} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.WorkspaceMetadata} + * @return {!proto.wsdaemon.WorkspaceMetadata} */ -proto.wssync.WorkspaceMetadata.deserializeBinaryFromReader = function(msg, reader) { +proto.wsdaemon.WorkspaceMetadata.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -606,9 +606,9 @@ proto.wssync.WorkspaceMetadata.deserializeBinaryFromReader = function(msg, reade * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.wssync.WorkspaceMetadata.prototype.serializeBinary = function() { +proto.wsdaemon.WorkspaceMetadata.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.wssync.WorkspaceMetadata.serializeBinaryToWriter(this, writer); + proto.wsdaemon.WorkspaceMetadata.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -616,11 +616,11 @@ proto.wssync.WorkspaceMetadata.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.wssync.WorkspaceMetadata} message + * @param {!proto.wsdaemon.WorkspaceMetadata} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.WorkspaceMetadata.serializeBinaryToWriter = function(message, writer) { +proto.wsdaemon.WorkspaceMetadata.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getOwner(); if (f.length > 0) { @@ -643,13 +643,13 @@ proto.wssync.WorkspaceMetadata.serializeBinaryToWriter = function(message, write * optional string owner = 1; * @return {string} */ -proto.wssync.WorkspaceMetadata.prototype.getOwner = function() { +proto.wsdaemon.WorkspaceMetadata.prototype.getOwner = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** @param {string} value */ -proto.wssync.WorkspaceMetadata.prototype.setOwner = function(value) { +proto.wsdaemon.WorkspaceMetadata.prototype.setOwner = function(value) { jspb.Message.setProto3StringField(this, 1, value); }; @@ -658,13 +658,13 @@ proto.wssync.WorkspaceMetadata.prototype.setOwner = function(value) { * optional string meta_id = 2; * @return {string} */ -proto.wssync.WorkspaceMetadata.prototype.getMetaId = function() { +proto.wsdaemon.WorkspaceMetadata.prototype.getMetaId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** @param {string} value */ -proto.wssync.WorkspaceMetadata.prototype.setMetaId = function(value) { +proto.wsdaemon.WorkspaceMetadata.prototype.setMetaId = function(value) { jspb.Message.setProto3StringField(this, 2, value); }; @@ -683,8 +683,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.wssync.InitWorkspaceResponse.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.InitWorkspaceResponse.toObject(opt_includeInstance, this); +proto.wsdaemon.InitWorkspaceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.wsdaemon.InitWorkspaceResponse.toObject(opt_includeInstance, this); }; @@ -693,11 +693,11 @@ proto.wssync.InitWorkspaceResponse.prototype.toObject = function(opt_includeInst * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.wssync.InitWorkspaceResponse} msg The msg instance to transform. + * @param {!proto.wsdaemon.InitWorkspaceResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.InitWorkspaceResponse.toObject = function(includeInstance, msg) { +proto.wsdaemon.InitWorkspaceResponse.toObject = function(includeInstance, msg) { var f, obj = { }; @@ -713,23 +713,23 @@ proto.wssync.InitWorkspaceResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.InitWorkspaceResponse} + * @return {!proto.wsdaemon.InitWorkspaceResponse} */ -proto.wssync.InitWorkspaceResponse.deserializeBinary = function(bytes) { +proto.wsdaemon.InitWorkspaceResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.InitWorkspaceResponse; - return proto.wssync.InitWorkspaceResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.wsdaemon.InitWorkspaceResponse; + return proto.wsdaemon.InitWorkspaceResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.wssync.InitWorkspaceResponse} msg The message object to deserialize into. + * @param {!proto.wsdaemon.InitWorkspaceResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.InitWorkspaceResponse} + * @return {!proto.wsdaemon.InitWorkspaceResponse} */ -proto.wssync.InitWorkspaceResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.wsdaemon.InitWorkspaceResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -749,9 +749,9 @@ proto.wssync.InitWorkspaceResponse.deserializeBinaryFromReader = function(msg, r * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.wssync.InitWorkspaceResponse.prototype.serializeBinary = function() { +proto.wsdaemon.InitWorkspaceResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.wssync.InitWorkspaceResponse.serializeBinaryToWriter(this, writer); + proto.wsdaemon.InitWorkspaceResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -759,11 +759,11 @@ proto.wssync.InitWorkspaceResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.wssync.InitWorkspaceResponse} message + * @param {!proto.wsdaemon.InitWorkspaceResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.InitWorkspaceResponse.serializeBinaryToWriter = function(message, writer) { +proto.wsdaemon.InitWorkspaceResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; @@ -782,8 +782,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.wssync.WaitForInitRequest.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.WaitForInitRequest.toObject(opt_includeInstance, this); +proto.wsdaemon.WaitForInitRequest.prototype.toObject = function(opt_includeInstance) { + return proto.wsdaemon.WaitForInitRequest.toObject(opt_includeInstance, this); }; @@ -792,11 +792,11 @@ proto.wssync.WaitForInitRequest.prototype.toObject = function(opt_includeInstanc * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.wssync.WaitForInitRequest} msg The msg instance to transform. + * @param {!proto.wsdaemon.WaitForInitRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.WaitForInitRequest.toObject = function(includeInstance, msg) { +proto.wsdaemon.WaitForInitRequest.toObject = function(includeInstance, msg) { var f, obj = { id: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -812,23 +812,23 @@ proto.wssync.WaitForInitRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.WaitForInitRequest} + * @return {!proto.wsdaemon.WaitForInitRequest} */ -proto.wssync.WaitForInitRequest.deserializeBinary = function(bytes) { +proto.wsdaemon.WaitForInitRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.WaitForInitRequest; - return proto.wssync.WaitForInitRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.wsdaemon.WaitForInitRequest; + return proto.wsdaemon.WaitForInitRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.wssync.WaitForInitRequest} msg The message object to deserialize into. + * @param {!proto.wsdaemon.WaitForInitRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.WaitForInitRequest} + * @return {!proto.wsdaemon.WaitForInitRequest} */ -proto.wssync.WaitForInitRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.wsdaemon.WaitForInitRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -852,9 +852,9 @@ proto.wssync.WaitForInitRequest.deserializeBinaryFromReader = function(msg, read * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.wssync.WaitForInitRequest.prototype.serializeBinary = function() { +proto.wsdaemon.WaitForInitRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.wssync.WaitForInitRequest.serializeBinaryToWriter(this, writer); + proto.wsdaemon.WaitForInitRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -862,11 +862,11 @@ proto.wssync.WaitForInitRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.wssync.WaitForInitRequest} message + * @param {!proto.wsdaemon.WaitForInitRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.WaitForInitRequest.serializeBinaryToWriter = function(message, writer) { +proto.wsdaemon.WaitForInitRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getId(); if (f.length > 0) { @@ -882,13 +882,13 @@ proto.wssync.WaitForInitRequest.serializeBinaryToWriter = function(message, writ * optional string id = 1; * @return {string} */ -proto.wssync.WaitForInitRequest.prototype.getId = function() { +proto.wsdaemon.WaitForInitRequest.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** @param {string} value */ -proto.wssync.WaitForInitRequest.prototype.setId = function(value) { +proto.wsdaemon.WaitForInitRequest.prototype.setId = function(value) { jspb.Message.setProto3StringField(this, 1, value); }; @@ -907,8 +907,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.wssync.WaitForInitResponse.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.WaitForInitResponse.toObject(opt_includeInstance, this); +proto.wsdaemon.WaitForInitResponse.prototype.toObject = function(opt_includeInstance) { + return proto.wsdaemon.WaitForInitResponse.toObject(opt_includeInstance, this); }; @@ -917,11 +917,11 @@ proto.wssync.WaitForInitResponse.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.wssync.WaitForInitResponse} msg The msg instance to transform. + * @param {!proto.wsdaemon.WaitForInitResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.WaitForInitResponse.toObject = function(includeInstance, msg) { +proto.wsdaemon.WaitForInitResponse.toObject = function(includeInstance, msg) { var f, obj = { }; @@ -937,23 +937,23 @@ proto.wssync.WaitForInitResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.WaitForInitResponse} + * @return {!proto.wsdaemon.WaitForInitResponse} */ -proto.wssync.WaitForInitResponse.deserializeBinary = function(bytes) { +proto.wsdaemon.WaitForInitResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.WaitForInitResponse; - return proto.wssync.WaitForInitResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.wsdaemon.WaitForInitResponse; + return proto.wsdaemon.WaitForInitResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.wssync.WaitForInitResponse} msg The message object to deserialize into. + * @param {!proto.wsdaemon.WaitForInitResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.WaitForInitResponse} + * @return {!proto.wsdaemon.WaitForInitResponse} */ -proto.wssync.WaitForInitResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.wsdaemon.WaitForInitResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -973,9 +973,9 @@ proto.wssync.WaitForInitResponse.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.wssync.WaitForInitResponse.prototype.serializeBinary = function() { +proto.wsdaemon.WaitForInitResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.wssync.WaitForInitResponse.serializeBinaryToWriter(this, writer); + proto.wsdaemon.WaitForInitResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -983,11 +983,11 @@ proto.wssync.WaitForInitResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.wssync.WaitForInitResponse} message + * @param {!proto.wsdaemon.WaitForInitResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.WaitForInitResponse.serializeBinaryToWriter = function(message, writer) { +proto.wsdaemon.WaitForInitResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; @@ -1006,8 +1006,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.wssync.TakeSnapshotRequest.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.TakeSnapshotRequest.toObject(opt_includeInstance, this); +proto.wsdaemon.TakeSnapshotRequest.prototype.toObject = function(opt_includeInstance) { + return proto.wsdaemon.TakeSnapshotRequest.toObject(opt_includeInstance, this); }; @@ -1016,11 +1016,11 @@ proto.wssync.TakeSnapshotRequest.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.wssync.TakeSnapshotRequest} msg The msg instance to transform. + * @param {!proto.wsdaemon.TakeSnapshotRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.TakeSnapshotRequest.toObject = function(includeInstance, msg) { +proto.wsdaemon.TakeSnapshotRequest.toObject = function(includeInstance, msg) { var f, obj = { id: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -1036,23 +1036,23 @@ proto.wssync.TakeSnapshotRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.TakeSnapshotRequest} + * @return {!proto.wsdaemon.TakeSnapshotRequest} */ -proto.wssync.TakeSnapshotRequest.deserializeBinary = function(bytes) { +proto.wsdaemon.TakeSnapshotRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.TakeSnapshotRequest; - return proto.wssync.TakeSnapshotRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.wsdaemon.TakeSnapshotRequest; + return proto.wsdaemon.TakeSnapshotRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.wssync.TakeSnapshotRequest} msg The message object to deserialize into. + * @param {!proto.wsdaemon.TakeSnapshotRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.TakeSnapshotRequest} + * @return {!proto.wsdaemon.TakeSnapshotRequest} */ -proto.wssync.TakeSnapshotRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.wsdaemon.TakeSnapshotRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1076,9 +1076,9 @@ proto.wssync.TakeSnapshotRequest.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.wssync.TakeSnapshotRequest.prototype.serializeBinary = function() { +proto.wsdaemon.TakeSnapshotRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.wssync.TakeSnapshotRequest.serializeBinaryToWriter(this, writer); + proto.wsdaemon.TakeSnapshotRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1086,11 +1086,11 @@ proto.wssync.TakeSnapshotRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.wssync.TakeSnapshotRequest} message + * @param {!proto.wsdaemon.TakeSnapshotRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.TakeSnapshotRequest.serializeBinaryToWriter = function(message, writer) { +proto.wsdaemon.TakeSnapshotRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getId(); if (f.length > 0) { @@ -1106,13 +1106,13 @@ proto.wssync.TakeSnapshotRequest.serializeBinaryToWriter = function(message, wri * optional string id = 1; * @return {string} */ -proto.wssync.TakeSnapshotRequest.prototype.getId = function() { +proto.wsdaemon.TakeSnapshotRequest.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** @param {string} value */ -proto.wssync.TakeSnapshotRequest.prototype.setId = function(value) { +proto.wsdaemon.TakeSnapshotRequest.prototype.setId = function(value) { jspb.Message.setProto3StringField(this, 1, value); }; @@ -1131,8 +1131,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.wssync.TakeSnapshotResponse.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.TakeSnapshotResponse.toObject(opt_includeInstance, this); +proto.wsdaemon.TakeSnapshotResponse.prototype.toObject = function(opt_includeInstance) { + return proto.wsdaemon.TakeSnapshotResponse.toObject(opt_includeInstance, this); }; @@ -1141,11 +1141,11 @@ proto.wssync.TakeSnapshotResponse.prototype.toObject = function(opt_includeInsta * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.wssync.TakeSnapshotResponse} msg The msg instance to transform. + * @param {!proto.wsdaemon.TakeSnapshotResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.TakeSnapshotResponse.toObject = function(includeInstance, msg) { +proto.wsdaemon.TakeSnapshotResponse.toObject = function(includeInstance, msg) { var f, obj = { url: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -1161,23 +1161,23 @@ proto.wssync.TakeSnapshotResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.TakeSnapshotResponse} + * @return {!proto.wsdaemon.TakeSnapshotResponse} */ -proto.wssync.TakeSnapshotResponse.deserializeBinary = function(bytes) { +proto.wsdaemon.TakeSnapshotResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.TakeSnapshotResponse; - return proto.wssync.TakeSnapshotResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.wsdaemon.TakeSnapshotResponse; + return proto.wsdaemon.TakeSnapshotResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.wssync.TakeSnapshotResponse} msg The message object to deserialize into. + * @param {!proto.wsdaemon.TakeSnapshotResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.TakeSnapshotResponse} + * @return {!proto.wsdaemon.TakeSnapshotResponse} */ -proto.wssync.TakeSnapshotResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.wsdaemon.TakeSnapshotResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1201,9 +1201,9 @@ proto.wssync.TakeSnapshotResponse.deserializeBinaryFromReader = function(msg, re * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.wssync.TakeSnapshotResponse.prototype.serializeBinary = function() { +proto.wsdaemon.TakeSnapshotResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.wssync.TakeSnapshotResponse.serializeBinaryToWriter(this, writer); + proto.wsdaemon.TakeSnapshotResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1211,11 +1211,11 @@ proto.wssync.TakeSnapshotResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.wssync.TakeSnapshotResponse} message + * @param {!proto.wsdaemon.TakeSnapshotResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.TakeSnapshotResponse.serializeBinaryToWriter = function(message, writer) { +proto.wsdaemon.TakeSnapshotResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUrl(); if (f.length > 0) { @@ -1231,13 +1231,13 @@ proto.wssync.TakeSnapshotResponse.serializeBinaryToWriter = function(message, wr * optional string url = 1; * @return {string} */ -proto.wssync.TakeSnapshotResponse.prototype.getUrl = function() { +proto.wsdaemon.TakeSnapshotResponse.prototype.getUrl = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** @param {string} value */ -proto.wssync.TakeSnapshotResponse.prototype.setUrl = function(value) { +proto.wsdaemon.TakeSnapshotResponse.prototype.setUrl = function(value) { jspb.Message.setProto3StringField(this, 1, value); }; @@ -1256,8 +1256,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.wssync.DisposeWorkspaceRequest.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.DisposeWorkspaceRequest.toObject(opt_includeInstance, this); +proto.wsdaemon.DisposeWorkspaceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.wsdaemon.DisposeWorkspaceRequest.toObject(opt_includeInstance, this); }; @@ -1266,11 +1266,11 @@ proto.wssync.DisposeWorkspaceRequest.prototype.toObject = function(opt_includeIn * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.wssync.DisposeWorkspaceRequest} msg The msg instance to transform. + * @param {!proto.wsdaemon.DisposeWorkspaceRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.DisposeWorkspaceRequest.toObject = function(includeInstance, msg) { +proto.wsdaemon.DisposeWorkspaceRequest.toObject = function(includeInstance, msg) { var f, obj = { id: jspb.Message.getFieldWithDefault(msg, 1, ""), backup: jspb.Message.getFieldWithDefault(msg, 2, false) @@ -1287,23 +1287,23 @@ proto.wssync.DisposeWorkspaceRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.DisposeWorkspaceRequest} + * @return {!proto.wsdaemon.DisposeWorkspaceRequest} */ -proto.wssync.DisposeWorkspaceRequest.deserializeBinary = function(bytes) { +proto.wsdaemon.DisposeWorkspaceRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.DisposeWorkspaceRequest; - return proto.wssync.DisposeWorkspaceRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.wsdaemon.DisposeWorkspaceRequest; + return proto.wsdaemon.DisposeWorkspaceRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.wssync.DisposeWorkspaceRequest} msg The message object to deserialize into. + * @param {!proto.wsdaemon.DisposeWorkspaceRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.DisposeWorkspaceRequest} + * @return {!proto.wsdaemon.DisposeWorkspaceRequest} */ -proto.wssync.DisposeWorkspaceRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.wsdaemon.DisposeWorkspaceRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1331,9 +1331,9 @@ proto.wssync.DisposeWorkspaceRequest.deserializeBinaryFromReader = function(msg, * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.wssync.DisposeWorkspaceRequest.prototype.serializeBinary = function() { +proto.wsdaemon.DisposeWorkspaceRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.wssync.DisposeWorkspaceRequest.serializeBinaryToWriter(this, writer); + proto.wsdaemon.DisposeWorkspaceRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1341,11 +1341,11 @@ proto.wssync.DisposeWorkspaceRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.wssync.DisposeWorkspaceRequest} message + * @param {!proto.wsdaemon.DisposeWorkspaceRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.DisposeWorkspaceRequest.serializeBinaryToWriter = function(message, writer) { +proto.wsdaemon.DisposeWorkspaceRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getId(); if (f.length > 0) { @@ -1368,13 +1368,13 @@ proto.wssync.DisposeWorkspaceRequest.serializeBinaryToWriter = function(message, * optional string id = 1; * @return {string} */ -proto.wssync.DisposeWorkspaceRequest.prototype.getId = function() { +proto.wsdaemon.DisposeWorkspaceRequest.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** @param {string} value */ -proto.wssync.DisposeWorkspaceRequest.prototype.setId = function(value) { +proto.wsdaemon.DisposeWorkspaceRequest.prototype.setId = function(value) { jspb.Message.setProto3StringField(this, 1, value); }; @@ -1385,13 +1385,13 @@ proto.wssync.DisposeWorkspaceRequest.prototype.setId = function(value) { * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ -proto.wssync.DisposeWorkspaceRequest.prototype.getBackup = function() { +proto.wsdaemon.DisposeWorkspaceRequest.prototype.getBackup = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 2, false)); }; /** @param {boolean} value */ -proto.wssync.DisposeWorkspaceRequest.prototype.setBackup = function(value) { +proto.wsdaemon.DisposeWorkspaceRequest.prototype.setBackup = function(value) { jspb.Message.setProto3BooleanField(this, 2, value); }; @@ -1410,8 +1410,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.wssync.DisposeWorkspaceResponse.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.DisposeWorkspaceResponse.toObject(opt_includeInstance, this); +proto.wsdaemon.DisposeWorkspaceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.wsdaemon.DisposeWorkspaceResponse.toObject(opt_includeInstance, this); }; @@ -1420,11 +1420,11 @@ proto.wssync.DisposeWorkspaceResponse.prototype.toObject = function(opt_includeI * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.wssync.DisposeWorkspaceResponse} msg The msg instance to transform. + * @param {!proto.wsdaemon.DisposeWorkspaceResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.DisposeWorkspaceResponse.toObject = function(includeInstance, msg) { +proto.wsdaemon.DisposeWorkspaceResponse.toObject = function(includeInstance, msg) { var f, obj = { gitStatus: (f = msg.getGitStatus()) && content$service$api_initializer_pb.GitStatus.toObject(includeInstance, f) }; @@ -1440,23 +1440,23 @@ proto.wssync.DisposeWorkspaceResponse.toObject = function(includeInstance, msg) /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.DisposeWorkspaceResponse} + * @return {!proto.wsdaemon.DisposeWorkspaceResponse} */ -proto.wssync.DisposeWorkspaceResponse.deserializeBinary = function(bytes) { +proto.wsdaemon.DisposeWorkspaceResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.DisposeWorkspaceResponse; - return proto.wssync.DisposeWorkspaceResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.wsdaemon.DisposeWorkspaceResponse; + return proto.wsdaemon.DisposeWorkspaceResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.wssync.DisposeWorkspaceResponse} msg The message object to deserialize into. + * @param {!proto.wsdaemon.DisposeWorkspaceResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.DisposeWorkspaceResponse} + * @return {!proto.wsdaemon.DisposeWorkspaceResponse} */ -proto.wssync.DisposeWorkspaceResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.wsdaemon.DisposeWorkspaceResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1481,9 +1481,9 @@ proto.wssync.DisposeWorkspaceResponse.deserializeBinaryFromReader = function(msg * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.wssync.DisposeWorkspaceResponse.prototype.serializeBinary = function() { +proto.wsdaemon.DisposeWorkspaceResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.wssync.DisposeWorkspaceResponse.serializeBinaryToWriter(this, writer); + proto.wsdaemon.DisposeWorkspaceResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1491,11 +1491,11 @@ proto.wssync.DisposeWorkspaceResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.wssync.DisposeWorkspaceResponse} message + * @param {!proto.wsdaemon.DisposeWorkspaceResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.wssync.DisposeWorkspaceResponse.serializeBinaryToWriter = function(message, writer) { +proto.wsdaemon.DisposeWorkspaceResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getGitStatus(); if (f != null) { @@ -1512,14 +1512,14 @@ proto.wssync.DisposeWorkspaceResponse.serializeBinaryToWriter = function(message * optional contentservice.GitStatus git_status = 1; * @return {?proto.contentservice.GitStatus} */ -proto.wssync.DisposeWorkspaceResponse.prototype.getGitStatus = function() { +proto.wsdaemon.DisposeWorkspaceResponse.prototype.getGitStatus = function() { return /** @type{?proto.contentservice.GitStatus} */ ( jspb.Message.getWrapperField(this, content$service$api_initializer_pb.GitStatus, 1)); }; /** @param {?proto.contentservice.GitStatus|undefined} value */ -proto.wssync.DisposeWorkspaceResponse.prototype.setGitStatus = function(value) { +proto.wsdaemon.DisposeWorkspaceResponse.prototype.setGitStatus = function(value) { jspb.Message.setWrapperField(this, 1, value); }; @@ -1527,7 +1527,7 @@ proto.wssync.DisposeWorkspaceResponse.prototype.setGitStatus = function(value) { /** * Clears the message field making it undefined. */ -proto.wssync.DisposeWorkspaceResponse.prototype.clearGitStatus = function() { +proto.wsdaemon.DisposeWorkspaceResponse.prototype.clearGitStatus = function() { this.setGitStatus(undefined); }; @@ -1536,7 +1536,7 @@ proto.wssync.DisposeWorkspaceResponse.prototype.clearGitStatus = function() { * Returns whether this field is set. * @return {boolean} */ -proto.wssync.DisposeWorkspaceResponse.prototype.hasGitStatus = function() { +proto.wsdaemon.DisposeWorkspaceResponse.prototype.hasGitStatus = function() { return jspb.Message.getField(this, 1) != null; }; @@ -1544,11 +1544,11 @@ proto.wssync.DisposeWorkspaceResponse.prototype.hasGitStatus = function() { /** * @enum {number} */ -proto.wssync.WorkspaceContentState = { +proto.wsdaemon.WorkspaceContentState = { NONE: 0, SETTING_UP: 1, AVAILABLE: 2, WRAPPING_UP: 3 }; -goog.object.extend(exports, proto.wssync); +goog.object.extend(exports, proto.wsdaemon); diff --git a/components/ws-daemon-api/typescript/src/index.ts b/components/ws-daemon-api/typescript/src/index.ts index 1d5c91ebde6863..89d7c630951797 100644 --- a/components/ws-daemon-api/typescript/src/index.ts +++ b/components/ws-daemon-api/typescript/src/index.ts @@ -4,5 +4,4 @@ * See License-AGPL.txt in the project root for license information. */ -export * from './wssync_grpc_pb' -export * from './wssync_pb' \ No newline at end of file +export * from './daemon_pb' \ No newline at end of file diff --git a/components/ws-daemon-api/typescript/src/workspace_grpc_pb.js b/components/ws-daemon-api/typescript/src/workspace_grpc_pb.js index 6ff670fdc68127..b4e6d2d470e651 100644 --- a/components/ws-daemon-api/typescript/src/workspace_grpc_pb.js +++ b/components/ws-daemon-api/typescript/src/workspace_grpc_pb.js @@ -77,14 +77,36 @@ function deserialize_wsbs_PauseTheiaResponse(buffer_arg) { return workspace_pb.PauseTheiaResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_wsbs_UidmapCanaryRequest(arg) { + if (!(arg instanceof workspace_pb.UidmapCanaryRequest)) { + throw new Error('Expected argument of type wsbs.UidmapCanaryRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsbs_UidmapCanaryRequest(buffer_arg) { + return workspace_pb.UidmapCanaryRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_wsbs_UidmapCanaryResponse(arg) { + if (!(arg instanceof workspace_pb.UidmapCanaryResponse)) { + throw new Error('Expected argument of type wsbs.UidmapCanaryResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_wsbs_UidmapCanaryResponse(buffer_arg) { + return workspace_pb.UidmapCanaryResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + var InWorkspaceHelperService = exports.InWorkspaceHelperService = { // BackupCanary can prepare workspace content backups. The canary is supposed to be triggered - // when the workspace is about to shut down, e.g. using the PreStop hook of a Kubernetes container. - // - // Note that the request/response flow is inverted here, as it's the server (supervisor) which requests a backup - // from the client (ws-daemon). - backupCanary: { +// when the workspace is about to shut down, e.g. using the PreStop hook of a Kubernetes container. +// +// Note that the request/response flow is inverted here, as it's the server (supervisor) which requests a backup +// from the client (ws-daemon). +backupCanary: { path: '/wsbs.InWorkspaceHelper/BackupCanary', requestStream: true, responseStream: true, @@ -96,9 +118,9 @@ var InWorkspaceHelperService = exports.InWorkspaceHelperService = { responseDeserialize: deserialize_wsbs_BackupCanaryRequest, }, // PauseTheia can pause the Theia process and all its children. As long as the request stream - // is held Theia will be paused. - // This is a stop-the-world mechanism for preventing concurrent modification during backup. - pauseTheia: { +// is held Theia will be paused. +// This is a stop-the-world mechanism for preventing concurrent modification during backup. +pauseTheia: { path: '/wsbs.InWorkspaceHelper/PauseTheia', requestStream: true, responseStream: false, @@ -120,6 +142,18 @@ var InWorkspaceHelperService = exports.InWorkspaceHelperService = { responseSerialize: serialize_wsbs_GitStatusResponse, responseDeserialize: deserialize_wsbs_GitStatusResponse, }, + // UidmapCanary can establish a uid mapping of a new user namespace spawned within the workspace. +uidmapCanary: { + path: '/wsbs.InWorkspaceHelper/UidmapCanary', + requestStream: true, + responseStream: true, + requestType: workspace_pb.UidmapCanaryResponse, + responseType: workspace_pb.UidmapCanaryRequest, + requestSerialize: serialize_wsbs_UidmapCanaryResponse, + requestDeserialize: deserialize_wsbs_UidmapCanaryResponse, + responseSerialize: serialize_wsbs_UidmapCanaryRequest, + responseDeserialize: deserialize_wsbs_UidmapCanaryRequest, + }, }; exports.InWorkspaceHelperClient = grpc.makeGenericClientConstructor(InWorkspaceHelperService); diff --git a/components/ws-daemon-api/typescript/src/workspace_pb.d.ts b/components/ws-daemon-api/typescript/src/workspace_pb.d.ts index 21c239211d01b2..6f702f7e4d0e85 100644 --- a/components/ws-daemon-api/typescript/src/workspace_pb.d.ts +++ b/components/ws-daemon-api/typescript/src/workspace_pb.d.ts @@ -7,120 +7,194 @@ // package: wsbs // file: workspace.proto -/* tslint:disable */ - import * as jspb from "google-protobuf"; import * as content_service_api_initializer_pb from "@gitpod/content-service/lib"; -export class BackupCanaryRequest extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): BackupCanaryRequest.AsObject; - static toObject(includeInstance: boolean, msg: BackupCanaryRequest): BackupCanaryRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: BackupCanaryRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): BackupCanaryRequest; - static deserializeBinaryFromReader(message: BackupCanaryRequest, reader: jspb.BinaryReader): BackupCanaryRequest; +export class BackupCanaryRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): BackupCanaryRequest.AsObject; + static toObject(includeInstance: boolean, msg: BackupCanaryRequest): BackupCanaryRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: BackupCanaryRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): BackupCanaryRequest; + static deserializeBinaryFromReader(message: BackupCanaryRequest, reader: jspb.BinaryReader): BackupCanaryRequest; } export namespace BackupCanaryRequest { - export type AsObject = { - } + export type AsObject = { + } } -export class BackupCanaryResponse extends jspb.Message { - getSuccess(): boolean; - setSuccess(value: boolean): void; +export class BackupCanaryResponse extends jspb.Message { + getSuccess(): boolean; + setSuccess(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): BackupCanaryResponse.AsObject; + static toObject(includeInstance: boolean, msg: BackupCanaryResponse): BackupCanaryResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: BackupCanaryResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): BackupCanaryResponse; + static deserializeBinaryFromReader(message: BackupCanaryResponse, reader: jspb.BinaryReader): BackupCanaryResponse; +} +export namespace BackupCanaryResponse { + export type AsObject = { + success: boolean, + } +} - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): BackupCanaryResponse.AsObject; - static toObject(includeInstance: boolean, msg: BackupCanaryResponse): BackupCanaryResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: BackupCanaryResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): BackupCanaryResponse; - static deserializeBinaryFromReader(message: BackupCanaryResponse, reader: jspb.BinaryReader): BackupCanaryResponse; +export class PauseTheiaRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PauseTheiaRequest.AsObject; + static toObject(includeInstance: boolean, msg: PauseTheiaRequest): PauseTheiaRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PauseTheiaRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PauseTheiaRequest; + static deserializeBinaryFromReader(message: PauseTheiaRequest, reader: jspb.BinaryReader): PauseTheiaRequest; } -export namespace BackupCanaryResponse { - export type AsObject = { - success: boolean, - } +export namespace PauseTheiaRequest { + export type AsObject = { + } } -export class PauseTheiaRequest extends jspb.Message { +export class PauseTheiaResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PauseTheiaResponse.AsObject; + static toObject(includeInstance: boolean, msg: PauseTheiaResponse): PauseTheiaResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PauseTheiaResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PauseTheiaResponse; + static deserializeBinaryFromReader(message: PauseTheiaResponse, reader: jspb.BinaryReader): PauseTheiaResponse; +} - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): PauseTheiaRequest.AsObject; - static toObject(includeInstance: boolean, msg: PauseTheiaRequest): PauseTheiaRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: PauseTheiaRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): PauseTheiaRequest; - static deserializeBinaryFromReader(message: PauseTheiaRequest, reader: jspb.BinaryReader): PauseTheiaRequest; +export namespace PauseTheiaResponse { + export type AsObject = { + } } -export namespace PauseTheiaRequest { - export type AsObject = { - } +export class GitStatusRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GitStatusRequest.AsObject; + static toObject(includeInstance: boolean, msg: GitStatusRequest): GitStatusRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GitStatusRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GitStatusRequest; + static deserializeBinaryFromReader(message: GitStatusRequest, reader: jspb.BinaryReader): GitStatusRequest; } -export class PauseTheiaResponse extends jspb.Message { +export namespace GitStatusRequest { + export type AsObject = { + } +} - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): PauseTheiaResponse.AsObject; - static toObject(includeInstance: boolean, msg: PauseTheiaResponse): PauseTheiaResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: PauseTheiaResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): PauseTheiaResponse; - static deserializeBinaryFromReader(message: PauseTheiaResponse, reader: jspb.BinaryReader): PauseTheiaResponse; +export class GitStatusResponse extends jspb.Message { + hasRepo(): boolean; + clearRepo(): void; + getRepo(): content_service_api_initializer_pb.GitStatus | undefined; + setRepo(value?: content_service_api_initializer_pb.GitStatus): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GitStatusResponse.AsObject; + static toObject(includeInstance: boolean, msg: GitStatusResponse): GitStatusResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GitStatusResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GitStatusResponse; + static deserializeBinaryFromReader(message: GitStatusResponse, reader: jspb.BinaryReader): GitStatusResponse; } -export namespace PauseTheiaResponse { - export type AsObject = { - } +export namespace GitStatusResponse { + export type AsObject = { + repo?: content_service_api_initializer_pb.GitStatus.AsObject, + } } -export class GitStatusRequest extends jspb.Message { +export class UidmapCanaryResponse extends jspb.Message { + getMessage(): string; + setMessage(value: string): void; + + getErrorCode(): number; + setErrorCode(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UidmapCanaryResponse.AsObject; + static toObject(includeInstance: boolean, msg: UidmapCanaryResponse): UidmapCanaryResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UidmapCanaryResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UidmapCanaryResponse; + static deserializeBinaryFromReader(message: UidmapCanaryResponse, reader: jspb.BinaryReader): UidmapCanaryResponse; +} - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GitStatusRequest.AsObject; - static toObject(includeInstance: boolean, msg: GitStatusRequest): GitStatusRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GitStatusRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GitStatusRequest; - static deserializeBinaryFromReader(message: GitStatusRequest, reader: jspb.BinaryReader): GitStatusRequest; +export namespace UidmapCanaryResponse { + export type AsObject = { + message: string, + errorCode: number, + } } -export namespace GitStatusRequest { - export type AsObject = { - } +export class UidmapCanaryRequest extends jspb.Message { + getPid(): number; + setPid(value: number): void; + + getGid(): boolean; + setGid(value: boolean): void; + + clearMappingList(): void; + getMappingList(): Array; + setMappingList(value: Array): void; + addMapping(value?: UidmapCanaryRequest.Mapping, index?: number): UidmapCanaryRequest.Mapping; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UidmapCanaryRequest.AsObject; + static toObject(includeInstance: boolean, msg: UidmapCanaryRequest): UidmapCanaryRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UidmapCanaryRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UidmapCanaryRequest; + static deserializeBinaryFromReader(message: UidmapCanaryRequest, reader: jspb.BinaryReader): UidmapCanaryRequest; } -export class GitStatusResponse extends jspb.Message { +export namespace UidmapCanaryRequest { + export type AsObject = { + pid: number, + gid: boolean, + mappingList: Array, + } + + export class Mapping extends jspb.Message { + getContainerId(): number; + setContainerId(value: number): void; - hasRepo(): boolean; - clearRepo(): void; - getRepo(): content_service_api_initializer_pb.GitStatus | undefined; - setRepo(value?: content_service_api_initializer_pb.GitStatus): void; + getHostId(): number; + setHostId(value: number): void; + getSize(): number; + setSize(value: number): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GitStatusResponse.AsObject; - static toObject(includeInstance: boolean, msg: GitStatusResponse): GitStatusResponse.AsObject; + toObject(includeInstance?: boolean): Mapping.AsObject; + static toObject(includeInstance: boolean, msg: Mapping): Mapping.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GitStatusResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GitStatusResponse; - static deserializeBinaryFromReader(message: GitStatusResponse, reader: jspb.BinaryReader): GitStatusResponse; -} + static serializeBinaryToWriter(message: Mapping, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Mapping; + static deserializeBinaryFromReader(message: Mapping, reader: jspb.BinaryReader): Mapping; + } -export namespace GitStatusResponse { + export namespace Mapping { export type AsObject = { - repo?: content_service_api_initializer_pb.GitStatus.AsObject, + containerId: number, + hostId: number, + size: number, } + } } + diff --git a/components/ws-daemon-api/typescript/src/workspace_pb.js b/components/ws-daemon-api/typescript/src/workspace_pb.js index 2bc7e2ec54d484..2cacfb7be34424 100644 --- a/components/ws-daemon-api/typescript/src/workspace_pb.js +++ b/components/ws-daemon-api/typescript/src/workspace_pb.js @@ -25,6 +25,9 @@ goog.exportSymbol('proto.wsbs.GitStatusRequest', null, global); goog.exportSymbol('proto.wsbs.GitStatusResponse', null, global); goog.exportSymbol('proto.wsbs.PauseTheiaRequest', null, global); goog.exportSymbol('proto.wsbs.PauseTheiaResponse', null, global); +goog.exportSymbol('proto.wsbs.UidmapCanaryRequest', null, global); +goog.exportSymbol('proto.wsbs.UidmapCanaryRequest.Mapping', null, global); +goog.exportSymbol('proto.wsbs.UidmapCanaryResponse', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -151,6 +154,69 @@ if (goog.DEBUG && !COMPILED) { */ proto.wsbs.GitStatusResponse.displayName = 'proto.wsbs.GitStatusResponse'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.wsbs.UidmapCanaryResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.wsbs.UidmapCanaryResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.wsbs.UidmapCanaryResponse.displayName = 'proto.wsbs.UidmapCanaryResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.wsbs.UidmapCanaryRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.wsbs.UidmapCanaryRequest.repeatedFields_, null); +}; +goog.inherits(proto.wsbs.UidmapCanaryRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.wsbs.UidmapCanaryRequest.displayName = 'proto.wsbs.UidmapCanaryRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.wsbs.UidmapCanaryRequest.Mapping = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.wsbs.UidmapCanaryRequest.Mapping, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.wsbs.UidmapCanaryRequest.Mapping.displayName = 'proto.wsbs.UidmapCanaryRequest.Mapping'; +} @@ -819,4 +885,545 @@ proto.wsbs.GitStatusResponse.prototype.hasRepo = function() { }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.wsbs.UidmapCanaryResponse.prototype.toObject = function(opt_includeInstance) { + return proto.wsbs.UidmapCanaryResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.wsbs.UidmapCanaryResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.wsbs.UidmapCanaryResponse.toObject = function(includeInstance, msg) { + var f, obj = { + message: jspb.Message.getFieldWithDefault(msg, 1, ""), + errorCode: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.wsbs.UidmapCanaryResponse} + */ +proto.wsbs.UidmapCanaryResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.wsbs.UidmapCanaryResponse; + return proto.wsbs.UidmapCanaryResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.wsbs.UidmapCanaryResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.wsbs.UidmapCanaryResponse} + */ +proto.wsbs.UidmapCanaryResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setErrorCode(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.wsbs.UidmapCanaryResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.wsbs.UidmapCanaryResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.wsbs.UidmapCanaryResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.wsbs.UidmapCanaryResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getErrorCode(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } +}; + + +/** + * optional string message = 1; + * @return {string} + */ +proto.wsbs.UidmapCanaryResponse.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.wsbs.UidmapCanaryResponse.prototype.setMessage = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional uint32 error_code = 2; + * @return {number} + */ +proto.wsbs.UidmapCanaryResponse.prototype.getErrorCode = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.wsbs.UidmapCanaryResponse.prototype.setErrorCode = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.wsbs.UidmapCanaryRequest.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.wsbs.UidmapCanaryRequest.prototype.toObject = function(opt_includeInstance) { + return proto.wsbs.UidmapCanaryRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.wsbs.UidmapCanaryRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.wsbs.UidmapCanaryRequest.toObject = function(includeInstance, msg) { + var f, obj = { + pid: jspb.Message.getFieldWithDefault(msg, 1, 0), + gid: jspb.Message.getFieldWithDefault(msg, 2, false), + mappingList: jspb.Message.toObjectList(msg.getMappingList(), + proto.wsbs.UidmapCanaryRequest.Mapping.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.wsbs.UidmapCanaryRequest} + */ +proto.wsbs.UidmapCanaryRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.wsbs.UidmapCanaryRequest; + return proto.wsbs.UidmapCanaryRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.wsbs.UidmapCanaryRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.wsbs.UidmapCanaryRequest} + */ +proto.wsbs.UidmapCanaryRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setPid(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setGid(value); + break; + case 3: + var value = new proto.wsbs.UidmapCanaryRequest.Mapping; + reader.readMessage(value,proto.wsbs.UidmapCanaryRequest.Mapping.deserializeBinaryFromReader); + msg.addMapping(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.wsbs.UidmapCanaryRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.wsbs.UidmapCanaryRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.wsbs.UidmapCanaryRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.wsbs.UidmapCanaryRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPid(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getGid(); + if (f) { + writer.writeBool( + 2, + f + ); + } + f = message.getMappingList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.wsbs.UidmapCanaryRequest.Mapping.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.wsbs.UidmapCanaryRequest.Mapping.prototype.toObject = function(opt_includeInstance) { + return proto.wsbs.UidmapCanaryRequest.Mapping.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.wsbs.UidmapCanaryRequest.Mapping} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.wsbs.UidmapCanaryRequest.Mapping.toObject = function(includeInstance, msg) { + var f, obj = { + containerId: jspb.Message.getFieldWithDefault(msg, 1, 0), + hostId: jspb.Message.getFieldWithDefault(msg, 2, 0), + size: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.wsbs.UidmapCanaryRequest.Mapping} + */ +proto.wsbs.UidmapCanaryRequest.Mapping.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.wsbs.UidmapCanaryRequest.Mapping; + return proto.wsbs.UidmapCanaryRequest.Mapping.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.wsbs.UidmapCanaryRequest.Mapping} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.wsbs.UidmapCanaryRequest.Mapping} + */ +proto.wsbs.UidmapCanaryRequest.Mapping.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setContainerId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setHostId(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint32()); + msg.setSize(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.wsbs.UidmapCanaryRequest.Mapping.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.wsbs.UidmapCanaryRequest.Mapping.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.wsbs.UidmapCanaryRequest.Mapping} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.wsbs.UidmapCanaryRequest.Mapping.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getContainerId(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getHostId(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } + f = message.getSize(); + if (f !== 0) { + writer.writeUint32( + 3, + f + ); + } +}; + + +/** + * optional uint32 container_id = 1; + * @return {number} + */ +proto.wsbs.UidmapCanaryRequest.Mapping.prototype.getContainerId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.wsbs.UidmapCanaryRequest.Mapping.prototype.setContainerId = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint32 host_id = 2; + * @return {number} + */ +proto.wsbs.UidmapCanaryRequest.Mapping.prototype.getHostId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.wsbs.UidmapCanaryRequest.Mapping.prototype.setHostId = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint32 size = 3; + * @return {number} + */ +proto.wsbs.UidmapCanaryRequest.Mapping.prototype.getSize = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.wsbs.UidmapCanaryRequest.Mapping.prototype.setSize = function(value) { + jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 pid = 1; + * @return {number} + */ +proto.wsbs.UidmapCanaryRequest.prototype.getPid = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.wsbs.UidmapCanaryRequest.prototype.setPid = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional bool gid = 2; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.wsbs.UidmapCanaryRequest.prototype.getGid = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 2, false)); +}; + + +/** @param {boolean} value */ +proto.wsbs.UidmapCanaryRequest.prototype.setGid = function(value) { + jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * repeated Mapping mapping = 3; + * @return {!Array} + */ +proto.wsbs.UidmapCanaryRequest.prototype.getMappingList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.wsbs.UidmapCanaryRequest.Mapping, 3)); +}; + + +/** @param {!Array} value */ +proto.wsbs.UidmapCanaryRequest.prototype.setMappingList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.wsbs.UidmapCanaryRequest.Mapping=} opt_value + * @param {number=} opt_index + * @return {!proto.wsbs.UidmapCanaryRequest.Mapping} + */ +proto.wsbs.UidmapCanaryRequest.prototype.addMapping = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.wsbs.UidmapCanaryRequest.Mapping, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.wsbs.UidmapCanaryRequest.prototype.clearMappingList = function() { + this.setMappingList([]); +}; + + goog.object.extend(exports, proto.wsbs); diff --git a/components/ws-daemon-api/typescript/src/wssync_grpc_pb.d.ts b/components/ws-daemon-api/typescript/src/wssync_grpc_pb.d.ts deleted file mode 100644 index cf17addd5b6b9e..00000000000000 --- a/components/ws-daemon-api/typescript/src/wssync_grpc_pb.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright (c) 2020 TypeFox GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License-AGPL.txt in the project root for license information. - */ - -// package: wssync -// file: wssync.proto - -/* tslint:disable */ - -import * as grpc from "grpc"; -import * as wssync_pb from "./wssync_pb"; -import * as content_service_api_initializer_pb from "@gitpod/content-service/lib"; - -interface IWorkspaceContentServiceService extends grpc.ServiceDefinition { - initWorkspace: IWorkspaceContentServiceService_IInitWorkspace; - waitForInit: IWorkspaceContentServiceService_IWaitForInit; - takeSnapshot: IWorkspaceContentServiceService_ITakeSnapshot; - disposeWorkspace: IWorkspaceContentServiceService_IDisposeWorkspace; -} - -interface IWorkspaceContentServiceService_IInitWorkspace extends grpc.MethodDefinition { - path: string; // "/wssync.WorkspaceContentService/InitWorkspace" - requestStream: boolean; // false - responseStream: boolean; // false - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IWorkspaceContentServiceService_IWaitForInit extends grpc.MethodDefinition { - path: string; // "/wssync.WorkspaceContentService/WaitForInit" - requestStream: boolean; // false - responseStream: boolean; // false - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IWorkspaceContentServiceService_ITakeSnapshot extends grpc.MethodDefinition { - path: string; // "/wssync.WorkspaceContentService/TakeSnapshot" - requestStream: boolean; // false - responseStream: boolean; // false - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IWorkspaceContentServiceService_IDisposeWorkspace extends grpc.MethodDefinition { - path: string; // "/wssync.WorkspaceContentService/DisposeWorkspace" - requestStream: boolean; // false - responseStream: boolean; // false - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} - -export const WorkspaceContentServiceService: IWorkspaceContentServiceService; - -export interface IWorkspaceContentServiceServer { - initWorkspace: grpc.handleUnaryCall; - waitForInit: grpc.handleUnaryCall; - takeSnapshot: grpc.handleUnaryCall; - disposeWorkspace: grpc.handleUnaryCall; -} - -export interface IWorkspaceContentServiceClient { - initWorkspace(request: wssync_pb.InitWorkspaceRequest, callback: (error: grpc.ServiceError | null, response: wssync_pb.InitWorkspaceResponse) => void): grpc.ClientUnaryCall; - initWorkspace(request: wssync_pb.InitWorkspaceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wssync_pb.InitWorkspaceResponse) => void): grpc.ClientUnaryCall; - initWorkspace(request: wssync_pb.InitWorkspaceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: wssync_pb.InitWorkspaceResponse) => void): grpc.ClientUnaryCall; - waitForInit(request: wssync_pb.WaitForInitRequest, callback: (error: grpc.ServiceError | null, response: wssync_pb.WaitForInitResponse) => void): grpc.ClientUnaryCall; - waitForInit(request: wssync_pb.WaitForInitRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wssync_pb.WaitForInitResponse) => void): grpc.ClientUnaryCall; - waitForInit(request: wssync_pb.WaitForInitRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: wssync_pb.WaitForInitResponse) => void): grpc.ClientUnaryCall; - takeSnapshot(request: wssync_pb.TakeSnapshotRequest, callback: (error: grpc.ServiceError | null, response: wssync_pb.TakeSnapshotResponse) => void): grpc.ClientUnaryCall; - takeSnapshot(request: wssync_pb.TakeSnapshotRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wssync_pb.TakeSnapshotResponse) => void): grpc.ClientUnaryCall; - takeSnapshot(request: wssync_pb.TakeSnapshotRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: wssync_pb.TakeSnapshotResponse) => void): grpc.ClientUnaryCall; - disposeWorkspace(request: wssync_pb.DisposeWorkspaceRequest, callback: (error: grpc.ServiceError | null, response: wssync_pb.DisposeWorkspaceResponse) => void): grpc.ClientUnaryCall; - disposeWorkspace(request: wssync_pb.DisposeWorkspaceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wssync_pb.DisposeWorkspaceResponse) => void): grpc.ClientUnaryCall; - disposeWorkspace(request: wssync_pb.DisposeWorkspaceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: wssync_pb.DisposeWorkspaceResponse) => void): grpc.ClientUnaryCall; -} - -export class WorkspaceContentServiceClient extends grpc.Client implements IWorkspaceContentServiceClient { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - public initWorkspace(request: wssync_pb.InitWorkspaceRequest, callback: (error: grpc.ServiceError | null, response: wssync_pb.InitWorkspaceResponse) => void): grpc.ClientUnaryCall; - public initWorkspace(request: wssync_pb.InitWorkspaceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wssync_pb.InitWorkspaceResponse) => void): grpc.ClientUnaryCall; - public initWorkspace(request: wssync_pb.InitWorkspaceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: wssync_pb.InitWorkspaceResponse) => void): grpc.ClientUnaryCall; - public waitForInit(request: wssync_pb.WaitForInitRequest, callback: (error: grpc.ServiceError | null, response: wssync_pb.WaitForInitResponse) => void): grpc.ClientUnaryCall; - public waitForInit(request: wssync_pb.WaitForInitRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wssync_pb.WaitForInitResponse) => void): grpc.ClientUnaryCall; - public waitForInit(request: wssync_pb.WaitForInitRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: wssync_pb.WaitForInitResponse) => void): grpc.ClientUnaryCall; - public takeSnapshot(request: wssync_pb.TakeSnapshotRequest, callback: (error: grpc.ServiceError | null, response: wssync_pb.TakeSnapshotResponse) => void): grpc.ClientUnaryCall; - public takeSnapshot(request: wssync_pb.TakeSnapshotRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wssync_pb.TakeSnapshotResponse) => void): grpc.ClientUnaryCall; - public takeSnapshot(request: wssync_pb.TakeSnapshotRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: wssync_pb.TakeSnapshotResponse) => void): grpc.ClientUnaryCall; - public disposeWorkspace(request: wssync_pb.DisposeWorkspaceRequest, callback: (error: grpc.ServiceError | null, response: wssync_pb.DisposeWorkspaceResponse) => void): grpc.ClientUnaryCall; - public disposeWorkspace(request: wssync_pb.DisposeWorkspaceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wssync_pb.DisposeWorkspaceResponse) => void): grpc.ClientUnaryCall; - public disposeWorkspace(request: wssync_pb.DisposeWorkspaceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: wssync_pb.DisposeWorkspaceResponse) => void): grpc.ClientUnaryCall; -} diff --git a/components/ws-daemon-api/typescript/src/wssync_grpc_pb.js b/components/ws-daemon-api/typescript/src/wssync_grpc_pb.js deleted file mode 100644 index b471d2d2b4fe9e..00000000000000 --- a/components/ws-daemon-api/typescript/src/wssync_grpc_pb.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Copyright (c) 2020 TypeFox GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License-AGPL.txt in the project root for license information. - */ - -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('grpc'); -var wssync_pb = require('./wssync_pb.js'); -var content$service$api_initializer_pb = require('@gitpod/content-service/lib'); - -function serialize_wssync_DisposeWorkspaceRequest(arg) { - if (!(arg instanceof wssync_pb.DisposeWorkspaceRequest)) { - throw new Error('Expected argument of type wssync.DisposeWorkspaceRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_wssync_DisposeWorkspaceRequest(buffer_arg) { - return wssync_pb.DisposeWorkspaceRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_wssync_DisposeWorkspaceResponse(arg) { - if (!(arg instanceof wssync_pb.DisposeWorkspaceResponse)) { - throw new Error('Expected argument of type wssync.DisposeWorkspaceResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_wssync_DisposeWorkspaceResponse(buffer_arg) { - return wssync_pb.DisposeWorkspaceResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_wssync_InitWorkspaceRequest(arg) { - if (!(arg instanceof wssync_pb.InitWorkspaceRequest)) { - throw new Error('Expected argument of type wssync.InitWorkspaceRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_wssync_InitWorkspaceRequest(buffer_arg) { - return wssync_pb.InitWorkspaceRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_wssync_InitWorkspaceResponse(arg) { - if (!(arg instanceof wssync_pb.InitWorkspaceResponse)) { - throw new Error('Expected argument of type wssync.InitWorkspaceResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_wssync_InitWorkspaceResponse(buffer_arg) { - return wssync_pb.InitWorkspaceResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_wssync_TakeSnapshotRequest(arg) { - if (!(arg instanceof wssync_pb.TakeSnapshotRequest)) { - throw new Error('Expected argument of type wssync.TakeSnapshotRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_wssync_TakeSnapshotRequest(buffer_arg) { - return wssync_pb.TakeSnapshotRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_wssync_TakeSnapshotResponse(arg) { - if (!(arg instanceof wssync_pb.TakeSnapshotResponse)) { - throw new Error('Expected argument of type wssync.TakeSnapshotResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_wssync_TakeSnapshotResponse(buffer_arg) { - return wssync_pb.TakeSnapshotResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_wssync_WaitForInitRequest(arg) { - if (!(arg instanceof wssync_pb.WaitForInitRequest)) { - throw new Error('Expected argument of type wssync.WaitForInitRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_wssync_WaitForInitRequest(buffer_arg) { - return wssync_pb.WaitForInitRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_wssync_WaitForInitResponse(arg) { - if (!(arg instanceof wssync_pb.WaitForInitResponse)) { - throw new Error('Expected argument of type wssync.WaitForInitResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_wssync_WaitForInitResponse(buffer_arg) { - return wssync_pb.WaitForInitResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -var WorkspaceContentServiceService = exports.WorkspaceContentServiceService = { - // initWorkspace intialises a new workspace folder in the working area - initWorkspace: { - path: '/wssync.WorkspaceContentService/InitWorkspace', - requestStream: false, - responseStream: false, - requestType: wssync_pb.InitWorkspaceRequest, - responseType: wssync_pb.InitWorkspaceResponse, - requestSerialize: serialize_wssync_InitWorkspaceRequest, - requestDeserialize: deserialize_wssync_InitWorkspaceRequest, - responseSerialize: serialize_wssync_InitWorkspaceResponse, - responseDeserialize: deserialize_wssync_InitWorkspaceResponse, - }, - // WaitForInit waits until a workspace is fully initialized. - // If the workspace is already initialized, this function returns immediately. - // If there is no initialization is going on, an error is returned. - waitForInit: { - path: '/wssync.WorkspaceContentService/WaitForInit', - requestStream: false, - responseStream: false, - requestType: wssync_pb.WaitForInitRequest, - responseType: wssync_pb.WaitForInitResponse, - requestSerialize: serialize_wssync_WaitForInitRequest, - requestDeserialize: deserialize_wssync_WaitForInitRequest, - responseSerialize: serialize_wssync_WaitForInitResponse, - responseDeserialize: deserialize_wssync_WaitForInitResponse, - }, - // TakeSnapshot creates a backup/snapshot of a workspace - takeSnapshot: { - path: '/wssync.WorkspaceContentService/TakeSnapshot', - requestStream: false, - responseStream: false, - requestType: wssync_pb.TakeSnapshotRequest, - responseType: wssync_pb.TakeSnapshotResponse, - requestSerialize: serialize_wssync_TakeSnapshotRequest, - requestDeserialize: deserialize_wssync_TakeSnapshotRequest, - responseSerialize: serialize_wssync_TakeSnapshotResponse, - responseDeserialize: deserialize_wssync_TakeSnapshotResponse, - }, - // disposeWorkspace cleans up a workspace, possibly after taking a final backup - disposeWorkspace: { - path: '/wssync.WorkspaceContentService/DisposeWorkspace', - requestStream: false, - responseStream: false, - requestType: wssync_pb.DisposeWorkspaceRequest, - responseType: wssync_pb.DisposeWorkspaceResponse, - requestSerialize: serialize_wssync_DisposeWorkspaceRequest, - requestDeserialize: deserialize_wssync_DisposeWorkspaceRequest, - responseSerialize: serialize_wssync_DisposeWorkspaceResponse, - responseDeserialize: deserialize_wssync_DisposeWorkspaceResponse, - }, -}; - -exports.WorkspaceContentServiceClient = grpc.makeGenericClientConstructor(WorkspaceContentServiceService); diff --git a/components/ws-daemon-api/typescript/src/wssync_pb.d.ts b/components/ws-daemon-api/typescript/src/wssync_pb.d.ts deleted file mode 100644 index b119a885dcb3eb..00000000000000 --- a/components/ws-daemon-api/typescript/src/wssync_pb.d.ts +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Copyright (c) 2020 TypeFox GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License-AGPL.txt in the project root for license information. - */ - -// package: wssync -// file: wssync.proto - -/* tslint:disable */ - -import * as jspb from "google-protobuf"; -import * as content_service_api_initializer_pb from "@gitpod/content-service/lib"; - -export class InitWorkspaceRequest extends jspb.Message { - getId(): string; - setId(value: string): void; - - - hasMetadata(): boolean; - clearMetadata(): void; - getMetadata(): WorkspaceMetadata | undefined; - setMetadata(value?: WorkspaceMetadata): void; - - - hasInitializer(): boolean; - clearInitializer(): void; - getInitializer(): content_service_api_initializer_pb.WorkspaceInitializer | undefined; - setInitializer(value?: content_service_api_initializer_pb.WorkspaceInitializer): void; - - getFullWorkspaceBackup(): boolean; - setFullWorkspaceBackup(value: boolean): void; - - getContentManifest(): Uint8Array | string; - getContentManifest_asU8(): Uint8Array; - getContentManifest_asB64(): string; - setContentManifest(value: Uint8Array | string): void; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): InitWorkspaceRequest.AsObject; - static toObject(includeInstance: boolean, msg: InitWorkspaceRequest): InitWorkspaceRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: InitWorkspaceRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): InitWorkspaceRequest; - static deserializeBinaryFromReader(message: InitWorkspaceRequest, reader: jspb.BinaryReader): InitWorkspaceRequest; -} - -export namespace InitWorkspaceRequest { - export type AsObject = { - id: string, - metadata?: WorkspaceMetadata.AsObject, - initializer?: content_service_api_initializer_pb.WorkspaceInitializer.AsObject, - fullWorkspaceBackup: boolean, - contentManifest: Uint8Array | string, - } -} - -export class WorkspaceMetadata extends jspb.Message { - getOwner(): string; - setOwner(value: string): void; - - getMetaId(): string; - setMetaId(value: string): void; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WorkspaceMetadata.AsObject; - static toObject(includeInstance: boolean, msg: WorkspaceMetadata): WorkspaceMetadata.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WorkspaceMetadata, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WorkspaceMetadata; - static deserializeBinaryFromReader(message: WorkspaceMetadata, reader: jspb.BinaryReader): WorkspaceMetadata; -} - -export namespace WorkspaceMetadata { - export type AsObject = { - owner: string, - metaId: string, - } -} - -export class InitWorkspaceResponse extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): InitWorkspaceResponse.AsObject; - static toObject(includeInstance: boolean, msg: InitWorkspaceResponse): InitWorkspaceResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: InitWorkspaceResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): InitWorkspaceResponse; - static deserializeBinaryFromReader(message: InitWorkspaceResponse, reader: jspb.BinaryReader): InitWorkspaceResponse; -} - -export namespace InitWorkspaceResponse { - export type AsObject = { - } -} - -export class WaitForInitRequest extends jspb.Message { - getId(): string; - setId(value: string): void; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WaitForInitRequest.AsObject; - static toObject(includeInstance: boolean, msg: WaitForInitRequest): WaitForInitRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WaitForInitRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WaitForInitRequest; - static deserializeBinaryFromReader(message: WaitForInitRequest, reader: jspb.BinaryReader): WaitForInitRequest; -} - -export namespace WaitForInitRequest { - export type AsObject = { - id: string, - } -} - -export class WaitForInitResponse extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WaitForInitResponse.AsObject; - static toObject(includeInstance: boolean, msg: WaitForInitResponse): WaitForInitResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WaitForInitResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WaitForInitResponse; - static deserializeBinaryFromReader(message: WaitForInitResponse, reader: jspb.BinaryReader): WaitForInitResponse; -} - -export namespace WaitForInitResponse { - export type AsObject = { - } -} - -export class TakeSnapshotRequest extends jspb.Message { - getId(): string; - setId(value: string): void; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TakeSnapshotRequest.AsObject; - static toObject(includeInstance: boolean, msg: TakeSnapshotRequest): TakeSnapshotRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TakeSnapshotRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TakeSnapshotRequest; - static deserializeBinaryFromReader(message: TakeSnapshotRequest, reader: jspb.BinaryReader): TakeSnapshotRequest; -} - -export namespace TakeSnapshotRequest { - export type AsObject = { - id: string, - } -} - -export class TakeSnapshotResponse extends jspb.Message { - getUrl(): string; - setUrl(value: string): void; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TakeSnapshotResponse.AsObject; - static toObject(includeInstance: boolean, msg: TakeSnapshotResponse): TakeSnapshotResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TakeSnapshotResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TakeSnapshotResponse; - static deserializeBinaryFromReader(message: TakeSnapshotResponse, reader: jspb.BinaryReader): TakeSnapshotResponse; -} - -export namespace TakeSnapshotResponse { - export type AsObject = { - url: string, - } -} - -export class DisposeWorkspaceRequest extends jspb.Message { - getId(): string; - setId(value: string): void; - - getBackup(): boolean; - setBackup(value: boolean): void; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DisposeWorkspaceRequest.AsObject; - static toObject(includeInstance: boolean, msg: DisposeWorkspaceRequest): DisposeWorkspaceRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DisposeWorkspaceRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DisposeWorkspaceRequest; - static deserializeBinaryFromReader(message: DisposeWorkspaceRequest, reader: jspb.BinaryReader): DisposeWorkspaceRequest; -} - -export namespace DisposeWorkspaceRequest { - export type AsObject = { - id: string, - backup: boolean, - } -} - -export class DisposeWorkspaceResponse extends jspb.Message { - - hasGitStatus(): boolean; - clearGitStatus(): void; - getGitStatus(): content_service_api_initializer_pb.GitStatus | undefined; - setGitStatus(value?: content_service_api_initializer_pb.GitStatus): void; - - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DisposeWorkspaceResponse.AsObject; - static toObject(includeInstance: boolean, msg: DisposeWorkspaceResponse): DisposeWorkspaceResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DisposeWorkspaceResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DisposeWorkspaceResponse; - static deserializeBinaryFromReader(message: DisposeWorkspaceResponse, reader: jspb.BinaryReader): DisposeWorkspaceResponse; -} - -export namespace DisposeWorkspaceResponse { - export type AsObject = { - gitStatus?: content_service_api_initializer_pb.GitStatus.AsObject, - } -} - -export enum WorkspaceContentState { - NONE = 0, - SETTING_UP = 1, - AVAILABLE = 2, - WRAPPING_UP = 3, -} diff --git a/components/ws-daemon-api/typescript/wssync_pb.js b/components/ws-daemon-api/typescript/wssync_pb.js deleted file mode 100644 index fecf374569dd0a..00000000000000 --- a/components/ws-daemon-api/typescript/wssync_pb.js +++ /dev/null @@ -1,3313 +0,0 @@ -/** - * @fileoverview - * @enhanceable - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.wssync.CloneTargetMode', null, global); -goog.exportSymbol('proto.wssync.DisposeWorkspaceRequest', null, global); -goog.exportSymbol('proto.wssync.DisposeWorkspaceResponse', null, global); -goog.exportSymbol('proto.wssync.EmptyInitializer', null, global); -goog.exportSymbol('proto.wssync.GitAuthMethod', null, global); -goog.exportSymbol('proto.wssync.GitConfig', null, global); -goog.exportSymbol('proto.wssync.GitInitializer', null, global); -goog.exportSymbol('proto.wssync.GitStatus', null, global); -goog.exportSymbol('proto.wssync.InitWorkspaceRequest', null, global); -goog.exportSymbol('proto.wssync.InitWorkspaceResponse', null, global); -goog.exportSymbol('proto.wssync.PrebuildInitializer', null, global); -goog.exportSymbol('proto.wssync.SnapshotInitializer', null, global); -goog.exportSymbol('proto.wssync.TakeSnapshotRequest', null, global); -goog.exportSymbol('proto.wssync.TakeSnapshotResponse', null, global); -goog.exportSymbol('proto.wssync.WaitForInitRequest', null, global); -goog.exportSymbol('proto.wssync.WaitForInitResponse', null, global); -goog.exportSymbol('proto.wssync.WorkspaceContentState', null, global); -goog.exportSymbol('proto.wssync.WorkspaceInitializer', null, global); -goog.exportSymbol('proto.wssync.WorkspaceMetadata', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.InitWorkspaceRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.InitWorkspaceRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.InitWorkspaceRequest.displayName = 'proto.wssync.InitWorkspaceRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.WorkspaceMetadata = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.WorkspaceMetadata, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.WorkspaceMetadata.displayName = 'proto.wssync.WorkspaceMetadata'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.WorkspaceInitializer = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.wssync.WorkspaceInitializer.oneofGroups_); -}; -goog.inherits(proto.wssync.WorkspaceInitializer, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.WorkspaceInitializer.displayName = 'proto.wssync.WorkspaceInitializer'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.EmptyInitializer = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.EmptyInitializer, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.EmptyInitializer.displayName = 'proto.wssync.EmptyInitializer'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.GitInitializer = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.GitInitializer, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.GitInitializer.displayName = 'proto.wssync.GitInitializer'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.GitConfig = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.GitConfig, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.GitConfig.displayName = 'proto.wssync.GitConfig'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.SnapshotInitializer = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.SnapshotInitializer, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.SnapshotInitializer.displayName = 'proto.wssync.SnapshotInitializer'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.PrebuildInitializer = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.PrebuildInitializer, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.PrebuildInitializer.displayName = 'proto.wssync.PrebuildInitializer'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.InitWorkspaceResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.InitWorkspaceResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.InitWorkspaceResponse.displayName = 'proto.wssync.InitWorkspaceResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.WaitForInitRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.WaitForInitRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.WaitForInitRequest.displayName = 'proto.wssync.WaitForInitRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.WaitForInitResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.WaitForInitResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.WaitForInitResponse.displayName = 'proto.wssync.WaitForInitResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.TakeSnapshotRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.TakeSnapshotRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.TakeSnapshotRequest.displayName = 'proto.wssync.TakeSnapshotRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.TakeSnapshotResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.TakeSnapshotResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.TakeSnapshotResponse.displayName = 'proto.wssync.TakeSnapshotResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.DisposeWorkspaceRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.DisposeWorkspaceRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.DisposeWorkspaceRequest.displayName = 'proto.wssync.DisposeWorkspaceRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.DisposeWorkspaceResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.wssync.DisposeWorkspaceResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.DisposeWorkspaceResponse.displayName = 'proto.wssync.DisposeWorkspaceResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.wssync.GitStatus = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.wssync.GitStatus.repeatedFields_, null); -}; -goog.inherits(proto.wssync.GitStatus, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.wssync.GitStatus.displayName = 'proto.wssync.GitStatus'; -} - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.InitWorkspaceRequest.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.InitWorkspaceRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.InitWorkspaceRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.InitWorkspaceRequest.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - metadata: (f = msg.getMetadata()) && proto.wssync.WorkspaceMetadata.toObject(includeInstance, f), - initializer: (f = msg.getInitializer()) && proto.wssync.WorkspaceInitializer.toObject(includeInstance, f), - fullWorkspaceBackup: jspb.Message.getFieldWithDefault(msg, 4, false), - contentManifest: msg.getContentManifest_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.InitWorkspaceRequest} - */ -proto.wssync.InitWorkspaceRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.InitWorkspaceRequest; - return proto.wssync.InitWorkspaceRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.InitWorkspaceRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.InitWorkspaceRequest} - */ -proto.wssync.InitWorkspaceRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - case 2: - var value = new proto.wssync.WorkspaceMetadata; - reader.readMessage(value,proto.wssync.WorkspaceMetadata.deserializeBinaryFromReader); - msg.setMetadata(value); - break; - case 3: - var value = new proto.wssync.WorkspaceInitializer; - reader.readMessage(value,proto.wssync.WorkspaceInitializer.deserializeBinaryFromReader); - msg.setInitializer(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setFullWorkspaceBackup(value); - break; - case 5: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setContentManifest(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.InitWorkspaceRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.InitWorkspaceRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.InitWorkspaceRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.InitWorkspaceRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getMetadata(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.wssync.WorkspaceMetadata.serializeBinaryToWriter - ); - } - f = message.getInitializer(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.wssync.WorkspaceInitializer.serializeBinaryToWriter - ); - } - f = message.getFullWorkspaceBackup(); - if (f) { - writer.writeBool( - 4, - f - ); - } - f = message.getContentManifest_asU8(); - if (f.length > 0) { - writer.writeBytes( - 5, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.wssync.InitWorkspaceRequest.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.wssync.InitWorkspaceRequest.prototype.setId = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional WorkspaceMetadata metadata = 2; - * @return {?proto.wssync.WorkspaceMetadata} - */ -proto.wssync.InitWorkspaceRequest.prototype.getMetadata = function() { - return /** @type{?proto.wssync.WorkspaceMetadata} */ ( - jspb.Message.getWrapperField(this, proto.wssync.WorkspaceMetadata, 2)); -}; - - -/** @param {?proto.wssync.WorkspaceMetadata|undefined} value */ -proto.wssync.InitWorkspaceRequest.prototype.setMetadata = function(value) { - jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.InitWorkspaceRequest.prototype.clearMetadata = function() { - this.setMetadata(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.InitWorkspaceRequest.prototype.hasMetadata = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional WorkspaceInitializer initializer = 3; - * @return {?proto.wssync.WorkspaceInitializer} - */ -proto.wssync.InitWorkspaceRequest.prototype.getInitializer = function() { - return /** @type{?proto.wssync.WorkspaceInitializer} */ ( - jspb.Message.getWrapperField(this, proto.wssync.WorkspaceInitializer, 3)); -}; - - -/** @param {?proto.wssync.WorkspaceInitializer|undefined} value */ -proto.wssync.InitWorkspaceRequest.prototype.setInitializer = function(value) { - jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.InitWorkspaceRequest.prototype.clearInitializer = function() { - this.setInitializer(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.InitWorkspaceRequest.prototype.hasInitializer = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional bool full_workspace_backup = 4; - * Note that Boolean fields may be set to 0/1 when serialized from a Java server. - * You should avoid comparisons like {@code val === true/false} in those cases. - * @return {boolean} - */ -proto.wssync.InitWorkspaceRequest.prototype.getFullWorkspaceBackup = function() { - return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false)); -}; - - -/** @param {boolean} value */ -proto.wssync.InitWorkspaceRequest.prototype.setFullWorkspaceBackup = function(value) { - jspb.Message.setProto3BooleanField(this, 4, value); -}; - - -/** - * optional bytes content_manifest = 5; - * @return {!(string|Uint8Array)} - */ -proto.wssync.InitWorkspaceRequest.prototype.getContentManifest = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * optional bytes content_manifest = 5; - * This is a type-conversion wrapper around `getContentManifest()` - * @return {string} - */ -proto.wssync.InitWorkspaceRequest.prototype.getContentManifest_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getContentManifest())); -}; - - -/** - * optional bytes content_manifest = 5; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getContentManifest()` - * @return {!Uint8Array} - */ -proto.wssync.InitWorkspaceRequest.prototype.getContentManifest_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getContentManifest())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.wssync.InitWorkspaceRequest.prototype.setContentManifest = function(value) { - jspb.Message.setProto3BytesField(this, 5, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.WorkspaceMetadata.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.WorkspaceMetadata.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.WorkspaceMetadata} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.WorkspaceMetadata.toObject = function(includeInstance, msg) { - var f, obj = { - owner: jspb.Message.getFieldWithDefault(msg, 1, ""), - metaId: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.WorkspaceMetadata} - */ -proto.wssync.WorkspaceMetadata.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.WorkspaceMetadata; - return proto.wssync.WorkspaceMetadata.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.WorkspaceMetadata} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.WorkspaceMetadata} - */ -proto.wssync.WorkspaceMetadata.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setOwner(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setMetaId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.WorkspaceMetadata.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.WorkspaceMetadata.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.WorkspaceMetadata} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.WorkspaceMetadata.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getOwner(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getMetaId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string owner = 1; - * @return {string} - */ -proto.wssync.WorkspaceMetadata.prototype.getOwner = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.wssync.WorkspaceMetadata.prototype.setOwner = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string meta_id = 2; - * @return {string} - */ -proto.wssync.WorkspaceMetadata.prototype.getMetaId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.wssync.WorkspaceMetadata.prototype.setMetaId = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.wssync.WorkspaceInitializer.oneofGroups_ = [[6,7,8,9]]; - -/** - * @enum {number} - */ -proto.wssync.WorkspaceInitializer.SpecCase = { - SPEC_NOT_SET: 0, - EMPTY: 6, - GIT: 7, - SNAPSHOT: 8, - PREBUILD: 9 -}; - -/** - * @return {proto.wssync.WorkspaceInitializer.SpecCase} - */ -proto.wssync.WorkspaceInitializer.prototype.getSpecCase = function() { - return /** @type {proto.wssync.WorkspaceInitializer.SpecCase} */(jspb.Message.computeOneofCase(this, proto.wssync.WorkspaceInitializer.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.WorkspaceInitializer.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.WorkspaceInitializer.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.WorkspaceInitializer} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.WorkspaceInitializer.toObject = function(includeInstance, msg) { - var f, obj = { - empty: (f = msg.getEmpty()) && proto.wssync.EmptyInitializer.toObject(includeInstance, f), - git: (f = msg.getGit()) && proto.wssync.GitInitializer.toObject(includeInstance, f), - snapshot: (f = msg.getSnapshot()) && proto.wssync.SnapshotInitializer.toObject(includeInstance, f), - prebuild: (f = msg.getPrebuild()) && proto.wssync.PrebuildInitializer.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.WorkspaceInitializer} - */ -proto.wssync.WorkspaceInitializer.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.WorkspaceInitializer; - return proto.wssync.WorkspaceInitializer.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.WorkspaceInitializer} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.WorkspaceInitializer} - */ -proto.wssync.WorkspaceInitializer.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 6: - var value = new proto.wssync.EmptyInitializer; - reader.readMessage(value,proto.wssync.EmptyInitializer.deserializeBinaryFromReader); - msg.setEmpty(value); - break; - case 7: - var value = new proto.wssync.GitInitializer; - reader.readMessage(value,proto.wssync.GitInitializer.deserializeBinaryFromReader); - msg.setGit(value); - break; - case 8: - var value = new proto.wssync.SnapshotInitializer; - reader.readMessage(value,proto.wssync.SnapshotInitializer.deserializeBinaryFromReader); - msg.setSnapshot(value); - break; - case 9: - var value = new proto.wssync.PrebuildInitializer; - reader.readMessage(value,proto.wssync.PrebuildInitializer.deserializeBinaryFromReader); - msg.setPrebuild(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.WorkspaceInitializer.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.WorkspaceInitializer.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.WorkspaceInitializer} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.WorkspaceInitializer.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getEmpty(); - if (f != null) { - writer.writeMessage( - 6, - f, - proto.wssync.EmptyInitializer.serializeBinaryToWriter - ); - } - f = message.getGit(); - if (f != null) { - writer.writeMessage( - 7, - f, - proto.wssync.GitInitializer.serializeBinaryToWriter - ); - } - f = message.getSnapshot(); - if (f != null) { - writer.writeMessage( - 8, - f, - proto.wssync.SnapshotInitializer.serializeBinaryToWriter - ); - } - f = message.getPrebuild(); - if (f != null) { - writer.writeMessage( - 9, - f, - proto.wssync.PrebuildInitializer.serializeBinaryToWriter - ); - } -}; - - -/** - * optional EmptyInitializer empty = 6; - * @return {?proto.wssync.EmptyInitializer} - */ -proto.wssync.WorkspaceInitializer.prototype.getEmpty = function() { - return /** @type{?proto.wssync.EmptyInitializer} */ ( - jspb.Message.getWrapperField(this, proto.wssync.EmptyInitializer, 6)); -}; - - -/** @param {?proto.wssync.EmptyInitializer|undefined} value */ -proto.wssync.WorkspaceInitializer.prototype.setEmpty = function(value) { - jspb.Message.setOneofWrapperField(this, 6, proto.wssync.WorkspaceInitializer.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.WorkspaceInitializer.prototype.clearEmpty = function() { - this.setEmpty(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.WorkspaceInitializer.prototype.hasEmpty = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * optional GitInitializer git = 7; - * @return {?proto.wssync.GitInitializer} - */ -proto.wssync.WorkspaceInitializer.prototype.getGit = function() { - return /** @type{?proto.wssync.GitInitializer} */ ( - jspb.Message.getWrapperField(this, proto.wssync.GitInitializer, 7)); -}; - - -/** @param {?proto.wssync.GitInitializer|undefined} value */ -proto.wssync.WorkspaceInitializer.prototype.setGit = function(value) { - jspb.Message.setOneofWrapperField(this, 7, proto.wssync.WorkspaceInitializer.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.WorkspaceInitializer.prototype.clearGit = function() { - this.setGit(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.WorkspaceInitializer.prototype.hasGit = function() { - return jspb.Message.getField(this, 7) != null; -}; - - -/** - * optional SnapshotInitializer snapshot = 8; - * @return {?proto.wssync.SnapshotInitializer} - */ -proto.wssync.WorkspaceInitializer.prototype.getSnapshot = function() { - return /** @type{?proto.wssync.SnapshotInitializer} */ ( - jspb.Message.getWrapperField(this, proto.wssync.SnapshotInitializer, 8)); -}; - - -/** @param {?proto.wssync.SnapshotInitializer|undefined} value */ -proto.wssync.WorkspaceInitializer.prototype.setSnapshot = function(value) { - jspb.Message.setOneofWrapperField(this, 8, proto.wssync.WorkspaceInitializer.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.WorkspaceInitializer.prototype.clearSnapshot = function() { - this.setSnapshot(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.WorkspaceInitializer.prototype.hasSnapshot = function() { - return jspb.Message.getField(this, 8) != null; -}; - - -/** - * optional PrebuildInitializer prebuild = 9; - * @return {?proto.wssync.PrebuildInitializer} - */ -proto.wssync.WorkspaceInitializer.prototype.getPrebuild = function() { - return /** @type{?proto.wssync.PrebuildInitializer} */ ( - jspb.Message.getWrapperField(this, proto.wssync.PrebuildInitializer, 9)); -}; - - -/** @param {?proto.wssync.PrebuildInitializer|undefined} value */ -proto.wssync.WorkspaceInitializer.prototype.setPrebuild = function(value) { - jspb.Message.setOneofWrapperField(this, 9, proto.wssync.WorkspaceInitializer.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.WorkspaceInitializer.prototype.clearPrebuild = function() { - this.setPrebuild(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.WorkspaceInitializer.prototype.hasPrebuild = function() { - return jspb.Message.getField(this, 9) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.EmptyInitializer.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.EmptyInitializer.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.EmptyInitializer} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.EmptyInitializer.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.EmptyInitializer} - */ -proto.wssync.EmptyInitializer.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.EmptyInitializer; - return proto.wssync.EmptyInitializer.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.EmptyInitializer} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.EmptyInitializer} - */ -proto.wssync.EmptyInitializer.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.EmptyInitializer.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.EmptyInitializer.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.EmptyInitializer} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.EmptyInitializer.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.GitInitializer.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.GitInitializer.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.GitInitializer} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.GitInitializer.toObject = function(includeInstance, msg) { - var f, obj = { - remoteUri: jspb.Message.getFieldWithDefault(msg, 1, ""), - upstreamRemoteUri: jspb.Message.getFieldWithDefault(msg, 2, ""), - targetMode: jspb.Message.getFieldWithDefault(msg, 3, 0), - cloneTaget: jspb.Message.getFieldWithDefault(msg, 4, ""), - checkoutLocation: jspb.Message.getFieldWithDefault(msg, 5, ""), - config: (f = msg.getConfig()) && proto.wssync.GitConfig.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.GitInitializer} - */ -proto.wssync.GitInitializer.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.GitInitializer; - return proto.wssync.GitInitializer.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.GitInitializer} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.GitInitializer} - */ -proto.wssync.GitInitializer.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setRemoteUri(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setUpstreamRemoteUri(value); - break; - case 3: - var value = /** @type {!proto.wssync.CloneTargetMode} */ (reader.readEnum()); - msg.setTargetMode(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setCloneTaget(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setCheckoutLocation(value); - break; - case 6: - var value = new proto.wssync.GitConfig; - reader.readMessage(value,proto.wssync.GitConfig.deserializeBinaryFromReader); - msg.setConfig(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.GitInitializer.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.GitInitializer.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.GitInitializer} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.GitInitializer.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getRemoteUri(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getUpstreamRemoteUri(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getTargetMode(); - if (f !== 0.0) { - writer.writeEnum( - 3, - f - ); - } - f = message.getCloneTaget(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getCheckoutLocation(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } - f = message.getConfig(); - if (f != null) { - writer.writeMessage( - 6, - f, - proto.wssync.GitConfig.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string remote_uri = 1; - * @return {string} - */ -proto.wssync.GitInitializer.prototype.getRemoteUri = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.wssync.GitInitializer.prototype.setRemoteUri = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string upstream_Remote_uri = 2; - * @return {string} - */ -proto.wssync.GitInitializer.prototype.getUpstreamRemoteUri = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.wssync.GitInitializer.prototype.setUpstreamRemoteUri = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional CloneTargetMode target_mode = 3; - * @return {!proto.wssync.CloneTargetMode} - */ -proto.wssync.GitInitializer.prototype.getTargetMode = function() { - return /** @type {!proto.wssync.CloneTargetMode} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** @param {!proto.wssync.CloneTargetMode} value */ -proto.wssync.GitInitializer.prototype.setTargetMode = function(value) { - jspb.Message.setProto3EnumField(this, 3, value); -}; - - -/** - * optional string clone_taget = 4; - * @return {string} - */ -proto.wssync.GitInitializer.prototype.getCloneTaget = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** @param {string} value */ -proto.wssync.GitInitializer.prototype.setCloneTaget = function(value) { - jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional string checkout_location = 5; - * @return {string} - */ -proto.wssync.GitInitializer.prototype.getCheckoutLocation = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** @param {string} value */ -proto.wssync.GitInitializer.prototype.setCheckoutLocation = function(value) { - jspb.Message.setProto3StringField(this, 5, value); -}; - - -/** - * optional GitConfig config = 6; - * @return {?proto.wssync.GitConfig} - */ -proto.wssync.GitInitializer.prototype.getConfig = function() { - return /** @type{?proto.wssync.GitConfig} */ ( - jspb.Message.getWrapperField(this, proto.wssync.GitConfig, 6)); -}; - - -/** @param {?proto.wssync.GitConfig|undefined} value */ -proto.wssync.GitInitializer.prototype.setConfig = function(value) { - jspb.Message.setWrapperField(this, 6, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.GitInitializer.prototype.clearConfig = function() { - this.setConfig(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.GitInitializer.prototype.hasConfig = function() { - return jspb.Message.getField(this, 6) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.GitConfig.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.GitConfig.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.GitConfig} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.GitConfig.toObject = function(includeInstance, msg) { - var f, obj = { - customConfigMap: (f = msg.getCustomConfigMap()) ? f.toObject(includeInstance, undefined) : [], - authentication: jspb.Message.getFieldWithDefault(msg, 2, 0), - authUser: jspb.Message.getFieldWithDefault(msg, 3, ""), - authPassword: jspb.Message.getFieldWithDefault(msg, 4, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.GitConfig} - */ -proto.wssync.GitConfig.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.GitConfig; - return proto.wssync.GitConfig.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.GitConfig} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.GitConfig} - */ -proto.wssync.GitConfig.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getCustomConfigMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, ""); - }); - break; - case 2: - var value = /** @type {!proto.wssync.GitAuthMethod} */ (reader.readEnum()); - msg.setAuthentication(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setAuthUser(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setAuthPassword(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.GitConfig.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.GitConfig.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.GitConfig} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.GitConfig.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCustomConfigMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } - f = message.getAuthentication(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getAuthUser(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getAuthPassword(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } -}; - - -/** - * map custom_config = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.wssync.GitConfig.prototype.getCustomConfigMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - */ -proto.wssync.GitConfig.prototype.clearCustomConfigMap = function() { - this.getCustomConfigMap().clear(); -}; - - -/** - * optional GitAuthMethod authentication = 2; - * @return {!proto.wssync.GitAuthMethod} - */ -proto.wssync.GitConfig.prototype.getAuthentication = function() { - return /** @type {!proto.wssync.GitAuthMethod} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {!proto.wssync.GitAuthMethod} value */ -proto.wssync.GitConfig.prototype.setAuthentication = function(value) { - jspb.Message.setProto3EnumField(this, 2, value); -}; - - -/** - * optional string auth_user = 3; - * @return {string} - */ -proto.wssync.GitConfig.prototype.getAuthUser = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** @param {string} value */ -proto.wssync.GitConfig.prototype.setAuthUser = function(value) { - jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string auth_password = 4; - * @return {string} - */ -proto.wssync.GitConfig.prototype.getAuthPassword = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** @param {string} value */ -proto.wssync.GitConfig.prototype.setAuthPassword = function(value) { - jspb.Message.setProto3StringField(this, 4, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.SnapshotInitializer.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.SnapshotInitializer.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.SnapshotInitializer} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.SnapshotInitializer.toObject = function(includeInstance, msg) { - var f, obj = { - snapshot: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.SnapshotInitializer} - */ -proto.wssync.SnapshotInitializer.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.SnapshotInitializer; - return proto.wssync.SnapshotInitializer.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.SnapshotInitializer} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.SnapshotInitializer} - */ -proto.wssync.SnapshotInitializer.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setSnapshot(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.SnapshotInitializer.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.SnapshotInitializer.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.SnapshotInitializer} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.SnapshotInitializer.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSnapshot(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string snapshot = 1; - * @return {string} - */ -proto.wssync.SnapshotInitializer.prototype.getSnapshot = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.wssync.SnapshotInitializer.prototype.setSnapshot = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.PrebuildInitializer.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.PrebuildInitializer.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.PrebuildInitializer} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.PrebuildInitializer.toObject = function(includeInstance, msg) { - var f, obj = { - prebuild: (f = msg.getPrebuild()) && proto.wssync.SnapshotInitializer.toObject(includeInstance, f), - git: (f = msg.getGit()) && proto.wssync.GitInitializer.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.PrebuildInitializer} - */ -proto.wssync.PrebuildInitializer.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.PrebuildInitializer; - return proto.wssync.PrebuildInitializer.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.PrebuildInitializer} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.PrebuildInitializer} - */ -proto.wssync.PrebuildInitializer.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.wssync.SnapshotInitializer; - reader.readMessage(value,proto.wssync.SnapshotInitializer.deserializeBinaryFromReader); - msg.setPrebuild(value); - break; - case 2: - var value = new proto.wssync.GitInitializer; - reader.readMessage(value,proto.wssync.GitInitializer.deserializeBinaryFromReader); - msg.setGit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.PrebuildInitializer.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.PrebuildInitializer.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.PrebuildInitializer} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.PrebuildInitializer.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPrebuild(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.wssync.SnapshotInitializer.serializeBinaryToWriter - ); - } - f = message.getGit(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.wssync.GitInitializer.serializeBinaryToWriter - ); - } -}; - - -/** - * optional SnapshotInitializer prebuild = 1; - * @return {?proto.wssync.SnapshotInitializer} - */ -proto.wssync.PrebuildInitializer.prototype.getPrebuild = function() { - return /** @type{?proto.wssync.SnapshotInitializer} */ ( - jspb.Message.getWrapperField(this, proto.wssync.SnapshotInitializer, 1)); -}; - - -/** @param {?proto.wssync.SnapshotInitializer|undefined} value */ -proto.wssync.PrebuildInitializer.prototype.setPrebuild = function(value) { - jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.PrebuildInitializer.prototype.clearPrebuild = function() { - this.setPrebuild(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.PrebuildInitializer.prototype.hasPrebuild = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional GitInitializer git = 2; - * @return {?proto.wssync.GitInitializer} - */ -proto.wssync.PrebuildInitializer.prototype.getGit = function() { - return /** @type{?proto.wssync.GitInitializer} */ ( - jspb.Message.getWrapperField(this, proto.wssync.GitInitializer, 2)); -}; - - -/** @param {?proto.wssync.GitInitializer|undefined} value */ -proto.wssync.PrebuildInitializer.prototype.setGit = function(value) { - jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.PrebuildInitializer.prototype.clearGit = function() { - this.setGit(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.PrebuildInitializer.prototype.hasGit = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.InitWorkspaceResponse.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.InitWorkspaceResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.InitWorkspaceResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.InitWorkspaceResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.InitWorkspaceResponse} - */ -proto.wssync.InitWorkspaceResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.InitWorkspaceResponse; - return proto.wssync.InitWorkspaceResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.InitWorkspaceResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.InitWorkspaceResponse} - */ -proto.wssync.InitWorkspaceResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.InitWorkspaceResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.InitWorkspaceResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.InitWorkspaceResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.InitWorkspaceResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.WaitForInitRequest.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.WaitForInitRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.WaitForInitRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.WaitForInitRequest.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.WaitForInitRequest} - */ -proto.wssync.WaitForInitRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.WaitForInitRequest; - return proto.wssync.WaitForInitRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.WaitForInitRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.WaitForInitRequest} - */ -proto.wssync.WaitForInitRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.WaitForInitRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.WaitForInitRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.WaitForInitRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.WaitForInitRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.wssync.WaitForInitRequest.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.wssync.WaitForInitRequest.prototype.setId = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.WaitForInitResponse.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.WaitForInitResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.WaitForInitResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.WaitForInitResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.WaitForInitResponse} - */ -proto.wssync.WaitForInitResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.WaitForInitResponse; - return proto.wssync.WaitForInitResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.WaitForInitResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.WaitForInitResponse} - */ -proto.wssync.WaitForInitResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.WaitForInitResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.WaitForInitResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.WaitForInitResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.WaitForInitResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.TakeSnapshotRequest.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.TakeSnapshotRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.TakeSnapshotRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.TakeSnapshotRequest.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.TakeSnapshotRequest} - */ -proto.wssync.TakeSnapshotRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.TakeSnapshotRequest; - return proto.wssync.TakeSnapshotRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.TakeSnapshotRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.TakeSnapshotRequest} - */ -proto.wssync.TakeSnapshotRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.TakeSnapshotRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.TakeSnapshotRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.TakeSnapshotRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.TakeSnapshotRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.wssync.TakeSnapshotRequest.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.wssync.TakeSnapshotRequest.prototype.setId = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.TakeSnapshotResponse.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.TakeSnapshotResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.TakeSnapshotResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.TakeSnapshotResponse.toObject = function(includeInstance, msg) { - var f, obj = { - url: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.TakeSnapshotResponse} - */ -proto.wssync.TakeSnapshotResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.TakeSnapshotResponse; - return proto.wssync.TakeSnapshotResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.TakeSnapshotResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.TakeSnapshotResponse} - */ -proto.wssync.TakeSnapshotResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setUrl(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.TakeSnapshotResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.TakeSnapshotResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.TakeSnapshotResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.TakeSnapshotResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUrl(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string url = 1; - * @return {string} - */ -proto.wssync.TakeSnapshotResponse.prototype.getUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.wssync.TakeSnapshotResponse.prototype.setUrl = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.DisposeWorkspaceRequest.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.DisposeWorkspaceRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.DisposeWorkspaceRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.DisposeWorkspaceRequest.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - backup: jspb.Message.getFieldWithDefault(msg, 2, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.DisposeWorkspaceRequest} - */ -proto.wssync.DisposeWorkspaceRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.DisposeWorkspaceRequest; - return proto.wssync.DisposeWorkspaceRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.DisposeWorkspaceRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.DisposeWorkspaceRequest} - */ -proto.wssync.DisposeWorkspaceRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setBackup(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.DisposeWorkspaceRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.DisposeWorkspaceRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.DisposeWorkspaceRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.DisposeWorkspaceRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getBackup(); - if (f) { - writer.writeBool( - 2, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.wssync.DisposeWorkspaceRequest.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.wssync.DisposeWorkspaceRequest.prototype.setId = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional bool backup = 2; - * Note that Boolean fields may be set to 0/1 when serialized from a Java server. - * You should avoid comparisons like {@code val === true/false} in those cases. - * @return {boolean} - */ -proto.wssync.DisposeWorkspaceRequest.prototype.getBackup = function() { - return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 2, false)); -}; - - -/** @param {boolean} value */ -proto.wssync.DisposeWorkspaceRequest.prototype.setBackup = function(value) { - jspb.Message.setProto3BooleanField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.DisposeWorkspaceResponse.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.DisposeWorkspaceResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.DisposeWorkspaceResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.DisposeWorkspaceResponse.toObject = function(includeInstance, msg) { - var f, obj = { - gitStatus: (f = msg.getGitStatus()) && proto.wssync.GitStatus.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.DisposeWorkspaceResponse} - */ -proto.wssync.DisposeWorkspaceResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.DisposeWorkspaceResponse; - return proto.wssync.DisposeWorkspaceResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.DisposeWorkspaceResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.DisposeWorkspaceResponse} - */ -proto.wssync.DisposeWorkspaceResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.wssync.GitStatus; - reader.readMessage(value,proto.wssync.GitStatus.deserializeBinaryFromReader); - msg.setGitStatus(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.DisposeWorkspaceResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.DisposeWorkspaceResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.DisposeWorkspaceResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.DisposeWorkspaceResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getGitStatus(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.wssync.GitStatus.serializeBinaryToWriter - ); - } -}; - - -/** - * optional GitStatus git_status = 1; - * @return {?proto.wssync.GitStatus} - */ -proto.wssync.DisposeWorkspaceResponse.prototype.getGitStatus = function() { - return /** @type{?proto.wssync.GitStatus} */ ( - jspb.Message.getWrapperField(this, proto.wssync.GitStatus, 1)); -}; - - -/** @param {?proto.wssync.GitStatus|undefined} value */ -proto.wssync.DisposeWorkspaceResponse.prototype.setGitStatus = function(value) { - jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - */ -proto.wssync.DisposeWorkspaceResponse.prototype.clearGitStatus = function() { - this.setGitStatus(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.wssync.DisposeWorkspaceResponse.prototype.hasGitStatus = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.wssync.GitStatus.repeatedFields_ = [3,4,5]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.wssync.GitStatus.prototype.toObject = function(opt_includeInstance) { - return proto.wssync.GitStatus.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.wssync.GitStatus} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.GitStatus.toObject = function(includeInstance, msg) { - var f, obj = { - branch: jspb.Message.getFieldWithDefault(msg, 1, ""), - latestCommit: jspb.Message.getFieldWithDefault(msg, 2, ""), - uncommitedFilesList: jspb.Message.getRepeatedField(msg, 3), - totalUncommitedFiles: jspb.Message.getFieldWithDefault(msg, 6, 0), - untrackedFilesList: jspb.Message.getRepeatedField(msg, 4), - totalUntrackedFiles: jspb.Message.getFieldWithDefault(msg, 7, 0), - unpushedCommitsList: jspb.Message.getRepeatedField(msg, 5), - totalUnpushedCommits: jspb.Message.getFieldWithDefault(msg, 8, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.wssync.GitStatus} - */ -proto.wssync.GitStatus.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.wssync.GitStatus; - return proto.wssync.GitStatus.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.wssync.GitStatus} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.wssync.GitStatus} - */ -proto.wssync.GitStatus.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setBranch(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setLatestCommit(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.addUncommitedFiles(value); - break; - case 6: - var value = /** @type {number} */ (reader.readInt64()); - msg.setTotalUncommitedFiles(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.addUntrackedFiles(value); - break; - case 7: - var value = /** @type {number} */ (reader.readInt64()); - msg.setTotalUntrackedFiles(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.addUnpushedCommits(value); - break; - case 8: - var value = /** @type {number} */ (reader.readInt64()); - msg.setTotalUnpushedCommits(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.wssync.GitStatus.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.wssync.GitStatus.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.wssync.GitStatus} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.wssync.GitStatus.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBranch(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getLatestCommit(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getUncommitedFilesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 3, - f - ); - } - f = message.getTotalUncommitedFiles(); - if (f !== 0) { - writer.writeInt64( - 6, - f - ); - } - f = message.getUntrackedFilesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 4, - f - ); - } - f = message.getTotalUntrackedFiles(); - if (f !== 0) { - writer.writeInt64( - 7, - f - ); - } - f = message.getUnpushedCommitsList(); - if (f.length > 0) { - writer.writeRepeatedString( - 5, - f - ); - } - f = message.getTotalUnpushedCommits(); - if (f !== 0) { - writer.writeInt64( - 8, - f - ); - } -}; - - -/** - * optional string branch = 1; - * @return {string} - */ -proto.wssync.GitStatus.prototype.getBranch = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** @param {string} value */ -proto.wssync.GitStatus.prototype.setBranch = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string latest_commit = 2; - * @return {string} - */ -proto.wssync.GitStatus.prototype.getLatestCommit = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** @param {string} value */ -proto.wssync.GitStatus.prototype.setLatestCommit = function(value) { - jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * repeated string uncommited_files = 3; - * @return {!Array} - */ -proto.wssync.GitStatus.prototype.getUncommitedFilesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); -}; - - -/** @param {!Array} value */ -proto.wssync.GitStatus.prototype.setUncommitedFilesList = function(value) { - jspb.Message.setField(this, 3, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - */ -proto.wssync.GitStatus.prototype.addUncommitedFiles = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 3, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.wssync.GitStatus.prototype.clearUncommitedFilesList = function() { - this.setUncommitedFilesList([]); -}; - - -/** - * optional int64 total_uncommited_files = 6; - * @return {number} - */ -proto.wssync.GitStatus.prototype.getTotalUncommitedFiles = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); -}; - - -/** @param {number} value */ -proto.wssync.GitStatus.prototype.setTotalUncommitedFiles = function(value) { - jspb.Message.setProto3IntField(this, 6, value); -}; - - -/** - * repeated string untracked_files = 4; - * @return {!Array} - */ -proto.wssync.GitStatus.prototype.getUntrackedFilesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); -}; - - -/** @param {!Array} value */ -proto.wssync.GitStatus.prototype.setUntrackedFilesList = function(value) { - jspb.Message.setField(this, 4, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - */ -proto.wssync.GitStatus.prototype.addUntrackedFiles = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 4, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.wssync.GitStatus.prototype.clearUntrackedFilesList = function() { - this.setUntrackedFilesList([]); -}; - - -/** - * optional int64 total_untracked_files = 7; - * @return {number} - */ -proto.wssync.GitStatus.prototype.getTotalUntrackedFiles = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); -}; - - -/** @param {number} value */ -proto.wssync.GitStatus.prototype.setTotalUntrackedFiles = function(value) { - jspb.Message.setProto3IntField(this, 7, value); -}; - - -/** - * repeated string unpushed_commits = 5; - * @return {!Array} - */ -proto.wssync.GitStatus.prototype.getUnpushedCommitsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); -}; - - -/** @param {!Array} value */ -proto.wssync.GitStatus.prototype.setUnpushedCommitsList = function(value) { - jspb.Message.setField(this, 5, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - */ -proto.wssync.GitStatus.prototype.addUnpushedCommits = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 5, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - */ -proto.wssync.GitStatus.prototype.clearUnpushedCommitsList = function() { - this.setUnpushedCommitsList([]); -}; - - -/** - * optional int64 total_unpushed_commits = 8; - * @return {number} - */ -proto.wssync.GitStatus.prototype.getTotalUnpushedCommits = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); -}; - - -/** @param {number} value */ -proto.wssync.GitStatus.prototype.setTotalUnpushedCommits = function(value) { - jspb.Message.setProto3IntField(this, 8, value); -}; - - -/** - * @enum {number} - */ -proto.wssync.CloneTargetMode = { - REMOTE_HEAD: 0, - REMOTE_COMMIT: 1, - REMOTE_BRANCH: 2, - LOCAL_BRANCH: 3 -}; - -/** - * @enum {number} - */ -proto.wssync.GitAuthMethod = { - NO_AUTH: 0, - BASIC_AUTH: 1 -}; - -/** - * @enum {number} - */ -proto.wssync.WorkspaceContentState = { - NONE: 0, - SETTING_UP: 1, - AVAILABLE: 2, - WRAPPING_UP: 3 -}; - -goog.object.extend(exports, proto.wssync); diff --git a/components/ws-daemon-api/workspace.proto b/components/ws-daemon-api/workspace.proto index fd20b4d9a1a407..daec1037d7e2bf 100644 --- a/components/ws-daemon-api/workspace.proto +++ b/components/ws-daemon-api/workspace.proto @@ -20,6 +20,9 @@ service InWorkspaceHelper { rpc PauseTheia(stream PauseTheiaRequest) returns (PauseTheiaResponse) {} rpc GitStatus(GitStatusRequest) returns (GitStatusResponse) {} + + // UidmapCanary can establish a uid mapping of a new user namespace spawned within the workspace. + rpc UidmapCanary(stream UidmapCanaryResponse) returns (stream UidmapCanaryRequest) {} } message BackupCanaryRequest { @@ -35,3 +38,19 @@ message GitStatusRequest {} message GitStatusResponse { contentservice.GitStatus repo = 1; } + +message UidmapCanaryResponse { + string message = 1; + uint32 error_code = 2; +} +message UidmapCanaryRequest { + message Mapping { + uint32 container_id = 1; + uint32 host_id = 2; + uint32 size = 3; + } + + int64 pid = 1; + bool gid = 2; + repeated Mapping mapping = 3; +} diff --git a/components/ws-daemon/README.md b/components/ws-daemon/README.md index 8df2cbfb716d45..281e9397f7cdf1 100644 --- a/components/ws-daemon/README.md +++ b/components/ws-daemon/README.md @@ -2,9 +2,9 @@ ### Run unit tests The unit tests in `pkg/sync` must be run as `root` because they create files with various permissions/ownership. -It's easiest to run them using `cd pkg/syncd && go test -c && sudo ./syncd.test -test.v`. +It's easiest to run them using `cd pkg/content && go test -c && sudo ./content.test -test.v`. Once you have build the test executable using `go test -c`, you can also run specific test or even testcases. -To run a specific test use `sudo ./syncd.test -test.run TestName`, to run a specific testcase use `sudo ./syncd.test -test.run TestName -execute testcaseName`. +To run a specific test use `sudo ./content.test -test.run TestName`, to run a specific testcase use `sudo ./content.test -test.run TestName -execute testcaseName`. _Beware_: when running all testcases (i.e. without `-execute`) the test itself will spawn a child process to recover from the permission drop across test cases. This also means that not all `-test.` flags will be passed on to the children. At the moment it's only `-test.v`. diff --git a/components/ws-daemon/cmd/generate-config.go b/components/ws-daemon/cmd/generate-config.go deleted file mode 100644 index 6f3c20d207df5a..00000000000000 --- a/components/ws-daemon/cmd/generate-config.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -//go:generate sh -c "cd .. && go run main.go generate config > config-schema.json" - -package cmd - -import ( - "encoding/json" - "fmt" - - "github.com/alecthomas/jsonschema" - "github.com/spf13/cobra" -) - -// generateConfigCmd represents the generateConfig command -var generateConfigCmd = &cobra.Command{ - Use: "config", - Short: "Generates JSON schema for the configuration", - - Run: func(cmd *cobra.Command, args []string) { - schema := jsonschema.Reflect(&config{}) - // schema.Definitions["Backup"].Properties["timeout"].Type = "string" - schema.Definitions["Configuration"].Properties["workspaceSizeLimit"].Type = "string" - - schema.Title = "ws-daemon config schema - generated using ws-daemon generate config" - out, err := json.MarshalIndent(schema, "", " ") - if err != nil { - panic(err) - } - fmt.Print(string(out)) - }, -} - -func init() { - generateCmd.AddCommand(generateConfigCmd) -} diff --git a/components/ws-daemon/cmd/root.go b/components/ws-daemon/cmd/root.go index dad42e80967c71..9152fbac40f3b9 100644 --- a/components/ws-daemon/cmd/root.go +++ b/components/ws-daemon/cmd/root.go @@ -9,13 +9,14 @@ import ( "crypto/x509" "encoding/json" "fmt" - "golang.org/x/xerrors" "io/ioutil" "os" + "golang.org/x/xerrors" + "github.com/gitpod-io/gitpod/common-go/log" "github.com/gitpod-io/gitpod/common-go/tracing" - "github.com/gitpod-io/gitpod/ws-daemon/pkg/syncd" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/daemon" "github.com/spf13/cobra" "google.golang.org/grpc" @@ -75,7 +76,7 @@ func init() { } type config struct { - Syncd syncd.Configuration `json:"syncd"` + Daemon daemon.Config `json:"daemon"` Service struct { Addr string `json:"address"` TLS tlsConfig `json:"tls"` diff --git a/components/ws-daemon/cmd/run.go b/components/ws-daemon/cmd/run.go index 6c3294e9afd688..7adfe4db1067e3 100644 --- a/components/ws-daemon/cmd/run.go +++ b/components/ws-daemon/cmd/run.go @@ -5,7 +5,6 @@ package cmd import ( - "context" "net" "net/http" "os" @@ -13,14 +12,14 @@ import ( "syscall" "time" - "github.com/gitpod-io/gitpod/ws-daemon/api" - "github.com/gitpod-io/gitpod/ws-daemon/pkg/syncd" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/daemon" "github.com/gitpod-io/gitpod/common-go/log" "github.com/gitpod-io/gitpod/common-go/pprof" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" "github.com/opentracing/opentracing-go" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spf13/cobra" "google.golang.org/grpc" @@ -34,10 +33,10 @@ var runCmd = &cobra.Command{ Run: func(cmd *cobra.Command, args []string) { cfg := getConfig() - - service, err := syncd.NewWorkspaceService(context.Background(), cfg.Syncd) + promreg := prometheus.NewRegistry() + dmn, err := daemon.NewDaemon(cfg.Daemon, promreg) if err != nil { - log.WithError(err).Fatal("cannot create service") + log.WithError(err).Fatal("cannot create daemon") } grpcOpts := []grpc.ServerOption{ @@ -63,7 +62,7 @@ var runCmd = &cobra.Command{ } server := grpc.NewServer(grpcOpts...) - api.RegisterWorkspaceContentServiceServer(server, service) + dmn.Register(server) lis, err := net.Listen("tcp", cfg.Service.Addr) if err != nil { log.WithError(err).Fatalf("cannot listen on %s", cfg.Service.Addr) @@ -74,11 +73,16 @@ var runCmd = &cobra.Command{ log.WithError(err).Fatal("cannot start server") } }() - log.WithField("addr", cfg.Service.Addr).Info("started workspace content server") + log.WithField("addr", cfg.Service.Addr).Info("started gRPC server") if cfg.Prometheus.Addr != "" { + promreg.MustRegister( + prometheus.NewGoCollector(), + prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}), + ) + handler := http.NewServeMux() - handler.Handle("/metrics", promhttp.Handler()) + handler.Handle("/metrics", promhttp.HandlerFor(promreg, promhttp.HandlerOpts{})) go func() { err := http.ListenAndServe(cfg.Prometheus.Addr, handler) @@ -93,13 +97,21 @@ var runCmd = &cobra.Command{ go pprof.Serve(cfg.PProf.Addr) } + err = dmn.Start() + if err != nil { + log.WithError(err).Fatal("cannot start daemon") + } + // run until we're told to stop sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM) log.Info("🧫 ws-daemon is up and running. Stop with SIGINT or CTRL+C") <-sigChan server.Stop() - service.Stop() + err = dmn.Stop() + if err != nil { + log.WithError(err).Error("cannot shut down gracefully") + } log.Info("Received SIGINT - shutting down") }, } diff --git a/components/ws-daemon/config-schema.json b/components/ws-daemon/config-schema.json deleted file mode 100644 index 3909a8dadd53f0..00000000000000 --- a/components/ws-daemon/config-schema.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/config", - "title": "ws-daemon config schema - generated using ws-daemon generate config", - "definitions": { - "": { - "required": [ - "enabled", - "maxLength" - ], - "properties": { - "enabled": { - "type": "boolean" - }, - "maxLength": { - "type": "integer" - } - }, - "additionalProperties": false, - "type": "object" - }, - "Configuration": { - "required": [ - "workingArea", - "workspaceSizeLimit", - "storage" - ], - "properties": { - "backup": { - "$ref": "#/definitions/" - }, - "storage": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/StorageConfig" - }, - "workingArea": { - "type": "string" - }, - "workspaceSizeLimit": { - "type": "string" - } - }, - "additionalProperties": false, - "type": "object" - }, - "GCloudConfig": { - "required": [ - "credentialsFile", - "region", - "projectId", - "parallelUpload", - "tmpdir", - "maximumBackupSize", - "maximumBackupCount" - ], - "properties": { - "credentialsFile": { - "type": "string" - }, - "maximumBackupCount": { - "type": "integer" - }, - "maximumBackupSize": { - "type": "integer" - }, - "parallelUpload": { - "type": "integer" - }, - "projectId": { - "type": "string" - }, - "region": { - "type": "string" - }, - "tmpdir": { - "type": "string" - } - }, - "additionalProperties": false, - "type": "object" - }, - "MinIOConfig": { - "required": [ - "endpoint", - "accessKey", - "secretKey", - "tmpdir" - ], - "properties": { - "accessKey": { - "type": "string" - }, - "endpoint": { - "type": "string" - }, - "maxBackupSize": { - "type": "integer" - }, - "parallelUpload": { - "type": "integer" - }, - "region": { - "type": "string" - }, - "secretKey": { - "type": "string" - }, - "secure": { - "type": "boolean" - }, - "tmpdir": { - "type": "string" - } - }, - "additionalProperties": false, - "type": "object" - }, - "StorageConfig": { - "required": [ - "stage", - "kind", - "gcloud", - "minio", - "backupTrail" - ], - "properties": { - "backupTrail": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/" - }, - "gcloud": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/GCloudConfig" - }, - "kind": { - "type": "string" - }, - "location": { - "type": "string" - }, - "minio": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/MinIOConfig" - }, - "stage": { - "type": "string" - } - }, - "additionalProperties": false, - "type": "object" - }, - "config": { - "required": [ - "syncd", - "service", - "prometheus", - "pprof" - ], - "properties": { - "pprof": { - "$ref": "#/definitions/" - }, - "prometheus": { - "$ref": "#/definitions/" - }, - "service": { - "$ref": "#/definitions/" - }, - "syncd": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Configuration" - } - }, - "additionalProperties": false, - "type": "object" - } - } -} \ No newline at end of file diff --git a/components/ws-daemon/example-config.json b/components/ws-daemon/example-config.json index f308e53268c5d6..f3511bad276928 100644 --- a/components/ws-daemon/example-config.json +++ b/components/ws-daemon/example-config.json @@ -1,6 +1,6 @@ { "$schema": "./config-schema.json", - "syncd": { + "content": { "workingArea": "/tmp/wssync", "backupPeriod": "30m", "workspaceSizeLimit": "20g", @@ -8,7 +8,7 @@ "kind": "minio", "stage": "dev", "gcloud": { - "credentialsFile": "/workspace/gitpod/charts/gitpod_io/secrets/storage/gitpod-dev-syncd-key.json", + "credentialsFile": "/workspace/gitpod/charts/gitpod_io/secrets/storage/gitpod-dev-content-key.json", "region": "europe-west1", "project": "gitpod-dev", "parallelUpload": 4, diff --git a/components/ws-daemon/go.mod b/components/ws-daemon/go.mod index 5b5bca35bec867..75eb1866c72e61 100644 --- a/components/ws-daemon/go.mod +++ b/components/ws-daemon/go.mod @@ -10,6 +10,7 @@ replace github.com/docker/docker v1.13.1 => github.com/docker/engine v0.0.0-2019 replace github.com/Sirupsen/logrus v1.6.0 => github.com/sirupsen/logrus v1.6.0 // leeway ignore require ( + github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26 github.com/alecthomas/repr v0.0.0-20200325044227-4184120f674c github.com/docker/docker v1.13.1 // indirect @@ -18,20 +19,25 @@ require ( github.com/gitpod-io/gitpod/content-service v0.0.0-00010101000000-000000000000 github.com/gitpod-io/gitpod/content-service/api v0.0.0-00010101000000-000000000000 github.com/gitpod-io/gitpod/ws-daemon/api v0.0.0-00010101000000-000000000000 + github.com/go-ole/go-ole v1.2.4 // indirect + github.com/golang/protobuf v1.4.2 github.com/google/go-cmp v0.5.2 + github.com/google/tcpproxy v0.0.0-20200125044825-b6bb9b5b8252 github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.1 github.com/opentracing/opentracing-go v1.1.0 github.com/prometheus/client_golang v1.1.0 + github.com/shirou/gopsutil v2.20.9+incompatible github.com/sirupsen/logrus v1.4.2 github.com/spf13/cobra v0.0.3 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/grpc v1.32.0 + k8s.io/api v0.0.0-20190620084959-7cf5895f2711 + k8s.io/apimachinery v0.0.0 + k8s.io/client-go v0.0.0 ) -replace github.com/gitpod-io/gitpod/ws-daemon/api => ../ws-daemon-api/go // leeway - replace github.com/gitpod-io/gitpod/common-go => ../common-go // leeway replace github.com/gitpod-io/gitpod/content-service => ../content-service // leeway diff --git a/components/ws-daemon/go.sum b/components/ws-daemon/go.sum index 0729853ae29032..6599838bb7cbe0 100644 --- a/components/ws-daemon/go.sum +++ b/components/ws-daemon/go.sum @@ -51,6 +51,8 @@ github.com/Microsoft/hcsshim v0.8.10/go.mod h1:g5uw8EV2mAlzqe94tfNBNdr89fnbD/n3H github.com/Microsoft/hcsshim/test v0.0.0-20200923174857-380508768ed2 h1:doGWRzcB0SF/kXu68378Q036h1pVlwQC81sMtETTp7c= github.com/Microsoft/hcsshim/test v0.0.0-20200923174857-380508768ed2/go.mod h1:30A5igQ91GEmhYJF8TaRP79pMBOYynRsyOByfVV0dU4= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/a8m/mark v0.1.1-0.20170507133748-44f2db618845/go.mod h1:c8Mh99Cw82nrsAnPgxQSZHkswVOJF7/MqZb1ZdvriLM= github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26 h1:b/CA15BzZIj8xNKnBxUwUmXt3USfJjb4Gl9eJIfMLtE= github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26/go.mod h1:qpebaTNSsyUn5rPSJMsfqEtDw71TTggXM6stUDI16HA= @@ -139,6 +141,9 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= +github.com/fatih/gomodifytags v1.9.0/go.mod h1:TbUyEjH1Zo0GkJd2Q52oVYqYcJ0eGNqG8bsiOb75P9c= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= @@ -150,6 +155,8 @@ github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3I github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ozzo/ozzo-validation v3.5.0+incompatible h1:sUy/in/P6askYr16XJgTKq/0SZhiWsdg4WZGaLsGQkM= github.com/go-ozzo/ozzo-validation v3.5.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -224,12 +231,15 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/tcpproxy v0.0.0-20200125044825-b6bb9b5b8252 h1:tAkooHvRrtO8kFB6YOPTpLQok3Hfv1DNDXdNqgi29Ao= +github.com/google/tcpproxy v0.0.0-20200125044825-b6bb9b5b8252/go.mod h1:DavVbd41y+b7ukKDmlnPR4nGYmkWXR6vHUkjQNiHPBs= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4 h1:hU4mGcQI4DaAYW+IbTun+2qEZVFxK0ySjQLTbS0VQKc= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= @@ -354,6 +364,8 @@ github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shirou/gopsutil v2.20.9+incompatible h1:msXs2frUV+O/JLva9EDLpuJ84PrFsdCTCQex8PUdtkQ= +github.com/shirou/gopsutil v2.20.9+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -568,6 +580,7 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180824175216-6c1c5e93cdc1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -741,6 +754,7 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +k8s.io/api v0.0.0-20190620084959-7cf5895f2711 h1:BblVYz/wE5WtBsD/Gvu54KyBUTJMflolzc5I2DTvh50= k8s.io/api v0.0.0-20190620084959-7cf5895f2711/go.mod h1:TBhBqb1AWbBQbW3XRusr7n7E4v2+5ZY8r8sAMnyFC5A= k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 h1:uV4S5IB5g4Nvi+TBVNf3e9L4wrirlwYJ6w88jUQxTUw= k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719/go.mod h1:I4A+glKBHiTgiEjQiCCQfCAIcIMFGt291SmsvcrFzJA= diff --git a/components/ws-daemon/pkg/syncd/config.go b/components/ws-daemon/pkg/content/config.go similarity index 52% rename from components/ws-daemon/pkg/syncd/config.go rename to components/ws-daemon/pkg/content/config.go index 31fea38a518a09..839e6a2928e4e8 100644 --- a/components/ws-daemon/pkg/syncd/config.go +++ b/components/ws-daemon/pkg/content/config.go @@ -2,21 +2,16 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package syncd +package content import ( - "path/filepath" - - "github.com/gitpod-io/gitpod/common-go/cri" - "github.com/gitpod-io/gitpod/common-go/log" "github.com/gitpod-io/gitpod/common-go/util" "github.com/gitpod-io/gitpod/content-service/pkg/storage" "github.com/gitpod-io/gitpod/ws-daemon/pkg/quota" - "github.com/gitpod-io/gitpod/ws-daemon/pkg/safetynet" ) -// Configuration configures the workspace manager -type Configuration struct { +// Config configures the workspace content service +type Config struct { // WorkingArea is the location on-disk where we create workspaces WorkingArea string `json:"workingArea"` @@ -44,33 +39,10 @@ type Configuration struct { } `json:"backup,omitempty"` // FullWorkspaceBackup configures the FWB behaviour - FullWorkspaceBackup FullWorkspaceBackupConfig `json:"fullWorkspaceBackup,omitempty"` - - // KubernetesNamespace is the namespace this ws-daemon is deployed in - KubernetesNamespace string `json:"namespace"` -} - -// FullWorkspaceBackupConfig configures the full workspace backup behaviour -type FullWorkspaceBackupConfig struct { - Enabled bool `json:"enabled"` - - // CRI configures ws-daemon's container runtime interface - CRI *cri.Config `json:"cri"` - - // WorkDir is a directory located on the same disk as the upperdir of containers - WorkDir string `json:"workdir"` -} - -// NewLiveBackup produces a new live backup -func (fwbc *FullWorkspaceBackupConfig) NewLiveBackup(instanceID string, src string) (*safetynet.LiveWorkspaceBackup, error) { - if !fwbc.Enabled { - return nil, nil - } + FullWorkspaceBackup struct { + Enabled bool `json:"enabled"` - res := &safetynet.LiveWorkspaceBackup{ - OWI: log.OWI("", "", instanceID), - Location: src, - Destination: filepath.Join(fwbc.WorkDir, instanceID), - } - return res, nil + // WorkDir is a directory located on the same disk as the upperdir of containers + WorkDir string `json:"workdir"` + } `json:"fullWorkspaceBackup,omitempty"` } diff --git a/components/ws-daemon/pkg/safetynet/workspace.go b/components/ws-daemon/pkg/content/livebackup.go similarity index 99% rename from components/ws-daemon/pkg/safetynet/workspace.go rename to components/ws-daemon/pkg/content/livebackup.go index 56e14e33b90ec8..a5cb5d6d292210 100644 --- a/components/ws-daemon/pkg/safetynet/workspace.go +++ b/components/ws-daemon/pkg/content/livebackup.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package safetynet +package content import ( "fmt" diff --git a/components/ws-daemon/pkg/syncd/service.go b/components/ws-daemon/pkg/content/service.go similarity index 93% rename from components/ws-daemon/pkg/syncd/service.go rename to components/ws-daemon/pkg/content/service.go index 754009b1358aa9..c66d3586e06e90 100644 --- a/components/ws-daemon/pkg/syncd/service.go +++ b/components/ws-daemon/pkg/content/service.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package syncd +package content import ( "context" @@ -24,7 +24,6 @@ import ( "github.com/gitpod-io/gitpod/ws-daemon/pkg/archive" "github.com/gitpod-io/gitpod/ws-daemon/pkg/internal/session" "github.com/gitpod-io/gitpod/ws-daemon/pkg/quota" - "github.com/gitpod-io/gitpod/ws-daemon/pkg/safetynet" "github.com/gitpod-io/gitpod/common-go/log" "github.com/opencontainers/go-digest" @@ -39,33 +38,20 @@ import ( // WorkspaceService implements the InitService and WorkspaceService type WorkspaceService struct { - config Configuration + config Config store *session.Store + ctx context.Context stopService context.CancelFunc sandboxes quota.SandboxProvider cric cri.ContainerRuntimeInterface } // NewWorkspaceService creates a new workspce initialization service, starts housekeeping and the Prometheus integration -func NewWorkspaceService(ctx context.Context, cfg Configuration) (res *WorkspaceService, err error) { +func NewWorkspaceService(ctx context.Context, cfg Config, kubernetesNamespace string, cri cri.ContainerRuntimeInterface) (res *WorkspaceService, err error) { span, ctx := opentracing.StartSpanFromContext(ctx, "NewWorkspaceService") defer tracing.FinishSpan(span, &err) - // connect to local container runtime - var cric cri.ContainerRuntimeInterface - if cfg.FullWorkspaceBackup.Enabled { - cric, err = cri.FromConfig(cfg.FullWorkspaceBackup.CRI) - if err != nil { - return nil, xerrors.Errorf("cannot connect to container runtime: %w", err) - } - go func() { - // TODO: handle this case more gracefully - err := <-cric.Error() - log.WithError(err).Fatal("container runtime interface error") - }() - } - // create working area err = os.MkdirAll(cfg.WorkingArea, 0755) if err != nil { @@ -73,12 +59,12 @@ func NewWorkspaceService(ctx context.Context, cfg Configuration) (res *Workspace } // read all session json files - store, err := session.NewStore(ctx, cfg.WorkingArea, workspaceLifecycleHooks(cfg)) + store, err := session.NewStore(ctx, cfg.WorkingArea, workspaceLifecycleHooks(cfg, kubernetesNamespace)) if err != nil { return nil, xerrors.Errorf("cannot create session store: %w", err) } ctx, stopService := context.WithCancel(ctx) - store.StartHousekeeping(ctx, 5*time.Minute) + if err := registerWorkingAreaDiskspaceGauge(cfg.WorkingArea); err != nil { log.WithError(err).Warn("cannot register Prometheus gauge for working area diskspace") } @@ -86,8 +72,9 @@ func NewWorkspaceService(ctx context.Context, cfg Configuration) (res *Workspace return &WorkspaceService{ config: cfg, store: store, + ctx: ctx, stopService: stopService, - cric: cric, + cric: cri, }, nil } @@ -112,6 +99,12 @@ func registerWorkingAreaDiskspaceGauge(workingArea string) error { })) } +// Start starts this workspace service and returns when the service gets stopped. +// This function is intended to run as Go routine. +func (s *WorkspaceService) Start() { + s.store.StartHousekeeping(s.ctx, 5*time.Minute) +} + // InitWorkspace intialises a new workspace folder in the working area func (s *WorkspaceService) InitWorkspace(ctx context.Context, req *api.InitWorkspaceRequest) (resp *api.InitWorkspaceResponse, err error) { span, ctx := opentracing.StartSpanFromContext(ctx, "InitWorkspace") @@ -401,7 +394,7 @@ func (s *WorkspaceService) uploadWorkspaceContent(ctx context.Context, sess *ses mf csapi.WorkspaceContentManifest ) if sess.FullWorkspaceBackup { - lb, ok := sess.NonPersistentAttrs[session.AttrLiveBackup].(*safetynet.LiveWorkspaceBackup) + lb, ok := sess.NonPersistentAttrs[session.AttrLiveBackup].(*LiveWorkspaceBackup) if lb == nil || !ok { return xerrors.Errorf("workspace has no live backup configured") } @@ -648,7 +641,7 @@ func (s *WorkspaceService) TakeSnapshot(ctx context.Context, req *api.TakeSnapsh return nil, status.Error(codes.Internal, "workspace has no remote storage") } if sess.FullWorkspaceBackup { - lb, ok := sess.NonPersistentAttrs[session.AttrLiveBackup].(*safetynet.LiveWorkspaceBackup) + lb, ok := sess.NonPersistentAttrs[session.AttrLiveBackup].(*LiveWorkspaceBackup) if lb == nil || !ok { log.WithFields(sess.OWI()).WithError(err).Error("cannot upload snapshot: no live backup available") return nil, status.Error(codes.Internal, "workspace has no live backup") @@ -685,9 +678,10 @@ func (s *WorkspaceService) TakeSnapshot(ctx context.Context, req *api.TakeSnapsh }, nil } -// Stop ends this service and its housekeeping -func (s *WorkspaceService) Stop() { +// Close ends this service and its housekeeping +func (s *WorkspaceService) Close() error { s.stopService() + return nil } // cannotCancelContext is a bit of a hack. We have some operations which we want to keep alive even after clients @@ -723,7 +717,7 @@ func (c *cannotCancelContext) Value(key interface{}) interface{} { return c.Delegate.Value(key) } -func workspaceLifecycleHooks(cfg Configuration) map[session.WorkspaceState][]session.WorkspaceLivecycleHook { +func workspaceLifecycleHooks(cfg Config, kubernetesNamespace string) map[session.WorkspaceState][]session.WorkspaceLivecycleHook { var setupWorkspace session.WorkspaceLivecycleHook = func(ctx context.Context, ws *session.Workspace) error { if _, ok := ws.NonPersistentAttrs[session.AttrRemoteStorage]; !ok { remoteStorage, err := storage.NewDirectAccess(&cfg.Storage) @@ -745,11 +739,11 @@ func workspaceLifecycleHooks(cfg Configuration) map[session.WorkspaceState][]ses } if _, ok := ws.NonPersistentAttrs[session.AttrLiveBackup]; ws.FullWorkspaceBackup && !ok { - lb, err := cfg.FullWorkspaceBackup.NewLiveBackup(ws.InstanceID, ws.UpperdirLocation) - if err != nil { - return xerrors.Errorf("cannot create live backup: %w", err) + ws.NonPersistentAttrs[session.AttrLiveBackup] = &LiveWorkspaceBackup{ + OWI: log.OWI("", "", ws.InstanceID), + Location: ws.UpperdirLocation, + Destination: filepath.Join(cfg.FullWorkspaceBackup.WorkDir, ws.InstanceID), } - ws.NonPersistentAttrs[session.AttrLiveBackup] = lb } return nil @@ -763,14 +757,14 @@ func workspaceLifecycleHooks(cfg Configuration) map[session.WorkspaceState][]ses if lbr == nil || !ok { log.WithFields(log.OWI(ws.Owner, ws.WorkspaceID, ws.InstanceID)).Warn("workspace is ready but did not have a live backup") - lbr, err = cfg.FullWorkspaceBackup.NewLiveBackup(ws.InstanceID, ws.UpperdirLocation) - if err != nil { - return xerrors.Errorf("cannot create live backup: %w", err) + ws.NonPersistentAttrs[session.AttrLiveBackup] = &LiveWorkspaceBackup{ + OWI: log.OWI("", "", ws.InstanceID), + Location: ws.UpperdirLocation, + Destination: filepath.Join(cfg.FullWorkspaceBackup.WorkDir, ws.InstanceID), } - ws.NonPersistentAttrs[session.AttrLiveBackup] = lbr } - lb, ok := lbr.(*safetynet.LiveWorkspaceBackup) + lb, ok := lbr.(*LiveWorkspaceBackup) if lbr == nil || !ok { return xerrors.Errorf("cannot start live backup - expected *LiveWorkspaceBackup") } @@ -780,7 +774,7 @@ func workspaceLifecycleHooks(cfg Configuration) map[session.WorkspaceState][]ses return map[session.WorkspaceState][]session.WorkspaceLivecycleHook{ session.WorkspaceInitializing: {setupWorkspace}, - session.WorkspaceReady: {setupWorkspace, startLiveBackup, serveWorkspace(cfg.KubernetesNamespace)}, + session.WorkspaceReady: {setupWorkspace, startLiveBackup, serveWorkspace(kubernetesNamespace)}, session.WorkspaceDisposing: {stopServingWorkspace}, } } diff --git a/components/ws-daemon/pkg/syncd/workspace.go b/components/ws-daemon/pkg/content/workspace.go similarity index 95% rename from components/ws-daemon/pkg/syncd/workspace.go rename to components/ws-daemon/pkg/content/workspace.go index fd63d116031328..6cbd550b959303 100644 --- a/components/ws-daemon/pkg/syncd/workspace.go +++ b/components/ws-daemon/pkg/content/workspace.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package syncd +package content import ( "context" @@ -14,7 +14,6 @@ import ( "github.com/gitpod-io/gitpod/common-go/log" "github.com/gitpod-io/gitpod/ws-daemon/api" "github.com/gitpod-io/gitpod/ws-daemon/pkg/internal/session" - "github.com/gitpod-io/gitpod/ws-daemon/pkg/safetynet" "golang.org/x/xerrors" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -35,7 +34,7 @@ const ( // WorkspaceBackupServer implements the workspace facing backup services type WorkspaceBackupServer struct { - LiveBackup *safetynet.LiveWorkspaceBackup + LiveBackup *LiveWorkspaceBackup lastCall time.Time mu sync.Mutex @@ -45,7 +44,7 @@ type WorkspaceBackupServer struct { // using a Unix socket serving a gRPC server. func serveWorkspace(namespace string) func(ctx context.Context, ws *session.Workspace) error { return func(ctx context.Context, ws *session.Workspace) error { - lb, ok := ws.NonPersistentAttrs[session.AttrLiveBackup].(*safetynet.LiveWorkspaceBackup) + lb, ok := ws.NonPersistentAttrs[session.AttrLiveBackup].(*LiveWorkspaceBackup) if ws.FullWorkspaceBackup && (lb == nil || !ok) { return xerrors.Errorf("cannot start workspace server - workspace has no live backup configured") } diff --git a/components/ws-daemon/pkg/daemon/config.go b/components/ws-daemon/pkg/daemon/config.go new file mode 100644 index 00000000000000..d15d245068229b --- /dev/null +++ b/components/ws-daemon/pkg/daemon/config.go @@ -0,0 +1,29 @@ +// Copyright (c) 2020 TypeFox GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License-AGPL.txt in the project root for license information. + +package daemon + +import ( + "github.com/gitpod-io/gitpod/common-go/cri" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/content" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/diskguard" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/hosts" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/resources" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/uidmap" +) + +// Config configures the workspace node daemon +type Config struct { + Runtime struct { + CRI *cri.Config `json:"containerRuntime"` + Kubeconfig string `json:"kubeconfig"` + KubernetesNamespace string `json:"namespace"` + } `json:"runtime"` + + Content content.Config `json:"content"` + Uidmapper uidmap.Config `json:"uidmapper"` + Resources resources.Config `json:"resources"` + Hosts hosts.Config `json:"hosts"` + DiskSpaceGuard diskguard.Config `json:"disk"` +} diff --git a/components/ws-daemon/pkg/daemon/daemon.go b/components/ws-daemon/pkg/daemon/daemon.go new file mode 100644 index 00000000000000..4689773844b12f --- /dev/null +++ b/components/ws-daemon/pkg/daemon/daemon.go @@ -0,0 +1,153 @@ +// Copyright (c) 2020 TypeFox GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License-AGPL.txt in the project root for license information. + +package daemon + +import ( + "context" + "os" + + "github.com/gitpod-io/gitpod/common-go/cri" + "github.com/gitpod-io/gitpod/common-go/log" + "github.com/gitpod-io/gitpod/ws-daemon/api" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/content" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/diskguard" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/dispatch" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/hosts" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/resources" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/uidmap" + "github.com/prometheus/client_golang/prometheus" + "golang.org/x/xerrors" + "google.golang.org/grpc" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/clientcmd" +) + +// NewDaemon produces a new daemon +func NewDaemon(config Config, prom prometheus.Registerer) (*Daemon, error) { + clientset, err := newClientSet(config.Runtime.Kubeconfig) + if err != nil { + + } + containerRuntime, err := cri.FromConfig(config.Runtime.CRI) + if err != nil { + return nil, err + } + if containerRuntime == nil { + return nil, xerrors.Errorf("no container runtime configured") + } + go func() { + // TODO(cw): handle this case more gracefully + err := <-containerRuntime.Error() + log.WithError(err).Fatal("container runtime interface error") + }() + + nodename := os.Getenv("NODENAME") + if nodename == "" { + return nil, xerrors.Errorf("NODENAME env var isn't set") + } + dsptch, err := dispatch.NewDispatch(containerRuntime, clientset, config.Runtime.KubernetesNamespace, nodename, + &uidmap.Uidmapper{Config: config.Uidmapper}, + resources.NewDispatchListener(&config.Resources, prom), + ) + if err != nil { + return nil, err + } + + contentService, err := content.NewWorkspaceService(context.Background(), config.Content, config.Runtime.KubernetesNamespace, containerRuntime) + if err != nil { + return nil, xerrors.Errorf("cannot create content service: %w", err) + } + + dsk := diskguard.FromConfig(config.DiskSpaceGuard, clientset, nodename) + + hsts, err := hosts.FromConfig(config.Hosts, clientset, config.Runtime.KubernetesNamespace) + if err != nil { + return nil, err + } + + return &Daemon{ + Config: config, + + dispatch: dsptch, + content: contentService, + diskGuards: dsk, + hosts: hsts, + }, nil +} + +func newClientSet(kubeconfig string) (res *kubernetes.Clientset, err error) { + defer func() { + if err != nil { + err = xerrors.Errorf("cannot create clientset: %w", err) + } + }() + + if kubeconfig != "" { + res, err := clientcmd.BuildConfigFromFlags("", kubeconfig) + if err != nil { + return nil, err + } + return kubernetes.NewForConfig(res) + } + + k8s, err := rest.InClusterConfig() + if err != nil { + return nil, err + } + return kubernetes.NewForConfig(k8s) +} + +// Daemon connects all the individual bits and bobs that make up the workspace daemon +type Daemon struct { + Config Config + + dispatch *dispatch.Dispatch + content *content.WorkspaceService + diskGuards []*diskguard.Guard + hosts hosts.Controller +} + +// Start runs all parts of the daemon until stop is called +func (d *Daemon) Start() error { + err := d.dispatch.Start() + if err != nil { + return xerrors.Errorf("cannot start dispatch: %w", err) + } + + go d.content.Start() + for _, dsk := range d.diskGuards { + go dsk.Start() + } + if d.hosts != nil { + go d.hosts.Start() + } + + return nil +} + +// Register registers all gRPC services provided by this daemon +func (d *Daemon) Register(srv *grpc.Server) { + api.RegisterWorkspaceContentServiceServer(srv, d.content) +} + +// Stop gracefully shuts down the daemon. Once stopped, it +// cannot be started again. +func (d *Daemon) Stop() error { + var errs []error + errs = append(errs, d.dispatch.Close()) + errs = append(errs, d.content.Close()) + if d.hosts != nil { + errs = append(errs, d.hosts.Close()) + } + + for _, err := range errs { + if err != nil { + return err + } + } + + return nil +} diff --git a/components/ws-manager-node/pkg/diskguard/guard.go b/components/ws-daemon/pkg/diskguard/guard.go similarity index 73% rename from components/ws-manager-node/pkg/diskguard/guard.go rename to components/ws-daemon/pkg/diskguard/guard.go index b6d5bd53485a94..0f83a54e44f404 100644 --- a/components/ws-manager-node/pkg/diskguard/guard.go +++ b/components/ws-daemon/pkg/diskguard/guard.go @@ -10,6 +10,7 @@ import ( "time" "github.com/gitpod-io/gitpod/common-go/log" + "github.com/gitpod-io/gitpod/common-go/util" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/util/retry" @@ -21,20 +22,51 @@ const ( LabelDiskPressure = "gitpod.io/diskPressure" ) +// Config configures the disk guard +type Config struct { + Enabled bool `json:"enabled"` + Interval util.Duration `json:"interval"` + Locations []struct { + Path string `json:"path"` + MinBytesAvail uint64 `json:"minBytesAvail"` + } `json:"locations"` +} + +// FromConfig produces a set of disk space guards from the configuration +func FromConfig(cfg Config, clientset kubernetes.Interface, nodeName string) []*Guard { + if !cfg.Enabled { + return nil + } + + res := make([]*Guard, len(cfg.Locations)) + for i, loc := range cfg.Locations { + res[i] = &Guard{ + Path: loc.Path, + MinBytesAvail: loc.MinBytesAvail, + Interval: time.Duration(cfg.Interval), + Clientset: clientset, + Nodename: nodeName, + } + } + + return res +} + // Guard regularly checks how much free space is left on a path/disk. // If the percentage of used space goes above a certain threshold, // we'll label the node accordingly - and remove the label once that condition // subsides. type Guard struct { Path string - Nodename string MinBytesAvail uint64 + Interval time.Duration Clientset kubernetes.Interface + Nodename string } // Start starts the disk guard -func (g *Guard) Start(period time.Duration) { - t := time.NewTicker(period) +func (g *Guard) Start() { + t := time.NewTicker(g.Interval) for { bvail, err := getAvailableBytes(g.Path) if err != nil { diff --git a/components/ws-manager-node/pkg/dispatch/dispatch.go b/components/ws-daemon/pkg/dispatch/dispatch.go similarity index 95% rename from components/ws-manager-node/pkg/dispatch/dispatch.go rename to components/ws-daemon/pkg/dispatch/dispatch.go index f3489fcdf3cbc6..9975f8be224ea1 100644 --- a/components/ws-manager-node/pkg/dispatch/dispatch.go +++ b/components/ws-daemon/pkg/dispatch/dispatch.go @@ -6,7 +6,6 @@ package dispatch import ( "context" - "os" "sync" "time" @@ -51,13 +50,13 @@ type UpdateListener interface { } // NewDispatch starts a new workspace dispatch -func NewDispatch(runtime cri.ContainerRuntimeInterface, kubernetes kubernetes.Interface, k8sNamespace string, listener ...Listener) (*Dispatch, error) { +func NewDispatch(runtime cri.ContainerRuntimeInterface, kubernetes kubernetes.Interface, k8sNamespace, nodename string, listener ...Listener) (*Dispatch, error) { d := &Dispatch{ CRI: runtime, Kubernetes: kubernetes, KubernetesNamespace: k8sNamespace, Listener: listener, - NodeName: os.Getenv("NODENAME"), + NodeName: nodename, ctxs: make(map[string]*workspaceState), } @@ -101,7 +100,7 @@ func GetFromContext(ctx context.Context) *Dispatch { // Start starts the dispatch func (d *Dispatch) Start() error { - ifac := informers.NewSharedInformerFactory(d.Kubernetes, podInformerResyncInterval) + ifac := informers.NewSharedInformerFactoryWithOptions(d.Kubernetes, podInformerResyncInterval, informers.WithNamespace(d.KubernetesNamespace)) podInformer := ifac.Core().V1().Pods().Informer() podInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ UpdateFunc: func(oldObj, newObj interface{}) { @@ -144,7 +143,7 @@ func (d *Dispatch) Start() error { } // Close stops the dispatch and cancels all previously started listener -func (d *Dispatch) Close() { +func (d *Dispatch) Close() error { d.mu.Lock() defer d.mu.Unlock() @@ -153,6 +152,8 @@ func (d *Dispatch) Close() { c.Cancel() } d.ctxs = make(map[string]*workspaceState) + + return nil } func (d *Dispatch) handlePodUpdate(oldPod, newPod *corev1.Pod) { diff --git a/components/ws-daemon/pkg/hosts/config.go b/components/ws-daemon/pkg/hosts/config.go new file mode 100644 index 00000000000000..c2262b67cce5b0 --- /dev/null +++ b/components/ws-daemon/pkg/hosts/config.go @@ -0,0 +1,69 @@ +// Copyright (c) 2020 TypeFox GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License-AGPL.txt in the project root for license information. + +package hosts + +import ( + "fmt" + + "golang.org/x/xerrors" + "k8s.io/client-go/kubernetes" +) + +// Config configures the hosts controller +type Config struct { + Enabled bool `json:"enabled"` + NodeHostsFile string `json:"nodeHostsFile"` + FromNodeIPs map[string]string `json:"fromPodNodeIP"` + ServiceProxy struct { + Enabled bool `json:"enabled,omitempty"` + PortMapping []struct { + Selector string `json:"selector"` + Alias string `json:"alias"` + ProxyPort int `json:"proxyPort"` + } `json:"mapping"` + } `json:"serviceProxy,omitempty"` +} + +// FromConfig produces a hosts controller from configuration. +func FromConfig(cfg Config, clientset kubernetes.Interface, kubernetesNamespace string) (res Controller, err error) { + if !cfg.Enabled { + return + } + + if cfg.ServiceProxy.Enabled { + provider := make(map[string]HostSource) + for _, portcfg := range cfg.ServiceProxy.PortMapping { + provider[fmt.Sprintf(":%d", portcfg.ProxyPort)] = &ServiceClusterIPSource{ + ID: portcfg.Alias, + Clientset: clientset, + Namespace: kubernetesNamespace, + Selector: portcfg.Selector, + Alias: portcfg.Alias, + } + } + + hg, err := NewProxyingController(kubernetesNamespace, cfg.NodeHostsFile, provider) + if err != nil { + return nil, xerrors.Errorf("cannot create hosts controller: %w", err) + } + return hg, nil + } + + var provider []HostSource + for src, alias := range cfg.FromNodeIPs { + provider = append(provider, &PodHostIPSource{ + ID: alias, + Clientset: clientset, + Namespace: kubernetesNamespace, + Selector: src, + Alias: alias, + }) + } + hg, err := NewDirectController(kubernetesNamespace, cfg.NodeHostsFile, provider...) + if err != nil { + return nil, xerrors.Errorf("cannot create hosts controller: %w", err) + } + return hg, nil +} diff --git a/components/ws-manager-node/pkg/hostsgov/hosts.go b/components/ws-daemon/pkg/hosts/hosts.go similarity index 81% rename from components/ws-manager-node/pkg/hostsgov/hosts.go rename to components/ws-daemon/pkg/hosts/hosts.go index 739418e8430051..16f5e12fdec6ee 100644 --- a/components/ws-manager-node/pkg/hostsgov/hosts.go +++ b/components/ws-daemon/pkg/hosts/hosts.go @@ -4,10 +4,11 @@ // +build linux -package hostsgov +package hosts import ( "fmt" + "io" "io/ioutil" "os" "strings" @@ -39,41 +40,42 @@ type HostSource interface { const ( // wsmanNodeMarkerComment is added to the end of a line to mark it as - // added by ws-manager-node. - fmtMarkerComment = " # added by ws-manager-node %s: %s" + // added by ws-daemon. + fmtMarkerComment = " # added by ws-daemon %s: %s" ) -// Governer controls a hosts resolvable domains -type Governer interface { +// Controller controls a hosts resolvable domains +type Controller interface { + io.Closer Start() } -// NewDirectGoverner creates a new hosts file governer -func NewDirectGoverner(name, hostsFile string, stopchan <-chan struct{}, sources ...HostSource) (*DirectGoverner, error) { +// NewDirectController creates a new hosts file controller +func NewDirectController(name, hostsFile string, sources ...HostSource) (*DirectController, error) { lockFD, err := syscall.Open(hostsFile, syscall.O_RDWR, 0644) if err != nil { return nil, xerrors.Errorf("cannot open hosts file: %w", err) } fd := os.NewFile(uintptr(lockFD), hostsFile) - return &DirectGoverner{ + return &DirectController{ Name: name, Sources: sources, hostsFD: fd, lockFD: lockFD, - stop: stopchan, + stop: make(chan struct{}), }, nil } -// DirectGoverner regularly updates the host's /etc/hosts file to add hostnames +// DirectController regularly updates the host's /etc/hosts file to add hostnames // which can be resolved by the kubelet. We use this to resolve the registry. -type DirectGoverner struct { +type DirectController struct { Name string Sources []HostSource hostsFD *os.File lockFD int - stop <-chan struct{} + stop chan struct{} } type hostUpdate struct { @@ -81,9 +83,9 @@ type hostUpdate struct { Hosts []Host } -// Start runs the hosts governer - this function does not return until the governer +// Start runs the hosts controller - this function does not return until the controller // is stopped. It's intended to be called as a Go routine. -func (g *DirectGoverner) Start() { +func (g *DirectController) Start() { updates := make(chan hostUpdate) go g.updateHostsFile(updates) @@ -115,7 +117,13 @@ func (g *DirectGoverner) Start() { } } -func (g *DirectGoverner) updateHostsFile(inc <-chan hostUpdate) { +// Close stops this controller +func (g *DirectController) Close() error { + close(g.stop) + return nil +} + +func (g *DirectController) updateHostsFile(inc <-chan hostUpdate) { for { var update hostUpdate select { @@ -190,7 +198,7 @@ func (g *DirectGoverner) updateHostsFile(inc <-chan hostUpdate) { } } -func (g *DirectGoverner) lockHostsFile() (lockAcquired bool, err error) { +func (g *DirectController) lockHostsFile() (lockAcquired bool, err error) { err = syscall.Flock(g.lockFD, syscall.LOCK_EX|syscall.LOCK_NB) if err == syscall.EWOULDBLOCK { return false, nil @@ -203,6 +211,6 @@ func (g *DirectGoverner) lockHostsFile() (lockAcquired bool, err error) { return } -func (g *DirectGoverner) unlockHostsFile() (err error) { +func (g *DirectController) unlockHostsFile() (err error) { return syscall.Flock(g.lockFD, syscall.LOCK_UN) } diff --git a/components/ws-manager-node/pkg/hostsgov/kubernetes.go b/components/ws-daemon/pkg/hosts/kubernetes.go similarity index 99% rename from components/ws-manager-node/pkg/hostsgov/kubernetes.go rename to components/ws-daemon/pkg/hosts/kubernetes.go index 52996f1256f832..7456b89c095a99 100644 --- a/components/ws-manager-node/pkg/hostsgov/kubernetes.go +++ b/components/ws-daemon/pkg/hosts/kubernetes.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package hostsgov +package hosts import ( "fmt" diff --git a/components/ws-manager-node/pkg/hostsgov/proxy.go b/components/ws-daemon/pkg/hosts/proxy.go similarity index 79% rename from components/ws-manager-node/pkg/hostsgov/proxy.go rename to components/ws-daemon/pkg/hosts/proxy.go index 87d50ee32ddef3..cb8f314ffb1420 100644 --- a/components/ws-manager-node/pkg/hostsgov/proxy.go +++ b/components/ws-daemon/pkg/hosts/proxy.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package hostsgov +package hosts import ( "fmt" @@ -10,27 +10,27 @@ import ( "github.com/gitpod-io/gitpod/common-go/log" ) -// ProxyingGoverner starts a TCP proxy for each host source instead of +// ProxyingController starts a TCP proxy for each host source instead of // updating the hosts directly. This is handy when the resolver on the host // caches the resolved address (much like systemd-resolved does). -type ProxyingGoverner struct { - DirectGoverner +type ProxyingController struct { + DirectController mappedSources map[string]HostSource p map[string]*tcpProxy } -// NewProxyingGoverner creates a new proxying hosts governer -func NewProxyingGoverner(name, hostsFile string, stopchan <-chan struct{}, sources map[string]HostSource) (*ProxyingGoverner, error) { - g, err := NewDirectGoverner(name, hostsFile, stopchan) +// NewProxyingController creates a new proxying hosts controller +func NewProxyingController(name, hostsFile string, sources map[string]HostSource) (*ProxyingController, error) { + g, err := NewDirectController(name, hostsFile) if err != nil { return nil, err } - res := &ProxyingGoverner{ - DirectGoverner: *g, - mappedSources: sources, - p: make(map[string]*tcpProxy), + res := &ProxyingController{ + DirectController: *g, + mappedSources: sources, + p: make(map[string]*tcpProxy), } for port := range sources { res.p[port] = &tcpProxy{Name: port} @@ -38,9 +38,9 @@ func NewProxyingGoverner(name, hostsFile string, stopchan <-chan struct{}, sourc return res, nil } -// Start runs the hosts governer - this function does not return until the governer +// Start runs the hosts controller - this function does not return until the controller // is stopped. It's intended to be called as a Go routine. -func (g *ProxyingGoverner) Start() { +func (g *ProxyingController) Start() { hostsFileUpdates := make(chan hostUpdate) go g.updateHostsFile(hostsFileUpdates) proxyUpdates := make(chan proxyHostUpdate) @@ -102,7 +102,7 @@ type proxyHostUpdate struct { Port string } -func (g *ProxyingGoverner) updateProxy(inc <-chan proxyHostUpdate) { +func (g *ProxyingController) updateProxy(inc <-chan proxyHostUpdate) { defer func() { for _, p := range g.p { p.Close() diff --git a/components/ws-manager-node/pkg/hostsgov/tcpproxy.go b/components/ws-daemon/pkg/hosts/tcpproxy.go similarity index 99% rename from components/ws-manager-node/pkg/hostsgov/tcpproxy.go rename to components/ws-daemon/pkg/hosts/tcpproxy.go index 47c640564d86df..6f9bdd6657dac6 100644 --- a/components/ws-manager-node/pkg/hostsgov/tcpproxy.go +++ b/components/ws-daemon/pkg/hosts/tcpproxy.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package hostsgov +package hosts import ( "math/rand" diff --git a/components/ws-daemon/pkg/internal/session/store.go b/components/ws-daemon/pkg/internal/session/store.go index c32d65fe3d74e2..387af3e7864760 100644 --- a/components/ws-daemon/pkg/internal/session/store.go +++ b/components/ws-daemon/pkg/internal/session/store.go @@ -154,36 +154,34 @@ func (s *Store) Get(name string) *Workspace { return s.workspaces[name] } -// StartHousekeeping starts garbage collection and regular cleanup +// StartHousekeeping starts garbage collection and regular cleanup. +// This function returns when the context is canceled. func (s *Store) StartHousekeeping(ctx context.Context, interval time.Duration) { span, ctx := opentracing.StartSpanFromContext(ctx, "Store.StartHousekeeping") defer tracing.FinishSpan(span, nil) + log.WithField("interval", interval.String()).Debug("started workspace housekeeping") ticker := time.NewTicker(interval) - go func() { - log.WithField("interval", interval.String()).Debug("started workspace housekeeping") - span := opentracing.StartSpan("housekeeping", opentracing.FollowsFrom(span.Context())) - ctx := opentracing.ContextWithSpan(ctx, span) - - run := true - for run { - var errs []error - select { - case <-ticker.C: - errs = s.doHousekeeping(ctx) - case <-ctx.Done(): - run = false - break - } - - for _, err := range errs { - log.WithError(err).Error("error during housekeeping") - } + defer ticker.Stop() + + run := true + for run { + var errs []error + select { + case <-ticker.C: + errs = s.doHousekeeping(ctx) + case <-ctx.Done(): + run = false + break } - span.Finish() - log.Debug("stopping workspace housekeeping") - }() + for _, err := range errs { + log.WithError(err).Error("error during housekeeping") + } + } + + span.Finish() + log.Debug("stopping workspace housekeeping") } func (s *Store) doHousekeeping(ctx context.Context) (errs []error) { diff --git a/components/ws-daemon/pkg/internal/session/workspace_test.go b/components/ws-daemon/pkg/internal/session/workspace_test.go index dfbb3515795e14..d1fd2577d7c66f 100644 --- a/components/ws-daemon/pkg/internal/session/workspace_test.go +++ b/components/ws-daemon/pkg/internal/session/workspace_test.go @@ -16,7 +16,6 @@ import ( "time" "github.com/gitpod-io/gitpod/content-service/pkg/storage" - "github.com/gitpod-io/gitpod/ws-daemon/pkg/safetynet" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/sirupsen/logrus" @@ -32,14 +31,6 @@ func (*emptySP) NewStorage() (storage.DirectAccess, error) { return &storage.DirectNoopStorage{}, nil } -// emptyLiveBackupProvider is a provider that returns no live backups -type emptyLiveBackupProvider struct{} - -// NewLiveBackup produces a new live backup -func (*emptyLiveBackupProvider) NewLiveBackup(instanceID string, src string) (*safetynet.LiveWorkspaceBackup, error) { - return nil, nil -} - func getTestStore() (*Store, error) { loc, err := ioutil.TempDir("", "wssync-test") if err != nil { diff --git a/components/ws-manager-node/pkg/resourcegov/.gitignore b/components/ws-daemon/pkg/resources/.gitignore similarity index 100% rename from components/ws-manager-node/pkg/resourcegov/.gitignore rename to components/ws-daemon/pkg/resources/.gitignore diff --git a/components/ws-manager-node/pkg/resourcegov/governer.go b/components/ws-daemon/pkg/resources/controller.go similarity index 87% rename from components/ws-manager-node/pkg/resourcegov/governer.go rename to components/ws-daemon/pkg/resources/controller.go index 14dd90b1172284..80b0e2e35cd887 100644 --- a/components/ws-manager-node/pkg/resourcegov/governer.go +++ b/components/ws-daemon/pkg/resources/controller.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package resourcegov +package resources import ( "container/ring" @@ -27,8 +27,8 @@ const ( maxCPUSampleCount = 10 ) -// Governer controls a container's resource use -type Governer struct { +// Controller controls a container's resource use +type Controller struct { InstanceID string CGroupBasePath string CGroupPath string @@ -57,47 +57,47 @@ type Governer struct { log *logrus.Entry } -// GovernerOpt configrues a governer -type GovernerOpt func(*Governer) +// ControllerOpt configrues a controller +type ControllerOpt func(*Controller) // WithCGroupBasePath sets the basepath for cgroup access -func WithCGroupBasePath(base string) GovernerOpt { - return func(g *Governer) { +func WithCGroupBasePath(base string) ControllerOpt { + return func(g *Controller) { g.CGroupBasePath = base } } // WithCPULimiter sets the resource limiter for CPUs -func WithCPULimiter(l ResourceLimiter) GovernerOpt { - return func(g *Governer) { +func WithCPULimiter(l ResourceLimiter) ControllerOpt { + return func(g *Controller) { g.cpuLimiter = l } } // WithGitpodIDs sets the gitpod relevant IDs -func WithGitpodIDs(workspaceID, instanceID string) GovernerOpt { - return func(g *Governer) { +func WithGitpodIDs(workspaceID, instanceID string) ControllerOpt { + return func(g *Controller) { g.log = g.log.WithFields(log.OWI("", workspaceID, instanceID)) } } // WithPrometheusRegisterer configures a prometheus registry -func WithPrometheusRegisterer(reg prometheus.Registerer) GovernerOpt { - return func(g *Governer) { +func WithPrometheusRegisterer(reg prometheus.Registerer) ControllerOpt { + return func(g *Controller) { g.Prometheus = reg } } // WithProcessPriorities enables process priority shaping -func WithProcessPriorities(prio map[ProcessType]int) GovernerOpt { - return func(g *Governer) { +func WithProcessPriorities(prio map[ProcessType]int) ControllerOpt { + return func(g *Controller) { g.processPriorities = prio } } -// WithControlPeriod configures the control period of the governer -func WithControlPeriod(period time.Duration) GovernerOpt { - return func(g *Governer) { +// WithControlPeriod configures the control period of the controller +func WithControlPeriod(period time.Duration) ControllerOpt { + return func(g *Controller) { g.ControlPeriod = period } } @@ -116,9 +116,9 @@ const ( ProcessDefault ProcessType = "default" ) -// NewGoverner creates a new resource governer for a container -func NewGoverner(containerID, instanceID string, cgroupPath string, opts ...GovernerOpt) (gov *Governer, err error) { - gov = &Governer{ +// NewController creates a new resource controller for a container +func NewController(containerID, instanceID string, cgroupPath string, opts ...ControllerOpt) (gov *Controller, err error) { + gov = &Controller{ stop: make(chan struct{}), log: log.WithField("containerID", containerID), CGroupPath: cgroupPath, @@ -157,7 +157,7 @@ func NewGoverner(containerID, instanceID string, cgroupPath string, opts ...Gove return gov, nil } -func (gov *Governer) registerPrometheusGauges() (err error) { +func (gov *Controller) registerPrometheusGauges() (err error) { gov.metrics.CPULimit = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "workspace_cpu_limit_sec", Help: "Time spent in each CPU limit", @@ -171,7 +171,7 @@ func (gov *Governer) registerPrometheusGauges() (err error) { } // Start actually starts governing. This function is meant to be called as a Go-routine. -func (gov *Governer) Start(ctx context.Context) { +func (gov *Controller) Start(ctx context.Context) { t := time.NewTicker(gov.SamplingPeriod) for { gov.controlCPU() @@ -182,10 +182,10 @@ func (gov *Governer) Start(ctx context.Context) { case <-t.C: continue case <-ctx.Done(): - gov.log.Debug("resource governer shutting down") + gov.log.Debug("resource controller shutting down") return case <-gov.stop: - gov.log.Debug("resource governer shutting down") + gov.log.Debug("resource controller shutting down") return } } @@ -194,7 +194,7 @@ func (gov *Governer) Start(ctx context.Context) { // see https://www.kernel.org/doc/Documentation/cgroup-v1/cpuacct.txt const userHZ = 100 -func (gov *Governer) controlCPU() { +func (gov *Controller) controlCPU() { sample, err := gov.cfsController.GetUsage() if err != nil { gov.log.WithError(err).Warn("cannot sample cpuacct.usage") @@ -256,7 +256,7 @@ func (gov *Governer) controlCPU() { } // SetFixedCPULimit overrides the CPU current limiter with a fixed CPU limiter -func (gov *Governer) SetFixedCPULimit(jiffiesPerSec int64) { +func (gov *Controller) SetFixedCPULimit(jiffiesPerSec int64) { gov.mu.Lock() defer gov.mu.Unlock() @@ -267,7 +267,7 @@ func (gov *Governer) SetFixedCPULimit(jiffiesPerSec int64) { } } -func (gov *Governer) controlProcessPriorities() { +func (gov *Controller) controlProcessPriorities() { if len(gov.processPriorities) == 0 { return } @@ -339,7 +339,7 @@ func determineProcessType(p processTypeIndicator) ProcessType { } // enforceCPULimit sets a new CPU spending limit expressed in jiffies/sec -func (gov *Governer) enforceCPULimit(limit int64) (didChange bool, err error) { +func (gov *Controller) enforceCPULimit(limit int64) (didChange bool, err error) { quota, period, err := gov.cfsController.GetQuota() if err != nil { return @@ -362,8 +362,8 @@ func (gov *Governer) enforceCPULimit(limit int64) (didChange bool, err error) { return true, nil } -// Stop stops the governer -func (gov *Governer) Stop() { +// Stop stops the controller +func (gov *Controller) Stop() { gov.stopOnce.Do(func() { close(gov.stop) }) diff --git a/components/ws-manager-node/pkg/resourcegov/governer_test.go b/components/ws-daemon/pkg/resources/controller_test.go similarity index 92% rename from components/ws-manager-node/pkg/resourcegov/governer_test.go rename to components/ws-daemon/pkg/resources/controller_test.go index cc1839dbc1f87e..493802675787e0 100644 --- a/components/ws-manager-node/pkg/resourcegov/governer_test.go +++ b/components/ws-daemon/pkg/resources/controller_test.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package resourcegov +package resources import ( "encoding/csv" @@ -46,49 +46,49 @@ func TestControlCPU(t *testing.T) { tests := []struct { Name string - Opts []GovernerOpt + Opts []ControllerOpt Consumer consumer Validator validator }{ { Name: "bucket regular use", - Opts: []GovernerOpt{WithCPULimiter(bktLimiter())}, + Opts: []ControllerOpt{WithCPULimiter(bktLimiter())}, Consumer: splitpointConsumer(fixedConsumer(500), randomConsumer(20, 100), 5*time.Minute), Validator: aucValidator(49985), }, { Name: "bucket max abuse", - Opts: []GovernerOpt{WithCPULimiter(bktLimiter())}, + Opts: []ControllerOpt{WithCPULimiter(bktLimiter())}, Consumer: fixedConsumer(600), Validator: aucValidator(192200), }, { Name: "bucket below radar abuse", - Opts: []GovernerOpt{WithCPULimiter(bktLimiter())}, + Opts: []ControllerOpt{WithCPULimiter(bktLimiter())}, Consumer: fixedConsumer(400), Validator: aucValidator(191000), }, { Name: "clamped bucket regular use", - Opts: []GovernerOpt{WithCPULimiter(clampingBktLimiter())}, + Opts: []ControllerOpt{WithCPULimiter(clampingBktLimiter())}, Consumer: splitpointConsumer(fixedConsumer(500), randomConsumer(20, 100), 5*time.Minute), Validator: aucValidator(51200), }, { Name: "clamped bucket max abuse", - Opts: []GovernerOpt{WithCPULimiter(clampingBktLimiter())}, + Opts: []ControllerOpt{WithCPULimiter(clampingBktLimiter())}, Consumer: fixedConsumer(600), Validator: aucValidator(125200), }, { Name: "clamped bucket below radar abuse", - Opts: []GovernerOpt{WithCPULimiter(clampingBktLimiter())}, + Opts: []ControllerOpt{WithCPULimiter(clampingBktLimiter())}, Consumer: fixedConsumer(400), Validator: aucValidator(125000), }, { Name: "clamped bucket smart abuser", - Opts: []GovernerOpt{WithCPULimiter(clampingBktLimiter())}, + Opts: []ControllerOpt{WithCPULimiter(clampingBktLimiter())}, Consumer: periodicConsumer(splitpointConsumer(fixedConsumer(500), fixedConsumer(100), 5*time.Minute), 10*time.Minute), Validator: aucValidator(150000), }, @@ -97,7 +97,7 @@ func TestControlCPU(t *testing.T) { for _, test := range tests { t.Run(test.Name, func(t *testing.T) { opts := append(test.Opts, WithControlPeriod(15*time.Minute)) - gov, err := NewGoverner("testcontainer", "instanceid", "none", opts...) + gov, err := NewController("testcontainer", "instanceid", "none", opts...) if err != nil { t.Fatalf("cannot create governer: %q", err) } diff --git a/components/ws-manager-node/pkg/resourcegov/dispatch.go b/components/ws-daemon/pkg/resources/dispatch.go similarity index 88% rename from components/ws-manager-node/pkg/resourcegov/dispatch.go rename to components/ws-daemon/pkg/resources/dispatch.go index 592c3c4f93b80e..c4916d1a51d373 100644 --- a/components/ws-manager-node/pkg/resourcegov/dispatch.go +++ b/components/ws-daemon/pkg/resources/dispatch.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package resourcegov +package resources import ( "context" @@ -11,15 +11,15 @@ import ( "github.com/gitpod-io/gitpod/common-go/cri" wsk8s "github.com/gitpod-io/gitpod/common-go/kubernetes" "github.com/gitpod-io/gitpod/common-go/log" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/dispatch" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/dispatch" "github.com/prometheus/client_golang/prometheus" "golang.org/x/xerrors" "k8s.io/apimachinery/pkg/api/resource" ) -// DispatchListenerConfig configures the containerd resource governer dispatch -type DispatchListenerConfig struct { +// Config configures the containerd resource governer dispatch +type Config struct { CPUBuckets []Bucket `json:"cpuBuckets"` ControlPeriod string `json:"controlPeriod"` SamplingPeriod string `json:"samplingPeriod"` @@ -28,11 +28,11 @@ type DispatchListenerConfig struct { } // NewDispatchListener creates a new resource governer dispatch listener -func NewDispatchListener(cfg *DispatchListenerConfig, prom prometheus.Registerer) *DispatchListener { +func NewDispatchListener(cfg *Config, prom prometheus.Registerer) *DispatchListener { d := &DispatchListener{ Prometheus: prom, Config: cfg, - governer: make(map[cri.ContainerID]*Governer), + governer: make(map[cri.ContainerID]*Controller), } prom.MustRegister( prometheus.NewGaugeFunc(prometheus.GaugeOpts{ @@ -52,9 +52,9 @@ func NewDispatchListener(cfg *DispatchListenerConfig, prom prometheus.Registerer // DispatchListener starts new resource governer using the workspace dispatch type DispatchListener struct { Prometheus prometheus.Registerer - Config *DispatchListenerConfig + Config *Config - governer map[cri.ContainerID]*Governer + governer map[cri.ContainerID]*Controller mu sync.Mutex } @@ -95,7 +95,7 @@ func (d *DispatchListener) WorkspaceAdded(ctx context.Context, ws *dispatch.Work } log := log.WithFields(wsk8s.GetOWIFromObject(&ws.Pod.ObjectMeta)).WithField("containerID", ws.ContainerID) - g, err := NewGoverner(string(ws.ContainerID), ws.InstanceID, cgroupPath, + g, err := NewController(string(ws.ContainerID), ws.InstanceID, cgroupPath, WithCGroupBasePath(d.Config.CGroupsBasePath), WithCPULimiter(cpuLimiter), WithGitpodIDs(ws.WorkspaceID, ws.InstanceID), diff --git a/components/ws-manager-node/pkg/resourcegov/controller.go b/components/ws-daemon/pkg/resources/limiter.go similarity index 99% rename from components/ws-manager-node/pkg/resourcegov/controller.go rename to components/ws-daemon/pkg/resources/limiter.go index 8f98fa6a417041..9b486144547054 100644 --- a/components/ws-manager-node/pkg/resourcegov/controller.go +++ b/components/ws-daemon/pkg/resources/limiter.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package resourcegov +package resources // ResourceLimiter implements a strategy to limit the resurce use of a workspace type ResourceLimiter interface { diff --git a/components/ws-manager-node/pkg/resourcegov/controller_test.go b/components/ws-daemon/pkg/resources/limiter_test.go similarity index 75% rename from components/ws-manager-node/pkg/resourcegov/controller_test.go rename to components/ws-daemon/pkg/resources/limiter_test.go index 318a33bf59d0f1..bef193e0c005a0 100644 --- a/components/ws-manager-node/pkg/resourcegov/controller_test.go +++ b/components/ws-daemon/pkg/resources/limiter_test.go @@ -2,19 +2,19 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package resourcegov_test +package resources_test import ( "encoding/json" "fmt" "testing" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/resourcegov" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/resources" "github.com/google/go-cmp/cmp" ) func TestBucketLimiter(t *testing.T) { - defaultBuckets := []resourcegov.Bucket{ + defaultBuckets := []resources.Bucket{ {Budget: 50, Limit: 100}, {Budget: 30, Limit: 50}, {Budget: 20, Limit: 20}, @@ -23,11 +23,11 @@ func TestBucketLimiter(t *testing.T) { tests := []struct { Desc string - Buckets []resourcegov.Bucket + Buckets []resources.Bucket BudgetSpent int64 ExpectedLimit int64 }{ - {"empty bucket list", []resourcegov.Bucket{}, 50, 0}, + {"empty bucket list", []resources.Bucket{}, 50, 0}, {"in first bucket", defaultBuckets, 40, 100}, {"in second bucket", defaultBuckets, 70, 50}, {"in third bucket", defaultBuckets, 90, 20}, @@ -37,7 +37,7 @@ func TestBucketLimiter(t *testing.T) { for _, test := range tests { t.Run(test.Desc, func(t *testing.T) { - limit := resourcegov.BucketLimiter(test.Buckets).Limit(test.BudgetSpent) + limit := resources.BucketLimiter(test.Buckets).Limit(test.BudgetSpent) if limit != test.ExpectedLimit { t.Errorf("unexpected limit %d: expected %d", limit, test.ExpectedLimit) } @@ -48,14 +48,14 @@ func TestBucketLimiter(t *testing.T) { func TestUnmarshalBucket(t *testing.T) { tests := []struct { Input string - Expectation resourcegov.Bucket + Expectation resources.Bucket }{ - {`{"budget": 20, "limit": 50}`, resourcegov.Bucket{Budget: 20, Limit: 50}}, + {`{"budget": 20, "limit": 50}`, resources.Bucket{Budget: 20, Limit: 50}}, } for i, test := range tests { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { - var act resourcegov.Bucket + var act resources.Bucket err := json.Unmarshal([]byte(test.Input), &act) if err != nil { t.Error(err) diff --git a/components/ws-manager-node/pkg/resourcegov/ttlcache.go b/components/ws-daemon/pkg/resources/ttlcache.go similarity index 98% rename from components/ws-manager-node/pkg/resourcegov/ttlcache.go rename to components/ws-daemon/pkg/resources/ttlcache.go index 529ff186de5a30..b622853131fb11 100644 --- a/components/ws-manager-node/pkg/resourcegov/ttlcache.go +++ b/components/ws-daemon/pkg/resources/ttlcache.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package resourcegov +package resources import ( "golang.org/x/xerrors" diff --git a/components/ws-manager-node/pkg/uidmap/uidmap.go b/components/ws-daemon/pkg/uidmap/uidmap.go similarity index 97% rename from components/ws-manager-node/pkg/uidmap/uidmap.go rename to components/ws-daemon/pkg/uidmap/uidmap.go index 5bac3de11250a9..f230f74867ca42 100644 --- a/components/ws-manager-node/pkg/uidmap/uidmap.go +++ b/components/ws-daemon/pkg/uidmap/uidmap.go @@ -17,8 +17,8 @@ import ( wsk8s "github.com/gitpod-io/gitpod/common-go/kubernetes" "github.com/gitpod-io/gitpod/common-go/log" - ndeapi "github.com/gitpod-io/gitpod/ws-manager-node/api" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/dispatch" + ndeapi "github.com/gitpod-io/gitpod/ws-daemon/api" + "github.com/gitpod-io/gitpod/ws-daemon/pkg/dispatch" "github.com/golang/protobuf/jsonpb" "github.com/sirupsen/logrus" @@ -54,11 +54,11 @@ const ( // Uidmapper provides UID mapping services for creating Linux user namespaces // from within a workspace. type Uidmapper struct { - Config UidmapperConfig + Config Config } -// UidmapperConfig configures the UID mapper -type UidmapperConfig struct { +// Config configures the UID mapper +type Config struct { // ProcLocation is the location of the node's proc filesystem ProcLocation string `json:"procLocation"` // RootRange is the range to which one can map the root (uid 0) user/group to diff --git a/components/ws-daemon/shiftfs-module-loader/entrypoint.sh b/components/ws-daemon/shiftfs-module-loader/entrypoint.sh index a12c3bdf9241be..baa2eb72e87a15 100755 --- a/components/ws-daemon/shiftfs-module-loader/entrypoint.sh +++ b/components/ws-daemon/shiftfs-module-loader/entrypoint.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Copyright (c) 2020 TypeFox GmbH. All rights reserved. +# Licensed under the GNU Affero General Public License (AGPL). +# See License-AGPL.txt in the project root for license information. + DRIVER_NAME=shiftfs DRIVER_VERSION=1.2 diff --git a/components/ws-daemon/shiftfs-module-loader/leeway.Dockerfile b/components/ws-daemon/shiftfs-module-loader/leeway.Dockerfile index 50c62556cb23b6..c59d653d1fa4a0 100644 --- a/components/ws-daemon/shiftfs-module-loader/leeway.Dockerfile +++ b/components/ws-daemon/shiftfs-module-loader/leeway.Dockerfile @@ -1,3 +1,7 @@ +# Copyright (c) 2020 TypeFox GmbH. All rights reserved. +# Licensed under the GNU Affero General Public License (AGPL). +# See License-AGPL.txt in the project root for license information. + FROM ubuntu:18.04 RUN apt-get update && apt-get install -y git gcc make dkms curl diff --git a/components/ws-manager-api/core.proto b/components/ws-manager-api/core.proto index 611ec5a317dfd5..b47763ac6f80d0 100644 --- a/components/ws-manager-api/core.proto +++ b/components/ws-manager-api/core.proto @@ -440,7 +440,7 @@ enum WorkspaceFeatureFlag { // This flag implies REGISTRY_FACADE FULL_WORKSPACE_BACKUP = 4; - // FixedResources ensures this workspace is not subject to ws-manager-node's dynamic resource limits. + // FixedResources ensures this workspace is not subject to ws-daemon's dynamic resource limits. // In this sence it's akin to "guaranteed" (as compared to burstable) resources for workspaces. FIXED_RESOURCES = 5; diff --git a/components/ws-manager-api/go/core.pb.go b/components/ws-manager-api/go/core.pb.go index f6b8fbb6f7edbc..2c617e491c22bf 100644 --- a/components/ws-manager-api/go/core.pb.go +++ b/components/ws-manager-api/go/core.pb.go @@ -221,7 +221,7 @@ const ( // // This flag implies REGISTRY_FACADE WorkspaceFeatureFlag_FULL_WORKSPACE_BACKUP WorkspaceFeatureFlag = 4 - // FixedResources ensures this workspace is not subject to ws-manager-node's dynamic resource limits. + // FixedResources ensures this workspace is not subject to ws-daemon's dynamic resource limits. // In this sence it's akin to "guaranteed" (as compared to burstable) resources for workspaces. WorkspaceFeatureFlag_FIXED_RESOURCES WorkspaceFeatureFlag = 5 // UserNamespace enables user namespace specific behaviour in the pod. It disables a host of diff --git a/components/ws-manager-node-api/generate.sh b/components/ws-manager-node-api/generate.sh deleted file mode 100755 index 5c3c99319fb964..00000000000000 --- a/components/ws-manager-node-api/generate.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -GO111MODULE=on go get github.com/golang/protobuf/protoc-gen-go@v1.3.5 -protoc -I. -I.. --go_out=plugins=grpc:. *.proto -mv github.com/gitpod-io/gitpod/ws-manager-node/api/* go && rm -rf github.com - -# GO111MODULE=on go get github.com/golang/mock/mockgen@latest -# cd go -# mockgen -package mock -source=wssync.pb.go > mock/mock_wssync.go diff --git a/components/ws-manager-node-api/go/BUILD.yaml b/components/ws-manager-node-api/go/BUILD.yaml deleted file mode 100644 index edca21fc38ced8..00000000000000 --- a/components/ws-manager-node-api/go/BUILD.yaml +++ /dev/null @@ -1,10 +0,0 @@ -packages: - - name: lib - type: go - srcs: - - "**/*.go" - - "go.mod" - - "go.sum" - config: - packaging: library - dontTest: false diff --git a/components/ws-manager-node-api/go/canary.go b/components/ws-manager-node-api/go/canary.go deleted file mode 100644 index 6a1766a6d50d06..00000000000000 --- a/components/ws-manager-node-api/go/canary.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -package api - -import ( - context "context" - "sync/atomic" - - grpc "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// NewInWorkspaceHelper produces a new InWorkspaceHelper -func NewInWorkspaceHelper() *InWorkspaceHelper { - return &InWorkspaceHelper{ - triggerUIDMap: make(chan *triggerNewuidmapReq), - } -} - -type triggerNewuidmapReq struct { - Req *UidmapCanaryRequest - Resp chan error -} - -// InWorkspaceHelper implements InWorkspaceHelperServer -type InWorkspaceHelper struct { - canaryAvailable int32 - - triggerUIDMap chan *triggerNewuidmapReq -} - -// Server produces a registrable InWorkspaceHelper server -func (iwh *InWorkspaceHelper) Server() InWorkspaceHelperServer { - return &iwhserver{iwh} -} - -// CanaryAvailable returns true if there's a canaray available. -// If there isn't, calling Newuidmap or Newguidmap won't succeed. -func (iwh *InWorkspaceHelper) CanaryAvailable() bool { - return atomic.LoadInt32(&iwh.canaryAvailable) > 0 -} - -// Newuidmap asks the canary to create a new uidmap. If there's no canary -// available, this function will block until one becomes available or the -// context is canceled. -func (iwh *InWorkspaceHelper) Newuidmap(ctx context.Context, req *UidmapCanaryRequest) error { - trigger := &triggerNewuidmapReq{ - Req: req, - Resp: make(chan error, 1), - } - - select { - case iwh.triggerUIDMap <- trigger: - case <-ctx.Done(): - return ctx.Err() - } - - select { - case err := <-trigger.Resp: - return err - case <-ctx.Done(): - return ctx.Err() - } -} - -type iwhserver struct { - *InWorkspaceHelper -} - -func (iwh *iwhserver) RegisterGRPC(srv *grpc.Server) { - RegisterInWorkspaceHelperServer(srv, iwh) -} - -func (iwh *iwhserver) UidmapCanary(srv InWorkspaceHelper_UidmapCanaryServer) error { - atomic.AddInt32(&iwh.canaryAvailable, 1) - defer atomic.AddInt32(&iwh.canaryAvailable, -1) - - for { - select { - case req := <-iwh.triggerUIDMap: - err := srv.Send(req.Req) - if err != nil { - req.Resp <- err - } - resp, err := srv.Recv() - if err != nil { - req.Resp <- err - } - if resp.ErrorCode > 0 { - req.Resp <- status.Error(codes.Code(resp.ErrorCode), resp.Message) - } - - req.Resp <- nil - case <-srv.Context().Done(): - // canary dropped out - we're done here - } - } -} diff --git a/components/ws-manager-node-api/go/go.mod b/components/ws-manager-node-api/go/go.mod deleted file mode 100644 index 40097f394eefee..00000000000000 --- a/components/ws-manager-node-api/go/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/gitpod-io/gitpod/ws-manager-node/api - -go 1.15 - -require ( - github.com/golang/protobuf v1.4.2 - google.golang.org/grpc v1.32.0 -) diff --git a/components/ws-manager-node-api/go/go.sum b/components/ws-manager-node-api/go/go.sum deleted file mode 100644 index 019911c94e5365..00000000000000 --- a/components/ws-manager-node-api/go/go.sum +++ /dev/null @@ -1,70 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/components/ws-manager-node-api/go/ws-manager-node.pb.go b/components/ws-manager-node-api/go/ws-manager-node.pb.go deleted file mode 100644 index af418847d19d85..00000000000000 --- a/components/ws-manager-node-api/go/ws-manager-node.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: ws-manager-node.proto - -package api - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type UidmapCanaryResponse struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - ErrorCode uint32 `protobuf:"varint,2,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UidmapCanaryResponse) Reset() { *m = UidmapCanaryResponse{} } -func (m *UidmapCanaryResponse) String() string { return proto.CompactTextString(m) } -func (*UidmapCanaryResponse) ProtoMessage() {} -func (*UidmapCanaryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_022226a2c4a7acd9, []int{0} -} - -func (m *UidmapCanaryResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UidmapCanaryResponse.Unmarshal(m, b) -} -func (m *UidmapCanaryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UidmapCanaryResponse.Marshal(b, m, deterministic) -} -func (m *UidmapCanaryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UidmapCanaryResponse.Merge(m, src) -} -func (m *UidmapCanaryResponse) XXX_Size() int { - return xxx_messageInfo_UidmapCanaryResponse.Size(m) -} -func (m *UidmapCanaryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UidmapCanaryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_UidmapCanaryResponse proto.InternalMessageInfo - -func (m *UidmapCanaryResponse) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func (m *UidmapCanaryResponse) GetErrorCode() uint32 { - if m != nil { - return m.ErrorCode - } - return 0 -} - -type UidmapCanaryRequest struct { - Pid int64 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` - Gid bool `protobuf:"varint,2,opt,name=gid,proto3" json:"gid,omitempty"` - Mapping []*UidmapCanaryRequest_Mapping `protobuf:"bytes,3,rep,name=mapping,proto3" json:"mapping,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UidmapCanaryRequest) Reset() { *m = UidmapCanaryRequest{} } -func (m *UidmapCanaryRequest) String() string { return proto.CompactTextString(m) } -func (*UidmapCanaryRequest) ProtoMessage() {} -func (*UidmapCanaryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_022226a2c4a7acd9, []int{1} -} - -func (m *UidmapCanaryRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UidmapCanaryRequest.Unmarshal(m, b) -} -func (m *UidmapCanaryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UidmapCanaryRequest.Marshal(b, m, deterministic) -} -func (m *UidmapCanaryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UidmapCanaryRequest.Merge(m, src) -} -func (m *UidmapCanaryRequest) XXX_Size() int { - return xxx_messageInfo_UidmapCanaryRequest.Size(m) -} -func (m *UidmapCanaryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UidmapCanaryRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UidmapCanaryRequest proto.InternalMessageInfo - -func (m *UidmapCanaryRequest) GetPid() int64 { - if m != nil { - return m.Pid - } - return 0 -} - -func (m *UidmapCanaryRequest) GetGid() bool { - if m != nil { - return m.Gid - } - return false -} - -func (m *UidmapCanaryRequest) GetMapping() []*UidmapCanaryRequest_Mapping { - if m != nil { - return m.Mapping - } - return nil -} - -type UidmapCanaryRequest_Mapping struct { - ContainerId uint32 `protobuf:"varint,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - HostId uint32 `protobuf:"varint,2,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"` - Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UidmapCanaryRequest_Mapping) Reset() { *m = UidmapCanaryRequest_Mapping{} } -func (m *UidmapCanaryRequest_Mapping) String() string { return proto.CompactTextString(m) } -func (*UidmapCanaryRequest_Mapping) ProtoMessage() {} -func (*UidmapCanaryRequest_Mapping) Descriptor() ([]byte, []int) { - return fileDescriptor_022226a2c4a7acd9, []int{1, 0} -} - -func (m *UidmapCanaryRequest_Mapping) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UidmapCanaryRequest_Mapping.Unmarshal(m, b) -} -func (m *UidmapCanaryRequest_Mapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UidmapCanaryRequest_Mapping.Marshal(b, m, deterministic) -} -func (m *UidmapCanaryRequest_Mapping) XXX_Merge(src proto.Message) { - xxx_messageInfo_UidmapCanaryRequest_Mapping.Merge(m, src) -} -func (m *UidmapCanaryRequest_Mapping) XXX_Size() int { - return xxx_messageInfo_UidmapCanaryRequest_Mapping.Size(m) -} -func (m *UidmapCanaryRequest_Mapping) XXX_DiscardUnknown() { - xxx_messageInfo_UidmapCanaryRequest_Mapping.DiscardUnknown(m) -} - -var xxx_messageInfo_UidmapCanaryRequest_Mapping proto.InternalMessageInfo - -func (m *UidmapCanaryRequest_Mapping) GetContainerId() uint32 { - if m != nil { - return m.ContainerId - } - return 0 -} - -func (m *UidmapCanaryRequest_Mapping) GetHostId() uint32 { - if m != nil { - return m.HostId - } - return 0 -} - -func (m *UidmapCanaryRequest_Mapping) GetSize() uint32 { - if m != nil { - return m.Size - } - return 0 -} - -func init() { - proto.RegisterType((*UidmapCanaryResponse)(nil), "wsmannode.UidmapCanaryResponse") - proto.RegisterType((*UidmapCanaryRequest)(nil), "wsmannode.UidmapCanaryRequest") - proto.RegisterType((*UidmapCanaryRequest_Mapping)(nil), "wsmannode.UidmapCanaryRequest.Mapping") -} - -func init() { - proto.RegisterFile("ws-manager-node.proto", fileDescriptor_022226a2c4a7acd9) -} - -var fileDescriptor_022226a2c4a7acd9 = []byte{ - // 317 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xd1, 0x4a, 0xc3, 0x30, - 0x14, 0x86, 0xad, 0x95, 0xd5, 0x9d, 0x6d, 0xa0, 0x51, 0xb1, 0x0c, 0xd4, 0xb9, 0x0b, 0xe9, 0xcd, - 0x3a, 0x9d, 0x2f, 0x20, 0xee, 0xc6, 0x5d, 0x88, 0x10, 0x18, 0xa2, 0x37, 0x23, 0x6b, 0x0e, 0x5d, - 0xd4, 0x26, 0x31, 0xe9, 0x18, 0xfa, 0xa0, 0x3e, 0x8f, 0x24, 0xeb, 0x86, 0x8a, 0x7a, 0xf7, 0x9f, - 0x8f, 0xf6, 0xcb, 0x9f, 0x1c, 0x38, 0x58, 0xd8, 0x5e, 0xc1, 0x24, 0xcb, 0xd1, 0xf4, 0xa4, 0xe2, - 0x98, 0x6a, 0xa3, 0x4a, 0x45, 0xea, 0x0b, 0x5b, 0x30, 0xe9, 0x40, 0xf7, 0x0e, 0xf6, 0xc7, 0x82, - 0x17, 0x4c, 0x0f, 0x99, 0x64, 0xe6, 0x8d, 0xa2, 0xd5, 0x4a, 0x5a, 0x24, 0x31, 0x44, 0x05, 0x5a, - 0xcb, 0x72, 0x8c, 0x83, 0x4e, 0x90, 0xd4, 0xe9, 0x6a, 0x24, 0x47, 0x00, 0x68, 0x8c, 0x32, 0x93, - 0x4c, 0x71, 0x8c, 0x37, 0x3b, 0x41, 0xd2, 0xa2, 0x75, 0x4f, 0x86, 0x4e, 0xf8, 0x11, 0xc0, 0xde, - 0x77, 0xe3, 0xeb, 0x1c, 0x6d, 0x49, 0x76, 0x20, 0xd4, 0x82, 0x7b, 0x59, 0x48, 0x5d, 0x74, 0x24, - 0x17, 0xdc, 0x1b, 0xb6, 0xa9, 0x8b, 0xe4, 0x0a, 0xa2, 0x82, 0x69, 0x2d, 0x64, 0x1e, 0x87, 0x9d, - 0x30, 0x69, 0x0c, 0xce, 0xd2, 0x75, 0xd3, 0xf4, 0x17, 0x69, 0x7a, 0xbb, 0xfc, 0x9a, 0xae, 0x7e, - 0x6b, 0x3f, 0x40, 0x54, 0x31, 0x72, 0x0a, 0xcd, 0x4c, 0xc9, 0x92, 0x09, 0x89, 0x66, 0x52, 0x9d, - 0xdc, 0xa2, 0x8d, 0x35, 0x1b, 0x71, 0x72, 0x08, 0xd1, 0x4c, 0xd9, 0x72, 0x52, 0xb5, 0x68, 0xd1, - 0x9a, 0x1b, 0x47, 0x9c, 0x10, 0xd8, 0xb2, 0xe2, 0x1d, 0xe3, 0xd0, 0x53, 0x9f, 0x07, 0x4f, 0xb0, - 0x3b, 0x92, 0xf7, 0xca, 0x3c, 0x5b, 0xcd, 0x32, 0xbc, 0xc1, 0x17, 0x8d, 0x86, 0x8c, 0xa1, 0xf9, - 0xb5, 0x17, 0x39, 0xf9, 0xb3, 0xf0, 0xf2, 0x5d, 0xdb, 0xc7, 0xff, 0xdf, 0xa8, 0xbb, 0x91, 0x04, - 0xe7, 0xc1, 0xf5, 0xc5, 0x63, 0x3f, 0x17, 0xe5, 0x6c, 0x3e, 0x4d, 0x33, 0x55, 0xb8, 0xa8, 0x15, - 0xef, 0x09, 0x55, 0xa5, 0xfe, 0x8f, 0xad, 0xf6, 0x99, 0x16, 0xd3, 0x9a, 0x5f, 0xed, 0xe5, 0x67, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x46, 0x38, 0x5f, 0xf3, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// InWorkspaceHelperClient is the client API for InWorkspaceHelper service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type InWorkspaceHelperClient interface { - // UidmapCanary can establish a uid mapping of a new user namespace spawned within the workspace. - UidmapCanary(ctx context.Context, opts ...grpc.CallOption) (InWorkspaceHelper_UidmapCanaryClient, error) -} - -type inWorkspaceHelperClient struct { - cc grpc.ClientConnInterface -} - -func NewInWorkspaceHelperClient(cc grpc.ClientConnInterface) InWorkspaceHelperClient { - return &inWorkspaceHelperClient{cc} -} - -func (c *inWorkspaceHelperClient) UidmapCanary(ctx context.Context, opts ...grpc.CallOption) (InWorkspaceHelper_UidmapCanaryClient, error) { - stream, err := c.cc.NewStream(ctx, &_InWorkspaceHelper_serviceDesc.Streams[0], "/wsmannode.InWorkspaceHelper/UidmapCanary", opts...) - if err != nil { - return nil, err - } - x := &inWorkspaceHelperUidmapCanaryClient{stream} - return x, nil -} - -type InWorkspaceHelper_UidmapCanaryClient interface { - Send(*UidmapCanaryResponse) error - Recv() (*UidmapCanaryRequest, error) - grpc.ClientStream -} - -type inWorkspaceHelperUidmapCanaryClient struct { - grpc.ClientStream -} - -func (x *inWorkspaceHelperUidmapCanaryClient) Send(m *UidmapCanaryResponse) error { - return x.ClientStream.SendMsg(m) -} - -func (x *inWorkspaceHelperUidmapCanaryClient) Recv() (*UidmapCanaryRequest, error) { - m := new(UidmapCanaryRequest) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// InWorkspaceHelperServer is the server API for InWorkspaceHelper service. -type InWorkspaceHelperServer interface { - // UidmapCanary can establish a uid mapping of a new user namespace spawned within the workspace. - UidmapCanary(InWorkspaceHelper_UidmapCanaryServer) error -} - -// UnimplementedInWorkspaceHelperServer can be embedded to have forward compatible implementations. -type UnimplementedInWorkspaceHelperServer struct { -} - -func (*UnimplementedInWorkspaceHelperServer) UidmapCanary(srv InWorkspaceHelper_UidmapCanaryServer) error { - return status.Errorf(codes.Unimplemented, "method UidmapCanary not implemented") -} - -func RegisterInWorkspaceHelperServer(s *grpc.Server, srv InWorkspaceHelperServer) { - s.RegisterService(&_InWorkspaceHelper_serviceDesc, srv) -} - -func _InWorkspaceHelper_UidmapCanary_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(InWorkspaceHelperServer).UidmapCanary(&inWorkspaceHelperUidmapCanaryServer{stream}) -} - -type InWorkspaceHelper_UidmapCanaryServer interface { - Send(*UidmapCanaryRequest) error - Recv() (*UidmapCanaryResponse, error) - grpc.ServerStream -} - -type inWorkspaceHelperUidmapCanaryServer struct { - grpc.ServerStream -} - -func (x *inWorkspaceHelperUidmapCanaryServer) Send(m *UidmapCanaryRequest) error { - return x.ServerStream.SendMsg(m) -} - -func (x *inWorkspaceHelperUidmapCanaryServer) Recv() (*UidmapCanaryResponse, error) { - m := new(UidmapCanaryResponse) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _InWorkspaceHelper_serviceDesc = grpc.ServiceDesc{ - ServiceName: "wsmannode.InWorkspaceHelper", - HandlerType: (*InWorkspaceHelperServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "UidmapCanary", - Handler: _InWorkspaceHelper_UidmapCanary_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "ws-manager-node.proto", -} diff --git a/components/ws-manager-node-api/ws-manager-node.proto b/components/ws-manager-node-api/ws-manager-node.proto deleted file mode 100644 index 2ccc3c3d552835..00000000000000 --- a/components/ws-manager-node-api/ws-manager-node.proto +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -syntax = "proto3"; - -package wsmannode; - -option go_package = "github.com/gitpod-io/gitpod/ws-manager-node/api"; - -service InWorkspaceHelper { - - // UidmapCanary can establish a uid mapping of a new user namespace spawned within the workspace. - rpc UidmapCanary(stream UidmapCanaryResponse) returns (stream UidmapCanaryRequest) {} - -} - -message UidmapCanaryResponse { - string message = 1; - uint32 error_code = 2; -} -message UidmapCanaryRequest { - message Mapping { - uint32 container_id = 1; - uint32 host_id = 2; - uint32 size = 3; - } - - int64 pid = 1; - bool gid = 2; - repeated Mapping mapping = 3; -} \ No newline at end of file diff --git a/components/ws-manager-node/.gitignore b/components/ws-manager-node/.gitignore deleted file mode 100644 index d37901e65aaa05..00000000000000 --- a/components/ws-manager-node/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ws-manager-node diff --git a/components/ws-manager-node/.golangci.yml b/components/ws-manager-node/.golangci.yml deleted file mode 100644 index 6f1cdfb5b5a8cd..00000000000000 --- a/components/ws-manager-node/.golangci.yml +++ /dev/null @@ -1,9 +0,0 @@ -issues: - exclude: - # we need to exclude the following two issues to allow the span, ctx := ... pattern - - ineffectual assignment to `ctx` - - this value of `ctx` is never used - exclude-rules: - - path: _test\.go - linters: - - errcheck \ No newline at end of file diff --git a/components/ws-manager-node/BUILD.yaml b/components/ws-manager-node/BUILD.yaml deleted file mode 100644 index 69682e5823fe68..00000000000000 --- a/components/ws-manager-node/BUILD.yaml +++ /dev/null @@ -1,38 +0,0 @@ -packages: - - name: app - type: go - srcs: - - "**/*.go" - - "go.mod" - - "go.sum" - deps: - - components/common-go:lib - - components/ws-manager-node-api/go:lib - env: - - CGO_ENABLED=0 - - GOOS=linux - config: - packaging: app - - name: golib - type: go - deps: - - components/common-go:lib - - components/ws-daemon-api/go:lib - - components/ws-manager-node-api/go:lib - srcs: - - "pkg/protocol/**" - - "go.mod" - - "go.sum" - config: - packaging: library - dontTest: false - - name: docker - type: docker - deps: - - :app - argdeps: - - imageRepoBase - config: - dockerfile: leeway.Dockerfile - image: - - ${imageRepoBase}/ws-manager-node:${version} diff --git a/components/ws-manager-node/cmd/newgidmap.go b/components/ws-manager-node/cmd/newgidmap.go deleted file mode 100644 index 0002b7a2bcd287..00000000000000 --- a/components/ws-manager-node/cmd/newgidmap.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -package cmd - -import ( - "fmt" - "strconv" - - ndeapi "github.com/gitpod-io/gitpod/ws-manager-node/api" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/uidmap" - "github.com/spf13/cobra" -) - -var newgidmapCmd = &cobra.Command{ - Use: "newuidmap ", - Args: cobra.MinimumNArgs(4), - RunE: func(cmd *cobra.Command, args []string) error { - pid, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - panic(err) - } - mapping := make([]*ndeapi.UidmapCanaryRequest_Mapping, 0, (len(args)-1)/3) - for i := 1; i < len(args); i++ { - icid, err := strconv.ParseUint(args[i], 10, 32) - if err != nil { - return fmt.Errorf("cannot parse inContainerID (arg %d): %w", i, err) - } - i++ - - hid, err := strconv.ParseUint(args[i], 10, 32) - if err != nil { - return fmt.Errorf("cannot parse inContainerID (arg %d): %w", i, err) - } - i++ - - sze, err := strconv.ParseUint(args[i], 10, 32) - if err != nil { - return fmt.Errorf("cannot parse inContainerID (arg %d): %w", i, err) - } - - mapping = append(mapping, &ndeapi.UidmapCanaryRequest_Mapping{ - ContainerId: uint32(icid), - HostId: uint32(hid), - Size: uint32(sze), - }) - } - - if (len(args)-1)%3 != 0 { - return fmt.Errorf("arguments must be tripples") - } - - return uidmap.WriteMapping(pid, true, mapping) - }, -} diff --git a/components/ws-manager-node/cmd/newuidmap.go b/components/ws-manager-node/cmd/newuidmap.go deleted file mode 100644 index ba6f61a4587eb9..00000000000000 --- a/components/ws-manager-node/cmd/newuidmap.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -package cmd - -import ( - "fmt" - "strconv" - - ndeapi "github.com/gitpod-io/gitpod/ws-manager-node/api" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/uidmap" - "github.com/spf13/cobra" -) - -var newuidmapCmd = &cobra.Command{ - Use: "newuidmap ", - Args: cobra.MinimumNArgs(4), - RunE: func(cmd *cobra.Command, args []string) error { - pid, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - panic(err) - } - mapping := make([]*ndeapi.UidmapCanaryRequest_Mapping, 0, (len(args)-1)/3) - for i := 1; i < len(args); i++ { - icid, err := strconv.ParseUint(args[i], 10, 32) - if err != nil { - return fmt.Errorf("cannot parse inContainerID (arg %d): %w", i, err) - } - i++ - - hid, err := strconv.ParseUint(args[i], 10, 32) - if err != nil { - return fmt.Errorf("cannot parse inContainerID (arg %d): %w", i, err) - } - i++ - - sze, err := strconv.ParseUint(args[i], 10, 32) - if err != nil { - return fmt.Errorf("cannot parse inContainerID (arg %d): %w", i, err) - } - - mapping = append(mapping, &ndeapi.UidmapCanaryRequest_Mapping{ - ContainerId: uint32(icid), - HostId: uint32(hid), - Size: uint32(sze), - }) - } - - if (len(args)-1)%3 != 0 { - return fmt.Errorf("arguments must be tripples") - } - - return uidmap.WriteMapping(pid, false, mapping) - }, -} diff --git a/components/ws-manager-node/cmd/root.go b/components/ws-manager-node/cmd/root.go deleted file mode 100644 index f064c3b79c7f9d..00000000000000 --- a/components/ws-manager-node/cmd/root.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -package cmd - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "os" - "strings" - - "github.com/gitpod-io/gitpod/common-go/log" - "github.com/gitpod-io/gitpod/common-go/tracing" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/daemon" - "github.com/spf13/cobra" -) - -var ( - // ServiceName is the name we use for tracing/logging - ServiceName = "ws-manager-node" - // Version of this service - set during build - Version = "" -) - -var cfgFile string -var kubeconfig string -var jsonLog bool - -// rootCmd represents the base command when called without any subcommands -var rootCmd = &cobra.Command{ - Use: "ws-manager-node", - Short: "ws-manager-node controls the behaviour of workspaces on a node", - PersistentPreRun: func(cmd *cobra.Command, args []string) { - log.Init(ServiceName, Version, jsonLog, jsonLog) - }, -} - -// Execute adds all child commands to the root command and sets flags appropriately. -// This is called by main.main(). It only needs to happen once to the rootCmd. -func Execute() { - var c *cobra.Command - fmt.Println(os.Args) - if strings.Contains(os.Args[0], "newuidmap") { - c = newuidmapCmd - } else if strings.Contains(os.Args[0], "newgidmap") { - c = newgidmapCmd - } else { - closer := tracing.Init(ServiceName) - if closer != nil { - defer closer.Close() - } - c = rootCmd - } - - if err := c.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } -} - -func init() { - rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file") - rootCmd.PersistentFlags().BoolVarP(&jsonLog, "json-log", "v", false, "produce JSON log output on verbose level") -} - -func getConfig() *config { - ctnt, err := ioutil.ReadFile(cfgFile) - if err != nil { - log.WithError(err).Error("cannot read configuration. Maybe missing --config?") - os.Exit(1) - } - - var cfg config - err = json.Unmarshal(ctnt, &cfg) - if err != nil { - log.WithError(err).Error("cannot read configuration. Maybe missing --config?") - os.Exit(1) - } - - return &cfg -} - -type config struct { - Daemon daemon.Configuration `json:"daemon"` - RPCServerAddr string `json:"rpcServerAddr"` - TLS struct { - Certificate string `json:"crt"` - PrivateKey string `json:"key"` - } `json:"tls"` - - PProfAddr string `json:"pprofAddr"` - PrometheusAddr string `json:"prometheusAddr"` -} diff --git a/components/ws-manager-node/cmd/run.go b/components/ws-manager-node/cmd/run.go deleted file mode 100644 index 416bfed55d2bec..00000000000000 --- a/components/ws-manager-node/cmd/run.go +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -package cmd - -import ( - "net" - "net/http" - "os" - "os/signal" - "syscall" - "time" - - "github.com/gitpod-io/gitpod/common-go/log" - "github.com/gitpod-io/gitpod/common-go/pprof" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/daemon" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/protocol" - - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" - grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" - "github.com/opentracing/opentracing-go" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/spf13/cobra" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/keepalive" -) - -// serveCmd represents the serve command -var runCmd = &cobra.Command{ - Use: "run", - Short: "Connects to the messagebus and starts the workspace monitor", - - Run: func(cmd *cobra.Command, args []string) { - cfg := getConfig() - - err := cfg.Daemon.Validate() - if err != nil { - log.WithError(err).Fatal("invalid configuration") - } - log.Info("wsman-node configuration is valid") - - reg := prometheus.NewRegistry() - daemon, err := daemon.New(cfg.Daemon, reg) - if err != nil { - log.WithError(err).Fatal("cannot start daemon") - } - go daemon.Start() - - grpcOpts := []grpc.ServerOption{ - // We don't know how good our cients are at closing connections. If they don't close them properly - // we'll be leaking goroutines left and right. Closing Idle connections should prevent that. - grpc.KeepaliveParams(keepalive.ServerParameters{MaxConnectionIdle: 30 * time.Minute}), - grpc.StreamInterceptor(grpc_middleware.ChainStreamServer( - grpc_opentracing.StreamServerInterceptor(grpc_opentracing.WithTracer(opentracing.GlobalTracer())), - )), - grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer( - grpc_opentracing.UnaryServerInterceptor(grpc_opentracing.WithTracer(opentracing.GlobalTracer())), - )), - } - if cfg.TLS.Certificate != "" && cfg.TLS.PrivateKey != "" { - creds, err := credentials.NewServerTLSFromFile(cfg.TLS.Certificate, cfg.TLS.PrivateKey) - if err != nil { - log.WithError(err).WithField("crt", cfg.TLS.Certificate).WithField("key", cfg.TLS.PrivateKey).Fatal("could not load TLS keys") - } - grpcOpts = append(grpcOpts, grpc.Creds(creds)) - log.WithField("crt", cfg.TLS.Certificate).WithField("key", cfg.TLS.PrivateKey).Debug("securing gRPC server with TLS") - } else { - log.Warn("no TLS configured - gRPC server will be unsecured") - } - - grpcServer := grpc.NewServer(grpcOpts...) - protocol.RegisterWorkspaceManagerNodeServer(grpcServer, daemon) - lis, err := net.Listen("tcp", cfg.RPCServerAddr) - if err != nil { - log.WithError(err).WithField("addr", cfg.RPCServerAddr).Fatal("cannot start RPC server") - } - //nolint:errcheck - go grpcServer.Serve(lis) - log.WithField("addr", cfg.RPCServerAddr).Info("started gRPC server") - - if cfg.PProfAddr != "" { - go pprof.Serve(cfg.PProfAddr) - } - - if cfg.PrometheusAddr != "" { - reg.MustRegister( - prometheus.NewGoCollector(), - prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}), - ) - - handler := http.NewServeMux() - handler.Handle("/metrics", promhttp.HandlerFor(reg, promhttp.HandlerOpts{})) - - go func() { - err := http.ListenAndServe(cfg.PrometheusAddr, handler) - if err != nil { - log.WithError(err).Error("Prometheus metrics server failed") - } - }() - log.WithField("addr", cfg.PrometheusAddr).Info("started Prometheus metrics server") - } - - // run until we're told to stop - sigChan := make(chan os.Signal, 1) - signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM) - log.Info("💁 wsman-node is up and running. Stop with SIGINT or CTRL+C") - <-sigChan - log.Info("Received SIGINT - shutting down") - - grpcServer.Stop() - daemon.Close() - }, -} - -func init() { - rootCmd.AddCommand(runCmd) -} diff --git a/components/ws-manager-node/debug.Dockerfile b/components/ws-manager-node/debug.Dockerfile deleted file mode 100644 index f69e850ecc9722..00000000000000 --- a/components/ws-manager-node/debug.Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM golang:1.13-alpine AS debugger -RUN apk add --no-cache git -RUN go get -u github.com/go-delve/delve/cmd/dlv - -FROM alpine:latest -RUN apk add ca-certificates -COPY --from=debugger /go/bin/dlv /usr/bin -COPY ws-manager-node /app/ws-manager-node -ENTRYPOINT [ "/app/ws-manager-node" ] -CMD [ "-v", "help" ] \ No newline at end of file diff --git a/components/ws-manager-node/debug.sh b/components/ws-manager-node/debug.sh deleted file mode 100755 index fdf1cc5e990123..00000000000000 --- a/components/ws-manager-node/debug.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# ws-manager-node ships with delve in the image. This script activates it and opens a port-forward - -kubectl patch daemonset ws-manager-node --patch '{"spec": {"template": {"spec": {"containers": [{"name": "ws-manager-node","command": ["dlv"],"args": ["exec", "--listen=127.0.0.1:32991", "--headless", "--api-version=2", "--", "/app/ws-manager-node", "run", "-v", "--config", "/config/config.json"]}]}}}}' -kubectl get pods --no-headers -o=custom-columns=:metadata.name | grep ws-manager-node | xargs kubectl delete pod - -echo "waiting for ws-manager-node on node which has a workspace running. Make sure you have a workspace running in this namespace." -for i in $(seq 1 10); do - node=$(kubectl get pod -l component=workspace -o json | jq -r '.items[].spec.nodeName' | xargs kubectl describe node | grep ws-manager-node | sed 's/\s\+/ /g' | cut -d ' ' -f 3 | head -n1) - if [ ! -z "$node" ]; then - # wait for the container to come up - sleep 2 - echo "found $node" - - echo "getting source path" - srcpath=$(kubectl exec -it $node -- strings /app/ws-manager-node | grep /tmp/build/ | sed -e 'N;s/^\(.*\).*\n\1.*$/\1\n\1/;D' | head -n 1) - - yq w -i $HOME/.config/dlv/config.yml substitute-path[+].from $srcpath - yq w -i $HOME/.config/dlv/config.yml substitute-path[*].to $PWD - - _term() { - echo "Caught SIGTERM signal!" - ps guax | grep kubectl | grep ws-manager-node-g6kxg | sed 's/\s\+/ /g' | cut -d ' ' -f 2 | xargs kill - } - trap _term SIGTERM - - echo "starting debugging session on $node" - kubectl port-forward $node 32991 - fi - - sleep 5 -done diff --git a/components/ws-manager-node/go.mod b/components/ws-manager-node/go.mod deleted file mode 100644 index 24054b61fbdac5..00000000000000 --- a/components/ws-manager-node/go.mod +++ /dev/null @@ -1,80 +0,0 @@ -module github.com/gitpod-io/gitpod/ws-manager-node - -go 1.13 - -require ( - cloud.google.com/go v0.48.0 // indirect - github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect - github.com/gitpod-io/gitpod/common-go v0.0.0-00010101000000-000000000000 - github.com/gitpod-io/gitpod/ws-manager-node/api v0.0.0-00010101000000-000000000000 - github.com/go-ole/go-ole v1.2.4 // indirect - github.com/golang/protobuf v1.4.2 - github.com/google/go-cmp v0.4.0 - github.com/google/tcpproxy v0.0.0-20200125044825-b6bb9b5b8252 - github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 - github.com/opentracing/opentracing-go v1.1.0 - github.com/prometheus/client_golang v1.1.0 - github.com/shirou/gopsutil v2.20.2+incompatible - github.com/sirupsen/logrus v1.4.2 - github.com/spf13/cobra v0.0.3 - golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 // indirect - golang.org/x/net v0.0.0-20200222125558-5a598a2470a0 // indirect - golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/appengine v1.6.5 // indirect - google.golang.org/genproto v0.0.0-20200218151345-dad8c97a84f5 // indirect - google.golang.org/grpc v1.32.0 - k8s.io/api v0.0.0-20191112020540-7f9008e52f64 - k8s.io/apimachinery v0.0.0 - k8s.io/client-go v0.0.0 -) - -replace github.com/gitpod-io/gitpod/ws-daemon/api => ../ws-daemon-api/go // leeway - -replace github.com/gitpod-io/gitpod/content-service/api => ../content-service-api/go // leeway - -replace github.com/gitpod-io/gitpod/ws-daemon/api => ../ws-daemon-api/go // leeway - -replace github.com/gitpod-io/gitpod/common-go => ../common-go // leeway - -replace github.com/gitpod-io/gitpod/ws-manager-node/api => ../ws-manager-node-api/go // leeway - -replace k8s.io/api => k8s.io/api v0.0.0-20190620084959-7cf5895f2711 // leeway indirect from components/common-go:lib - -replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190620085554-14e95df34f1f // leeway indirect from components/common-go:lib - -replace k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 // leeway indirect from components/common-go:lib - -replace k8s.io/apiserver => k8s.io/apiserver v0.0.0-20190620085212-47dc9a115b18 // leeway indirect from components/common-go:lib - -replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20190620085706-2090e6d8f84c // leeway indirect from components/common-go:lib - -replace k8s.io/client-go => k8s.io/client-go v0.0.0-20190620085101-78d2af792bab // leeway indirect from components/common-go:lib - -replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20190620090043-8301c0bda1f0 // leeway indirect from components/common-go:lib - -replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.0.0-20190620090013-c9a0fc045dc1 // leeway indirect from components/common-go:lib - -replace k8s.io/code-generator => k8s.io/code-generator v0.15.12-beta.0 // leeway indirect from components/common-go:lib - -replace k8s.io/component-base => k8s.io/component-base v0.0.0-20190620085130-185d68e6e6ea // leeway indirect from components/common-go:lib - -replace k8s.io/cri-api => k8s.io/cri-api v0.0.0-20190531030430-6117653b35f1 // leeway indirect from components/common-go:lib - -replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.0.0-20190620090116-299a7b270edc // leeway indirect from components/common-go:lib - -replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20190620085325-f29e2b4a4f84 // leeway indirect from components/common-go:lib - -replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.0.0-20190620085942-b7f18460b210 // leeway indirect from components/common-go:lib - -replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.0.0-20190620085809-589f994ddf7f // leeway indirect from components/common-go:lib - -replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.0.0-20190620085912-4acac5405ec6 // leeway indirect from components/common-go:lib - -replace k8s.io/kubelet => k8s.io/kubelet v0.0.0-20190620085838-f1cb295a73c9 // leeway indirect from components/common-go:lib - -replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.0.0-20190620090156-2138f2c9de18 // leeway indirect from components/common-go:lib - -replace k8s.io/metrics => k8s.io/metrics v0.0.0-20190620085625-3b22d835f165 // leeway indirect from components/common-go:lib - -replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.0.0-20190620085408-1aef9010884e // leeway indirect from components/common-go:lib diff --git a/components/ws-manager-node/go.sum b/components/ws-manager-node/go.sum deleted file mode 100644 index f6f05593ee3ca6..00000000000000 --- a/components/ws-manager-node/go.sum +++ /dev/null @@ -1,587 +0,0 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.48.0 h1:6ZHYIRlohUdU4LrLHbTsReY1eYy/MoZW1FsEyBuMXsk= -cloud.google.com/go v0.48.0/go.mod h1:gGOnoa/XMQYHAscREBlbdHduGchEaP9N0//OXdrPI/M= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v11.1.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.15-0.20200908182639-5b44b70ab3ab h1:9pygWVFqbY9lPxM0peffumuVDyMuIMzNLyO9uFjJuQo= -github.com/Microsoft/go-winio v0.4.15-0.20200908182639-5b44b70ab3ab/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/hcsshim v0.8.7 h1:ptnOoufxGSzauVTsdE+wMYnCWA301PdoN4xg5oRdZpg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.8.10 h1:k5wTrpnVU2/xv8ZuzGkbXVd3js5zJ8RnumPo5RxiIxU= -github.com/Microsoft/hcsshim v0.8.10/go.mod h1:g5uw8EV2mAlzqe94tfNBNdr89fnbD/n3HV0OhsddkmM= -github.com/Microsoft/hcsshim/test v0.0.0-20200923174857-380508768ed2 h1:doGWRzcB0SF/kXu68378Q036h1pVlwQC81sMtETTp7c= -github.com/Microsoft/hcsshim/test v0.0.0-20200923174857-380508768ed2/go.mod h1:30A5igQ91GEmhYJF8TaRP79pMBOYynRsyOByfVV0dU4= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= -github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= -github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3 h1:i8+1fuPLjSgAYXUyBlHNhFwjcfAsP4ufiuH1+PWkyDU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f h1:tSNMc+rJDfmYntojat8lljbt1mgKNpTxUZJsSzJ9Y1s= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 h1:qWj4qVYZ95vLWwqyNJCQg7rDsG5wPdze0UaPolH7DUk= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1 h1:uict5mhHFTzKLUCufdSLym7z/J0CbBJT59lYbP9wtbg= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2 h1:ForxmXkA6tPIvffbrDAcPUIB32QgXkt2XFj+F0UxetA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1 h1:pASeJT3R3YyVn+94qEPk0SnU1OQ20Jd/T+SPKy9xehY= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe h1:PEmIrUvwG9Yyv+0WKZqjXfSFDeZjs/q15g0m08BYS9k= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b h1:qUtCegLdOUVfVJOw+KDg6eJyE1TGvLlkGEd1091kSSQ= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3 h1:esQOJREg8nw8aXj6uCN5dfW5cKUBiEJ/+nni1Q/D/sw= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v1.0.2 h1:2/O3oTZN36q2xRolk0a2WWGgh7/Vf/liElg5hFYLX9U= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v1.0.1 h1:PvuK4E3D5S5q6IqsPDCy928FhP0LUIGcmZ/Yhgp5Djw= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0 h1:XJIw/+VlJ+87J+doOxznsAWIdmWuViOVhkQamW5YV28= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= -github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.5/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e h1:BWhy2j3IXJhjCbC68FptL43tDKIq8FladmaTs3Xs7Z8= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= -github.com/gogo/googleapis v1.4.0 h1:zgVt4UpGxcqVOw97aRGxT4svlcmdK35fynLNctY32zI= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= -github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/tcpproxy v0.0.0-20200125044825-b6bb9b5b8252 h1:tAkooHvRrtO8kFB6YOPTpLQok3Hfv1DNDXdNqgi29Ao= -github.com/google/tcpproxy v0.0.0-20200125044825-b6bb9b5b8252/go.mod h1:DavVbd41y+b7ukKDmlnPR4nGYmkWXR6vHUkjQNiHPBs= -github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4 h1:hU4mGcQI4DaAYW+IbTun+2qEZVFxK0ySjQLTbS0VQKc= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1 h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJGY8Y= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.6.0 h1:+bIAS/Za3q5FTwWym4fTB0vObnfCf3G/NC7K6Jx62mY= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURmKE= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/shirou/gopsutil v2.20.2+incompatible h1:ucK79BhBpgqQxPASyS2cu9HX8cfDVljBN1WWFvbNvgY= -github.com/shirou/gopsutil v2.20.2+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/uber-go/atomic v1.4.0 h1:yOuPqEq4ovnhEjpHmfFwsqBXDYbQeT6Nb0bwD6XnD5o= -github.com/uber-go/atomic v1.4.0/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= -github.com/uber/jaeger-client-go v2.16.1-0.20190821210114-30e625686abe+incompatible h1:JHBDV9mu1P4nS/bZ+tjjnsVYN5qDLwKlZCwUuYPzG48= -github.com/uber/jaeger-client-go v2.16.1-0.20190821210114-30e625686abe+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.0.0+incompatible h1:iMSCV0rmXEogjNWPh2D0xk9YVKvrtGoHJNe9ebLu/pw= -github.com/uber/jaeger-lib v2.0.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243 h1:R43TdZy32XXSXjJn7M/HhALJ9imq6ztLnChfYJpVDnM= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4= -golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343 h1:00ohfJ4K98s3m6BGUoBd8nyfp4Yl0GoIKvw5abItTjI= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0 h1:MsuvTghUPjX762sGLnGsxC3HM0B5r83wEtYcYR8/vRs= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479 h1:LhLiKguPgZL+Tglay4GhVtfF0kb8cvOJ0dHTCBO8YNI= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138 h1:H3uGjxCR/6Ds0Mjgyp7LMK81+LvmbvWWEnJhzk1Pi9E= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc h1:NCy3Ohtk6Iny5V/reW2Ktypo4zIpWBdRJ1uFMjBxdg8= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= -google.golang.org/genproto v0.0.0-20170731182057-09f6ed296fc6/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24 h1:wDju+RU97qa0FZT0QnZDg9Uc2dH0Ql513kFvHocz+WM= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200218151345-dad8c97a84f5 h1:jB9+PJSvu5tBfmJHy/OVapFdjDF3WvpkqRhxqrmzoEU= -google.golang.org/genproto v0.0.0-20200218151345-dad8c97a84f5/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.13.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/inf.v0 v0.9.0 h1:3zYtXIO92bvsdS3ggAdA8Gb4Azj0YU+TVY1uGYNFA8o= -gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -k8s.io/api v0.0.0-20190620084959-7cf5895f2711 h1:BblVYz/wE5WtBsD/Gvu54KyBUTJMflolzc5I2DTvh50= -k8s.io/api v0.0.0-20190620084959-7cf5895f2711/go.mod h1:TBhBqb1AWbBQbW3XRusr7n7E4v2+5ZY8r8sAMnyFC5A= -k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 h1:uV4S5IB5g4Nvi+TBVNf3e9L4wrirlwYJ6w88jUQxTUw= -k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719/go.mod h1:I4A+glKBHiTgiEjQiCCQfCAIcIMFGt291SmsvcrFzJA= -k8s.io/client-go v0.0.0-20190620085101-78d2af792bab h1:E8Fecph0qbNsAbijJJQryKu4Oi9QTp5cVpjTE+nqg6g= -k8s.io/client-go v0.0.0-20190620085101-78d2af792bab/go.mod h1:E95RaSlHr79aHaX0aGSwcPNfygDiPKOVXdmivCIZT0k= -k8s.io/cri-api v0.0.0-20190531030430-6117653b35f1/go.mod h1:K6Ux7uDbzKhacgqW0OJg3rjXk/SR9kprCPfSUDXGB5A= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.1 h1:RVgyDHY/kFKtLqh67NvEWIgkMneNoIrdkN0CxDSQc68= -k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= -k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d h1:1P0iBJsBzxRmR+dIFnM+Iu4aLxnoa7lBqozW/0uHbT8= -k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/components/ws-manager-node/leeway.Dockerfile b/components/ws-manager-node/leeway.Dockerfile deleted file mode 100644 index ef1e04a368c19f..00000000000000 --- a/components/ws-manager-node/leeway.Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2020 TypeFox GmbH. All rights reserved. -# Licensed under the GNU Affero General Public License (AGPL). -# See License-AGPL.txt in the project root for license information. - -FROM golang:1.13-alpine AS debugger -RUN apk add --no-cache git -RUN go get -u github.com/go-delve/delve/cmd/dlv - -FROM alpine:latest -RUN apk add ca-certificates -COPY --from=debugger /go/bin/dlv /usr/bin -COPY components-ws-manager-node--app/ws-manager-node /app/ws-manager-node -ENTRYPOINT [ "/app/ws-manager-node" ] -CMD [ "-v", "help" ] \ No newline at end of file diff --git a/components/ws-manager-node/main.go b/components/ws-manager-node/main.go deleted file mode 100644 index cfbfa0ac2588f8..00000000000000 --- a/components/ws-manager-node/main.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -package main - -import ( - "github.com/gitpod-io/gitpod/ws-manager-node/cmd" - - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" -) - -func main() { - cmd.Execute() -} diff --git a/components/ws-manager-node/pkg/daemon/config.go b/components/ws-manager-node/pkg/daemon/config.go deleted file mode 100644 index ff87ac07974689..00000000000000 --- a/components/ws-manager-node/pkg/daemon/config.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -package daemon - -import ( - "fmt" - - "github.com/gitpod-io/gitpod/common-go/cri" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/resourcegov" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/uidmap" -) - -// Configuration configures a daemon -type Configuration struct { - ContainerRuntime *cri.Config `json:"containerRuntime"` - KubernetesNamespace string `json:"namespace"` - Kubeconfig string `json:"kubeconfig"` - - Uidmapper *uidmap.UidmapperConfig `json:"uidmapper"` - Resources *resourcegov.DispatchListenerConfig `json:"resources"` - Hosts *struct { - NodeHostsFile string `json:"nodeHostsFile"` - FromNodeIPs map[string]string `json:"fromPodNodeIP"` - ServiceProxy struct { - Enabled bool `json:"enabled,omitempty"` - PortMapping []struct { - Selector string `json:"selector"` - Alias string `json:"alias"` - ProxyPort int `json:"proxyPort"` - } `json:"mapping"` - } `json:"serviceProxy,omitempty"` - } `json:"hosts"` - DiskSpaceGuard []struct { - Path string `json:"path"` - MinBytesAvail uint64 `json:"minBytesAvail"` - } `json:"disk"` -} - -// Validate ensures the configuration is valid -func (c Configuration) Validate() error { - if c.Resources != nil { - if c.Resources.CGroupsBasePath == "" { - return fmt.Errorf("cgroupBasePath is mandatory") - } - } - - return nil -} diff --git a/components/ws-manager-node/pkg/daemon/daemon.go b/components/ws-manager-node/pkg/daemon/daemon.go deleted file mode 100644 index b9b6b31eba4964..00000000000000 --- a/components/ws-manager-node/pkg/daemon/daemon.go +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -package daemon - -import ( - "fmt" - "os" - "sync" - "time" - - "github.com/gitpod-io/gitpod/common-go/cri" - "github.com/gitpod-io/gitpod/common-go/log" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/diskguard" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/dispatch" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/hostsgov" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/resourcegov" - "github.com/gitpod-io/gitpod/ws-manager-node/pkg/uidmap" - "github.com/prometheus/client_golang/prometheus" - "golang.org/x/xerrors" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" -) - -// New creates a new daemon for the given configuration -func New(cfg Configuration, reg prometheus.Registerer) (*Daemon, error) { - clientset, err := newClientSet(cfg.Kubeconfig) - if err != nil { - return nil, err - } - containerRuntime, err := cri.FromConfig(cfg.ContainerRuntime) - if err != nil { - return nil, err - } - if containerRuntime == nil { - return nil, xerrors.Errorf("no container runtime configured") - } - go func() { - // TODO(cw): handle this case more gracefully - err := <-containerRuntime.Error() - log.WithError(err).Fatal("container runtime interface error") - }() - - var listener []dispatch.Listener - if cfg.Uidmapper != nil { - log.Info("setting up UID mapper service") - listener = append(listener, &uidmap.Uidmapper{Config: *cfg.Uidmapper}) - } - if cfg.Resources != nil { - listener = append(listener, resourcegov.NewDispatchListener(cfg.Resources, reg)) - } - - disp, err := dispatch.NewDispatch(containerRuntime, clientset, cfg.KubernetesNamespace, listener...) - if err != nil { - return nil, err - } - - d := &Daemon{ - Config: cfg, - Prometheus: reg, - Dispatch: disp, - close: make(chan struct{}), - } - - if len(cfg.DiskSpaceGuard) > 0 { - nodename := os.Getenv("NODENAME") - if nodename == "" { - return nil, xerrors.Errorf("no NODENAME envvar set but needed to set up disk guards") - } - - for _, p := range d.Config.DiskSpaceGuard { - d.DiskGuards = append(d.DiskGuards, &diskguard.Guard{ - Nodename: nodename, - Clientset: clientset, - MinBytesAvail: p.MinBytesAvail, - Path: p.Path, - }) - } - } - if cfg.Hosts != nil { - if cfg.Hosts.ServiceProxy.Enabled { - provider := make(map[string]hostsgov.HostSource) - for _, portcfg := range cfg.Hosts.ServiceProxy.PortMapping { - provider[fmt.Sprintf(":%d", portcfg.ProxyPort)] = &hostsgov.ServiceClusterIPSource{ - ID: portcfg.Alias, - Clientset: clientset, - Namespace: cfg.KubernetesNamespace, - Selector: portcfg.Selector, - Alias: portcfg.Alias, - } - } - - hg, err := hostsgov.NewProxyingGoverner(cfg.KubernetesNamespace, cfg.Hosts.NodeHostsFile, d.close, provider) - if err != nil { - return nil, xerrors.Errorf("cannot create hosts governer: %w", err) - } - d.Hosts = hg - } else { - var provider []hostsgov.HostSource - for src, alias := range cfg.Hosts.FromNodeIPs { - provider = append(provider, &hostsgov.PodHostIPSource{ - ID: alias, - Clientset: clientset, - Namespace: cfg.KubernetesNamespace, - Selector: src, - Alias: alias, - }) - } - hg, err := hostsgov.NewDirectGoverner(cfg.KubernetesNamespace, cfg.Hosts.NodeHostsFile, d.close, provider...) - if err != nil { - return nil, xerrors.Errorf("cannot create hosts governer: %w", err) - } - d.Hosts = hg - } - - } - - return d, nil -} - -func newClientSet(kubeconfig string) (*kubernetes.Clientset, error) { - if kubeconfig != "" { - res, err := clientcmd.BuildConfigFromFlags("", kubeconfig) - if err != nil { - return nil, err - } - return kubernetes.NewForConfig(res) - } - - k8s, err := rest.InClusterConfig() - if err != nil { - return nil, err - } - return kubernetes.NewForConfig(k8s) -} - -// Daemon runs on a node and ensure proper service of workspaces -type Daemon struct { - Config Configuration - Prometheus prometheus.Registerer - Dispatch *dispatch.Dispatch - DiskGuards []*diskguard.Guard - Hosts hostsgov.Governer - - closeOnce sync.Once - close chan struct{} -} - -// Start begins observing workspace pods. -// This function does not return until Close() is called. -func (d *Daemon) Start() { - err := d.Dispatch.Start() - if err != nil { - log.WithError(err).Fatal("cannot start dispatch") - } - log.Info("started workspace dispatch") - - for _, g := range d.DiskGuards { - go g.Start(30 * time.Second) - log.WithField("path", g.Path).Info("started disk guard") - } - if d.Hosts != nil { - go d.Hosts.Start() - } -} - -// Close stops the daemon -func (d *Daemon) Close() error { - d.closeOnce.Do(func() { - d.Dispatch.Close() - close(d.close) - }) - return nil -} diff --git a/components/ws-manager-node/pkg/protocol/generate.sh b/components/ws-manager-node/pkg/protocol/generate.sh deleted file mode 100755 index 9a22df486d1bef..00000000000000 --- a/components/ws-manager-node/pkg/protocol/generate.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Copyright (c) 2020 TypeFox GmbH. All rights reserved. -# Licensed under the GNU Affero General Public License (AGPL). -# See License-AGPL.txt in the project root for license information. - - -go get github.com/golang/protobuf/protoc-gen-go -protoc -I. -I../../../ --go_out=plugins=grpc:. protocol.proto diff --git a/components/ws-manager-node/pkg/protocol/protocol.go b/components/ws-manager-node/pkg/protocol/protocol.go deleted file mode 100644 index aaab103887d8f9..00000000000000 --- a/components/ws-manager-node/pkg/protocol/protocol.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -//go:generate sh generate.sh - -package protocol diff --git a/components/ws-manager-node/pkg/protocol/protocol.pb.go b/components/ws-manager-node/pkg/protocol/protocol.pb.go deleted file mode 100644 index e419ab92cd858f..00000000000000 --- a/components/ws-manager-node/pkg/protocol/protocol.pb.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: protocol.proto - -package protocol - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -func init() { proto.RegisterFile("protocol.proto", fileDescriptor_2bc2336598a3f7e0) } - -var fileDescriptor_2bc2336598a3f7e0 = []byte{ - // 70 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x03, 0x33, 0x84, 0x38, 0x60, 0x7c, 0x23, 0x31, 0x2e, 0x91, 0xf0, - 0xfc, 0xa2, 0xec, 0xe2, 0x82, 0xc4, 0xe4, 0x54, 0xdf, 0xc4, 0xbc, 0xc4, 0xf4, 0xd4, 0x22, 0xbf, - 0xfc, 0x94, 0xd4, 0x24, 0x36, 0xb0, 0x0a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4e, 0xe0, - 0x1f, 0x64, 0x3a, 0x00, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// WorkspaceManagerNodeClient is the client API for WorkspaceManagerNode service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WorkspaceManagerNodeClient interface { -} - -type workspaceManagerNodeClient struct { - cc *grpc.ClientConn -} - -func NewWorkspaceManagerNodeClient(cc *grpc.ClientConn) WorkspaceManagerNodeClient { - return &workspaceManagerNodeClient{cc} -} - -// WorkspaceManagerNodeServer is the server API for WorkspaceManagerNode service. -type WorkspaceManagerNodeServer interface { -} - -// UnimplementedWorkspaceManagerNodeServer can be embedded to have forward compatible implementations. -type UnimplementedWorkspaceManagerNodeServer struct { -} - -func RegisterWorkspaceManagerNodeServer(s *grpc.Server, srv WorkspaceManagerNodeServer) { - s.RegisterService(&_WorkspaceManagerNode_serviceDesc, srv) -} - -var _WorkspaceManagerNode_serviceDesc = grpc.ServiceDesc{ - ServiceName: "protocol.WorkspaceManagerNode", - HandlerType: (*WorkspaceManagerNodeServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "protocol.proto", -} diff --git a/components/ws-manager-node/pkg/protocol/protocol.proto b/components/ws-manager-node/pkg/protocol/protocol.proto deleted file mode 100644 index 8de981909d259f..00000000000000 --- a/components/ws-manager-node/pkg/protocol/protocol.proto +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2020 TypeFox GmbH. All rights reserved. -// Licensed under the GNU Affero General Public License (AGPL). -// See License-AGPL.txt in the project root for license information. - -syntax = "proto3"; - -package protocol; - -service WorkspaceManagerNode { - -} diff --git a/components/ws-manager-node/rebuild-locally.sh b/components/ws-manager-node/rebuild-locally.sh deleted file mode 100755 index 71b6aeaffabdeb..00000000000000 --- a/components/ws-manager-node/rebuild-locally.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -set -Eeuo pipefail - -# ws-manager-node runs as daemonset on each node which renders telepresence useless for debugging. -# This script builds ws-manager-node locally, puts it in a Dockerfile, builds the image, pushes it, -# patches the daemonset and restarts all pods. -# -# This way you can test out your changes with a 30 sec turnaround. -# -# BEWARE: the properly built version of ws-manager-node may behave differently. - -docker ps &> /dev/null || (echo "You need a working Docker daemon. Maybe set DOCKER_HOST?"; exit -1) -gcloud auth list | grep typefox &>/dev/null || (echo "Login using 'gcloud auth login' for the docker push to work"; exit 1) - -leeway build .:docker -Dversion=dev -devImage=eu.gcr.io/gitpod-dev/ws-manager-node:dev - -kubectl patch daemonset ws-manager-node --patch '{"spec": {"template": {"spec": {"containers": [{"name": "ws-manager-node","image": "'$devImage'"}]}}}}' -kubectl delete pod -l component=ws-manager-node diff --git a/components/ws-manager/pkg/manager/annotations.go b/components/ws-manager/pkg/manager/annotations.go index a0080ad7534a6d..6401a9dc882bdf 100644 --- a/components/ws-manager/pkg/manager/annotations.go +++ b/components/ws-manager/pkg/manager/annotations.go @@ -80,7 +80,7 @@ const ( ingressPortsAnnotation = "gitpod/ingressPorts" // withUsernamespaceAnnotation is set on workspaces which are wrapped in a user namespace (or have some form of user namespace support) - // Beware: this annotation is duplicated/copied in ws-manager-node + // Beware: this annotation is duplicated/copied in ws-daemon withUsernamespaceAnnotation = "gitpod/withUsernamespace" ) diff --git a/components/ws-manager/pkg/manager/config.go b/components/ws-manager/pkg/manager/config.go index f6206a516c1c5d..3a40433a01f75a 100644 --- a/components/ws-manager/pkg/manager/config.go +++ b/components/ws-manager/pkg/manager/config.go @@ -69,8 +69,8 @@ type Configuration struct { ReconnectionInterval util.Duration `json:"reconnectionInterval"` // DryRun prevents us from ever stopping a pod. It is considered equivalent to a listener mode DryRun bool `json:"dryRun,omitempty"` - // WorkspaceSync configures our connection to the workspace sync daemons runnin on the nodes - WorkspaceSync WorkspaceSyncConfiguration `json:"wssync"` + // WorkspaceDaemon configures our connection to the workspace sync daemons runnin on the nodes + WorkspaceDaemon WorkspaceDaemonConfiguration `json:"wsdaemon"` // TheiaSupervisorToken is the bearer token required to talk to the sentinel part of the supervisor health endpoint TheiaSupervisorToken string `json:"theiaSupervisorToken"` // RegistryFacadeHost is the host (possibly including port) on which the registry facade resolves @@ -128,8 +128,8 @@ type WorkspacePodTemplateConfiguration struct { ProbePath string `json:"probePath,omitempty"` } -// WorkspaceSyncConfiguration configures our connection to the workspace sync daemons runnin on the nodes -type WorkspaceSyncConfiguration struct { +// WorkspaceDaemonConfiguration configures our connection to the workspace sync daemons runnin on the nodes +type WorkspaceDaemonConfiguration struct { // Port is the port on the node on which the ws-daemon is listening Port int `json:"port"` // TLS is the certificate/key config to connect to ws-daemon diff --git a/components/ws-manager/pkg/manager/create.go b/components/ws-manager/pkg/manager/create.go index 4170c149fc97c5..c1f7062f46bec2 100644 --- a/components/ws-manager/pkg/manager/create.go +++ b/components/ws-manager/pkg/manager/create.go @@ -316,7 +316,7 @@ func (m *Manager) createDefiniteWorkspacePod(startContext *startWorkspaceContext Operator: corev1.NodeSelectorOpExists, }, { - Key: wssyncLabel, + Key: wsdaemonLabel, Operator: corev1.NodeSelectorOpExists, }, }, diff --git a/components/ws-manager/pkg/manager/integration_test.go b/components/ws-manager/pkg/manager/integration_test.go index 74a83cbf4dce22..e0823b1709b645 100644 --- a/components/ws-manager/pkg/manager/integration_test.go +++ b/components/ws-manager/pkg/manager/integration_test.go @@ -21,8 +21,8 @@ import ( csapi "github.com/gitpod-io/gitpod/content-service/api" "github.com/gitpod-io/gitpod/content-service/pkg/layer" "github.com/gitpod-io/gitpod/content-service/pkg/storage" - wssync "github.com/gitpod-io/gitpod/ws-daemon/api" - wssync_mock "github.com/gitpod-io/gitpod/ws-daemon/api/mock" + wsdaemon "github.com/gitpod-io/gitpod/ws-daemon/api" + wsdaemon_mock "github.com/gitpod-io/gitpod/ws-daemon/api/mock" "github.com/gitpod-io/gitpod/ws-manager/api" "github.com/gitpod-io/gitpod/ws-manager/pkg/manager/internal/grpcpool" "github.com/gitpod-io/gitpod/ws-manager/pkg/test" @@ -44,7 +44,7 @@ import ( var integrationFlag = flag.String("integration-test", "disabled", "configures integration tests. Valid values are disabled, local or a path to a kubeconfig file") func init() { - wssyncRetryInterval = 0 + wsdaemonRetryInterval = 0 } func forIntegrationTestGetManager(t *testing.T) *Manager { @@ -212,10 +212,10 @@ func ensureIntegrationTestTheiaLabelOnNodes(client kubernetes.Interface, namespa return } -func connectToMockWssync(ctx context.Context, wssyncSrv wssync.WorkspaceContentServiceServer) (*grpc.ClientConn, error) { +func connectToMockWsdaemon(ctx context.Context, wsdaemonSrv wsdaemon.WorkspaceContentServiceServer) (*grpc.ClientConn, error) { lis := bufconn.Listen(1024 * 1024) srv := grpc.NewServer() - wssync.RegisterWorkspaceContentServiceServer(srv, wssyncSrv) + wsdaemon.RegisterWorkspaceContentServiceServer(srv, wsdaemonSrv) go func() { err := srv.Serve(lis) if err != nil { @@ -238,19 +238,19 @@ type IntegrationTestPodTemplates struct { } type SingleWorkspaceIntegrationTest struct { - MockWssync func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) - WssyncConnectionContext func() context.Context - StartRequestModifier func(t *testing.T, req *api.StartWorkspaceRequest) - PostStart func(t *testing.T, monitor *Monitor, instanceID string, updates *StatusRecoder) - PodTemplates IntegrationTestPodTemplates + MockWsdaemon func(t *testing.T, s *wsdaemon_mock.MockWorkspaceContentServiceServer) + WsdaemonConnectionContext func() context.Context + StartRequestModifier func(t *testing.T, req *api.StartWorkspaceRequest) + PostStart func(t *testing.T, monitor *Monitor, instanceID string, updates *StatusRecoder) + PodTemplates IntegrationTestPodTemplates } func (test *SingleWorkspaceIntegrationTest) FillDefaults() *SingleWorkspaceIntegrationTest { - if test.MockWssync == nil { - test.MockWssync = func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) {} + if test.MockWsdaemon == nil { + test.MockWsdaemon = func(t *testing.T, s *wsdaemon_mock.MockWorkspaceContentServiceServer) {} } - if test.WssyncConnectionContext == nil { - test.WssyncConnectionContext = context.Background + if test.WsdaemonConnectionContext == nil { + test.WsdaemonConnectionContext = context.Background } if test.StartRequestModifier == nil { test.StartRequestModifier = func(t *testing.T, req *api.StartWorkspaceRequest) {} @@ -300,11 +300,11 @@ func (test *SingleWorkspaceIntegrationTest) Run(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - manager.wssyncPool = grpcpool.New(func(host string) (*grpc.ClientConn, error) { - s := wssync_mock.NewMockWorkspaceContentServiceServer(ctrl) - test.MockWssync(t, s) - ctx := test.WssyncConnectionContext() - return connectToMockWssync(ctx, s) + manager.wsdaemonPool = grpcpool.New(func(host string) (*grpc.ClientConn, error) { + s := wsdaemon_mock.NewMockWorkspaceContentServiceServer(ctrl) + test.MockWsdaemon(t, s) + ctx := test.WsdaemonConnectionContext() + return connectToMockWsdaemon(ctx, s) }) monitor, err := manager.CreateMonitor() diff --git a/components/ws-manager/pkg/manager/manager.go b/components/ws-manager/pkg/manager/manager.go index 54b5ab272b931a..1251689c04c1d5 100644 --- a/components/ws-manager/pkg/manager/manager.go +++ b/components/ws-manager/pkg/manager/manager.go @@ -23,7 +23,7 @@ import ( "github.com/gitpod-io/gitpod/common-go/tracing" "github.com/gitpod-io/gitpod/content-service/pkg/layer" regapi "github.com/gitpod-io/gitpod/registry-facade/api" - wssync "github.com/gitpod-io/gitpod/ws-daemon/api" + wsdaemon "github.com/gitpod-io/gitpod/ws-daemon/api" "github.com/gitpod-io/gitpod/ws-manager/api" "github.com/gitpod-io/gitpod/ws-manager/pkg/manager/internal/grpcpool" @@ -56,7 +56,7 @@ type Manager struct { ingressPortAllocator IngressPortAllocator - wssyncPool *grpcpool.Pool + wsdaemonPool *grpcpool.Pool subscribers map[string]chan *api.SubscribeResponse subscriberLock sync.RWMutex @@ -92,8 +92,8 @@ const ( // theiaVersionLabelFmt is the format to produce the label a node has if Theia is available on it in a particular version theiaVersionLabelFmt = "gitpod.io/theia.%s" - // wssyncLabel is the label a node has if ws-daemon is running on it - wssyncLabel = "gitpod.io/ws-daemon" + // wsdaemonLabel is the label a node has if ws-daemon is running on it + wsdaemonLabel = "gitpod.io/ws-daemon" ) const ( @@ -120,7 +120,7 @@ func New(config Configuration, clientset kubernetes.Interface, cp *layer.Provide Content: cp, activity: make(map[string]time.Time), subscribers: make(map[string]chan *api.SubscribeResponse), - wssyncPool: grpcpool.New(wssyncConnfactory), + wsdaemonPool: grpcpool.New(wssyncConnfactory), ingressPortAllocator: ingressPortAllocator, } m.metrics = newMetrics(m) @@ -137,7 +137,7 @@ func Register(grpcServer *grpc.Server, manager *Manager) { // Close disposes some of the resources held by the manager. After calling close, the manager is not guaranteed // to function properly anymore. func (m *Manager) Close() { - m.wssyncPool.Close() + m.wsdaemonPool.Close() m.ingressPortAllocator.Stop() } @@ -1103,22 +1103,22 @@ func isKubernetesObjNotFoundError(err error) bool { return false } -// connectToWorkspaceSync establishes a connection to the ws-daemon daemon running on the node of the pod/workspace. -func (m *Manager) connectToWorkspaceSync(ctx context.Context, wso workspaceObjects) (wssync.WorkspaceContentServiceClient, error) { - span, ctx := tracing.FromContext(ctx, "connectToWorkspaceSync") +// connectToWorkspaceDaemon establishes a connection to the ws-daemon daemon running on the node of the pod/workspace. +func (m *Manager) connectToWorkspaceDaemon(ctx context.Context, wso workspaceObjects) (wsdaemon.WorkspaceContentServiceClient, error) { + span, ctx := tracing.FromContext(ctx, "connectToWorkspaceDaemon") tracing.ApplyOWI(span, wso.GetOWI()) defer tracing.FinishSpan(span, nil) host := wso.HostIP() if host == "" { - return nil, xerrors.Errorf("pod has no hostIP") + return nil, xerrors.Errorf("cannot connect to ws-daemon: pod has no hostIP") } - conn, err := m.wssyncPool.Get(host) + conn, err := m.wsdaemonPool.Get(host) if err != nil { - return nil, xerrors.Errorf("cannot connect to ws-daemon: %w", err) + return nil, err } - return wssync.NewWorkspaceContentServiceClient(conn), nil + return wsdaemon.NewWorkspaceContentServiceClient(conn), nil } // newWssyncConnectionFactory creates a new wssync connection factory based on the wsmanager configuration @@ -1132,7 +1132,7 @@ func newWssyncConnectionFactory(managerConfig Configuration) (grpcpool.Factory, // see https://github.com/grpc/grpc-go/blob/506b7730668b5a13465224b0d8133f974a3f843d/dialoptions.go#L522-L524 var retryPolicy = `{ "methodConfig": [{ - "name": [{"service": "wssync.WorkspaceContentService"}], + "name": [{"service": "wsdaemon.WorkspaceContentService"}], "waitForReady": true, "retryPolicy": { @@ -1145,7 +1145,7 @@ func newWssyncConnectionFactory(managerConfig Configuration) (grpcpool.Factory, }] }` - cfg := managerConfig.WorkspaceSync + cfg := managerConfig.WorkspaceDaemon opts := []grpc.DialOption{ grpc.WithUnaryInterceptor(grpc_opentracing.UnaryClientInterceptor(grpc_opentracing.WithTracer(opentracing.GlobalTracer()))), grpc.WithStreamInterceptor(grpc_opentracing.StreamClientInterceptor(grpc_opentracing.WithTracer(opentracing.GlobalTracer()))), @@ -1181,7 +1181,7 @@ func newWssyncConnectionFactory(managerConfig Configuration) (grpcpool.Factory, } creds := credentials.NewTLS(&tls.Config{ - ServerName: "wssync", + ServerName: "wsdaemon", Certificates: []tls.Certificate{certificate}, RootCAs: certPool, }) @@ -1203,10 +1203,10 @@ func newWssyncConnectionFactory(managerConfig Configuration) (grpcpool.Factory, conn, err := grpc.DialContext(conctx, addr, opts...) if err != nil { - log.WithError(err).WithField("host", host).Error("cannot connect to ws-daemon") + log.WithError(err).WithField("addr", addr).Error("cannot connect to ws-daemon") // we deliberately swallow the error here as users might see this one. - return nil, xerrors.Errorf("cannot connect to workspace sync") + return nil, xerrors.Errorf("cannot connect to workspace daemon") } return conn, nil }, nil diff --git a/components/ws-manager/pkg/manager/manager_ee.go b/components/ws-manager/pkg/manager/manager_ee.go index 5770cefee69843..1961f738dbdc6c 100644 --- a/components/ws-manager/pkg/manager/manager_ee.go +++ b/components/ws-manager/pkg/manager/manager_ee.go @@ -16,7 +16,7 @@ import ( wsk8s "github.com/gitpod-io/gitpod/common-go/kubernetes" "github.com/gitpod-io/gitpod/common-go/log" "github.com/gitpod-io/gitpod/common-go/tracing" - wssync "github.com/gitpod-io/gitpod/ws-daemon/api" + wsdaemon "github.com/gitpod-io/gitpod/ws-daemon/api" "github.com/gitpod-io/gitpod/ws-manager/api" "google.golang.org/grpc/codes" @@ -53,12 +53,12 @@ func (m *Manager) TakeSnapshot(ctx context.Context, req *api.TakeSnapshotRequest return nil, status.Errorf(codes.FailedPrecondition, "can only take snapshots of running workspaces") } - sync, err := m.connectToWorkspaceSync(ctx, workspaceObjects{Pod: pod}) + sync, err := m.connectToWorkspaceDaemon(ctx, workspaceObjects{Pod: pod}) if err != nil { - return nil, status.Errorf(codes.Unavailable, "cannot connect to workspace sync: %q", err) + return nil, status.Errorf(codes.Unavailable, "cannot connect to workspace daemon: %q", err) } - r, err := sync.TakeSnapshot(ctx, &wssync.TakeSnapshotRequest{Id: req.Id}) + r, err := sync.TakeSnapshot(ctx, &wsdaemon.TakeSnapshotRequest{Id: req.Id}) if err != nil { // err is already a grpc error - no need to faff with that return nil, err diff --git a/components/ws-manager/pkg/manager/monitor.go b/components/ws-manager/pkg/manager/monitor.go index 3a4e1c97a71e1c..06f0b18eb74093 100644 --- a/components/ws-manager/pkg/manager/monitor.go +++ b/components/ws-manager/pkg/manager/monitor.go @@ -52,16 +52,16 @@ const ( ) var ( - // wssyncMaxAttempts is the number of times we'll attempt to work with ws-daemon when a former attempt returned unavailable. - // We rety for two minutes every 5 seconds (see wssyncRetryInterval). + // wsdaemonMaxAttempts is the number of times we'll attempt to work with ws-daemon when a former attempt returned unavailable. + // We rety for two minutes every 5 seconds (see wwsdaemonRetryInterval). // // Note: this is a variable rather than a constant so that tests can modify this value. - wssyncMaxAttempts = 120 / 5 + wsdaemonMaxAttempts = 120 / 5 - // wssyncRetryInterval is the time in between attempts to work with ws-daemon. + // 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. - wssyncRetryInterval = 5 * time.Second + wsdaemonRetryInterval = 5 * time.Second ) // Monitor listens for kubernetes events and periodically checks if everything is still ok. @@ -592,7 +592,7 @@ func (m *Monitor) actOnHeadlessDone(pod *corev1.Pod, failed bool) (err error) { tpe = api.WorkspaceType_PREBUILD } if tpe == api.WorkspaceType_PREBUILD { - snc, err := m.manager.connectToWorkspaceSync(ctx, wso) + snc, err := m.manager.connectToWorkspaceDaemon(ctx, wso) if err != nil { tracing.LogError(span, err) return handleFailure(fmt.Sprintf("cannot take snapshot: %v", err)) @@ -906,9 +906,9 @@ func (m *Monitor) waitForWorkspaceReady(ctx context.Context, pod *corev1.Pod) (e } // Theia is available - let's wait until the workspace is initialized - snc, err := m.manager.connectToWorkspaceSync(ctx, workspaceObjects{Pod: pod}) + snc, err := m.manager.connectToWorkspaceDaemon(ctx, workspaceObjects{Pod: pod}) if err != nil { - return xerrors.Errorf("cannot connect to workspace sync: %w", err) + return xerrors.Errorf("cannot connect to workspace daemon: %w", err) } // Note: we don't have to use the same cancelable context that we used for the original Init call. @@ -1077,9 +1077,9 @@ func (m *Monitor) initializeWorkspaceContent(ctx context.Context, pod *corev1.Po } // connect to the appropriate ws-daemon - snc, err = m.manager.connectToWorkspaceSync(ctx, workspaceObjects{Pod: pod}) + snc, err = m.manager.connectToWorkspaceDaemon(ctx, workspaceObjects{Pod: pod}) if err != nil { - return xerrors.Errorf("cannot connect to ws-daemon: %w", err) + return err } // mark that we're already initialising this workspace @@ -1127,13 +1127,13 @@ func retryIfUnavailable(ctx context.Context, op func(ctx context.Context) error) span, ctx := tracing.FromContext(ctx, "retryIfUnavailable") defer tracing.FinishSpan(span, &err) - for i := 0; i < wssyncMaxAttempts; i++ { + for i := 0; i < wsdaemonMaxAttempts; i++ { err := op(ctx) span.LogKV("attempt", i) if st, ok := grpc_status.FromError(err); ok && st.Code() == codes.Unavailable { // service is unavailable - try again after some time - time.Sleep(wssyncRetryInterval) + time.Sleep(wsdaemonRetryInterval) } else if err != nil { // some other error happened, we'done done here return err @@ -1202,7 +1202,7 @@ func (m *Monitor) finalizeWorkspaceContent(ctx context.Context, wso *workspaceOb } // we're not yet finalizing - start the process - snc, err := m.manager.connectToWorkspaceSync(ctx, *wso) + snc, err := m.manager.connectToWorkspaceDaemon(ctx, *wso) if err != nil { m.finalizerMapLock.Unlock() return true, nil, err @@ -1235,7 +1235,7 @@ func (m *Monitor) finalizeWorkspaceContent(ctx context.Context, wso *workspaceOb backupError error gitStatus *csapi.GitStatus ) - for i := 0; i < wssyncMaxAttempts; i++ { + for i := 0; i < wsdaemonMaxAttempts; i++ { tracing.LogKV(span, "attempt", strconv.Itoa(i)) didSometing, gs, err := doFinalize() if !didSometing { @@ -1261,7 +1261,7 @@ func (m *Monitor) finalizeWorkspaceContent(ctx context.Context, wso *workspaceOb st.Code() == codes.Unavailable || st.Code() == codes.Canceled { // service is currently unavailable or we did not finish in time - let's wait some time and try again - time.Sleep(wssyncRetryInterval) + time.Sleep(wsdaemonRetryInterval) continue } diff --git a/components/ws-manager/pkg/manager/monitor_integration_test.go b/components/ws-manager/pkg/manager/monitor_integration_test.go index 96aa3bd933ffb5..b784864a60a1e2 100644 --- a/components/ws-manager/pkg/manager/monitor_integration_test.go +++ b/components/ws-manager/pkg/manager/monitor_integration_test.go @@ -54,7 +54,7 @@ func TestIntegrationWorkspaceDisposal(t *testing.T) { StartRequestModifier: func(t *testing.T, r *api.StartWorkspaceRequest) { r.Spec.WorkspaceImage = "does-not-exist" }, - MockWssync: func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) { + MockWsdaemon: func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) { s.EXPECT().InitWorkspace(gomock.Any(), gomock.Any()).DoAndReturn(func(a, b interface{}) { time.Sleep(1 * time.Second) }).Return(&wssync.InitWorkspaceResponse{}, nil) s.EXPECT().WaitForInit(gomock.Any(), gomock.Any()).Return(&wssync.WaitForInitResponse{}, nil).AnyTimes() s.EXPECT().DisposeWorkspace(gomock.Any(), matches(func(a interface{}) bool { @@ -87,7 +87,7 @@ func TestIntegrationWorkspaceDisposal(t *testing.T) { StartRequestModifier: func(t *testing.T, r *api.StartWorkspaceRequest) { r.Spec.WorkspaceImage = "gitpod/workspace-full" }, - MockWssync: func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) { + MockWsdaemon: func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) { s.EXPECT().InitWorkspace(gomock.Any(), gomock.Any()).DoAndReturn(func(a, b interface{}) { time.Sleep(1 * time.Second) }).Return(nil, status.Error(codes.Internal, "fail intentionally")) s.EXPECT().WaitForInit(gomock.Any(), gomock.Any()).Return(&wssync.WaitForInitResponse{}, nil).AnyTimes() s.EXPECT().DisposeWorkspace(gomock.Any(), matches(func(a interface{}) bool { @@ -116,7 +116,7 @@ func TestIntegrationWorkspaceDisposal(t *testing.T) { StartRequestModifier: func(t *testing.T, s *api.StartWorkspaceRequest) { s.Spec.WorkspaceImage = "csweichel/noop:latest" }, - MockWssync: func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) { + MockWsdaemon: func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) { initCall := s.EXPECT().InitWorkspace(gomock.Any(), gomock.Any()).Return(&wssync.InitWorkspaceResponse{}, nil) s.EXPECT().WaitForInit(gomock.Any(), gomock.Any()).Return(&wssync.WaitForInitResponse{}, nil).MinTimes(1).After(initCall) s.EXPECT().DisposeWorkspace(gomock.Any(), matches(func(a interface{}) bool { @@ -162,12 +162,12 @@ func TestIntegrationWorkspaceDisposal(t *testing.T) { StartRequestModifier: func(t *testing.T, s *api.StartWorkspaceRequest) { s.Spec.WorkspaceImage = "csweichel/noop:latest" }, - MockWssync: func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) { + MockWsdaemon: func(t *testing.T, s *wssync_mock.MockWorkspaceContentServiceServer) { initCall := s.EXPECT().InitWorkspace(gomock.Any(), gomock.Any()).Return(&wssync.InitWorkspaceResponse{}, nil) s.EXPECT().WaitForInit(gomock.Any(), gomock.Any()).Return(&wssync.WaitForInitResponse{}, nil).MinTimes(1).After(initCall) s.EXPECT().DisposeWorkspace(gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, req interface{}) (resp *wssync.DisposeWorkspaceRequest, err error) { return nil, context.DeadlineExceeded - }).MinTimes(wssyncMaxAttempts) + }).MinTimes(wsdaemonMaxAttempts) }, PostStart: func(t *testing.T, monitor *Monitor, id string, updates *StatusRecoder) { ok := updates.WaitFor(func(s *api.WorkspaceStatus) bool { diff --git a/gitpod-ws.theia-workspace b/gitpod-ws.theia-workspace index 6806fb212844fd..87a7d2fbb01b9a 100644 --- a/gitpod-ws.theia-workspace +++ b/gitpod-ws.theia-workspace @@ -11,7 +11,6 @@ { "path": "components/registry-facade" }, { "path": "components/service-waiter" }, { "path": "components/supervisor" }, - { "path": "components/ws-manager-node" }, { "path": "components/ws-manager" }, { "path": "components/ws-daemon" }, { "path": "components/ws-proxy" }, diff --git a/install/aws-full-terraform/modules/storage/templates/values.tpl b/install/aws-full-terraform/modules/storage/templates/values.tpl index 23547b8b615c4f..a3aa2b0d301378 100644 --- a/install/aws-full-terraform/modules/storage/templates/values.tpl +++ b/install/aws-full-terraform/modules/storage/templates/values.tpl @@ -1,7 +1,7 @@ components: - wsSync: + wsDaemon: hostWorkspaceArea: /var/gitpod/workspaces - name: ws-sync + name: "ws-daemon" remoteStorage: kind: minio minio: diff --git a/install/aws-terraform/modules/storage/templates/values.tpl b/install/aws-terraform/modules/storage/templates/values.tpl index 23547b8b615c4f..3e11ec20054d2c 100644 --- a/install/aws-terraform/modules/storage/templates/values.tpl +++ b/install/aws-terraform/modules/storage/templates/values.tpl @@ -1,7 +1,7 @@ components: - wsSync: + wsDaemon: hostWorkspaceArea: /var/gitpod/workspaces - name: ws-sync + name: ws-daemon remoteStorage: kind: minio minio: diff --git a/install/helm/templates/gcp/ws-sync-key.yaml b/install/helm/templates/gcp/ws-sync-key.yaml index bcd8280ce0c2d0..01c8bf994fc112 100644 --- a/install/helm/templates/gcp/ws-sync-key.yaml +++ b/install/helm/templates/gcp/ws-sync-key.yaml @@ -6,7 +6,7 @@ apiVersion: v1 kind: Secret metadata: - name: gcp-ws-sync-key + name: gcp-ws-daemon-key labels: app: {{ template "gitpod.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" diff --git a/install/helm/values/gcp/buckets.yaml b/install/helm/values/gcp/buckets.yaml index 9fcbd236792696..17f56a3dd1e955 100644 --- a/install/helm/values/gcp/buckets.yaml +++ b/install/helm/values/gcp/buckets.yaml @@ -6,11 +6,11 @@ gitpod: components: - wsSync: + wsDaemon: volumes: - name: gcloud-creds secret: - secretName: gcp-ws-sync-key + secretName: gcp-ws-daemon-key - name: gcloud-tmp hostPath: path: /mnt/disks/ssd0/sync-tmp