loft-sh / devpod-provider-gcloud

DevPod on Google Cloud
Mozilla Public License 2.0
5 stars 4 forks source link

Building an image that takes more than half an hour will result in a timeout. #13

Open execbbbr opened 10 months ago

execbbbr commented 10 months ago

What happened?
Im using DevPod Mac ARM, version v0.4.2.

I tried to build an R devcontainer using Google Cloud. Because there are many required packages, the building process takes at least 80 minutes. However, it always stops at 30 minutes each time.

Here is the log:

... other succesed log

[19:06:35] info loft-sh/devpod#16 1369.6 ✔ Installed lumi 2.54.0  (73ms)
[19:06:35] info loft-sh/devpod#16 1369.6 ℹ Building wateRmelon 2.8.0
[19:06:54] info rpc error: code = Unavailable desc = error reading from server: EOF
[19:06:54] info failed to receive status
[19:06:54] info github.com/moby/buildkit/client.(*Client).solve.func4
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/moby/buildkit/client/solve.go:316
[19:06:54] info golang.org/x/sync/errgroup.(*Group).Go.func1
[19:06:54] info /home/runner/work/devpod/devpod/vendor/golang.org/x/sync/errgroup/errgroup.go:75
[19:06:54] info runtime.goexit
[19:06:54] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598
[19:06:54] info build
[19:06:54] info github.com/loft-sh/devpod/pkg/driver/docker.(*dockerDriver).internalBuild
[19:06:54] info /home/runner/work/devpod/devpod/pkg/driver/docker/build.go:238
[19:06:54] info github.com/loft-sh/devpod/pkg/driver/docker.(*dockerDriver).BuildDevContainer
[19:06:54] info /home/runner/work/devpod/devpod/pkg/driver/docker/build.go:80
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).buildImage
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/build.go:306
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).extendImage
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/build.go:121
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).build
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/build.go:95
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).runSingleContainer
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/single.go:48
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).Up
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/run.go:121
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).devPodUp
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:326
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).up
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:159
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:93
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:52
[19:06:54] info github.com/spf13/cobra.(*Command).execute
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:916
[19:06:54] info github.com/spf13/cobra.(*Command).ExecuteC
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1044
[19:06:54] info github.com/spf13/cobra.(*Command).Execute
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:968
[19:06:54] info github.com/loft-sh/devpod/cmd.Execute
[19:06:54] info /home/runner/work/devpod/devpod/cmd/root.go:90
[19:06:54] info main.main
[19:06:54] info /home/runner/work/devpod/devpod/main.go:8
[19:06:54] info runtime.main
[19:06:54] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
[19:06:54] info runtime.goexit
[19:06:54] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598
[19:06:54] info internal build
[19:06:54] info github.com/loft-sh/devpod/pkg/driver/docker.(*dockerDriver).BuildDevContainer
[19:06:54] info /home/runner/work/devpod/devpod/pkg/driver/docker/build.go:82
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).buildImage
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/build.go:306
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).extendImage
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/build.go:121
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).build
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/build.go:95
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).runSingleContainer
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/single.go:48
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).Up
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/run.go:121
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).devPodUp
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:326
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).up
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:159
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:93
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:52
[19:06:54] info github.com/spf13/cobra.(*Command).execute
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:916
[19:06:54] info github.com/spf13/cobra.(*Command).ExecuteC
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1044
[19:06:54] info github.com/spf13/cobra.(*Command).Execute
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:968
[19:06:54] info github.com/loft-sh/devpod/cmd.Execute
[19:06:54] info /home/runner/work/devpod/devpod/cmd/root.go:90
[19:06:54] info main.main
[19:06:54] info /home/runner/work/devpod/devpod/main.go:8
[19:06:54] info runtime.main
[19:06:54] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
[19:06:54] info runtime.goexit
[19:06:54] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598
[19:06:54] info build image
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).runSingleContainer
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/single.go:56
[19:06:54] info github.com/loft-sh/devpod/pkg/devcontainer.(*runner).Up
[19:06:54] info /home/runner/work/devpod/devpod/pkg/devcontainer/run.go:121
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).devPodUp
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:326
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).up
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:159
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:93
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:52
[19:06:54] info github.com/spf13/cobra.(*Command).execute
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:916
[19:06:54] info github.com/spf13/cobra.(*Command).ExecuteC
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1044
[19:06:54] info github.com/spf13/cobra.(*Command).Execute
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:968
[19:06:54] info github.com/loft-sh/devpod/cmd.Execute
[19:06:54] info /home/runner/work/devpod/devpod/cmd/root.go:90
[19:06:54] info main.main
[19:06:54] info /home/runner/work/devpod/devpod/main.go:8
[19:06:54] info runtime.main
[19:06:54] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
[19:06:54] info runtime.goexit
[19:06:54] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598
[19:06:54] info devcontainer up
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:95
[19:06:54] info github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1
[19:06:54] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:52
[19:06:54] info github.com/spf13/cobra.(*Command).execute
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:916
[19:06:54] info github.com/spf13/cobra.(*Command).ExecuteC
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1044
[19:06:54] info github.com/spf13/cobra.(*Command).Execute
[19:06:54] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:968
[19:06:54] info github.com/loft-sh/devpod/cmd.Execute
[19:06:54] info /home/runner/work/devpod/devpod/cmd/root.go:90
[19:06:54] info main.main
[19:06:54] debug done inject
[19:06:54] info /home/runner/work/devpod/devpod/main.go:8
[19:06:54] debug done injecting
[19:06:54] info runtime.main
[19:06:54] debug Done InjectAgentAndExecute
[19:06:54] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
[19:06:54] info runtime.goexit
[19:06:54] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598
[19:06:54] info error parsing workspace info: rerun as root: exit status 1
[19:06:54] debug Connection to SSH Server closed
[19:06:54] debug Done creating devcontainer
[19:06:54] debug Done executing ssh server helper command
[19:06:54] debug done exec
[19:06:55] fatal Process exited with status 1
run agent command
github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel.ExecuteCommand.func2
        /Users/runner/work/devpod/devpod/pkg/devcontainer/sshtunnel/sshtunnel.go:111
