The Unified and Autonomous Development Platform
docs: clarify sandbox and workspace image setup
Robin Shena220f6495cbb
diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java b/server-core/src/main/java/io/onedev/server/buildspec/job/Job.javaindex ad024e6040..50cd2ae2ca 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java@@ -205,9 +205,10 @@ public class Job implements NamedElement, Validatable {@Editable(order=195, description="""Specify the sandbox template image used to run this job. The image must \- have shell, Git, and Python 3 installed. If the job runs Docker-related \+ have shell, Git, Git LFS, and Python 3 installed. If the job runs Docker-related \steps or services, Docker must be configured in the image, and a non-root \- default user must have passwordless sudo access.""")+ default user must have passwordless sudo access. See the \+ <a href='${docsite}/tutorials/cicd/build-sandbox-template' target='_blank'>template setup guide</a>.""")@Interpolative(variableSuggester="suggestVariables")@DependsOn(property="executeInSandbox")@NotEmptydiff --git a/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/WorkspaceSpec.java b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/WorkspaceSpec.javaindex 56bcc6fd04..9a1cd6e4e1 100644--- a/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/WorkspaceSpec.java+++ b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/WorkspaceSpec.java@@ -166,7 +166,7 @@ public class WorkspaceSpec implements Serializable, Validatable {@Editable(order = 60, name = "container:image", description = """Specify container image to create workspace inside. The image must have \- shell, Git, and tmux installed""")+ shell, Git, Git LFS, and tmux installed""")@Interpolative(variableSuggester="suggestVariables")@DependsOn(property = "provisionMode", value = "DOCKER")@NotEmpty@@ -180,7 +180,8 @@ public class WorkspaceSpec implements Serializable, Validatable {@Editable(order = 70, description = """Specify sandbox template image to create workspace from. The image must \- have shell, Git, Python 3, and tmux installed""")+ have shell, Git, Python 3, and tmux installed. See the \+ <a href='${docsite}/tutorials/workspace/build-sandbox-template' target='_blank'>template setup guide</a>.""")@Interpolative(variableSuggester="suggestVariables")@DependsOn(property = "provisionMode", value = "SANDBOX")@NotEmptydiff --git a/server-ee b/server-eeindex 805682666d..e460f913e8 160000--- a/server-ee+++ b/server-ee@@ -1 +1 @@-Subproject commit 805682666dc343cb2ae0612ccf306380b3a59a0e+Subproject commit e460f913e88bf80a00741c746abb467c409fd98ediff --git a/server-plugin/server-plugin-executor-serversandbox/src/main/java/io/onedev/server/plugin/executor/serversandbox/ServerSandboxExecutor.java b/server-plugin/server-plugin-executor-serversandbox/src/main/java/io/onedev/server/plugin/executor/serversandbox/ServerSandboxExecutor.javaindex 163bdbeac0..8eec821e6f 100644--- a/server-plugin/server-plugin-executor-serversandbox/src/main/java/io/onedev/server/plugin/executor/serversandbox/ServerSandboxExecutor.java+++ b/server-plugin/server-plugin-executor-serversandbox/src/main/java/io/onedev/server/plugin/executor/serversandbox/ServerSandboxExecutor.java@@ -50,8 +50,8 @@ import io.onedev.server.web.util.Testable;@Editable(order=ServerSandboxExecutor.ORDER, name="Server Sandbox Executor", description="Runs shell and Docker steps in a fresh Docker Sandbox on the server. "+ "Job services run inside the sandbox and are accessible by service name from shell and container steps. "+ "The sandbox and its services are deleted after each job. "- + "See <a href='${docsite}/tutorials/sandbox/working-with-sandbox' target='_blank'>Working with Sandbox</a> "- + "for host setup, login, and security practices. "+ + "Follow <a href='${docsite}/tutorials/sandbox/working-with-sandbox' target='_blank'>Working with Sandbox</a> "+ + "to set up the server host. "+ "<b class='text-warning'>WARNING:</b> For better security, use a Remote Sandbox Executor "+ "on a dedicated agent host, especially for untrusted jobs.")@ClassValidating@@ -298,9 +298,10 @@ public class ServerSandboxExecutor extends JobExecutor implements SandboxAware,@Editable(order=100, description="""Specify a Docker sandbox shell template image to test against. The image must \- have shell, Git, and Python3 installed. To also test container, Docker must be \+ have shell, Git, Git LFS, and Python 3 installed. To also test a container, Docker must be \configured in the image, and a non-root default user must have passwordless \- sudo access""")+ sudo access. See the \+ <a href='${docsite}/tutorials/cicd/build-sandbox-template' target='_blank'>template setup guide</a>.""")@NotEmptypublic String getTemplate() {return template;diff --git a/server-plugin/server-plugin-provisioner-serverdocker/src/main/java/io/onedev/server/plugin/provisioner/serverdocker/ServerDockerProvisioner.java b/server-plugin/server-plugin-provisioner-serverdocker/src/main/java/io/onedev/server/plugin/provisioner/serverdocker/ServerDockerProvisioner.javaindex b7c6d8b78f..37e3d6d152 100644--- a/server-plugin/server-plugin-provisioner-serverdocker/src/main/java/io/onedev/server/plugin/provisioner/serverdocker/ServerDockerProvisioner.java+++ b/server-plugin/server-plugin-provisioner-serverdocker/src/main/java/io/onedev/server/plugin/provisioner/serverdocker/ServerDockerProvisioner.java@@ -290,7 +290,7 @@ public class ServerDockerProvisioner extends WorkspaceProvisioner implements Docprivate String dockerImage;- @Editable(description="Specify a Docker image to test against. The image must have shell, Git, and tmux installed")+ @Editable(description="Specify a Docker image to test against. The image must have shell, Git, Git LFS, and tmux installed")@OmitName@NotEmptypublic String getDockerImage() {diff --git a/server-plugin/server-plugin-provisioner-serversandbox/src/main/java/io/onedev/server/plugin/provisioner/serversandbox/ServerSandboxProvisioner.java b/server-plugin/server-plugin-provisioner-serversandbox/src/main/java/io/onedev/server/plugin/provisioner/serversandbox/ServerSandboxProvisioner.javaindex 95145a73d6..e37103be56 100644--- a/server-plugin/server-plugin-provisioner-serversandbox/src/main/java/io/onedev/server/plugin/provisioner/serversandbox/ServerSandboxProvisioner.java+++ b/server-plugin/server-plugin-provisioner-serversandbox/src/main/java/io/onedev/server/plugin/provisioner/serversandbox/ServerSandboxProvisioner.java@@ -44,11 +44,11 @@ import io.onedev.server.workspace.WorkspaceRuntime;@Editable(order=ServerSandboxProvisioner.ORDER, name="Server Sandbox Provisioner", description="""Runs workspaces directly in a Docker Sandbox on the server. Setup commands and terminals run as the template image's default user.- The sandbox is stopped between sessions to preserve files and removed when the workspace is deleted.+ The sandbox is removed when the workspace is deleted.Select <b>Sandbox</b> as the workspace spec's provision mode. To use Docker in workspace commands,select a sandbox template that provides Docker in the workspace spec.- See <a href='${docsite}/tutorials/sandbox/working-with-sandbox' target='_blank'>Working with Sandbox</a>- for host setup and login. For untrusted workspaces, use a Remote Sandbox Provisioner on a dedicated agent host.""")+ Follow <a href='${docsite}/tutorials/sandbox/working-with-sandbox' target='_blank'>Working with Sandbox</a>+ to set up the server host. For untrusted workspaces, use a Remote Sandbox Provisioner on a dedicated agent host.""")public class ServerSandboxProvisioner extends WorkspaceProvisioner implements Testable<ServerSandboxProvisioner.TestData> {@Serial@@ -177,7 +177,8 @@ public class ServerSandboxProvisioner extends WorkspaceProvisioner implements Te@Editable(description="""Specify a Docker sandbox template image to test against. The image must have \- shell, Git, Python 3, and tmux installed""")+ shell, Git, Git LFS, Python 3, and tmux installed. See the \+ <a href='${docsite}/tutorials/workspace/build-sandbox-template' target='_blank'>template setup guide</a>.""")@OmitName@NotEmptypublic String getTemplate() {