Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: macOS上でDev Containersが動作しない問題を修正 #10207

Merged
merged 1 commit into from
Mar 5, 2023

Conversation

Ry0taK
Copy link
Contributor

@Ry0taK Ry0taK commented Mar 5, 2023

What

  • Dev Containers実行時にpnpm storeの場所を変更するように変更
  • Dev ContainersのRedisに対してrestart: unless-stoppedを使用するように変更

Why

  • macOS上においてDev Containers内で実行されたpnpm installに失敗していたため
  • restart: alwaysを指定しているとDev Containersを使用していない際にもRedisが立ち上がってしまうため

Additional info (optional)

@codecov
Copy link

codecov bot commented Mar 5, 2023

Codecov Report

Merging #10207 (d53a177) into develop (4cf3bc5) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop   #10207   +/-   ##
========================================
  Coverage    69.23%   69.23%           
========================================
  Files          707      707           
  Lines        65407    65407           
  Branches      5213     5216    +3     
========================================
+ Hits         45283    45286    +3     
+ Misses       20124    20121    -3     
Impacted Files Coverage Δ
packages/backend/src/core/NotificationService.ts 100.00% <0.00%> (+4.28%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Ry0taK Ry0taK changed the title fix: macOS上でDevContainerが動作しない問題を修正 fix: macOS上でDev Containersが動作しない問題を修正 Mar 5, 2023
@Ry0taK Ry0taK marked this pull request as ready for review March 5, 2023 05:03
@github-actions github-actions bot requested review from acid-chicken and tamaina March 5, 2023 05:03
@Ry0taK
Copy link
Contributor Author

Ry0taK commented Mar 5, 2023

一旦このプルリクエストはこれでReady for reviewですが、#10208 により起動後にpnpm devを実行しても上がってきません。 (趣旨が違うので別のプルリクエストで修正します。)

@tamaina
Copy link
Contributor

tamaina commented Mar 5, 2023

とりあえずチェックアウトして動作確認を始めた

sudo chown -R node /workspaceを待っている)

@tamaina tamaina merged commit 2bb0a5a into misskey-dev:develop Mar 5, 2023
@tamaina
Copy link
Contributor

tamaina commented Mar 5, 2023

👍 👍👍👍

@tamaina
Copy link
Contributor

tamaina commented Mar 5, 2023

VS Codeを完全終了して開き直した時(終了時に開いていたDev Containerをすぐに開きなおそうとする場合)に、次のような感じでエラーが出てくるのだけれど、これはMisskeyサイドではどうしようもない感じでしょうか?

