Clean up old stuff & fix ui errors
This commit is contained in:
@@ -17,6 +17,15 @@ const networkArgs = () => (env.network ? ['--network', env.network] : []);
|
||||
|
||||
const containerRuntime = () => env.containerRuntime;
|
||||
|
||||
export const jobWorkspaceVolumeSpec = (workdir: string) => {
|
||||
const volumeOptions =
|
||||
env.containerVolumeOptions ??
|
||||
(containerRuntime().endsWith('podman') ? 'Z' : undefined);
|
||||
return volumeOptions
|
||||
? `${workdir}:/workspace:${volumeOptions}`
|
||||
: `${workdir}:/workspace`;
|
||||
};
|
||||
|
||||
export const runInJobContainer = async (args: {
|
||||
workdir: string;
|
||||
command: string[];
|
||||
@@ -36,7 +45,7 @@ export const runInJobContainer = async (args: {
|
||||
...networkArgs(),
|
||||
...environmentArgs(args.environment),
|
||||
'-v',
|
||||
`${args.workdir}:/workspace`,
|
||||
jobWorkspaceVolumeSpec(args.workdir),
|
||||
'-w',
|
||||
'/workspace/repo',
|
||||
env.jobImage,
|
||||
@@ -87,7 +96,7 @@ export const startWorkspaceContainer = async (args: {
|
||||
: []),
|
||||
...environmentArgs(args.environment),
|
||||
'-v',
|
||||
`${args.workdir}:/workspace`,
|
||||
jobWorkspaceVolumeSpec(args.workdir),
|
||||
'-w',
|
||||
'/workspace/repo',
|
||||
env.jobImage,
|
||||
@@ -168,7 +177,7 @@ export const streamInJobContainer = async (args: {
|
||||
...networkArgs(),
|
||||
...environmentArgs(args.environment),
|
||||
'-v',
|
||||
`${args.workdir}:/workspace`,
|
||||
jobWorkspaceVolumeSpec(args.workdir),
|
||||
'-w',
|
||||
'/workspace/repo',
|
||||
env.jobImage,
|
||||
|
||||
Reference in New Issue
Block a user