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

Dockerで実行時、アーティファクト生成時のownerをホスト環境のものに揃える #40

Merged
merged 4 commits into from
Apr 25, 2023

Conversation

windymelt
Copy link
Owner

cf: #30

前提 / Prerequisites

  • ZMMはDockerで実行可能である
  • ZMMはレンダリング結果や音声合成結果(アーティファクト)をartifacts/以下に保存する

なぜこのPRが必要になったか / Why do we need this PR

  • 保存したアーティファクトのownerがrootになってしまい、ホストから削除できなくなるという問題が発生していた
  • アーティファクトのuid/gidは、ホスト環境のuid/gidと揃っていることが望ましい

なにをやったか / What I did

  • entrypoint.shに細工をして、Docker image内部での実行ユーザ(zundamon)をホストのuid/gidに修正するようにした
    • ホストのuid/gidをどう得るのか?→マウントされているはずのカレントディレクトリのuid/gidから得る
    • 実行ユーザをどう切り替えるのか?→entrypoint.shが起動した時点ではrootで動作し、最後にsetprivコマンドをexecして切り替える

補足 / Supplementary information

実行環境として想定しているcorettoのsetprivには--init-groupsが無かった(おそらくバージョンの問題)。しょうがないので--clear-groupsで代替している。実行イメージをcoretto以外のものにしてもよいが、今のところcorettoが安定しているので妥協した。

@windymelt windymelt self-assigned this Apr 25, 2023
@windymelt windymelt merged commit cb76ba4 into main Apr 25, 2023
@windymelt windymelt deleted the plastic-user-group branch April 25, 2023 18:54
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.

None yet

1 participant