[24 ms] Dev Containers 0.282.0 in VS Code 1.76.0 (92da9481c0904c6adfe372c12da3b7748d74bdcb).
[23 ms] Start: Resolving Remote
[31 ms] Setting up container for folder or workspace: /Users/aqz/misskey
[33 ms] Start: Check Docker is running
[33 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[116 ms] Server API version: 1.41
[117 ms] Start: Run: docker volume ls -q
[183 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/Users/aqz/misskey --filter label=vsch.quality=stable
[254 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/aqz/misskey --filter label=devcontainer.config_file=/Users/aqz/misskey/.devcontainer/devcontainer.json
[327 ms] Start: Run: docker inspect --type container dbfef1cd17fe
[408 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/aqz/misskey
[478 ms] Start: Run: docker inspect --type container dbfef1cd17fe
[547 ms] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/aqz/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/aqz/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-211439a8-548e-4ee7-93ae-cfc32a7decb81678015139531 --workspace-folder /Users/aqz/misskey --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/aqz/misskey --id-label devcontainer.config_file=/Users/aqz/misskey/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/aqz/misskey/.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
[739 ms] (node:58133) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[740 ms] (Use `Code Helper (Plugin) --trace-deprecation ...` to show where the warning was created)
[740 ms] @devcontainers/cli 0.31.0. Node.js v16.14.2. darwin 22.3.0 arm64.
[740 ms] Start: Run: docker buildx version
[968 ms] github.com/docker/buildx v0.10.3 79e156beb11f697f06ac67fa1fb958e4762c0fab
[968 ms] 
[968 ms] Start: Resolving Remote
[971 ms] Start: Run: docker-compose version --short
[1203 ms] Docker Compose version: 2.15.1
[1204 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=misskey_devcontainer --filter label=com.docker.compose.service=app
[1283 ms] Start: Run: docker inspect --type container dbfef1cd17fe
[1348 ms] Start: Inspecting container
[1348 ms] Start: Run: docker inspect --type container dbfef1cd17feb2f60033d7adef612aaa3f58820b0a51fbd91383975098b8d531
[1428 ms] Start: Run in container: /bin/sh
[1434 ms] Start: Run in container: uname -m
[1890 ms] aarch64
[1890 ms] 
[1890 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[1893 ms] PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[1893 ms] 
[1894 ms] Start: Run in container: cat /etc/passwd
[1897 ms] Start: Run in container: test -f '/var/devcontainer/.patchEtcEnvironmentMarker'
[1899 ms] 
[1899 ms] 
[1899 ms] Start: Run in container: test -f '/var/devcontainer/.patchEtcProfileMarker'
[1901 ms] 
[1901 ms] 
[1904 ms] Start: Run: docker inspect --type container dbfef1cd17feb2f60033d7adef612aaa3f58820b0a51fbd91383975098b8d531
[1986 ms] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/aqz/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /Users/aqz/misskey --id-label devcontainer.local_folder=/Users/aqz/misskey --id-label devcontainer.config_file=/Users/aqz/misskey/.devcontainer/devcontainer.json --container-id dbfef1cd17feb2f60033d7adef612aaa3f58820b0a51fbd91383975098b8d531 --log-level debug --log-format json --config /Users/aqz/misskey/.devcontainer/devcontainer.json --mount-workspace-git-root true
[2200 ms] (node:58177) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2201 ms] (Use `Code Helper (Plugin) --trace-deprecation ...` to show where the warning was created)
[2204 ms] @devcontainers/cli 0.31.0. Node.js v16.14.2. darwin 22.3.0 arm64.
[2204 ms] Start: Run: docker inspect --type container dbfef1cd17feb2f60033d7adef612aaa3f58820b0a51fbd91383975098b8d531
[2310 ms] Start: Run: docker-compose version --short
[2453 ms] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/aqz/.vscode/extensions/ms-vscode-remote.remote-containers-0.282.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /Users/aqz/misskey --id-label devcontainer.local_folder=/Users/aqz/misskey --id-label devcontainer.config_file=/Users/aqz/misskey/.devcontainer/devcontainer.json --container-id dbfef1cd17feb2f60033d7adef612aaa3f58820b0a51fbd91383975098b8d531 --log-level debug --log-format json --config /Users/aqz/misskey/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root true
[2691 ms] (node:58204) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2691 ms] (Use `Code Helper (Plugin) --trace-deprecation ...` to show where the warning was created)
[2694 ms] @devcontainers/cli 0.31.0. Node.js v16.14.2. darwin 22.3.0 arm64.
[2694 ms] Start: Run: docker inspect --type container dbfef1cd17feb2f60033d7adef612aaa3f58820b0a51fbd91383975098b8d531
[2782 ms] Start: Inspecting container
[2782 ms] Start: Run: docker inspect --type container dbfef1cd17feb2f60033d7adef612aaa3f58820b0a51fbd91383975098b8d531
[2882 ms] Start: Run in container: /bin/sh
[2885 ms] Start: Run in container: uname -m
[2991 ms] Start: Run in container: cat /etc/passwd
[2991 ms] Stdin closed!
[2994 ms] Shell server terminated (code: 1, signal: null)

Error response from daemon: Container dbfef1cd17feb2f60033d7adef612aaa3f58820b0a51fbd91383975098b8d531 is not running

@Ry0taK
Copy link
Contributor Author

Ry0taK commented Mar 5, 2023

@tamaina これは以下のような流れになってしまっていることが原因のため、これ用の設定がない限りはDev Containers側で修正するのは難しいかと思います (軽く探してみましたがこれ用の設定は見つかりませんでした...)

  1. VSCodeを閉じる
  2. Dockerの停止処理が始まる
  3. VSCodeが再度開かれる
  4. Dockerの停止処理が完了する

@tamaina
Copy link
Contributor

tamaina commented Mar 5, 2023

あ〜、即座に開き直すことはあまりないのでまあいいか

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dev Containerのpnpmが微妙な感じがする
2 participants