42atomys / stud42

Stud42 official repository since major 3 update (https://s42.app)
https://s42.app
MIT License
859 stars 27 forks source link

fix: VSCode Dev Container env. not working on Apple Silicon (M1) #298

Closed sungyongcho closed 1 year ago

sungyongcho commented 1 year ago

Describe the bug

When trying to initialize Dev Containers on Apple Silicon (M1) machine, the build cannot be proceed.

To Reproduce

  1. Open vscode
  2. Cmd + Shift + P to launch prompt, and find an option Dev Containers: Open Folders in Container...
  3. The build begins, and cannot be proceed

Expected behavior

The dev. environment should pull up

Relevant log output

The log created from Dev Containers-

#0 9.981 2022-12-04 23:41:31 (287 MB/s) - written to stdout [3195/3195]
#0 9.981 
#0 10.00 deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com bullseye main
#0 10.07 Hit:1 http://deb.debian.org/debian bullseye InRelease
#0 10.07 Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease
[2022-12-04T23:41:33.302Z] #0 10.07 Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
#0 10.09 Get:4 https://apt.releases.hashicorp.com bullseye InRelease [12.0 kB]
#0 10.09 Get:5 https://baltocdn.com/helm/stable/debian all InRelease [7652 B]
#0 10.10 Hit:6 https://dl.yarnpkg.com/debian stable InRelease
#0 10.37 Get:8 https://apt.releases.hashicorp.com bullseye/main arm64 Packages [22.8 kB]
#0 10.41 Get:9 https://baltocdn.com/helm/stable/debian all/main arm64 Packages [3072 B]
#0 10.84 Get:7 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [9383 B]
#0 10.98 Get:10 https://packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages [60.0 kB]
#0 11.01 Fetched 115 kB in 1s (117 kB/s)
#0 11.01 Reading package lists...
#0 11.30 Reading package lists...
[2022-12-04T23:41:33.302Z] 
#0 11.58 Building dependency tree...
#0 11.65 Reading state information...
#0 11.69 E: Unable to locate package terraform
------
[2022-12-04T23:41:33.302Z] failed to solve: executor failed running [/bin/sh -c apt-get update && export DEBIAN_FRONTEND=noninteractive   && apt-get -y install --no-install-recommends gnupg2 postgresql-client   iputils-ping dnsutils vim htop nano sudo curl build-essential zsh wget   fonts-powerline tig ca-certificates software-properties-common &&   curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg &&   echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list &&   curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null &&   echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list &&   wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | tee /usr/share/keyrings/hashic
[2022-12-04T23:41:33.302Z] orp-archive-keyring.gpg > /dev/null &&   echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list &&   apt-get update &&   apt-get install kubectl helm terraform]: exit code: 100
[2022-12-04T23:41:33.309Z] Stop (12403 ms): Run: docker-compose --project-name stud42_devcontainer -f /Users/wwaya/Documents/stud42/.devcontainer/docker-compose.yaml -f /Users/wwaya/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1670197280905.yml build
[2022-12-04T23:41:33.309Z] Error: Command failed: docker-compose --project-name stud42_devcontainer -f /Users/wwaya/Documents/stud42/.devcontainer/docker-compose.yaml -f /Users/wwaya/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1670197280905.yml build
[2022-12-04T23:41:33.309Z]     at cF (/Users/wwaya/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1849:431)
[2022-12-04T23:41:33.309Z]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-12-04T23:41:33.309Z]     at async eoe (/Users/wwaya/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1849:2433)
[2022-12-04T23:41:33.309Z]     at async Qse (/Users/wwaya/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1831:2396)
[2022-12-04T23:41:33.309Z]     at async voe (/Users/wwaya/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:2222)
[2022-12-04T23:41:33.309Z]     at async Xf (/Users/wwaya/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:3212)
[2022-12-04T23:41:33.310Z]     at async Jae (/Users/wwaya/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:15058)
[2022-12-04T23:41:33.310Z]     at async Wae (/Users/wwaya/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:14812)
[2022-12-04T23:41:33.311Z] Stop (13244 ms): Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/wwaya/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/wwaya/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /Users/wwaya/Documents/stud42 --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/wwaya/Documents/stud42 --log-level debug --log-format json --config /Users/wwaya/Documents/stud42/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-12-04T23:41:33.312Z] Exit code 1
[2022-12-04T23:41:33.314Z] Command failed: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/wwaya/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/wwaya/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /Users/wwaya/Documents/stud42 --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/wwaya/Documents/stud42 --log-level debug --log-format json --config /Users/wwaya/Documents/stud42/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-12-04T23:41:33.314Z] Exit code 1


### Version of software

v0.19

### Environment

Sandbox (https://sandbox.s42.dev)

### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
42atomys commented 1 year ago

Found the reason on the Terraform documentation : https://developer.hashicorp.com/terraform/cli/install/apt#supported-architectures

I open a PR to fix the install process

sungyongcho commented 1 year ago

Hello, I found an another issue, and this happens after the dev container built,

and below is the error log

image image
42atomys commented 1 year ago

I currently work on the support in this branch : feat/dev-container-support-m1 (#306)

https://github.com/42Atomys/stud42/tree/feat/dev-container-support-m1

The protoc is already fixed, I'm on the next step : grpc-tools