runtime.goexit
        /Users/runner/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_arm64.s:1172

What did you expect to happen instead?
Continuous connection without disconnection, relevant parameters of SSH session can be configured.

How can we reproduce the bug? (as minimally and precisely as possible)

Just build my devcontainer.json

My devcontainer.json:

{
    "image": "ghcr.io/rocker-org/devcontainer/r-ver:4.3",
    "features": {
        "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
            "packages": "make,gcc,g++,liblzma-dev,xz-utils,libbz2-dev,openssl,libcurl4-openssl-dev"
        },
        "ghcr.io/rocker-org/devcontainer-features/r-packages:1": {
            "additionalRepositories": "rhub = 'https://r-hub.r-universe.dev', jeroen = 'https://jeroen.r-universe.dev'",
            "packages": "IRkernel,dplyr,tidyr,readr,lubridate,BiocManager,biomaRt,Seurat,patchwork,scRepertoire,ChAMP,minfi,methylationArrayAnalysis,wateRmelon,abind,affxparser,affy,affycoretools,affyio,affyPLM,annotate,GenomicFeatures,AnnotationDbi,AnnotationFilter,AnnotationForge,ape,aplot,arrow,askpass,assertthat,AUCell,backports,base,base64enc,beachmat,BH,Biobase,BiocFileCache,BiocGenerics,BiocIO,BiocNeighbors,BiocParallel,BiocSingular,BiocVersion,biovizBase,bit,bit64,bitops,blob,boot,brew,brio,broom,broom.helpers,BSgenome,bslib,bsseq,cachem,callr,Category,caTools,cellranger,checkmate,class,cli,clipr,CLL,colorspace,compiler,conflicted,cowplot,cpp11,crosstalk,ctv"
        },
        "ghcr.io/devcontainers/features/python:1": {
            "installJupyterlab": true
        },
        "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
        // "ghcr.io/devcontainers/features/node:1": {}
    },
    "remoteEnv": {
        "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
    },
    "postCreateCommand": "sudo apt-get update && R -e \"IRkernel::installspec()\"",
    "customizations": {
        "vscode": {
            "extensions": [
                "ms-azuretools.vscode-docker",
                "EditorConfig.EditorConfig",
                "ms-vscode.makefile-tools",
                "redhat.vscode-yaml",
                "ms-python.python",
                "ms-toolsai.jupyter"
            ]
        }
    }
}

Local Environment:

DevPod Provider:

Anything else we need to know?

pascalbreuninger commented 10 months ago

@execbbbr thanks for opening this issue! Do you know if this only happens in the google cloud provider? I.e. have you tried to build this image with the docker provider already?

execbbbr commented 10 months ago

@pascalbreuninger thank you for reply, I have only tried in Google cloud. I.can try ssh provide later

execbbbr commented 10 months ago

hi @pascalbreuninger , I successfully built it on an SSH provider machine. Could it be that there is a timeout setting for the default connection configuration of Google EC2?

pascalbreuninger commented 10 months ago

great, thanks for trying. We can focus on the gcp provider then, maybe we'll need to configure it differently I took the liberty to transfer it to the provider repo