Mount repo inside the sandbox #13

Closed
opened 2024-03-03 16:17:39 +08:00 by 张泊明518370910136 · 3 comments

If we execute everything inside the sandbox, we do not want to copy in the whole repo every stage.

If we execute everything inside the sandbox, we do not want to copy in the whole repo every stage.
张泊明518370910136 added the
priority
p0
label 2024-03-03 16:17:39 +08:00
张泊明518370910136 added this to the (deleted) project 2024-03-03 16:17:39 +08:00
Author
Owner
See https://github.com/criyle/go-judge/blob/master/mount.yaml
Author
Owner

It can be tricky as drone use /tmp/drone-${RANDOM}/drone/src as workspace. (See https://docs.drone.io/pipeline/ssh/syntax/workspace/)

Maybe we should not mount it. We just provide extra options for the sandbox executor so that it can add everything in the workspace to copyIn. copyIn field supports reading local files and add them to sandbox. As the repo size is not large and both src and dst use tmpfs, it will not be a bottleneck to copy all the files in the repo to the sandbox.

It can be tricky as drone use `/tmp/drone-${RANDOM}/drone/src` as workspace. (See https://docs.drone.io/pipeline/ssh/syntax/workspace/) Maybe we should not mount it. We just provide extra options for the sandbox executor so that it can add everything in the workspace to `copyIn`. `copyIn` field supports reading local files and add them to sandbox. As the repo size is not large and both src and dst use tmpfs, it will not be a bottleneck to copy all the files in the repo to the sandbox.
Author
Owner

Tested with wrk, copy 30 3KB files from non-tmpfs src to the disk will cost 1ms.

Tested with `wrk`, copy 30 3KB files from non-tmpfs src to the disk will cost 1ms.
Sign in to join this conversation.
No description provided.